|
1 | 1 | --- |
2 | 2 | name: run-benchmark |
3 | | -description: >- |
4 | | - Run this repository's problem-reductions bug-finding benchmark end to end and produce a |
5 | | - submission.json. Supports reproducible Docker/Podman runs and lightweight local headless |
6 | | - runs with codex exec or claude -p, including pinned repository preparation, explicit output |
7 | | - and log paths, preflight where applicable, and optional upload. Use when asked to run, |
8 | | - reproduce, smoke-test, or generate a model submission. Not for pytest/unit-test requests. |
| 3 | +description: Route a request to run, reproduce, smoke-test, or generate a submission for this problem-reductions benchmark. Use when the caller has not yet chosen between a model API run and an installed coding-agent CLI run. Ask the execution-route question, then hand off to run-api-benchmark or run-cli-benchmark; do not implement either backend flow here. |
9 | 4 | --- |
10 | 5 |
|
11 | | -# Run the benchmark |
| 6 | +# Route a benchmark run |
12 | 7 |
|
13 | | -Run one whole-repository agent session. The agent chooses rules, search depth, and when to |
14 | | -stop. Do not add a step, turn, cost, or rule-count limit. The evaluation-owned `submit` |
15 | | -command is the only scored certificate channel; its run-wide attempt limit defaults to 100. |
| 8 | +Choose exactly one execution route before asking about models, credentials, paths, or |
| 9 | +submission settings. |
16 | 10 |
|
17 | | -First determine two choices if the user has not already supplied them: |
| 11 | +If the caller already explicitly requested an API, container, mini-swe, Codex, Claude Code, |
| 12 | +or another coding-agent CLI, do not ask the route question again. Invoke the matching child |
| 13 | +skill immediately. |
18 | 14 |
|
19 | | -1. Frontend: reproducible container, or lightweight local headless CLI. |
20 | | -2. Goal: produce/test a local submission, or upload it to the official intake. |
| 15 | +Otherwise ask this question and wait: |
21 | 16 |
|
22 | | -Do not ask for intake secrets unless upload is requested. Before any real model run, show the |
23 | | -resolved model, backend, target `PR_REF`, submit limit, output path, and log path; get explicit |
24 | | -confirmation because the run can consume time and API credits. |
| 17 | +> How should the benchmark call the model? |
| 18 | +> |
| 19 | +> 1. **Model API** — use the containerized mini-swe/LiteLLM runner with an API key or custom |
| 20 | +> endpoint. |
| 21 | +> 2. **Coding-agent CLI** — use an installed autonomous coding agent such as Codex or Claude |
| 22 | +> Code. |
25 | 23 |
|
26 | | -## Common configuration |
| 24 | +Use the product's structured user-input UI when available; otherwise ask the same question |
| 25 | +in plain text. Do not combine both routes in one run. |
27 | 26 |
|
28 | | -Create `submission.env` from the template when absent. It is gitignored. |
| 27 | +- For **Model API**, invoke `$run-api-benchmark` and follow it completely. |
| 28 | +- For **Coding-agent CLI**, invoke `$run-cli-benchmark` and follow it completely. |
29 | 29 |
|
30 | | -```bash |
31 | | -cp submission.env.example submission.env |
32 | | -``` |
33 | | - |
34 | | -Set `MODEL_NAME` and the authentication required by the selected backend. Read |
35 | | -`references/env-and-troubleshoot.md` when configuring a provider or diagnosing a failure. |
36 | | -Do not add the removed `AGENT_MODE`, `MAX_RULES`, or max-turn settings. |
37 | | - |
38 | | -## Container path |
39 | | - |
40 | | -Use this for the reproducible benchmark. The image pins the problem-reductions source, |
41 | | -compiled `pred`, Python dependencies, and mini-swe runtime. |
42 | | - |
43 | | -1. Run `<skill-dir>/scripts/detect-engine.sh` and parse its `KEY=VALUE` output. Read |
44 | | - `references/engines.md` only if no engine is available or the RAM hint is low. |
45 | | -2. Build with one consistent ref: |
46 | | - |
47 | | - ```bash |
48 | | - make runner-build PR_REF=v0.6.0 |
49 | | - ``` |
50 | | - |
51 | | - For Podman, use the equivalent raw build shown in `references/engines.md`. |
52 | | -3. For the default mini-swe backend, run `make preflight`. It checks `pred`, rule sources, |
53 | | - and makes one tiny LiteLLM call. Do not describe this as a Codex/Claude CLI preflight. |
54 | | -4. After user confirmation, run `make run` (or the equivalent Podman command using the |
55 | | - detector's `RUN_FLAGS`). |
56 | | -5. Confirm `out/submission.json` exists. Report `bugs_found`, `total_tokens_k`, submit attempts, |
57 | | - and any `run_error`. Logs are also under `out/`; the configured submission path is the |
58 | | - single authoritative JSON output. |
59 | | - |
60 | | -An exit code 137 during build means the engine needs more memory. Never proceed after a |
61 | | -failed preflight. |
62 | | - |
63 | | -## Lightweight local headless path |
64 | | - |
65 | | -Use this for an installed `codex exec` or `claude -p`. It reuses the same benchmark CLI, |
66 | | -prompt, schema, verifier, and submit ledger as the container path. |
67 | | - |
68 | | -Confirm these host prerequisites: |
69 | | - |
70 | | -- `git` and the benchmark's Python dependencies; |
71 | | -- a `pred` binary matching the target benchmark version; |
72 | | -- `codex` authenticated (`codex login status`) or an authenticated Claude CLI. |
73 | | - |
74 | | -Require all three paths explicitly and keep them separate: |
75 | | - |
76 | | -- `LOCAL_REPO_DIR`: clone destination; |
77 | | -- `LOCAL_OUTPUT`: authoritative submission JSON path; |
78 | | -- `LOCAL_LOG_DIR`: agent logs (raw CLI stream for headless backends, normalized mini-swe log). |
79 | | - |
80 | | -Run, for example: |
81 | | - |
82 | | -```bash |
83 | | -make run-local \ |
84 | | - PR_REF=v0.6.0 \ |
85 | | - LOCAL_BACKEND=codex \ |
86 | | - LOCAL_REPO_DIR=../runs/problem-reductions-v0.6.0 \ |
87 | | - LOCAL_OUTPUT=../runs/results/submission.json \ |
88 | | - LOCAL_LOG_DIR=../runs/logs |
89 | | -``` |
90 | | - |
91 | | -Use `LOCAL_BACKEND=claude-code` for Claude. The default is Codex. |
92 | | - |
93 | | -The runner clones `PR_REF` when `LOCAL_REPO_DIR` is absent. If it already exists, it must be |
94 | | -a Git checkout whose `HEAD` exactly matches the requested tag, branch, or commit. The runner |
95 | | -must not fetch, reset, or check out an existing working tree; on mismatch, use another path or |
96 | | -ask the user to update it. |
97 | | - |
98 | | -Every backend starts by probing the evaluation-owned file-backed submission channel with |
99 | | -`submit --status`. A run with neither a successful status probe nor a ledger attempt is an |
100 | | -infrastructure failure and must carry `run_error`; do not report it as a clean zero. On such |
101 | | -a failure, check `LOCAL_LOG_DIR/salvaged-agent-artifacts/` for preserved certificates. |
102 | | - |
103 | | -There is no local turn cap. `CODEX_SESSION_TIMEOUT` and `CLAUDE_CODE_SESSION_TIMEOUT` are only |
104 | | -hung-process backstops. Codex token totals come from its JSON `turn.completed` event. |
105 | | - |
106 | | -## No-spend wiring smoke test |
107 | | - |
108 | | -Only use this when the user wants to test runner wiring without invoking a model or `pred`: |
109 | | - |
110 | | -```bash |
111 | | -python -m benchmark.run_submission \ |
112 | | - --fake --model fake/smoke \ |
113 | | - --repo-dir /tmp/prb-fake-repo \ |
114 | | - --output /tmp/prb-smoke/submission.json \ |
115 | | - --trajectory-dir /tmp/prb-smoke/logs |
116 | | -python -m benchmark.submit --predictions /tmp/prb-smoke/submission.json --dry-run |
117 | | -``` |
118 | | - |
119 | | -Clearly label this as a wiring check, not a benchmark result. |
120 | | - |
121 | | -## Validate and optionally upload |
122 | | - |
123 | | -Always validate the produced file before handoff or upload: |
124 | | - |
125 | | -```bash |
126 | | -python -m benchmark.submit --predictions <submission.json> --dry-run |
127 | | -``` |
128 | | - |
129 | | -If the goal is local/test, stop after reporting the artifact paths. If the user explicitly |
130 | | -requested official submission and supplied `PRB_SUBMIT_URL` plus `PRB_API_KEY`, upload with: |
131 | | - |
132 | | -```bash |
133 | | -python -m benchmark.submit --predictions <submission.json> |
134 | | -# add --test to keep an end-to-end intake test off the public leaderboard |
135 | | -``` |
136 | | - |
137 | | -Never upload merely because a run completed. The backend re-verifies accepted ledger |
138 | | -certificates with `pred`; only aggregate results become public. |
139 | | - |
140 | | -## Failure handling |
141 | | - |
142 | | -- Read actual command output and branch on it; never assume build, auth, or run success. |
143 | | -- Preserve a partial submission and logs when `run_error` is present; report it as partial, |
144 | | - not as a clean zero-bug completion. |
145 | | -- Treat `submit channel was not successfully probed` as runner infrastructure failure, not |
146 | | - agent performance. Preserve the logs and salvaged certificate artifacts. |
147 | | -- Do not silently install software, change engine settings, mutate an existing checkout, or |
148 | | - upload data. |
149 | | -- For provider fields and common failures, read `references/env-and-troubleshoot.md`. |
150 | | -- For Docker/Podman setup, ownership, SELinux, or OOM issues, read `references/engines.md`. |
| 30 | +The child skill owns all later questions, preflight, execution, validation, and optional |
| 31 | +upload. Do not duplicate those workflows here. |
0 commit comments