Exit 4

Method

Everything that decides the verdict was written down, hashed and tagged before the first task of the main run. This page quotes those files. Where the amendment and the original differ, the amendment wins.

Registered44d715bd

The registration

Two files, hashed in prereg/HASHES.txt and tagged in git before they applied.

Check a file yourself: sha256sum prereg/experiment-1.md must print the first line above.

Hypothesis, as registered

Routing the agent's delegate lane to Claude Haiku 5.5 instead of Claude Sonnet 5.5 (variation lanes_v1) lowers the mean dollar cost per task (task_cost), while the solve rate (task_solved) drops by no more than 20 percentage points. Units are real SWE-bench-Live tasks created after the models' training cutoff, one Flagsmith identity per task.

Question

When a coding agent hands its grunt work (exploring the repository, reading long files, running and summarising tests) to a small model instead of the frontier model, does the cost per task go down without the agent solving fewer tasks?

The decision rule

Three conditions. All must hold, or control stays.

Ship lanes_v1 (set it as the flag's value after ending the experiment) only if all three hold:

  1. Flagsmith reports a chance to beat control of at least 95% on task_cost.
  2. Our Beta(1,1) posterior gives P(Δsolve > −m) ≥ 0.90, where m = 20 percentage points and Δsolve is the lanes_v1 solve rate minus the control solve rate.
  3. Flagsmith does not report task_solved as losing (chance to beat control below 5%).

Otherwise keep control and publish the reason.

Metrics

MetricAggregationDirectionRole
task_costmeandown (lower is better)primary
task_solvedoccurrenceup, expected not to decreaseguardrail
task_turnsmeaninformationalsecondary
task_secondsmeaninformationalsecondary

task_cost is sent for every exposed task, including capped, failed and excluded ones. task_solved is sent only when every FAIL_TO_PASS and PASS_TO_PASS test passes in a fresh grading container.

The margin m

How much solve rate lanes_v1 may lose and still pass rule 2.

m = 20 percentage points

D19. The guardrail margin is 20 points, because the fresh pool is small

N was meant to come from the power analysis, but it is capped by supply: every task in the fresh tier (created after the models' cutoff, inside the stratum) is already in the exp1 pool, and about 62% of them validate. That gives about 43 tasks per arm. With those numbers, analysis/power.py on the pilot shows:

  • the cost question is well powered: 95% power at the pilot's 37% cut;
  • the solve-rate guardrail is not: only a drop of about 25 points is detectable.

A 5-point margin would fail almost every time, even for an arm that is truly as good as control, so the experiment would decide nothing. The prereg uses m = 20 points, which an equal arm passes 77% of the time at this N. It also states plainly that smaller solve-rate losses cannot be ruled out. Adding older tasks would raise N but bring back the contamination risk that D1 avoids.

Power

From analysis/power.py on the 18 pilot tasks, 2000 simulations, seed 20260202.

From analysis/power.py on the 18 pilot tasks (solve rate 50%, mean cost $0.114 for control and $0.072 for lanes_v1), 2000 simulations, seed 20260202. At 45 tasks per arm:

  • Cost: a 29% cut in mean cost is detected with 80% power. The pilot's observed cut (37%) is detected with 95% power.
  • Solve rate: only a drop of about 25 percentage points is detected with 80% power.
  • Guardrail: if lanes_v1 truly solves as many tasks as control, rule 2 passes 77% of the time.

So this experiment can answer the cost question, but it can only rule out large drops in solve rate. A small solve-rate loss of, say, 5 points would go undetected; ruling that out would need roughly 800 tasks per arm, more than the fresh pool holds. The results will say so next to the numbers.

The margin of 20 points was chosen after the pilot and before any experiment task ran. It was set so that a lanes_v1 that is truly as good as control passes the guardrail more often than not at this N.

Power by tasks per arm, from analysis/out/power.json
Tasks per armSmallest detectable solve dropSmallest detectable cost cutPower at the pilot's cost effectRule 2 pass rate, no true drop
2532.5 pp37%79.6%55.5%
3030.5 pp35%84.4%65.4%
3528.0 pp32%89.0%68.8%
4026.5 pp31%93.8%71.3%
45registered25.5 pp29%94.9%77.1%
5023.5 pp28%96.5%75.5%
5523.0 pp27%97.2%81.7%
6021.5 pp26%98.9%84.3%
6522.0 pp25%99.1%88.5%
70amendment20.0 pp25%99.4%86.5%
7519.5 pp23%99.3%88.8%
8020.0 pp23%99.6%91.0%
8519.5 pp22%100.0%92.2%
9018.0 pp21%100.0%92.0%
9518.5 pp21%100.0%93.6%
10017.5 pp21%100.0%95.4%

Source: analysis/out/power.json. Larger sizes up to 2000 per arm are in the file.

Task pools

Seeded (seed 20261127), disjoint, and pinned to one dataset revision.

Task pools from tasks/pools/manifest.json
PoolTasksLanguagesFile sha256
pilot943013e46a0d6af8769e440429ac80b706ad914736d82f6f9e36b1ca56cfb8e433
exp11406b3ff128e3e894f162c0abea18d9a519e5a7bde554d62fa3000e1183592ad785c
rollout208ffd0c2b998f392333e33b7f1f7b27932e183aca92fdb718fbd4f63e66035291d
exp210084f6a003739828a6950c13dd8a4ffab9bef72912a2de597a8ec7d82987d60cb6b
reserve74187422e9e6298c97cf8722535fec1082a3a86cd0d3b38a1030c1752340f62c2a6
exp1b808650e71bda64a9dd10a7023edf6888215bdda315525d2e47b9fc712129461ad1c
exp2b11081fdd798926e15e78bdf60aedf3fc4a02c0cac84c6dbe25f73d191eb4d16135b4
exp318387ebb3c167e0198d2a082951652304c833a383682a2655474c22a52e9d42fffa0
exp420081bc8393a4a2ab693b92720c93392d8593222558be086c65a7d402f827c037157

Stratum: the fix touches 1 to 3 files and at most 60 changed lines; problem statements under 12,000 characters. Fresh tier: created on or after 2026-07-01. Pre-cutoff tier: from 2026-03-01. Dataset revision 47c3efdb8eb8.

D1. Task pools: fresh tier for experiment 1, newest pre-cutoff tier for the rest

All three candidate models (Claude Opus 5.5, Sonnet 5.5, Haiku 5.5) have a June 2026 training-data cutoff (models overview, checked 2026-11-27). Counted on 2026-11-27 from the Hugging Face parquet exports:

SourceCreated ≥ 2026-07-01Created 2026-03-01 to 2026-06-30
SWE-bench-Live/MultiLang (c, cpp, go, js, rust, java, ts, cs)231423
SWE-bench-Live/SWE-bench-Live (Python, full)0 (latest is 2025-04)0
nebius/SWE-rebench-leaderboard 2026_030110
nebius/SWE-rebench-V20 (latest is 2025-10)0

The fresh tier can't fill three disjoint pools of several hundred tasks each. So:

  • Experiment 1 (the headline) uses every task in the fresh tier that passes validation. Every task in the headline result was created after every model's training cutoff.
  • Pilot, experiment 2 and the rollout batch draw from the newest pre-cutoff tier. This is disclosed in the README limits section, and created_month is recorded as a trait.
  • N per arm comes from analysis/power.py on pilot data, bounded by the fresh pool size. If that falls below the original target of 250 per arm, the prereg states the smallest solve-rate drop the experiment can detect, rather than claiming more than it can.

Contamination doesn't bias the arm comparison much, since both arms use the same main-lane model, but it does inflate absolute solve rates. That's why the fresh tier carries the headline.

D10. Final difficulty stratum: at most 3 files and 60 changed lines, C++ included

With the first stratum (at most 2 files, 40 lines, no C++), only 92 fresh tasks qualified, which is 46 per arm and below Flagsmith's floor of 50 identities per arm before validation drops any. The final stratum allows the gold patch to touch at most 3 files and 60 changed lines, keeps problem statements under 12,000 characters, and includes C++ (the runner VM has 64 GB of RAM). Selected with seed 20261127 from the pinned dataset revision recorded in tasks/pools/manifest.json:

PoolTasksTier
pilot12created 2026-03-01 to 2026-06-30
exp1140created on or after 2026-07-01 (every fresh task in the stratum)
rollout20created 2026-03-01 to 2026-06-30
exp2100created 2026-03-01 to 2026-06-30
reserve74SWE-rebench 2026_03, Python

Pool files are stored as gzip with a fixed timestamp, so the same seed produces byte-identical files.

Validation and order

Each task is built and its gold patch tested before any model sees it.

  • Pool: tasks/pools/exp1.jsonl.gz, every SWE-bench-Live MultiLang task created on or after 2026-07-01 in the stratum of at most 3 files and 60 changed lines, minus the instances that failed validation (tasks/validation_report.json). Seed 20261127, with the dataset revision in tasks/pools/manifest.json.
  • Identity: swelive:<instance_id>. Traits: repo, language, created_month, gold_files, gold_lines.
  • N: every valid task in the pool. 140 tasks were drawn; about 62% of those validated so far pass, so we expect around 85 valid tasks, about 43 per arm. Flagsmith's bucketing decides the split, so the arms will not be exactly equal.
  • Order: validation (gold patch, run without any model) is arm-blind, so a task is enqueued as soon as it passes. Validation never sees an arm and the agent never sees validation output beyond the task itself.

D20. Tasks are enqueued as they pass validation

Validating a task means building it and running its tests with the gold patch. That takes from one minute to an hour, and a full pool takes many hours across two machines. The runner's --valid-report mode enqueues each task once any validation report marks it valid, and it keeps polling until every pool task has a verdict. This is sound because validation never involves a model or an arm, so the order in which tasks enter the queue tells us nothing about either arm. Every enqueue batch is written to the ledger.

Exclusions and stopping

What may be dropped, and when the run ends.

Exclusions

Infrastructure failures (image pull, container start, git trouble in the container, provider errors after retries) are retried once, then excluded and listed in runs/exp1/exclusions.jsonl. Events are sent only for a task's final attempt, so a retried task's metrics reflect that attempt; the spend of the failed attempt is still counted in the budget and the ledger. Agent failures (refusals, caps, malformed loops) are never excluded. An SRM p-value below 0.001 means the results aren't acted on until the cause is found.

Stopping

The run continues until every task in the pool is done or excluded. There is no early stopping on a good result. The flag is not touched while the experiment runs. Only routing_kill may be used, for safety, and any use is logged.

About task_seconds

task_seconds is wall time from assignment to the end of grading, so it includes pulling the image and building and running the tests. The 1200-second cap applies only to the agent loop. Image builds dominate this metric, which is why it is informational.

What the pilot decided

Arms forced by the runner, a disjoint pool, no Flagsmith exposure. Used only to set N and m.

controllanes_v1
Tasks99
Solved54
Solve rate56%44%
Mean cost$0.1143$0.0723
Median cost$0.1071$0.0504
Max cost$0.2684$0.1720
Delegate share of cost61%11%
Max turns1417
Max seconds20932153
Mean delegate calls2.33.6
Infra retries01
Spend incl. retries$1.0289$0.6720

Source: prereg/pilot-report.md, generated by analysis/pilot_report.py.

D16. Delegation is the expected way to do grunt work

In the dry run the main lane never called delegate in four tasks. The two arms differ only in the delegate lane's model, so without delegation they would be identical. The shared main-lane prompt now states that the main lane's context is the expensive resource. It tells the agent to delegate surveys, long reads and test runs, starting with a survey of the code the issue touches, and to use bash itself only for small, targeted checks. Both arms get the same prompt. The pilot measures the delegate share of tokens and cost before the prereg is fixed.

D17. The main lane sees short tool output; long output goes through the delegate

The stronger prompt (D16) still produced no delegation: the main lane read files and ran builds with its own bash. The harness now enforces the two-lane design in both arms. The main lane's bash returns only the first and last 1 KB of output, and its tool description says so. The delegate's bash returns up to 16 KB. Short checks still work in the main lane. Reading long files, searching widely and digesting test or build output are delegated, which is the grunt work the experiment routes to a cheaper model.

The amendment

More tasks so that Flagsmith can give a verdict at all.

Why

Decision rule 1 uses the chance to beat control that Flagsmith reports for task_cost. Flagsmith shows no inference for a metric until each variant has at least 50 identities (RESULTS_MIN_IDENTITIES_PER_VARIANT = 50 in api/experimentation/constants.py of the Flagsmith repository). It checks sample-ratio mismatch only from 100 identities in total. The registered pool was expected to give about 43 valid tasks per arm. At that size Flagsmith would show "collecting data" to the end, and rule 1 could never pass. The original registration missed this.

What was known when it was written

The experiment had started at 23:02:34Z. Three tasks had finished. Before writing this, the author had seen only:

  • the Flagsmith results endpoint at 23:04Z, showing 3 exposures and no events;
  • a pipeline health check: 3 tasks, all assigned by the experiment, no infra errors, and 9 events (3 each of task_cost, task_turns and task_seconds).

The event counts imply that none of the three finished tasks had been solved. No result per arm, and no cost, was seen.

Change

  1. Pool. The experiment also runs tasks/pools/exp1b.jsonl.gz: the next 80 pre-cutoff tasks (created 2026-03-01 to 2026-06-30, same stratum). They are drawn in the same seeded order (seed 20261127) after the pilot, rollout and exp2 pools, which are unchanged. tasks/select_tasks.py --exp1b 80 reproduces them, and tasks/pools/manifest.json records it. The same validation rule applies, and validated tasks are enqueued the same way. Expected total: about 135 valid tasks, about 68 per arm.
  2. Units. Units are now SWE-bench-Live MultiLang tasks of both tiers, one Flagsmith identity per task. Pre-cutoff tasks may have been seen in training. That raises solve rates in both arms alike, since assignment is random, but it means the tier is a trait to report. The Flagsmith experiment's hypothesis field, which mentions only fresh tasks, is left as created so that nothing on the running experiment is edited. This amendment is the record of the change.
  3. Analyses. Primary, unchanged: decision rules 1-3 on all exposed tasks of both pools. New secondary analysis: the same estimates for the fresh tier alone and for the pre-cutoff tier alone. These are reported, but they don't enter the decision.
  4. Unchanged: the arms, flag values, caps, metrics, the margin m = 20 points, the decision rule, the exclusions and the stopping rule. The run ends when every task in both pools is done, excluded or invalid.

Power at the new size

From the same analysis/power.py run as the registration (analysis/out/power.json), at 70 tasks per arm:

  • a 25% cost cut is detected with 80% power, and the pilot's 37% cut with 99% power;
  • a solve-rate drop of 20 points is detected with 80% power;
  • if lanes_v1 truly solves as many tasks as control, rule 2 passes 87% of the time.

Small solve-rate losses still cannot be ruled out.

After the decision

The rollout and the second experiment.

The experiment is ended in Flagsmith, the winning variation's value becomes the flag's value, and a fresh batch (tasks/pools/rollout.jsonl.gz, disjoint from this pool) runs on the same flag with no code change. Experiment 2 is registered separately.

D24. The live board shows running totals per arm

The board at https://forkbill.prashantthakur.dev went live at 05:55Z on 2026-11-27, with exp1 89 tasks in. From then on it shows each arm's tasks, solves and spend as the run goes, so the operator sees interim figures too. This can't move the result: the decision rule, the margin, the pools and the stopping rule (every task in both pools done, excluded or invalid) are fixed in the registration, and there is no early stop. The verdict section stays empty until the analysis script runs at the end.

Part 2

How the agent works

One coding agent, split into a planner and a worker. Both arms run the same agent; they differ only in the model behind the worker. Each task is a real bug from SWE-bench-Live, graded by that repo's own tests.

The frontier model reads the logs at frontier prices

Why split the agent at all.

A coding agent spends much of its tokens on grunt work: searching the repo, reading long files, running tests and reading what they print. When one frontier model does everything, that work is billed at the frontier rate. At list price, a million input tokens cost 20 times as much on Sonnet 5.5 as on Haiku 5.5.

Toll, per million tokensInputOutput
Sonnet 5.5$2.00 input$10.00 output
Haiku 5.5$0.10 input$0.50 output

Source: harness/pricing.json, checked 2026-11-27

Two lanes inside one container

The planner decides and writes; the worker searches, builds and runs tests.

The task container holds two lanes. The planner lane (Sonnet 5.5) reads and edits files, delegates and submits. The worker lane (Sonnet 5.5 or Haiku 5.5) runs bash and returns JSON findings. Submit sends the patch to a fresh grading container.Task container · network offPlanner lane · Sonnet 5.5Worker lane · Sonnet 5.5 or Haiku 5.5view_fileedit_filedelegateJSON findingssubmitbashGradingfresh containernetwork on

Planner lane. It has four tools: read up to 150 numbered lines of one file, edit a file, hand a job to the worker, and submit. It has no shell, so anything that needs searching or running goes through the worker.

Worker lane. It has bash in the same container, with up to 16 KB of output per command. It works in its own conversation and answers with JSON. The planner never sees its transcript.

harness/tools/defs.py:117Source: harness/tools/defs.py
MAIN_TOOLS = [VIEW_FILE, EDIT_FILE, DELEGATE, SUBMIT]
DELEGATE_TOOLS_READONLY = [BASH]
DELEGATE_TOOLS_DRAFT = [BASH, EDIT_FILE]

How a job is handed off

The planner asks; the worker digs; a short answer comes back.

The planner calls delegate with a task in plain words. The worker gets its own tool loop of at most 12 turns and must end with {summary, findings[], confidence}. Only that JSON enters the planner's context, which is why the worker's model can be small: it reads the long output, the planner reads the summary.

D18. Planner and worker: the main lane has no shell

Even with its shell output cut to 1 KB (D17), the main lane still delegated nothing. It switched to tighter sed -n and grep | head commands. Two identical arms would measure nothing. The harness now uses the orchestrator/worker split that many coding agents use, identically in both arms:

  • Main lane (planner). Tools are view_file (up to 150 numbered lines of one file), edit_file, delegate and submit. It decides what to change and writes the change.
  • Delegate lane (worker). Has bash (16 KB of output) in the same container. All searching, surveying, building and test running goes through it, and it returns JSON findings.

The experiment's question is unchanged: whether the worker can be a small model without the planner solving fewer tasks. D17's main-lane bash cap no longer applies, because the main lane has no bash.

Costs and caps

Read from the flag values. Identical in both arms.

Routing policy settings for each arm, from flagsmith/policies
Settingcontrollanes_v1
Planner modelclaude-sonnet-5-5claude-sonnet-5-5
Worker modelclaude-sonnet-5-5claude-haiku-5-5
Planner max tokens per call80008000
Worker max tokens per call20482048
Worker context limit2400024000
Effort, planner / workermedium / lowmedium / low
Cap: planner turns4040
Cap: dollars per task$0.60$0.60
Cap: agent seconds12001200
Worker input price, per MTok$2.00$0.10

Highlighted rows differ between arms. Sources: control.json, lanes_v1.json, pricing.json.

D6. Global spend cap by reservation

harness/budget.py reserves each call's worst-case cost before the call, using an atomic Lua script in Redis or a file lock locally, and settles it to the real cost afterwards. A reservation that would exceed the cap is refused, so a crash or bug can only make the cap stricter, never looser.

D7. Per-task cap checked before each call

The per-task dollar cap is checked before every model call in both lanes. A task can therefore end slightly above the cap by at most one call's cost, and the same rule applies in both arms. The full real spend is reported as task_cost.

What both arms share

A clean A/B test changes one thing.

flagsmith/policies/control.json → lanes_v1.jsonSource: the lanes_v1 policy file
  {
-   "policy": "control",
+   "policy": "lanes_v1",
    "schema": 1,
    "main": {
      "model": "claude-sonnet-5-5",
      "max_tokens": 8000,
      "cache": true,
      "effort": "medium"
    },
    "delegate": {
-     "model": "claude-sonnet-5-5",
+     "model": "claude-haiku-5-5",
      "max_tokens": 2048,
      "max_context_tokens": 24000,
      "effort": "low"
    },
    "caps": {
      "turns": 40,
      "usd_per_task": 0.6,
      "seconds": 1200
    },
    "prompt_variant": "delegate_v1"
  }

The whole flag value for each arm, side by side. One line differs: the worker's model. The harness refuses a variant that differs anywhere else.

D2. No `temperature`; arms share effort and thinking settings instead

The Messages API rejects temperature, top_p and top_k on every model, and Opus 5.5 can't turn thinking off. The clean-A/B control is therefore: identical output_config.effort per lane, adaptive thinking (the model default, never configured differently per arm), identical prompts, tools, tool order, caps and harness code. RoutingPolicy.clean_ab_diff checks that the two flag values differ only in delegate.model, and flagsmith/setup.sh refuses to create a variant that differs in anything else.

D3. No server-side refusal fallback

The API offers a fallback that re-runs a refused request on another model inside the same call. That would silently change which model did the work in one arm, so it's off. A refusal ends the task as agent_error. Agent errors are never excluded, so refusals count against the arm that produced them.

How a fix is graded

The repo's own tests, in a fresh container, after the agent has stopped.

runner/grading.py:3Source: runner/grading.py
Per instance, in a fresh container started from the instance image:

1. ``git apply --reject --whitespace=nowarn`` the ``test_patch`` in ``/testbed``, then the
   candidate patch (a failed apply is recorded but does not stop the run, as upstream).
2. Run ``rebuild_cmds`` then ``test_cmds`` (each list joined with ``" ; "``) in one logical shell
   session, then ``print_cmds``; the print output is the test log. Sources without print
   commands get the upstream fallback: tests run via ``run_test.sh`` into ``testlog.out``,
   which is then printed.
3. Parse the log with the instance's parser and resolve: every FAIL_TO_PASS test passes and
   every PASS_TO_PASS test is present and not failing (upstream ``run_instance`` rules,
   including its handling of truncated parametrised test ids).

D11. Grading runs with network access; the agent's container does not

The agent works in a container with networking disabled. Grading happens afterwards, in a fresh container built from the same image, with networking on, as the official SWE-bench-Live harness does: many rebuild steps download dependencies, and some PASS_TO_PASS tests (for example c-ares' DNS tests) make live lookups. Because grading starts from a clean container after the agent has finished, network access during grading can't help the agent.

D15. The agent's patch is measured from the container's starting state

The SWE-bench-Live images ship with a dirty work tree: test reports and other files left by the image build, and sometimes edited tracked files. Collecting the agent's patch with git diff HEAD swept these in. In the dry run that produced a 27 MB patch that failed to apply at grading. When a task container starts, the runner commits its state as a local baseline and records which files were untracked build output. The agent's patch is its diff against that baseline, including files it created. Build-output files are left out even when the agent's test runs rewrite them. Grading starts a fresh container from the same image, which is in the same starting state, so the patch applies cleanly. Covered by tests/integration/test_baseline_diff.py.

Next: how Flagsmith assigns each task