Skip to content

Commit a19b03a

Browse files
feat: add launch crash benchmark (#334)
* feat: add launch crash benchmark * fix: remove unused benchmark export * fix: enforce launch benchmark validity * fix: harden benchmark evidence audit * fix: verify benchmark metrics provenance * fix: publish audited launch benchmark * fix: reject mixed source capture * fix: audit all repaired paths * fix: enforce benchmark identity and portability * fix: preserve audited run records * fix: harden benchmark publication
1 parent 0d56b35 commit a19b03a

24 files changed

Lines changed: 5225 additions & 72 deletions

docs/agent-benchmark-v4.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ identifiers. Private raw results retain invalid attempts for diagnosis. The
172172
Markdown report is the machine-readable summary; the viewer is an audit view
173173
and does not redefine metrics.
174174

175+
The executable coordinator and its machine-local setup contract live in
176+
[`scripts/agent-benchmark/`](../scripts/agent-benchmark/README.md). The driver
177+
prepares and commits launch-failure fixtures, dispatches Codex or Claude,
178+
collects and audits proof, writes `run.json`, cleans owned resources, and
179+
generates the private report. Credentials, pins, golden build state, and raw
180+
transcripts remain outside the repository.
181+
175182
![A benchmark timeline with separate shell and monitored background-process lanes](images/benchmark-background-process.png)
176183

177184
![A benchmark timeline expanded to 4x with its lane labels pinned during horizontal scrolling](images/benchmark-timeline-zoom.jpg)
@@ -227,6 +234,17 @@ output and `stim logs --errors`; control collects the equivalent Metro and
227234
simulator logs manually. The injected error text is unique per run so the
228235
collector can prove that the reported stack and repair refer to this failure.
229236

237+
The coordinator creates a per-run fixture branch, injects and commits the
238+
exception, and checks out that fixture before dispatch, outside the timed
239+
interval. The agent starts in the fixture checkout and creates its own isolated
240+
run worktree from that HEAD, so worktree setup remains part of the measured
241+
workflow. The agent must launch before inspecting source. An actionable
242+
diagnosis contains both the run's unique error token and the root-layout source
243+
location. A valid repair removes that token, relaunches the app, and reaches the
244+
unchanged Settings proof on the same explicitly targeted simulator. Report
245+
diagnosis and repair timing separately; do not add crash-suite results to the
246+
readiness charts.
247+
230248
Run the crash suite only after the four-cell readiness pilot is accepted. Keep
231249
its goldens, prompts, metrics, and report separate from the normal JS/native
232250
speed results.

knip.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"$schema": "https://unpkg.com/knip@6/schema.json",
3-
"ignore": ["website/**", "packages/stim-cli/shim/**"],
3+
"ignore": [
4+
"website/**",
5+
"packages/stim-cli/shim/**",
6+
"scripts/agent-benchmark/stamp.mjs",
7+
"scripts/agent-benchmark/watch-app.mjs"
8+
],
49
"ignoreBinaries": ["pod"]
510
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"build": "pnpm -r --filter \"./packages/*\" run build",
1919
"test:e2e": "node --test test/e2e/*.e2e.js",
2020
"knip": "knip",
21+
"benchmark:agent": "node scripts/agent-benchmark/driver.mjs",
2122
"release:prep": "node scripts/release-prep.mjs",
2223
"preinstall": "npx only-allow pnpm"
2324
},

scripts/agent-benchmark/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Agent benchmark driver
2+
3+
This is the executable coordinator used by the published agent benchmarks. It
4+
keeps machine-local pins, credentials, build artifacts, raw transcripts, and
5+
device identifiers outside the repository while keeping fixture preparation,
6+
dispatch, evidence collection, audit, cleanup, and reporting reviewable.
7+
8+
The driver currently runs the iOS readiness and JavaScript launch-failure
9+
suites described in [`../../docs/agent-benchmark-v4.md`](../../docs/agent-benchmark-v4.md).
10+
Runs are sequential. Never dispatch two cells against the same benchmark root.
11+
12+
## Machine-local layout
13+
14+
Create a benchmark root outside the repository with these entries:
15+
16+
```text
17+
benchmark-root/
18+
bin/stim
19+
golden/
20+
pins.env
21+
runtime/node_modules/stim-cli/
22+
results/
23+
state/
24+
```
25+
26+
`bin/stim` is an executable shim for the pinned `stim-cli` in `runtime`.
27+
`pins.env` contains the exact fixture, CLI, agent-device, OS, Xcode, Node, and
28+
CocoaPods values checked by `preflight`; use the keys read by `versionChecks`
29+
in `driver.mjs`. Keep authentication and raw evidence out of Git.
30+
31+
Set the machine-local paths explicitly:
32+
33+
```bash
34+
export STIM_BENCH_ROOT=/path/to/benchmark-root
35+
export STIM_BENCH_FIXTURE=/path/to/clean-trailhead-checkout
36+
export STIM_BENCH_WORKTREE_PARENT=/path/to/benchmark-worktrees
37+
export STIM_BENCH_STIM_PACKAGE="$STIM_BENCH_ROOT/runtime/node_modules/stim-cli"
38+
export STIM_BENCH_CODEX_AUTH=/path/to/codex-auth.json
39+
export STIM_BENCH_SKILLS_ROOT=/path/to/skills
40+
```
41+
42+
`STIM_BENCH_CODEX_BIN`, `STIM_BENCH_CLAUDE_BIN`, and
43+
`STIM_BENCH_AGENT_DEVICE_BIN` can pin non-default executable paths.
44+
45+
## Run a cell
46+
47+
Prepare the golden artifact and parked simulator once, then dispatch, collect,
48+
and clean one cell:
49+
50+
```bash
51+
node scripts/agent-benchmark/driver.mjs preflight
52+
node scripts/agent-benchmark/driver.mjs prepare
53+
node scripts/agent-benchmark/driver.mjs dispatch gpt-5.6-sol stim launch-crash sol-launch-crash
54+
node scripts/agent-benchmark/driver.mjs collect /path/to/run-directory
55+
node scripts/agent-benchmark/driver.mjs cleanup /path/to/run-directory
56+
node scripts/agent-benchmark/driver.mjs report sol-launch-crash
57+
```
58+
59+
`dispatch` creates and commits the broken fixture before the timed turn, gives
60+
the agent the fixture checkout as its starting directory, and requires the
61+
agent to create the measured run worktree itself. `collect` rejects source
62+
inspection before launch/error capture, a missing exact repair, a missing
63+
successful relaunch, a mismatched device, or missing Settings-screen proof.
64+
65+
Run the self-tests before a campaign:
66+
67+
```bash
68+
node scripts/agent-benchmark/driver.mjs selftest-device-targeting
69+
node scripts/agent-benchmark/driver.mjs selftest-agent-device-isolation
70+
node scripts/agent-benchmark/driver.mjs selftest-launch-crash
71+
```

0 commit comments

Comments
 (0)