Muhtasham/goalbench
GitHub: Muhtasham/goalbench
面向 ProgramBench 基准任务的 Codex 目标模式自动化评测工具,用于批量运行、评估和报告 AI 编码智能体在多种配置下的表现。
Stars: 0 | Forks: 0
# GoalBench
针对 ProgramBench 任务的 Codex `/goal` benchmark 运行程序。
此仓库针对 ProgramBench 洁净室任务运行 GPT-5.5 Codex CLI 目标模式,在
镜像中将生成的代码打包为 `submission.tar.gz`,使用 ProgramBench 自带的
评估器进行评估,并构建 ProgramBench 风格的公开报告。
这不是官方的 mini-SWE-agent 基线。结果应标记为 Codex `/goal` 脚手架结果。
## 从这里开始
针对 Noam/Jake 提出的问题,主要运行配置为:
- `gpt-5.5`
- 推理强度 `xhigh`
- Codex `/goal`
- `no-internet` 模式
- Linux `amd64`
- ProgramBench 的 200 个任务集
该模式会保持目标容器处于离线状态,阻止源码/包查找,并
保持目标探测的黑盒状态。这不是 mini-SWE-agent 的复现,但它是
针对“如果 GPT-5.5 在 ProgramBench 上获得 `/goal` 和更多的挂钟时间,会发生什么?”这个问题最直接的回答。
## 运行机制
Codex 运行在 Linux VM 主机上,而不是在 Docker 内部。Docker 用于推理过程中的黑盒目标容器以及在打包提交后进行 ProgramBench 评估。
```
Your laptop
└─ ssh into Linux amd64 VM
Linux VM
├─ tmux: one Codex CLI /goal session per active task
│ └─ writes only that task's solution/ directory
├─ Docker: one offline ProgramBench target container per active task
│ └─ exposes /workspace/executable for black-box probing
├─ local_state/: batch state, summaries, public report inputs
└─ ~/pb-goal-runs/: per-task prompts, logs, submissions, eval JSON
Later, during evaluation
└─ ProgramBench runs submission.tar.gz through its Docker evaluator
```
每个任务都有自己的 `solution/`、`guard-bin/`、`tool-caches/`、目标容器、tmux 记录和 `submission.tar.gz`。`max_parallel` 控制同时激活的 Codex 任务会话数量;默认情况下,评估是顺序运行的,以获得更清晰的结果。
## 快速设置
请使用 Linux `amd64` 虚拟机进行正式运行。ProgramBench 为 `linux/amd64` 发布任务镜像;Mac/ARM 上的运行仅作为冒烟测试。
```
git clone git@github.com:Muhtasham/goalbench.git
cd goalbench
scripts/bootstrap-linux-vm.sh
codex login
scripts/doctor.sh configs/linux-smoke-nointernet-xhigh.json
```
引导程序会安装 Docker、`uv`、`tmux`(如缺失)、Codex CLI、同级 `../ProgramBench` 检出,以及论文风格运行中使用的特定目标包装器。
## 冒烟测试
从一个小型 Linux 冒烟测试开始:
```
scripts/start-sweep-tmux.sh configs/linux-smoke-nointernet-xhigh.json
uv run python scripts/run-config.py status configs/linux-smoke-nointernet-xhigh.json
```
完成后,执行定稿/评估:
```
uv run python scripts/run-config.py finalize configs/linux-smoke-nointernet-xhigh.json
```
请勿将 Mac/ARM 或小型虚拟机的冒烟测试分数视为与 ProgramBench 具有可比性。
## 完整运行
默认的全量扫描:
```
scripts/run-sweep.sh --dry-run
scripts/run-sweep.sh
```
完整运行的配置默认为 `max_parallel=10`,因此正常启动最多可以同时运行十个 Codex `/goal` 任务会话。在较小的虚拟机上,可以使用以下方式降低并行度:
```
scripts/run-sweep.sh --max-parallel 4
MAX_PARALLEL=4 scripts/start-sweep-tmux.sh configs/full-nointernet-xhigh.json
```
在评估后发布重新生成的 GitHub Pages 报告:
```
scripts/run-sweep.sh --publish
```
对于长时间运行,请使用增量定稿/报告,这样无需等待所有 200 个实例完成即可对已完成的任务进行评分:
```
scripts/run-sweep.sh --incremental-finalize --publish
```
如果设置了 `PROGRAMBENCH_REPO`,`scripts/run-sweep.sh` 将使用该环境变量;否则,它会自动检测同级目录下的 `../ProgramBench` 检出。如果该检出不存在,请运行 `scripts/bootstrap-programbench.sh`。
## 模式
每种模式请使用单独的批次。不要将它们混合在一个结果中。
| 模式 | 配置 | 含义 |
| --- | --- | --- |
| `no-internet` | `configs/full-nointernet-xhigh.json` | 主要的 Codex `/goal` 脚手架。无外部查找,黑盒目标探测。 |
| `paper` | `configs/full-paper-xhigh.json` | 针对 Codex `/goal` 的更严格的 ProgramBench 风格洁净室模式;非官方 mini-SWE-agent。 |
| `no-internet-local-tools` | `configs/full-localtools-xhigh.json` | 不合规的工具匮乏消融实验。无互联网/源码查找,但允许使用本地二进制分析/追踪工具。 |
| `open-internet` | `configs/full-open-xhigh.json` | 具有正常 Codex 互联网/包访问权限的不合规上限运行。 |
任何具有 `no-internet` 语义的模式(`no-internet`、`paper` 和 `no-internet-local-tools`)都必须使用严格的主机出口限制。运行程序会拒绝这些配置,除非 `strict_egress=true`,并且启动检查程序需要一个专用的非 root `codex_user` 且仅限 OpenAI 的出口防护处于活动状态。协调器可以以 root 身份运行以获取 Docker/eval 访问权限,但生成的 Codex `/goal` tmux 会话以该专用用户身份运行。
推荐运行顺序:
在论文规格的 Linux 主机上,请使用 `full-*` 配置。在当前的 Hetzner `cpx62` 运行器上,请使用匹配的 `cpx62-*` 配置;它们标明的是 `16 CPU / 30g` 而不是 `20 CPU / 60g`。
1. `cpx62-nointernet-xhigh`
2. `cpx62-nointernet-high`
3. `cpx62-paper-xhigh`
4. `cpx62-localtools-xhigh`
5. `cpx62-open-xhigh`
当您希望在相同的 VM/脚手架上进行直接的推理强度比较时,请在 xhigh 主要运行之后运行 `high`。
## 报告
报告反映了 ProgramBench 的公开格式:
- 解决率
- 在 `score >= 0.95` 时的接近解决率
- 平均行为通过率
- 预估成本
- Codex 调用次数
- 挂钟时间
- 每个任务的详细页面
成本是根据本地 Codex token 日志和刷新的 OpenAI 定价快照估算的。它不是权威的账单。
手动构建站点:
```
uv run python scripts/build-report.py --output-dir docs
uv run python scripts/privacy-scan.py
```
公开站点发布经过净化的汇总行、公开证据摘要以及可下载的 CSV/JSON。默认情况下,原始 Codex 日志和提交 tar 包保留在本地。
## 实用命令
```
# 检查先决条件和配置
scripts/doctor.sh configs/full-nointernet-xhigh.json
# 监控 batch 状态
uv run python scripts/run-config.py status configs/full-nointernet-xhigh.json
# 从当前本地状态重建报告
uv run python scripts/run-config.py finalize configs/full-nointernet-xhigh.json
# 在 teardown 前备份 VM 运行
scripts/backup-run-root.sh --batch-name full-nointernet-xhigh --run-version
# 运行本地质量检查
uv run ruff check .
uv run ty check
uv run pre-commit run --all-files
```
## 更多文档
- [详细运行手册](docs/runbook.md)
- [论文/合规性说明](docs/paper-compliance.md)
- [公开报告](https://muhtasham.github.io/goalbench/)
标签:Codex CLI, DLL 劫持, Docker容器, GPT-5.5, ProgramBench, 人工智能, 代码生成, 大语言模型, 实验框架, 应用安全, 性能测评, 提示词注入, 攻击面发现, 沙箱环境, 渗透测试工具, 特权提升, 用户模式Hook绕过, 系统工程, 网络安全审计, 自动化编程, 自动化评估, 自动化部署, 请求拦截, 逆向工具, 黑盒测试