Agent harness engineering·
Open Mind, Closed Loop: Measuring the Trade-offs of Decision Models in Agentic Systems
A little less speculation, a little more instrumentation.
712 graded runsA scripted graph beat the loop with plenty of turns and lost with few
Inside the graph it made no measurable difference whether the planner, a small decision model or a random pick made the choices. The one choice that mattered was not giving up on a package.
1. The question
A Reddit post told me the agentic loop was outdated. The title above is roughly how I took that, and I tested it anyway.
Where the question came from
The post was on r/ClaudeCode, titled “The Agentic Loop is OUTDATED”. It introduced Jive, an open-source harness in which graphs of shell steps are written by the model, with a decision model from TypeSafe, called Jev, as some of the steps. Jive’s own benchmark table shows single runs with times and call counts, and the Jive repository says the table “deliberately omits success labels and task-quality scores”. So the post had evidence that a graph harness could be fast, and none that the harness got anything right.
My first attempt at testing the claim went wrong, and I took the write-up off my site. I had let agents design and run the experiments without reviewing what the experiments asked. The cost figures were checked twice and the questions were never checked once. This is the redone study. This time I fixed the question first, wrote down what would count as an answer before any run, and checked the measuring tools before I used their numbers.
One result from the first attempt held up under review: fewer model calls did not mean a smaller bill. It is in chapter 4, and it is why turns, dollars and seconds are recorded separately for every run in this study.
Loop, graph, and the two things I varied
A coding agent is a language model that writes code by requesting tool runs and reading what comes back. The program around the model, which sends the prompts and runs the tools, is the harness. The ordinary harness is a loop: one tool call is requested by the model, the result comes back, and the next call is chosen from that result, until the model replies that the work is done.
In a graph harness more of that sequence is fixed in advance. The steps the agent goes through (write the code, run the checks, repair what failed, review against the specification) are named ahead of time, with rules for which step comes next. I varied two parts of that layout.
The first is where the graph comes from. It can be written by the model, a new one every turn, or scripted ahead of time by a developer and followed in every run.
The second is how the choices inside the graph are settled. At some steps there is a real choice: which documents to read, whether to repair or start again, whether a review comment is right, whether to stop. I call each such step a decision point. The decider is the component a decision point’s choice is left to. The decider can be the model that writes the code (the planner), a small decision model that only returns answers to fixed-form questions, a rule written in code, or a random pick.
The question, for a whole build, is whether either of those matters. Two origins for the graph and four kinds of decider give the options tested.
%%{init: {'theme': 'base', 'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'themeVariables': {
'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'fontSize': '15px',
'primaryColor': '#F4F6F8', 'primaryTextColor': '#0A2540', 'primaryBorderColor': '#0A2540',
'secondaryColor': '#FFFFFF', 'tertiaryColor': '#FFFFFF', 'lineColor': '#5B6B7F',
'textColor': '#0A2540', 'clusterBkg': '#FFFFFF', 'clusterBorder': '#C9D3DE',
'edgeLabelBackground': '#FFFFFF'
}, 'flowchart': {'wrappingWidth': 300, 'rankSpacing': 42}}}%%
flowchart TB
G["<b>A graph harness</b><br/>named steps, with rules<br/>for which step comes next"]
W["<b>The graph is written by</b>"]
D["<b>Choices inside it are decided by</b>"]
W1["The model,<br/>a new graph every turn"]
W2["A developer,<br/>one script every run follows"]
D1["The planner"]
D2["A small<br/>decision model"]
D3["A rule<br/>written in code"]
D4["A random pick"]
G --> W & D
W --> W1 & W2
D --> D1 & D2 & D3 & D4
One package, from specification to score
Every run builds real code to a written specification: a press-release intake module for an existing business system. The module is seven work packages, one stage each. A run in the main experiment builds one group of them. In the follow-up a third of the runs build all seven. The intake group is Sanitize (raw email to clean text), Attachments (the text of PDF and Word files) and Extract (a scripted parser fills the fields). The delivery group is Verify (a model reviews the fields), Persist (stores the row and removes duplicates), Mailbox poll (hands on mail from staff senders only) and Airtable push (creates each release once).
A package passes when the files its specification names are present, every hidden test passes, and the linter and formatter are clean. A hidden test is a test the agent can’t read. A run’s score is the share of its packages that pass.
%%{init: {'theme': 'base', 'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'themeVariables': {
'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'fontSize': '15px',
'primaryColor': '#F4F6F8', 'primaryTextColor': '#0A2540', 'primaryBorderColor': '#0A2540',
'secondaryColor': '#FFFFFF', 'tertiaryColor': '#FFFFFF', 'lineColor': '#5B6B7F',
'textColor': '#0A2540', 'clusterBkg': '#FFFFFF', 'clusterBorder': '#C9D3DE',
'edgeLabelBackground': '#FFFFFF'
}, 'flowchart': {'wrappingWidth': 300, 'rankSpacing': 42}}}%%
flowchart TB
SP["Written specification<br/>for one work package"]
AG["<b>Agent in the harness under test</b><br/>writes the package's files"]
GR["<b>Grader</b><br/>runs after the agent has finished"]
C1["Every file the<br/>specification names is present"]
C2["Every hidden test passes"]
C3["Linter and formatter<br/>are clean"]
P["<b>The package passes</b><br/>when all three hold"]:::good
S["Run's score: the share<br/>of its packages that pass"]
SP -->|"is read by"| AG -->|"files are read by"| GR
GR --> C1 & C2 & C3
C1 & C2 & C3 --> P --> S
classDef problem fill:#FAF0EE,stroke:#BA4A38,stroke-width:2px,color:#0A2540;
classDef good fill:#EAF7EF,stroke:#3BB273,stroke-width:2px,color:#0A2540;
A pass doesn’t mean the code is correct, and how far the tests can be trusted is in chapter 4.
Four experiments, each set up by the one before
| Experiment | Runs | What it was for | Where |
|---|---|---|---|
| Pilots | 126 | Check that the tests, budgets and decision points can measure a difference at all | Appendix E |
| Wiring check | No builds | Check that the requests sent to the decision model carry what a correct reply requires | Appendix E |
| Main experiment | 328 | Loop, planner-written graph and scripted graph, with five deciders inside the scripted graph | Chapter 2 |
| Follow-up | 384 | A loop compared with a harness that splits the work among parallel workers, at small budgets | Chapter 3 |
The pilots supplied the turn budgets. The wiring check showed that deciders were sent only the first 12,000 characters of a specification, and that truncation was removed. The main experiment left two results open, and the follow-up was designed around those two.
%%{init: {'theme': 'base', 'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'themeVariables': {
'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'fontSize': '15px',
'primaryColor': '#F4F6F8', 'primaryTextColor': '#0A2540', 'primaryBorderColor': '#0A2540',
'secondaryColor': '#FFFFFF', 'tertiaryColor': '#FFFFFF', 'lineColor': '#5B6B7F',
'textColor': '#0A2540', 'clusterBkg': '#FFFFFF', 'clusterBorder': '#C9D3DE',
'edgeLabelBackground': '#FFFFFF'
}, 'flowchart': {'wrappingWidth': 300, 'rankSpacing': 42}}}%%
flowchart TB
P["<b>Pilots</b>, 126 runs<br/>can the tests, budgets and decision<br/>points measure a difference?"]
W["<b>Wiring check</b>, no builds<br/>do requests to the decision model<br/>carry what a correct reply requires?"]
M["<b>Main experiment</b>, 328 runs<br/>loop, planner-written graph, scripted graph,<br/>five deciders inside the scripted graph"]
F["<b>Follow-up</b>, 384 runs<br/>loop against parallel workers<br/>at small budgets"]
P -->|"supply the turn budgets"| M
W -->|"truncation found, then removed"| M
M -->|"two open results tested in"| F
The plan written before the runs also had experiments on the shape of the graph and on new work with another model family. They have not been run.
Small models and tight budgets, on purpose
The planner is a small model in every run: gpt-6-luna on Azure for the pilots and the main
experiment, and claude-haiku-5-5 for the follow-up. A run costs 5 to 31 cents on average,
depending on the arm. An arm is one harness setup under test.
| Model | Used for | Price per million tokens: input, cached input, output |
|---|---|---|
gpt-6-luna |
Planner in the pilots and the main experiment | $0.10, $0.01, $0.50 |
claude-haiku-5-5 |
Planner and workers in the follow-up | $0.10, $0.01, $0.50 |
gpt-6.2-sol |
Wrote hidden tests for six packages that were later dropped | $2.00, $0.10, $10.00 |
The two planners cost the same per token, and cached input costs a tenth of fresh input. So how much of a conversation is re-sent from the cache matters to the bill as much as how many calls are made.
The pilots and the main experiment run on DeepSeek Harness, an existing coding-agent harness, installed and not modified. For the follow-up I wrote a small runner, so that every arm shares one worker loop.
The small models are deliberate. In an earlier round nearly every package passed under two larger planners, so no harness design could look different from any other. For the same reason each run has a turn budget, a cap on model calls, which I set from pilot runs so that under the loop some packages pass and others fail. Given the main experiment’s budgets, 67% to 100% of the packages passed in every arm with the follow-up’s model, so the follow-up’s budgets were cut to between a tenth and a fifth of the main experiment’s.
The budgets are a test condition. Nobody should starve a cheap model of turns in production. The squeeze is there to show what each harness does with a fixed number of turns, on work that is hard for the model.
Three things I left out
The first is how accurate the decision model is in general. TypeSafe publishes evaluations of that accuracy, and those evaluations are the source to cite. The wiring check in Appendix E uses only what shows the decision model was sent proper requests.
The second is a decision model called as a tool from a plain loop, which is a different design from a decision model inside a graph.
The third is the harness from the post, run again. The redo tests the question the post raised and leaves the post’s software alone.
The engineering behind the runs
What I built to make the runs possible is in four appendices, and the pilot runs are in a fifth.
- Appendix A: the Azure setup is a private network on Microsoft Azure where model-written code runs with no path to the internet, no stored cloud keys, a spending cap checked before every model call, and everything billed by the hour removed between sessions.
- Appendix B: the module is a seven-stage pipeline designed to fit an existing Flask and SQLAlchemy business system, held together by a frozen data contract and built against a stand-in for that system.
- Appendix C: the harness and its arms has the scripted graph step by step, and the exact question put to each decider.
- Appendix D: grading covers what a pass is, how the hidden tests are kept from the agent, and how much bad code is known to get past them.
2. The main experiment
The main experiment (E18 in the data files) is 328 runs with gpt-6-luna as the planner. All
328 finished and were graded. None was left out and none was rerun.
Level overall, from two opposite effects
Over both groups, the scripted graph and the loop came out level. That level result is two opposite effects of about the same size: the scripted graph was ahead on the intake group and behind on the delivery group. It was behind there because its turns ran out. The delivery group’s four packages are built in order under the scripted graph, and the last of them never passed under it.
Fewer packages passed under the planner-written graph than under the loop or the scripted graph. In that arm the file tools were also switched off and much less of each result came back, so neither comparison isolates the effect of the graph being written by the planner.
Inside the scripted graph, changing the decider made no difference detectable in this experiment, as long as skipping a package was left out of the decider’s options. And the decision model’s arm turned out to be a fixed policy: “repair” at all 263 repair decisions and “stop” at all 85 review decisions. That arm’s tie with the planner’s arm therefore means that always repairing and then stopping did as well as the planner’s choices. The tie leaves open whether the decision model’s judgement is as good as the planner’s.
All of these are comparisons I wrote down before the first run, tested on a setup that was tuned on these same seven packages with this one planner. They hold for this work, and I don’t offer them as evidence about graphs or deciders in general.
Eight arms, one planner
Every arm has the same planner, packages, turn budget and grading. Each arm is described in full in Appendix C.
| Arm | What runs | Decider |
|---|---|---|
| Loop | The harness’s own loop, no graph | |
| Planner-written graph | The planner writes a graph each turn and the harness runs it | The planner, inside its own graph |
| Scripted graph, decided by the planner | A fixed procedure: write, check, then repair, rewrite or skip, then review or stop | The planner, in a short separate call |
| The same arm again, under another label | The same fixed procedure, as a duplicate to show how far two identical arms differ by chance | The planner again |
| Scripted graph, decided by the decision model | The same fixed procedure | Jev |
| Scripted graph, decided by a rule | The same fixed procedure | A rule written in code |
| Scripted graph, random, skipping excluded | The same fixed procedure | A random pick, with skipping a package left out of the options |
| Scripted graph, random, skipping allowed | The same fixed procedure | A random pick |
The first three arms ran on both groups. The other five, which are the duplicate of the planner’s arm and the four arms with another decider, ran on the intake group only, for the reason in Appendix E. The 328 runs went in one shuffled order, on code frozen at the commit that holds the pre-registration.
So on the intake group the scripted graph ran with five deciders, and with the planner as decider it ran twice.
%%{init: {'theme': 'base', 'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'themeVariables': {
'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'fontSize': '15px',
'primaryColor': '#F4F6F8', 'primaryTextColor': '#0A2540', 'primaryBorderColor': '#0A2540',
'secondaryColor': '#FFFFFF', 'tertiaryColor': '#FFFFFF', 'lineColor': '#5B6B7F',
'textColor': '#0A2540', 'clusterBkg': '#FFFFFF', 'clusterBorder': '#C9D3DE',
'edgeLabelBackground': '#FFFFFF'
}, 'flowchart': {'wrappingWidth': 300, 'rankSpacing': 42}}}%%
flowchart TB
S["Same planner, packages,<br/>turn budget and grading"]
L["<b>Loop</b><br/>the harness's own loop,<br/>no graph"]
PG["<b>Planner-written graph</b><br/>the planner writes<br/>a graph each turn"]
SG["<b>Scripted graph</b><br/>a fixed procedure for every package,<br/>five deciders on the intake group"]
D1["Planner<br/>(run twice)"]
D2["Decision<br/>model"]
D3["Rule in<br/>code"]
D4["Random,<br/>skipping excluded"]
D5["Random,<br/>skipping allowed"]
S --> L & PG & SG
SG --> D1 & D2 & D3 & D4 & D5
For each package the scripted graph has four decision points. Two of them set the path a package takes: one after a failed check, where the options are repair, rewrite or skip, and one after clean checks, where the options are review or stop. The other two are the choice of documents before the write step and the filtering of the problems a review lists, and they come up at the end of this chapter.
%%{init: {'theme': 'base', 'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'themeVariables': {
'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'fontSize': '15px',
'primaryColor': '#F4F6F8', 'primaryTextColor': '#0A2540', 'primaryBorderColor': '#0A2540',
'secondaryColor': '#FFFFFF', 'tertiaryColor': '#FFFFFF', 'lineColor': '#5B6B7F',
'textColor': '#0A2540', 'clusterBkg': '#FFFFFF', 'clusterBorder': '#C9D3DE',
'edgeLabelBackground': '#FFFFFF'
}, 'flowchart': {'wrappingWidth': 300, 'rankSpacing': 42}}}%%
flowchart TB
W["<b>Write</b><br/>the model builds the package's files"]
C["<b>Checks</b><br/>scripts run them after every step"]
D3{"A check fails:<br/>repair, rewrite or skip?"}
R["<b>Repair or rewrite</b><br/>a model step"]
D5{"All clean:<br/>review or stop?"}
RV["<b>Review</b><br/>against the specification"]
N["Next package"]
W --> C
C -->|"fails"| D3
D3 -->|"repair or rewrite"| R
R -->|"checks again"| C
D3 -->|"skip"| N
C -->|"clean"| D5
D5 -->|"review"| RV
RV -->|"problems kept"| R
D5 -->|"stop"| N
A difference is claimed only when its 95% interval is clear of zero, and the difference is called “at least 0.15” only when that whole interval lies beyond 0.15. “Level” is claimed only when the whole interval lies within 0.10 of zero.
Two groups: different work on different budgets
| Intake group | Delivery group | |
|---|---|---|
| Packages | Sanitize, Attachments, Extract | Verify, Persist, Mailbox poll, Airtable push |
| Kind of work | Parsing untrusted input: cleaning a raw email, reading PDF and Word files from strangers, filling 14 fields with a scripted parser | Connecting to other systems: a model call, a database, a mailbox, Airtable |
| Where the difficulty is | Many edge cases stated in the specification (45 to 51 hidden tests each) | Getting the contract with each outside system right |
| How hard it was | Hard. Sanitize passed in 0 to 7 of 32 runs in every arm, Extract in 1 to 11 | Easier. The loop passed 0.677 of the packages |
| Turn budget | 330 for three packages, about 110 each | 112 for four packages, about 28 each |
The groups differ in the kind of work and in the turns each package gets, both at once. Each budget was set in a loop-only pilot, at the level where at least two of the group’s packages pass in some runs and fail in others (Appendix E). So a difference between the two groups can’t be put down to turns from the group totals alone. The package-by-package results on the delivery group, further down, are what point to turns.
Every arm’s results, and why Attachments matters most
| Arm | Group | Runs | Share passing | Passes by package | Turns per run | Cost per run |
|---|---|---|---|---|---|---|
| Loop | Intake | 32 | 0.302 | Sanitize 2, Attachments 26, Extract 1 | 252 | $0.305 |
| Planner-written graph | Intake | 32 | 0.115 | Sanitize 0, Attachments 7, Extract 4 | 228 | $0.230 |
| Scripted graph, decided by the planner | Intake | 32 | 0.448 | Sanitize 4, Attachments 32, Extract 7 | 217 | $0.206 |
| Scripted graph, decided by the planner (duplicate) | Intake | 32 | 0.469 | Sanitize 3, Attachments 31, Extract 11 | 216 | $0.215 |
| Scripted graph, decided by the decision model | Intake | 32 | 0.448 | Sanitize 7, Attachments 32, Extract 4 | 161 | $0.155 |
| Scripted graph, decided by a rule | Intake | 32 | 0.344 | Sanitize 4, Attachments 27, Extract 2 | 196 | $0.184 |
| Scripted graph, random, skipping excluded | Intake | 32 | 0.458 | Sanitize 5, Attachments 30, Extract 9 | 224 | $0.228 |
| Scripted graph, random, skipping allowed | Intake | 32 | 0.198 | Sanitize 1, Attachments 15, Extract 3 | 122 | $0.130 |
| Loop | Delivery | 24 | 0.677 | Verify 15, Persist 21, Mailbox poll 13, Airtable push 16 | 110 | $0.147 |
| Planner-written graph | Delivery | 24 | 0.344 | Verify 5, Persist 14, Mailbox poll 4, Airtable push 10 | 111 | $0.110 |
| Scripted graph, decided by the planner | Delivery | 24 | 0.552 | Verify 24, Persist 23, Mailbox poll 6, Airtable push 0 | 112 | $0.108 |
Share passing is the mean over an arm’s runs. Passes are counts of runs.
Two packages sit near the bottom in every arm: Sanitize passed in 0 to 7 of 32 runs and Extract in 1 to 11. So the intake group’s differences come mostly from Attachments.
What a near miss looks like
Many failing builds were close. Of the 1,056 graded packages, 165 failed exactly one hidden test. The five tests that most often stood alone between a build and a pass all belong to the intake group’s packages.
| Package | Hidden tests | The one test failed | Builds |
|---|---|---|---|
| Sanitize | 51 | test_find_directives_d2_role_marker_detected |
19 |
| Extract | 46 | test_event_dates_from_to_range_skips_date_before_release_date |
12 |
| Extract | 46 | test_summary_long_paragraph_capped_on_sentence_boundary |
11 |
| Sanitize | 51 | test_malformed_bad_date_address_and_base64_degrade_quietly |
10 |
| Attachments | 45 | test_docx_zip_bomb_under_low_max_bytes_returns_too_large |
9 |
These are edge cases that are stated in the specification and tend to be missed in a first draft: a line dressed up as a system message inside an email, a date range that starts before the release date, a Word file that unpacks to more than the size limit. Each package ships with seven or eight public tests the agent can run and is graded on 45 to 51 hidden ones, so rules like these are where a build that looks finished still fails.
Finished, running and correct are three different marks
The score above is all or nothing. A package that fails one hidden test of 51 counts the same as a package with no code in it. So I recounted every arm at three levels below the pass mark: whether the code runs at all (at least one hidden test passes), how much of the hidden suite it passes on average, and whether it passes the whole suite. I counted these after reading the results, so they are exploratory and no registered comparison rests on them.
| Arm | Group | Runs at all | Average share of hidden tests passed | Every hidden test passes | Score (tests, linter and formatter) |
|---|---|---|---|---|---|
| Loop | Intake | 0.927 | 0.888 | 0.323 | 0.302 |
| Planner-written graph | Intake | 0.990 | 0.875 | 0.125 | 0.115 |
| Scripted graph, decided by the planner | Intake | 0.979 | 0.941 | 0.448 | 0.448 |
| Scripted graph, decided by the planner (duplicate) | Intake | 0.990 | 0.944 | 0.479 | 0.469 |
| Scripted graph, decided by the decision model | Intake | 1.000 | 0.946 | 0.448 | 0.448 |
| Scripted graph, decided by a rule | Intake | 0.958 | 0.905 | 0.365 | 0.344 |
| Scripted graph, random, skipping excluded | Intake | 1.000 | 0.971 | 0.469 | 0.458 |
| Scripted graph, random, skipping allowed | Intake | 0.927 | 0.810 | 0.375 | 0.198 |
| Loop | Delivery | 0.958 | 0.928 | 0.792 | 0.677 |
| Planner-written graph | Delivery | 0.958 | 0.910 | 0.354 | 0.344 |
| Scripted graph, decided by the planner | Delivery | 0.719 | 0.708 | 0.646 | 0.552 |
Nearly every package runs. The exception is the scripted graph on the delivery group, at 0.719, where the last packages were never started.
Most failures are near misses. Packages pass 81% to 97% of their hidden tests on average, and on the intake group no arm gets more than 48% of them through the whole suite.
The planner-written graph looks much less bad by this count. Its builds pass about as many hidden tests as the loop’s, 0.875 against 0.888 on the intake group and 0.910 against 0.928 on the delivery group. It is far behind only on complete passes. Its code was about as close to correct as the loop’s and was finished less often.
The decider result is the same at every level. The planner, the decision model and the random pick with skipping excluded stay together, and the random pick with skipping allowed is lowest.
None of these levels says whether the code is good beyond its tests. That would have needed the second test set built from a quality rubric, which was never made (Appendix E).
Loop compared with graph
Each group weighs the same in the overall figure. In this section “the scripted graph” is the arm decided by the planner, the one scripted-graph arm that ran on both groups.
| Comparison | Difference in share passing | 95% interval | Intake alone | Delivery alone | Verdict |
|---|---|---|---|---|---|
| Scripted graph minus loop | +0.010 | -0.052 to +0.073 | +0.146 (0.073 to 0.229) | -0.125 (-0.229 to -0.021) | Level over both groups |
| Scripted graph minus planner-written graph | +0.271 | 0.203 to 0.339 | +0.333 | +0.208 | Scripted graph better by at least 0.15 |
| Planner-written graph minus loop | -0.260 | -0.333 to -0.182 | -0.188 | -0.333 | Planner-written graph worse by at least 0.15 |
Where the scripted graph was ahead
On the intake group, with about 110 turns a package, Attachments passed in all 32 scripted-graph runs and in 26 of the loop’s 32, and Extract passed in 7 scripted-graph runs and 1 of the loop’s. The scripted-graph runs also took fewer turns (217 to 252) and cost a third less. Per passing package the cost was $0.154 under the scripted graph and $0.337 under the loop.
Partway through, I changed the batch to run more runs at once, and runs got slower. Four of the loop’s 7 later runs on this group ended on the time limit. That slowdown doesn’t explain the gap. The loop’s mean score was 0.293 on its 25 earlier runs and 0.333 on its 7 later ones, and on the earlier runs alone the scripted graph was ahead by 0.157.
The linter doesn’t account for the lead either. A package can pass every hidden test and still fail on the linter or the formatter, which comes up again in the follow-up in chapter 3. Counting hidden tests alone, the loop goes from 0.302 to 0.323 and the scripted graph stays at 0.448, because under the graph the lint and format fixers are run in code before every check.
Why the graph was ahead here was not tested, and the two arms differ in several things at once. Under the graph the checks run after every step, where under the loop they run only when the planner calls for them. Each graph step starts a fresh session. At most five standards and example documents are selected per package under the graph. Any of those differences could be the cause.
One pilot measurement bears on the cost. In the last pilot, at this budget, the scripted graph’s model calls carried about 27,000 input tokens each and the loop’s about 71,000 (from 3 scripted-graph runs and 6 loop runs). Both had more than 92% of their input billed at the cached price. A fresh session for each step keeps the conversation short, which fits the lower cost per run. I did not count tokens per call from the main experiment’s records, so the token figure comes from the pilot alone.
Where it was behind: a cost in turns
On the delivery group the scripted graph’s four packages are built in order, with 112 turns for all of them. In the step logs of its 24 runs, the last package was started in only 2.
| Package, in build order | Runs that started it | Passed | Turns used (median) | How it ended |
|---|---|---|---|---|
| Verify | 24 of 24 | 24 | 62.5 | Clean in all 24 |
| Persist | 24 of 24 | 23 | 18.5 | Clean in 23, skipped in 1 |
| Mailbox poll | 23 of 24 | 6 | 28 | Clean in 6, skipped in 15, out of turns in 2, not started in 1 |
| Airtable push | 2 of 24 | 0 | 7 | Not started in 22, skipped in 2 |
Verify alone took more than half the budget, and the first three packages took all of it. Under the loop the turns were spread over all four, and Airtable push passed in 16 of 24 runs. Per passing package the scripted graph took 50.6 turns and the loop 40.5.
Skipping also cost the scripted graph on this group. Of the 15 Mailbox poll builds that were skipped, 9 already passed every hidden test and failed only the linter or the formatter. The loop had the same problem in another form: 11 of its delivery packages passed every hidden test and failed on lint or format. On hidden tests alone the loop’s score is 0.792 and the scripted graph’s 0.646, so the gap is about the same size either way.
In dollars per passing package the two arms stand in the opposite order to their order in turns: $0.049 for the scripted graph and $0.054 for the loop, because each graph step starts a fresh session with less to re-read.
I report the scripted graph’s result on the delivery group as a cost in turns, and I draw nothing from it about which design builds more. With turns as the limit and nothing in the graph to ration them, the budget is gone before the last package. I predicted this result in the pre-registration and called it a rationing effect there.
What the planner-written graph arm did
This part is exploratory. I computed it after the results were read, from the event logs of the 56 planner-written-graph runs and the 56 loop runs. Calls are sorted into reading, writing and checking by matching patterns in their text, so the splits are approximate.
The graphs the planner wrote were valid, and most of them were a single node.
| What the planner submitted | Count |
|---|---|
| Graphs submitted | 9,738 |
| Rejected as malformed | 9 |
| One node only | 6,941 (71%) |
| More than one node | 2,797 |
| A node set to run after another | 18 |
| A node reading another node’s output | 40 |
A node is one step in a submitted graph, and nearly all were shell scripts. The planner did combine writing and checking: of its 1,535 submissions that wrote a file, 1,102 (72%) also ran a check. But that happened inside one shell script, and only 53 of those 1,102 submissions had more than one node. So the work was batched the way a shell user would batch it, and the graph’s own structure, steps that wait for other steps or read their output, went almost unused.
The arm also worked with different tools from the loop’s. The loop’s read, edit, write and search tools were switched off in this arm, and all file work went through shell scripts. Less of each result came back as well, because the graph tool returns only the first 600 and last 600 characters of each node’s output. The graph tool returned one result for each of the 9,738 graphs submitted. 6,806 of those results were cut that way (70%), and in the cut results 68% of the characters were withheld. None of the loop’s 13,015 results were cut.
The arm’s turns went to reading. On the intake group it made more calls that read or looked than the loop did, and far fewer that wrote or edited a file.
| Intake group, per run | Loop | Planner-written graph |
|---|---|---|
| Calls that read or looked | 114 | 172 |
| Calls that wrote or edited a file | 131 | 35 |
| Calls that touched a specification (median) | 19.5 | 64 |
| Calls that ran a check (median) | 44 | 43 |
The write counts are not like for like: the loop makes small edits, and this arm rewrote whole files. Its builds were complete but failed more hidden tests. Attachments passed in 7 of its 32 runs and failed by one or two tests in 19 more.
That the cut results caused the extra reading is my inference from the pattern. The graph tool was never run with more of each result returned or with the file tools left on. Three things differed at once in the comparison with the loop: the graph written by the planner, the file tools switched off and the cut results. So the 0.26 by which this arm trailed the loop can’t be put down to any one of them. The follow-up in chapter 3 takes that confound out.
The deciders inside the scripted graph
These comparisons are on the intake group only.
| Comparison | Difference in share passing | 95% interval | Verdict |
|---|---|---|---|
| Decision model minus planner | 0.000 | -0.083 to +0.094 | Level |
| Decision model minus rule | +0.104 | 0.010 to 0.198 | Unsettled. The interval is clear of zero, but the p-value corrected for the number of comparisons (0.114) is not significant |
| Planner minus random (skipping allowed) | +0.250 | 0.167 to 0.333 | Planner better by at least 0.15 |
| Random (skipping excluded) minus planner | +0.010 | -0.073 to +0.104 | Random is not worse. No claim of “level”, because the interval reaches past 0.10 |
| Duplicate planner arm minus planner arm | +0.021 | -0.073 to +0.115 | Two identical arms differ by 0.02 |
With skipping among its options, a random decider cost a quarter of the packages. With skipping left out, a random decider cost nothing. So the one choice that mattered here was whether a package was skipped. Of the 65 packages skipped in the random arm with skipping allowed, 17 already passed every hidden test at the point they were skipped.
Counted by decider, the choices at the two decision points vary a good deal, except in the decision model’s row, which holds a single option in each column.
| Decider | After a failed check | After clean checks |
|---|---|---|
| Planner | repair 207, rewrite 88 | stop 46, review 41 |
| Planner (duplicate arm) | repair 211, rewrite 110 | stop 55, review 30 |
| Decision model | repair 263 | stop 85 |
| Rule | repair 233, rewrite 29, skip 28 | review 72 |
| Random, skipping excluded | repair 163, rewrite 138 | review 49, stop 40 |
| Random, skipping allowed | repair 70, skip 65, rewrite 52 | stop 20, review 11 |
The decision model’s output never varied. It was “repair” 263 times of 263 and “stop” 85 times of 85, with no failed call. The pilots had shown the same on a smaller count. So the decision model’s arm is a test of the fixed policy “repair, then stop”, and that policy did as well as the planner. The arm got there on fewer turns and less money: 161 turns and $0.155 a run, where the planner’s arm took 217 and $0.206. Skipping the review saves the turns.
Rewriting and reviewing bought nothing measurable. In the planner’s arm a rewrite was chosen at 88 of 295 repair decisions and a review at 41 of 87 review decisions, and in the random arm with skipping excluded both were chosen more often still. The decision model’s arm, which had no rewrites and no reviews, the planner’s arm and that random arm ended within 0.02 of each other.
The rule’s lower score fits the same reading. Apart from the random arm with skipping allowed, the rule’s arm is the only one in which packages were skipped (28 skips), and it scored 0.344.
The other two decision points ran in every scripted-graph arm, and neither changes the reading that skipping was the one choice that mattered.
One is the choice of documents. Before the write step at most five of 19 standards and example files are picked for the package. Under the decision model none at all were picked for 68 of its 96 packages, an average of 0.3 a package. The planner’s two arms averaged 2.8 and 1.5, the rule 4 and the random arms 5. The decision-model arm still tied the planner’s. So on this work the documents made no visible difference to the score. In the wiring check in Appendix E the decision model’s picks came to about two documents a package, so that check didn’t predict what happened in real runs.
The other is the filtering of review findings. Two planted false findings are mixed into every review in a scripted-graph run, alongside the problems the planner lists in the review step, so that there are known wrong answers for the decider to drop. Under the planner 71 of 82 planted findings were dropped (50 of 60 in the duplicate arm). Under the rule 103 of 144 were dropped and 41 kept. In 30 of the rule’s 72 reviews the review step listed no problem of its own, and in 19 of those 30 a planted finding was kept and a clean build was sent to be repaired because of that finding. So an arm with more reviews is exposed to more planted findings, and the review step as run is not a clean test of reviewing. Under the rule a review ran every time, which may be part of its lower score. Under the decision model no review ran, so its arm was never exposed.
Three departures from the registration
The first two departures were written into the analysis notes before any outcome was read. The third was found afterwards by a check those notes had planned.
I took the batch from 12 runs at once to 24, then 20, and runs got slower afterwards. On the 219 runs before the change every comparison has the same direction and every prediction that held still holds, with wider intervals.
The batch also stopped once, when the VM ran out of memory while grading. No run was restarted. Swap space was added and the batch resumed four minutes later.
The third departure is two package grades that had an incomplete test session, both for Extract. Graded again with the same command, both still fail.
A rerun and a separate count give the same figures
The archive I checked is the one named in the results, and its checksum matches. The registered analysis reruns to the same output, character for character.
With my own reader I recounted the runs, passes by package, arm means, the eight differences, the decider choices and the total cost from the run records. All match: 328 runs, 1,056 package grades, 2,278 repair and review decisions, $61.66.
My own reader did not recompute the intervals and p-values, which are taken from the experiment’s registered output, and I did not rerun the experiment’s secondary models. The secondary models are a mixed-effects model and a Bayesian model on the same runs, and their results agree with the registered analysis on every comparison.
In a few places my recount differs from the figures in the experiment’s notes. None of the differences changes a verdict.
The 328 runs cost $61.66
Model spend for the 328 runs was $61.66. The decision model cost $0.44 of that.
3. A follow-up on tight budgets
Two things were still open after the main experiment. Fewer packages passed under the planner-written graph than under the loop, but that graph also ran with different tools. And on the delivery group the scripted graph built its packages in order, and the turns ran out before the last one. The follow-up (E19 in the data files) was designed from those two results: 384 runs, of which the registered analysis uses the 360 that belong to complete blocks of runs, as set out below.
The follow-up ran with a different planner (claude-haiku-5-5) and a different harness from
the main experiment, at budgets of about five to ten turns a package.
Three changes from the main experiment
| Result in the main experiment | Change in the follow-up |
|---|---|
| The graph the planner writes for itself is much worse than the loop | The planner’s plan is validated before it runs, and data is passed between steps |
| The scripted graph ran out of turns before its last package | Each step gets its own share of the turns, and independent steps run side by side |
| The planner-written graph had different tools and a smaller window on results | Every arm uses one runner, the same four tools and the same limit of 8,000 characters on a result |
The harness under test is a DAG harness. Its input is a plan written as a graph of steps with dependencies and no cycles. The plan is validated, and each build step is then run by a worker: one short tool loop that builds or repairs one package. Each worker starts with an empty conversation and its own share of the run’s turns.
After the public checks a run either ends or goes back for a new plan or a repair round, which can happen at most twice.
%%{init: {'theme': 'base', 'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'themeVariables': {
'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'fontSize': '15px',
'primaryColor': '#F4F6F8', 'primaryTextColor': '#0A2540', 'primaryBorderColor': '#0A2540',
'secondaryColor': '#FFFFFF', 'tertiaryColor': '#FFFFFF', 'lineColor': '#5B6B7F',
'textColor': '#0A2540', 'clusterBkg': '#FFFFFF', 'clusterBorder': '#C9D3DE',
'edgeLabelBackground': '#FFFFFF'
}, 'flowchart': {'wrappingWidth': 300, 'rankSpacing': 42}}}%%
flowchart TB
PL["<b>Plan</b><br/>a graph of steps with dependencies,<br/>written by the planner or scripted"]
V["<b>Harness checks the plan</b><br/>valid, and no cycles"]
WK["<b>Build workers, at most four at once</b><br/>each starts with an empty conversation<br/>and its own share of the turns"]
CK["<b>Public checks</b>"]
RP["New plan or repair round,<br/>at most twice"]
E["Run ends and is graded"]
PL --> V --> WK --> CK
CK -->|"a check fails"| RP
RP -->|"goes back to"| V
CK -->|"clean, or no turns left"| E
One arm of the follow-up runs a plan I scripted, which builds every package side by side on three-quarters of the run’s turns, split evenly. In the first plan logged for one such run on the delivery group, the run’s twenty turns become three whole turns for each of the four packages.
{
"nodes": [
{"id": "r1-wp4-verify", "tool": "build_package",
"args": {"package": "wp4-verify", "turns": 3, "notes": ""}, "deps": []},
{"id": "r1-wp5-persist", "tool": "build_package",
"args": {"package": "wp5-persist", "turns": 3, "notes": ""}, "deps": []},
{"id": "r1-wp6-mailbox", "tool": "build_package",
"args": {"package": "wp6-mailbox", "turns": 3, "notes": ""}, "deps": []},
{"id": "r1-wp7-airtable", "tool": "build_package",
"args": {"package": "wp7-airtable", "turns": 3, "notes": ""}, "deps": []},
{"id": "r1-report", "tool": "report",
"deps": ["r1-wp4-verify", "r1-wp5-persist", "r1-wp6-mailbox", "r1-wp7-airtable"],
"args": {"results": [{"$ref": "r1-wp4-verify"}, {"$ref": "r1-wp5-persist"},
{"$ref": "r1-wp6-mailbox"}, {"$ref": "r1-wp7-airtable"}]}}
],
"output": "r1-report"
}
The rest of the turns were kept for repair rounds on the packages whose checks failed. In the repair rounds that followed this plan, each failing package got one turn.
Four arms on three tasks
| Arm | What runs |
|---|---|
| Loop | One worker over the whole task |
| DAG, planner’s plan | The model writes a plan. The harness validates it, runs the build steps with at most four workers at once and runs the public checks. On failure a new plan is requested, at most twice |
| DAG, scripted plan | The same harness with a plan I wrote: every package side by side on three-quarters of the budget split evenly, then up to two repair rounds on the packages whose checks fail |
| DAG, no re-plan | As “DAG, planner’s plan”, with no new plan after the first |
| Task | Packages | Turn budget |
|---|---|---|
| Intake group | 3 | 30 |
| Delivery group | 4 | 20 |
| All seven | 7 | 50 |
The packages, hidden tests and grader are the main experiment’s, unchanged. A turn here is one model reply, which may hold several tool calls.
The registered analysis uses 30 complete blocks
384 runs started and ended. Three of the runs each stopped on a single error from the model’s API and were not rerun. The runs were listed in 32 blocks, each holding one run of every arm on every task, which is 12 runs a block. The three stopped runs left two blocks incomplete. The registered analysis uses complete blocks only: 30 of 32, which is 360 runs, 30 for each arm and task. A second table over all 381 usable runs agrees in sign and size on every comparison.
More packages passed under the loop on every task
Each cell is the share of packages that passed, over 30 runs. The loop’s share is the highest in every column.
| Arm | Intake (30 turns) | Delivery (20 turns) | All seven (50 turns) |
|---|---|---|---|
| Loop | 0.467 | 0.500 | 0.495 |
| DAG, planner’s plan | 0.333 | 0.192 | 0.348 |
| DAG, scripted plan | 0.356 | 0.108 | 0.290 |
| DAG, no re-plan | 0.333 | 0.175 | 0.305 |
Four comparisons were fixed in advance. Each weighs the three tasks the same.
| Comparison | Difference in share passing | 95% interval | Verdict |
|---|---|---|---|
| DAG with planner’s plan, minus loop | -0.196 | -0.237 to -0.156 | Loop better by at least 0.15 |
| DAG with scripted plan, minus loop | -0.236 | -0.278 to -0.194 | Loop better by at least 0.15 |
| DAG with planner’s plan, minus DAG with no re-plan | +0.020 | -0.008 to +0.049 | Level |
| Whether the gap to the loop shrinks on the seven-package task | +0.073 | -0.005 to +0.151 | Direction as predicted, but the interval includes zero |
More packages passed under the loop than under any form of the DAG harness, by 0.20 to 0.24 of a task’s packages at equal turn budgets.
A plan I wrote did no better than the planner’s. The scripted plan did slightly worse: the planner’s plan minus the scripted plan is +0.039 (0.009 to 0.070), a difference in the planner’s favour.
Re-planning made no measurable difference to the score, but it barely ran. No run had turns left for a second new plan. The one repair round that did run went mostly on lint fixes, which the count of hidden tests alone brings out further down.
Extract passed in no run of any arm, and Attachments passed almost always in every arm, so neither carries information here. The differences come from the other five packages. On the intake group that leaves Sanitize alone, since Attachments and Extract are that group’s other two packages.
Why fewer packages passed under the DAG harness
This part is exploratory. The counts in this section are measured from the run logs. That the counts explain the gap is my reading, because no arm varied how many turns a worker gets or what a worker starts with.
No DAG run ended clean. The registered analysis has 270 DAG runs, 90 for each of the three DAG arms, and 90 loop runs. The 180 runs with a scripted plan or with no re-plan ended with public checks still failing. The 90 runs with the planner’s plan ended after a failed check with no turns left to plan again. In 83 of the 90 loop runs the run was ended by the model itself.
A worker’s share of the turns was too small.
| Turns given to one build worker (median) | Intake | Delivery | All seven |
|---|---|---|---|
| First round, planner’s plan | 9 | 4 | 6 |
| First round, scripted plan | 7 | 3 | 5 |
| Later rounds, either plan | 2 | 1 | 1 |
Each worker starts with an empty conversation, and its first turns go on reading the specification and the shared types. A repair worker with one turn can do one of the two, read or write.
Verify is the clearest case. On the delivery group Verify passed in 27 of 30 loop runs. It passed in none of the 90 DAG runs on that group, 30 for each DAG arm, and in 70 of those 90 at least one of the two files Verify must create was missing at the end. In the scripted plan Verify had 3 turns, then 1, then 1.
In the loop the shared material is read once. The loop used 19 of its 20 turns on the delivery group, and Verify and Persist still passed in most runs.
Planning itself was cheap. The planner’s plan cost about 2 of a run’s turns, and 7 of the planner’s plans in 90 runs were invalid.
Tests alone, without the linter
This part is also exploratory, and I didn’t report it in my notes on the experiment. A package passes only when the hidden tests pass and the linter and formatter are both clean (Appendix D). Counting the hidden tests alone changes the size of the gap and leaves its direction as it was.
| Arm | Share passing, as registered | Share passing every hidden test | Packages that failed on the linter or formatter alone |
|---|---|---|---|
| Loop | 0.487 | 0.493 | 2 of 420 |
| DAG, planner’s plan | 0.291 | 0.353 | 29 of 420 |
| DAG, scripted plan | 0.251 | 0.292 | 22 of 420 |
| DAG, no re-plan | 0.271 | 0.401 | 59 of 420 |
Shares are means over the three tasks, 30 runs each.
110 DAG packages passed every hidden test and still failed. The loop had 2. On the delivery group the no-re-plan arm goes from 0.175 to 0.417 on tests alone, and the loop from 0.500 to 0.517.
What failed those 110 packages is the linter, mostly on one package. In 102 of the 110 the linter failed, and in 8 only the formatter did. 56 of the 110 are Mailbox poll.
More packages still pass every hidden test under the loop, by 0.09 over the best DAG arm on this count, which is the one with no re-plan, and 0.20 over the scripted plan. So my reading that a worker’s share of the turns was too small stands, and that shortage accounts for less of the gap than the registered scores suggest.
Re-planning mostly bought lint fixes. More packages that pass every hidden test were built without re-planning than with it (0.401 to 0.353), and twice as many of them were then lost to the linter (59 to 29). The two arms’ registered scores are level, and this is what the level result is made of: in one arm every turn went on the first round, and in the other some were kept back for a repair round that cleared lint.
The DAG harness runs the linter and the formatter as checks. It never runs the automatic fixers, so a worker has to spend part of a turn calling them. The main experiment’s scripted graph runs both fixers in code before every check, and on the intake group no package was lost this way in its planner and decision-model arms.
I can’t say how many of the 110 a fixer in the harness would have saved. A formatter clears every formatting failure, but the automatic lint fixer clears only some lint rules, and no run tested a fixer in the DAG harness. The main experiment is a caution here. Its scripted graph ran the fixers, and 9 Mailbox poll builds still passed every hidden test and failed the linter or the formatter.
An explanation in my notes that the logs don’t support
One part of my own account doesn’t hold in the logs. In my notes I wrote that the loop wins partly because the loop “packs many tool calls into each turn”. Over the registered runs, the loop made 1.3 to 1.7 tool calls a turn and the DAG arms 1.1 to 2.0. The ranges overlap, so tool calls per turn can’t be what separates the loop from the DAG arms. My reading is that the loop’s edge is one conversation keeping what it has read.
The DAG arms finished sooner and mostly cost more
Each cell is the mean cost and the mean time of one run.
| Arm | Intake | Delivery | All seven |
|---|---|---|---|
| Loop | $0.09, 648 s | $0.07, 463 s | $0.13, 791 s |
| DAG, planner’s plan | $0.11, 460 s | $0.10, 289 s | $0.22, 538 s |
| DAG, scripted plan | $0.11, 487 s | $0.05, 205 s | $0.18, 502 s |
| DAG, no re-plan | $0.11, 431 s | $0.10, 268 s | $0.22, 502 s |
The DAG arms finished in about two-thirds of the loop’s time, because their workers run side by side. They cost more per run in every cell but one. So a budget in seconds would have favoured them, and a budget in dollars would not. The counted batch cost $47.76.
A small budget split among workers that each start with an empty conversation
This is a result about splitting a small turn budget among workers that each start from nothing. That is the DAG harness at its weakest, and budgets where turns are plentiful were not tested. Four other things were not tried: a plan that gives fewer packages more turns each, a shared reading pass handed to every worker, lint and format fixers run by the harness after each worker, and a budget in tokens or seconds. Repeating the experiment at the same budgets would return the same answer.
What I recounted, and one unstable test
The archive’s checksum matches the one recorded for the experiment. Rerun, the registered analysis reproduces the saved output. With a reader of my own I recounted which runs count, every arm mean, the differences, the pass rate by package, end states, turns, seconds and cost, and all match. I also recounted the worker-turn and Verify figures above, and counted the tests-alone figures from the same grade files. The intervals were not rerun.
One hidden test for Sanitize turned out to be unstable. 36 runs were regraded in a second isolated copy of the grader, and 166 of 168 package grades were reproduced. Both of the grades that differed come from one Sanitize test whose outcome varies from one process to the next on some builds. That test alone separated 5 of this experiment’s 256 graded Sanitize packages from a pass, counted over all 384 runs (32 blocks, four arms and the two tasks that include Sanitize), and 2 of 256 in the main experiment (eight arms of 32 runs on the intake group). Those counts are too few to change any verdict.
4. What it adds up to
Where turns ran short, fewer packages passed under a graph
The two experiments used different planners, harnesses and budgets, so I compared them side by side and did not pool their results. Ordered by how many turns a package had, the three comparisons of a graph or DAG harness with the loop line up. A turn is one model call in the main experiment and one model reply, which may hold several tool calls, in the follow-up. Green marks a graph ahead of the loop and red a graph behind it.
%%{init: {'theme': 'base', 'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'themeVariables': {
'fontFamily': 'Inter, Helvetica Neue, Arial, sans-serif', 'fontSize': '15px',
'primaryColor': '#F4F6F8', 'primaryTextColor': '#0A2540', 'primaryBorderColor': '#0A2540',
'secondaryColor': '#FFFFFF', 'tertiaryColor': '#FFFFFF', 'lineColor': '#5B6B7F',
'textColor': '#0A2540', 'clusterBkg': '#FFFFFF', 'clusterBorder': '#C9D3DE',
'edgeLabelBackground': '#FFFFFF'
}, 'flowchart': {'wrappingWidth': 300, 'rankSpacing': 45}}}%%
flowchart TB
Q["How many turns does<br/>each package get?"]
A["<b>About 110</b><br/>Main experiment, intake group"]
B["<b>About 28</b><br/>Main experiment, delivery group"]
C["<b>5 to 10</b><br/>Follow-up, all three tasks"]
RA["<b>Scripted graph ahead of the loop</b><br/>by 0.146 of the packages,<br/>at a third less cost per run"]:::good
RB["<b>Scripted graph behind the loop</b><br/>by 0.125. Its last package<br/>passed in 0 of 24 runs"]:::problem
RC["<b>DAG harness behind the loop</b><br/>by 0.20 to 0.24. Every run ended<br/>with checks still failing"]:::problem
Q --> A --> RA
Q --> B --> RB
Q --> C --> RC
classDef problem fill:#FAF0EE,stroke:#BA4A38,stroke-width:2px,color:#0A2540;
classDef good fill:#EAF7EF,stroke:#3BB273,stroke-width:2px,color:#0A2540;
In both experiments fewer packages passed under the graph where the turn budget ran short. What a loop reads once has to be read again in each fresh worker or step. The follow-up’s logs show that directly. In the main experiment the scripted graph took more turns per passing package on the delivery group (50.6 to 40.5), and the reason was not measured.
Running packages side by side didn’t remove the loss on tight budgets. The follow-up’s harness was built to fix the main experiment’s delivery-group result, where packages built in order ran out of turns. With 3 to 9 turns a worker, every package got started and few got finished.
Part of the follow-up’s gap is lint. 110 packages built by the DAG arms passed every hidden test and failed on the linter or the formatter, against 2 for the loop. On hidden tests alone more packages still passed under the loop than under every DAG arm, by 0.09 to 0.20.
The one place a graph was ahead had plenty of turns and a graph tuned over the pilots. Which part of the scripted graph produced that lead was not tested.
Inside the graph the choice of decider made no difference. The scores were the same under the planner, a decision model and a random pick, as long as skipping a package was not an option.
What I would do with this
Check the measuring tools before counting anything. Six faults that would have spoiled a counted experiment were caught in the pilots, and one of those faults, the public tests that couldn’t run, had already lowered the scores of the round before. The 126 pilot runs cost $19.95.
Leave out any option to skip a package. Skipping was the only decision that changed the score. A random pick with no skip option matched the planner, and with a skip option a quarter of the packages were lost.
Try the fixed policy before paying for a decider. “Always repair, and stop when the checks are clean” matched the planner’s own choices with a quarter fewer turns and a quarter less cost. A decider, whether a model or a rule, is worth running only if it scores higher than that policy and a random pick. Here the planner, the decision model and the rule all failed to.
Don’t split a small budget among workers that each start with an empty conversation. A worker needs enough turns to read, write and check. If it can’t have them, give it the shared reading up front or keep the work in one conversation.
Give a fixed sequence a way to ration. In a graph that builds in order on one shared budget, the turns go to the first packages. The scripted graph needed a turn budget for each package and didn’t have one.
Report turns, dollars and seconds separately, because an arm that was ahead on one was behind on another. On the delivery group the scripted graph cost more turns but fewer dollars per passing package. The DAG harness cost more dollars a run in every cell but one and finished in about two-thirds of the loop’s time.
Report tests and lint separately too, and don’t spend model turns on formatting. One pass mark hid 110 packages in the follow-up that passed every hidden test. On the intake group the lint and format fixers were run in code by the scripted graph, and no package was lost this way in its planner and decision-model arms. In the DAG harness the fixers were left to workers with three to nine turns.
Each of these follows from a result above, on this work with these models. None has been tested on other work.
Carried over from the first attempt: fewer calls, not a smaller bill
One result from the first attempt held up under review, and it shaped the redo. Jive made 3.6 times fewer model calls than a plain loop on the same tasks (207 compared with 740 over 43 runs each), and nearly the same number of runs passed (40 and 41). It still cost 1.21 times as much in total (1.24 times at the median run). That gap is within the noise: in the same study an identical setup, run as two separate groups, came out 1.23 times apart. The reason is the prompt cache. A loop only ever adds to the end of its history, so 93% of the loop’s input was billed at the cached price. For Jive the share was 64%. Fewer calls doesn’t mean a smaller bill, which is why turns, dollars and seconds are recorded separately for every run in this study.
The key-finding card from the first attempt. “Every design here” means the designs in that study.
Every limit I know of
This is one family of work: seven packages of one module, written by one author. The decider question rests on the three intake packages, and two of them, Sanitize and Extract, sit near the bottom in every arm. There are two small planners, each used in one experiment, so nothing here says what a larger model does.
The setup was tuned on the same packages the arms are measured on. Budgets, step caps, specification wording and tests were all adjusted over the pilots with one planner. The scripted graph got that tuning and the loop’s prompt didn’t. The follow-up has the opposite weakness: its plans and prompts were written once and not tuned, and its 50-turn budget for the seven-package task was not piloted.
The hidden tests have one author, the same as the specifications, and no check with planted defects exists for these packages. On an earlier round’s builds, the tests failed 86% of builds with a critical finding and 29% of those with only major ones. A pass is a weak certificate of correct code, and Appendix D has the detail.
Two reworded rules are graded by old tests. Three specifications were reworded after the earlier round: Sanitize, Attachments and Airtable push. Sanitize’s tests were changed afterwards. The hidden tests for Attachments and Airtable push were not, and the new Attachments rule has no test.
The six unmet requirements in Appendix E all apply.
“No difference between deciders” holds only at the size of difference the main experiment could detect. The intervals run from about -0.08 to between +0.09 and +0.12. With Extract near the bottom, the chance of detecting a real difference of 0.15 was about 59%.
Three of the comparisons are less clean than their names suggest. The decision-model arm exercised a fixed policy and never a decider whose choice depends on the state of the build. Planted false findings make the review step an unfair test, because an arm with more reviews is handed more of the planted findings (chapter 2). And the planner-written graph arm differs from the loop in its tools and in how much of each result is shown, as well as in having a graph.
The tests-alone figures are exploratory. They were counted after the results were read, and whether fixers in the DAG harness would have turned the packages that failed on lint or format alone into passes was never tested.
Nothing is independent. The same model family wrote the specifications, the graph, the analysis and the review of the analysis. I reviewed the questions and the rulings, but I did not hand-check a sample of builds.
Where I stopped
It was written into the plan in advance that if random choices do no harm, the experiments on the decider end and that result is the finding. A random pick with no skip option was not worse than the planner, so I ended the decider experiments there. I report the finding as it stands: on this work, at the size the main experiment could detect, the score was the same whichever decider the choice between repair, rewrite and review was left to, and the one choice that mattered was whether a package could be skipped.
Nothing is claimed here about graphs in general. The decision rule for the main experiment, written beforehand, had two branches. One was that the graph is level with the loop overall and within 0.10 of it on the intake group, meaning a graph doesn’t help. The other was that the level result is refuted. The result landed in neither: the graph was level overall and ahead by 0.146 on the intake group. I have not forced that result into either branch.
The planned experiments on graph shape and on new work with another model family have not been run. No further experiment comparing deciders is planned on this work.
Questions these runs leave open
- Which part of the scripted graph produced the higher pass rate on the intake group: the checks run by script after every step, the fresh session for each step, or the limit on documents?
- Would fewer packages still pass under the scripted graph on the delivery group if each package had its own turn cap?
- Would fewer packages still pass under a DAG harness if each worker were handed the shared reading, if the lint and format fixers were run by the harness, or if the budget were counted in tokens or seconds?
- Do any of these results hold on work by another author, graded by tests from a second model family?
Appendix A: The Azure setup and why it is built this way
Every run in this study happened on Microsoft Azure, on a setup I built to do three things. The agents write and run their own commands, so the machine that hosts the agents must not be able to reach the internet, the hidden tests or any key. Every model call is checked against a spending limit before it is sent. And anything charged by the hour is removed when work stops, so that as little as possible is billed between sessions.
I started every Azure command from one machine, the controller workstation (the workstation, below). The run VM is the virtual machine that holds the harness (the program that sends prompts to the model and carries out the model’s tool calls), the tasks and the grader. A second machine, the proxy VM, is the only one with a public address and a path to the internet. Every model call passes through a meter, a small program on the run VM.
The 126 pilot runs, the 328 runs of the main experiment and the 440 runs of the follow-up and its pilots, 384 of them the follow-up itself, all ran on this setup. Both paths out of the run VM carried real work: the private path to Azure’s own models, and the path through the proxy VM, which passes only an allowlist of hostnames, to two outside services.
Nothing reaches the run VM from the internet
I controlled every part of the setup from the workstation, running scripts on the VM through Run Command and moving files through storage.
The run VM reaches storage and the models through private endpoints, and reaches Jev (the decision model) and the Anthropic API through the proxy VM, with each reply coming back the same way.
Nothing reaches the run VM from the internet: it has no public address and no name lookup.
The Azure tools and why each was chosen
| Azure tool | What it does here | Why this one |
|---|---|---|
| Subscription spending limit | The hard stop on Azure spending | It holds even if every other guard fails. |
| Entra ID sign-in | I signed in from the workstation with the az command-line tool |
No account key exists to leak. Key sign-in is switched off on storage and on the models |
| Managed identity | The run VM’s own Azure login. Programs on the VM get a short-lived token from a local address (the instance metadata service) | Nothing secret is stored for storage or the models on a machine that runs model-written code |
| Role assignments (Azure RBAC) | The VM’s identity holds three roles and nothing wider: Storage Blob Data Reader on the upload container, Storage Blob Data Contributor on the results container, and Cognitive Services OpenAI User on the Azure OpenAI account that hosts the models (the model account) | A token taken from the VM could do no more than a run already does |
| Virtual network, three subnets | One subnet each for the run VM, the private endpoints and the proxy, each with its own network security group (NSG). The run VM’s subnet may send only to the endpoints on port 443 and to the proxy on port 3128 | The restriction holds even if a program on the VM is misconfigured |
| Private endpoints | Give the storage account and the model account an address inside the network | Public access can then be switched off on the model account. The storage account refuses every outside address except the workstation’s, which is how code goes up and results come down |
| Azure OpenAI account | Hosts the model deployments: gpt-6-luna (the planner in the pilots and the main experiment) at 2,500,000 tokens a minute and gpt-6.2-sol at 500,000 |
The models sit behind the same private network as the run VM, with no key to manage |
| Run Command | Runs a script on a VM as root through Azure’s management service | No SSH port is open anywhere, so there is no network login to attack |
| Proxy VM running Squid | Passes only the hostnames on a list, here two: the Anthropic API and the TypeSafe API that serves Jev | The run VM calls two outside services and must reach nothing else |
| Storage account, two containers | One for uploads, which the VM may only read, and one for results, which the VM may only write | Run Command can’t carry files, and the split means a run can’t alter what was uploaded |
| Azure Policy on the resource group | Two deny rules. One denies any public address except the proxy VM’s. One limits regions to Canada Central, with Canada East allowed for AI resources | Azure denies a mistaken deployment up front, so it doesn’t have to be caught later |
| Bicep templates with what-if | Storage and the model account are described in template files. Each deployment is previewed, then created with the same arguments | The preview shows what will change before anything is created |
| VM auto-shutdown | Azure deallocates each VM at a set deadline | It works even if the workstation is off |
I checked the quota for every model before choosing one, because the model catalogue lists models the subscription may not deploy.
One session, start to finish
A session is everything between dsh-session up and dsh-session down: eleven steps that
begin with a shutdown deadline and end with the VMs deallocated.
The deadline comes first (step 1). A watchdog sets each VM’s auto-shutdown and starts a timer on the workstation that runs the stop script at the same time. If the watchdog fails to arm, nothing starts.
Then the setup is rebuilt (steps 2 to 5). Both VMs start, the two templates are previewed and
deployed to bring back the private endpoints, which step 11 of the previous session deleted,
and the run VM fetches the uploaded code with a token from its identity. The meters start
next (step 6) under an account named runner, with the spending caps passed as arguments.
The script that starts the meters ends by checking that the account the agent runs as
(agent) can’t read the key file, the file on the run VM that holds the API keys for the two
outside services.
The batch (steps 7 to 9) starts a few runs at a time and grades each under another account,
grader, which owns the hidden tests. Finished runs are archived to the results container
every 12 runs. Run Command allows one command per VM at a time, so the batch is a background
service and its status is polled.
Results come down to the workstation in step 10. They contain files a model wrote, so I treated the results as untrusted data and never executed any of them.
Step 11 stops everything billed by the hour: the VMs are deallocated and the private endpoints deleted, with the endpoints’ names recorded for the next session. The disks and the proxy VM’s public address keep billing between sessions.
API keys for Jev and Anthropic are uploaded once as a blob and fetched by the run VM into the
key file, which only root and runner can read. The blob is deleted straight after.
One model call
Every request the harness sends to an Azure model goes to the meter first. The harness is configured with the meter as its model provider and is given a placeholder in place of a key.
The meter rejects the request if a limit is reached: the session’s spending cap, which defaults to zero, or the run’s budget of model calls. Otherwise the meter gets a token from the VM’s identity service, and reuses that token until five minutes before the token expires.
Pacing comes next. On Azure, cached input counts against a deployment’s tokens-per-minute limit, so the meter holds each request until the last minute’s total fits under 2,000,000 tokens across all runs. If the reply is still “rate limited”, the request is sent again after a wait, up to six times.
The request then goes to the model account’s private endpoint, and the reply is passed back unchanged. Each call is recorded in a ledger: token counts with cached input counted separately, cost, duration, time held back and retries. The cost in the ledger is computed from list prices and isn’t taken from an Azure bill.
The code below is the part of the meter that gets the token and sends the request, taken
from the meter’s source (azure_meter.py). The limit checks, the pacing, the retries and the
ledger lines are left out. No key appears anywhere: the caller’s credential is dropped, and
the token comes from the VM’s identity service.
IMDS = ("http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01"
"&resource=https://cognitiveservices.azure.com")
def imds_token() -> str:
"""Managed-identity token, cached until five minutes before it expires."""
with _lock:
if _token["value"] and time.time() < _token["expires"] - 300:
return _token["value"]
opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))
with opener.open(urllib.request.Request(IMDS, headers={"Metadata": "true"}), timeout=10) as r:
d = json.load(r)
with _lock:
_token.update(value=d["access_token"], expires=float(d.get("expires_on") or time.time() + 3000))
return _token["value"]
def upstream_connection(timeout: float) -> http.client.HTTPSConnection:
return http.client.HTTPSConnection(os.environ["AZURE_OPENAI_HOST"], 443, timeout=timeout)
# Inside the request handler, after the spending cap and the run's budget are checked:
bearer = token()
host = os.environ.get("AZURE_OPENAI_HOST", "")
headers = {k: v for k, v in self.headers.items()
if k.lower() not in HOP_HEADERS | {"x-api-key", "api-key", "authorization"}}
headers.update({"Authorization": f"Bearer {bearer}", "Host": host, "Accept-Encoding": "identity",
"Content-Length": str(len(body))})
conn = connect(timeout)
conn.request(self.command, "/openai/v1" + path, body=body or None, headers=headers)
resp = conn.getresponse()
One outside call, out and back
Two programs on the run VM make outside calls: the Jev broker for decision-model questions and the Anthropic meter for Anthropic models.
Each program checks its caps, adds its own real key, sends the request through the proxy VM,
returns the reply and records the call. The harness never holds the Jev key or the Anthropic
key. The pilots and the main experiment made outside calls through the Jev broker only,
because their planner is an Azure model. The 440 runs of the follow-up and its pilots used
claude-haiku-5-5 through the Anthropic meter and the proxy VM.
What each account can read
The run VM has four accounts, split so that the keys, the hidden tests, the ledgers, the token service and the model endpoint are all out of reach of the account the agent runs under.
| Account | What it runs | What it can read |
|---|---|---|
agent |
The harness and every command the model writes | Its working folder. Access to the keys, the hidden tests, the ledgers, the token service and the model endpoint is blocked |
toolsvc |
The project’s check and lookup tools, when called from the agent account |
The stand-in for the business system and its standards, which the agent account can’t read directly |
runner |
The two meters and the Jev broker | The keys and the run settings |
grader |
The hidden tests, after a run has ended | The hidden tests, which it owns |
File permissions enforce part of this split. The network part is a per-account firewall on
the run VM (nftables, matching on the sending user’s ID): everything the agent account
sends is dropped unless it goes to the proxy VM or stays on the run VM itself, where the
meters listen. That firewall is what keeps model-written
code away from the token service and the model endpoint on a machine where the runner
account can use both.
The proxy VM is on the agent account’s allowed list, so model-written code could send a
request to either of the two outside hostnames without passing a meter. Such a request would
carry no key. Both keys are held by the runner account, and each time the services start a
check confirms that the agent account can’t read them. I did not test what either service
does with a request that has no key. The harness itself doesn’t take that route: its model
calls are addressed to the meters on the run VM.
Constraints, some Azure’s and some mine, and what each changed
| The constraint | What changed |
|---|---|
| I switched off key sign-in and public access on the model account, and its private endpoint is deleted between sessions | No model call is possible outside a session. The meter signs each call with the VM’s identity |
Tool calls failed on the chat-completions endpoint with gpt-6.2-sol, and worked with gpt-6-luna only with reasoning turned off |
The harness is driven through the responses endpoint for both models |
| On Azure, cached input counts against a deployment’s tokens-per-minute limit as well as fresh input. When four runs were started together with no pacing, two aborted on that limit | The meter paces all runs under one limit and retries |
| Run Command returns about 4 KB and runs one command per VM at a time | Long work runs as background services. Anything bigger than a status line travels through storage |
| Name lookups are a way to leak data, so I blocked Azure’s name service on the run VM’s subnet. That also rules out the private DNS zone | The storage and model hostnames are written into the VM’s hosts file with the endpoints’ addresses |
| Private endpoints are billed by the hour and can’t be paused | Endpoints are deleted at the end of each session and redeployed at the start of the next |
What two read-only passes found on Azure
I inspected the setup on Azure itself in two passes of read-only commands, one after the pilots and one while the main experiment was running. Two sessions started between the passes, so the second pass also shows that a session start rebuilds the same setup.
| Point | What the check found |
|---|---|
The agent account’s network reach |
No response from the token service or the model endpoint, in both passes. The runner account got a token |
What the agent account can read |
Access denied to all ten things tried, including the key file, the hidden tests, other runs’ folders and both ledgers |
| The proxy list in force | Two hostnames, accepted from the run VM’s subnet only |
Appendix B: A module built to fit an existing ERP
Every run in this study builds part of one real feature: a module that takes press releases arriving by email and files them in a shared table. It is written for an existing business system, a Python web application built on Flask 3, SQLAlchemy 2 and Celery 5, with PostgreSQL in production. I call that system “the ERP” here and leave it unnamed.
The design problem was to let several hundred model-written builds target the ERP without any build reading or changing it. Three design choices make that possible.
The module is split into seven work packages, one per stage, and each is built alone from its own specification. “Package” below always means one of these.
The packages are held together by contracts. A contract is a written rule that two pieces of code both keep, so that each can be built without reading the other. The module has four kinds.
The code is built against a host kit, a stand-in for the ERP: copies of its coding standards, example files copied unchanged from it, and small substitute modules with the same function signatures as the real ones.
Press releases, from a mailbox to an Airtable table
Staff at the company receive press releases by email and forward the ones worth a look to one intake mailbox. The module reads that mailbox, turns each forwarded email into a set of fields (company, headline, dates, contact and so on), and puts one row per release into an Airtable table, where people decide which releases to pursue.
One email passes through seven stages on its way from the intake mailbox to the Airtable table.
Each box is one work package, labelled with the group it is built in (see What one run is asked to build).
| Package | What it does | The rule that matters most |
|---|---|---|
| Mailbox poll | A job that runs every ten minutes, reads unseen mail, and checks from the From address alone whether the sender is staff | Mail from anyone else is recorded as rejected and moved aside. It is never parsed and never reaches a model |
| Sanitize | Turns one raw email into clean plain text and unwraps the forward to find the original release | Markup, scripts, hidden text and text addressed to an AI reader are removed and recorded |
| Attachments | Reads the text of a PDF or Word attachment | The files come from strangers, so the package must never raise an error and never run or follow anything inside a file |
| Extract | A scripted parser fills 14 fields and ranks every email address in the release as the follow-up contact | No model, no network, no clock. The same input always gives the same output |
| Verify | Sends the parser’s fields to a language model for review, once per release | The parser’s output is the default. The model’s reply can only mark a field as agreed, corrected or uncertain, and what is accepted is set by fixed rules |
| Persist | Stores one row per forwarded message. Duplicates are caught at this stage: a release whose text is already stored gets a row marked duplicate, pointing at the original, and that row goes no further | Processing the same message twice writes one row |
| Airtable push | Sends every stored, non-duplicate release to one Airtable table | A release is never created there twice, and no token or field value reaches a log |
What the agent builds, and what is left to people
The agent builds the 13 files of the seven packages, each named in its package’s specification. Its instructions are to create exactly those files and to change no others.
Some of the module was built afterwards by hand. The module repository calls this assembly:
- The wiring file that calls the stages in order. It also holds six decisions that are in no package specification, such as the retry limit for a message whose handling fails and the rule for telling duplicates apart when a release arrives as an attachment.
- The second scheduled task, which runs the Airtable push.
- A script that assembles the module from chosen builds, an end-to-end test over sample emails, the operator’s how-to and the insertion guide.
Integration is the ERP team’s responsibility. The module is delivered ready to insert and changes nothing in the ERP itself. Fitting it in is the job of the team that owns the ERP, and the insertion guide lists each step as a change request with the exact text to add:
- Every edit to a file the ERP already has.
- Choosing a data class for the two new tables that Persist adds. The ERP lists each table under a data class, and the class governs whether release text may be sent to a model at all.
- Turning on the switch for the ERP’s content schedule, the part of the job schedule that the module’s two scheduled tasks are added to.
The rest is out of scope altogether.
- Creating the intake mailbox and its credentials.
- Creating the Airtable base, the table, its columns and the access token.
- Any page in the ERP for releases or rejections. People work in Airtable.
- Updating a release already in Airtable when a correction arrives.
- A tool for people to remove duplicates by hand. Removing duplicates is automatic and is part of the Persist stage, which marks a release whose text is already stored as a duplicate. The Airtable push never sends a marked row. What is out of scope is cleaning up, by hand, any duplicate that this match on stored text misses, such as the same release reworded.
The experiment adds limits of its own. The ERP is never exposed to the agent, which builds against the host kit, so whether the assembled module works inside the real system has not been tested (see Checked by reading, and left for insertion).
A pass means passing the hidden tests and the style check. On an earlier round’s 281 graded builds, 86% of builds with a critical fault were caught by the hidden tests, and 29% of builds with only major faults. A pass is not proof of a sound build (Appendix D).
The contracts
Four kinds of contract hold the module together and fit it into the ERP.
1. The data contract between stages
One file, app/press_releases/types.py, defines every record that passes from one stage to the
next. It is frozen: editing it is forbidden in every specification, and grading uses its own
copy. Packages may not import each other. They share only this file, which is what lets seven
packages be built separately and still fit.
| Record | Made by | Used by | What it holds |
|---|---|---|---|
Attachment |
Attachments | Sanitize, Extract | File name, type, size, a status (read, unsupported, too large, failed, skipped) and the text, when the file was read |
CleanEmail |
Sanitize | Extract, Verify, Persist | Who forwarded it, the original sender and subject, the release text with nothing else in it, links, attachments, a list of what was removed, and a hash of the text used to spot duplicates |
Extraction |
Extract | Verify | The 14 fields, the snippet of text each came from with a confidence, and the ranked contact candidates |
VerifiedRelease |
Verify | Persist | The final 14 fields, a needs-review flag with reasons, each difference between the parser’s fields and the model’s and how it was settled, and which model was called (none if no model was called) |
VerifiedRelease is the last record in the chain, copied here as it stands in the contract
file. It carries its own audit trail. A reader of one row can tell whether a model was called,
which fields differed from the parser’s output, and how each difference was settled.
@dataclass(frozen=True)
class VerifiedRelease:
"""Final fields after the checker reviewed the scripted extraction.
``checker_model`` is None when no model was consulted (unconfigured, or the
call failed); then ``fields`` are the scripted fields and ``needs_review``
is True with a reason saying so.
"""
fields: ExtractedFields
needs_review: bool
review_reasons: tuple[str, ...]
disagreements: tuple[Disagreement, ...]
checker_model: str | None
confidence: dict[str, float] = field(default_factory=dict)
The 14 fields are company name, company website, headline, summary, release type, product name, event name, event date, event end date, event location, release date, and the contact’s name, email and phone.
2. Each package’s own contract
The files to create, the public functions and classes with their exact signatures, and the imports allowed are all fixed in the package’s specification.
| Package | Files to create | What it must expose | May import, beyond the standard library and the data contract |
|---|---|---|---|
| Sanitize | sanitize.py |
clean_email, find_injection_directives, one error class |
An HTML parser and a date parser the ERP already pins |
| Attachments | attachments.py |
read_attachment, with limits on bytes, pages and characters |
pypdf and python-docx, the module’s only two new dependencies |
| Extract | extract.py |
extract_fields, rank_contacts |
A date parser, optionally |
| Verify | verify.py and one versioned prompt file |
verify_extraction, build_prompt, the schema of the model’s reply |
The ERP’s model interface and its structured-call helper. No provider’s own library |
| Persist | A model file, one database migration, persist.py |
Two table models, store_release, record_rejection, a query for rows waiting to be pushed |
SQLAlchemy, Alembic and the ERP’s database object |
| Mailbox poll | config.py, mailbox.py, one task file |
Settings read from the environment, the sender check, poll_mailbox, the scheduled task and its schedule entry |
Celery, Flask and the ERP’s app and logging modules |
| Airtable push | airtable_config.py, airtable_push.py |
Settings, a write client, the field mapping, push_pending |
requests, a retry library and the ERP’s circuit breaker. No Airtable library and no database model |
The separation goes furthest in the Airtable push package, which imports neither of Persist’s two table models, even though the rows it pushes are the rows Persist stored. Rows reach the package through a small interface and a loader function handed in from outside, so the package can be built and tested with no database at all.
All seven also follow the ERP’s house rules: Python 3.11, full type annotations, a fixed docstring style, the ERP’s linter settings, named error classes with no catch-all error handling, no message content or tokens in logs, and tests that use stand-ins instead of network calls.
3. The contracts with the ERP
The module meets the ERP at its model client, data-class registry, model registry and migration chain, job schedule, circuit breaker and environment file.
| Where it meets the ERP | What the ERP requires | How the module meets it | Who makes the change in the ERP |
|---|---|---|---|
| Calling a language model | Every model call goes through the ERP’s own client interface and its structured-call helper. An ERP contract test checks that no module imports a provider’s library directly | Verify calls the helper once per release, with a fixed reply schema, and never touches a provider library | Nobody. The module only uses what is there |
| Sending data to a model | A table’s text may go to a model only if the table is listed under a data class that allows it. Text from an unlisted table may not be sent | The registry is checked by the pipeline wiring before each model call. If the table isn’t allowed, the release is checked without a model and stored as needing review, with the reason given | The owner adds the two table names under a class of their choosing |
| Database tables | Each new table model is listed in the model registry so the database tools see it | Persist delivers the model file and doesn’t touch the registry | The owner adds one line |
| Database migrations | Migrations form a single chain with one newest entry | Persist delivers one migration that adds two tables and touches no existing table. The migration names as its parent the entry that was newest when the host kit was built | The owner re-points the migration if the chain has moved on. Two lines change |
| Scheduled jobs | A schedule file must belong to one of ten fixed domains, and task names follow one form | Each task file exports its schedule entry as a constant and creates no schedule file | The owner appends two entries to the existing content-domain schedule |
| Calls to outside services | Outside HTTP calls use the ERP’s shared circuit breaker (a guard that stops calling a service that keeps failing) and its client pattern | The Airtable client is written as a sibling of the ERP’s existing read-only Airtable client, with its own breaker name | Nobody |
| Settings and secrets | Settings come from environment variables, read when a task runs and never at import. Secrets are never logged | 14 variables under one prefix, three of them required for the mailbox and three for Airtable. With a required variable unset, the task that needs it reports “skipped” and makes no network call | The owner adds a commented block to the environment example file |
| Dependencies | The production requirements file pins every package to an exact version, once | Two new packages, both for reading attachments | The owner adds two lines and rebuilds the images |
| Pages and navigation | Only packages that serve pages register routes | The module serves no pages, so it registers none | Nobody |
Three of these are design choices that keep the module safe to switch on in steps. The poll does nothing until the mailbox settings exist, and the push does nothing until the Airtable settings do. With no data class chosen the module still runs, with no model, and flags every release for review.
4. The acceptance contract
A package is done when the files named in its specification pass two checks. The first is its hidden tests, 45 to 51 per package, run by a separate grader account on files the agent can no longer change. The second is the ERP’s linter and formatter, with the ERP’s settings.
The agent gets each package’s public tests and sample inputs, and the prompt states that the grading tests are different: “build to the specifications, not only to the public tests”.
What one run is asked to build
The seven packages are divided into two groups, and a run builds one group. In a third of the follow-up’s runs it builds all seven.
| Group | Name in the data | Packages |
|---|---|---|
| Intake | m1-intake |
Sanitize, Attachments, Extract |
| Delivery | m2-delivery |
Verify, Persist, Mailbox poll, Airtable push |
A run starts in a folder with one subfolder per package. Each subfolder holds that package’s specification, its public tests and sample inputs, and the frozen data contract. The instructions in the prompt are to build every package. The prompt also states that each package is graded on its own and that the result is the number of packages that pass, “so a finished package is worth more than several half-built ones”.
The ERP’s standards, the example files, the project’s Python environment and the check tools are not in the folder. The agent reaches them only through a catalog of 31 tools in five groups (standards, examples, checks, fixes, workspace), and the plain Python on the machine has none of the project’s libraries.
The prompt gives the result as a count. A run’s score is the same count as a share: the share of the group’s packages that pass both checks.
Checked by reading, and left for insertion
The module has not been run inside the ERP, and that is by design: untested model-written code stays out of the real system until its owner inserts a chosen build. What I could check without running anything, I checked, by comparing the insertion guide with a copy of the ERP at the commit the host kit was built from.
The stand-ins match the real signatures. I compared seven functions the module calls, argument by argument, between the ERP and the host kit: the model interface’s three methods, the structured-call helper, the data-class check, the circuit-breaker getter and the security log call. All seven are identical.
The module collides with nothing, since no file in the ERP mentions press releases, and neither new dependency is in any requirements file. The migration chain still ends at the entry the delivered migration names, and no other migration names that entry as its parent.
The registries are as the guide describes. The model registry list exists, the schedule allows
ten fixed domains including content, and the example environment file ships the content
schedule’s switch off.
The rest is left for insertion, because it can’t be settled by reading:
- Running the module inside the ERP: its tests, its imports and its migration.
- Installing the two new dependencies beside the ERP’s pinned versions.
- Calling the real model client. The tests cover “no model configured” and a fake client in place of the real one.
- The six decisions made at assembly. They are in no package specification, so no agent run is tested on them. The insertion guide lists them.
Appendix C: The harness and its arms
The agent setups compared in the pilots and the main experiment are set out here, with the scripted graph step by step and the exact input sent to each decider. The follow-up experiment uses a different harness, the DAG harness, which is covered in chapter 3. The loop, the scripted graph and the DAG harness are put side by side at the end of this appendix.
What a run, an arm and a decider are
A run is one attempt by one agent setup to build one group of work packages, graded once at the end. An arm is one agent setup, and runs in the same arm differ only by chance.
The planner is the model that writes the code. In the pilots and the main
experiment it is gpt-6-luna, reached through Azure
(Appendix A). The harness is the program that sends prompts
to the planner and carries out the planner’s tool calls. In the pilots and the main
experiment the harness is DeepSeek Harness, installed and not modified. One request to the
planner and the reply to it is a model call. A model step is one job handed to the
planner inside the scripted graph, such as “write this package”. A model step is a fresh
harness session and may take many model calls.
The scripted graph is a fixed procedure, written ahead of time in code, in which the next step is set by that code. The planner doesn’t write the procedure and can’t change it. A place in the graph where there is a choice is a decision point. There are four, named D1, D3, D4 and D5. The numbers are the programme design’s. Its D2 (which catalog tool meets a need) and D6 (which package to build next) don’t occur in this graph, where the tools at each step and the order of the packages are fixed by the script. The choice at a decision point is made by a decider, which is the planner, the decision model, a scripted rule or a random pick.
The decision model is Jev, from TypeSafe. It doesn’t write text. It takes a question with a fixed answer shape and returns the answer with a probability.
The tool list is the 31 commands available in a run for reading the project’s standards and example files and for running its checks (Appendix B). 19 of them print a document: 9 standards and 10 example files.
The seven arms
Each arm has a name in the run lists and data files, and a plain name used in the chapters.
| Name in the data | Plain name | Order of work is set by | Choices at decision points are made by |
|---|---|---|---|
loop |
Loop | The planner, one call at a time | There are none |
graph_free |
Planner-written graph | The planner, which writes a graph each turn | The planner, inside its own graph |
mod_planner |
Scripted graph, decided by the planner | A pre-scripted procedure, written in code before any run (the scripted graph) | The planner, in a short separate call |
mod_jev |
Scripted graph, decided by the decision model | A pre-scripted procedure, written in code before any run (the scripted graph) | The decision model |
mod_rule |
Scripted graph, decided by a rule | A pre-scripted procedure, written in code before any run (the scripted graph) | A rule written in code |
mod_random |
Scripted graph, random, skipping allowed | A pre-scripted procedure, written in code before any run (the scripted graph) | A random pick |
mod_random_ns |
Scripted graph, random, skipping excluded | A pre-scripted procedure, written in code before any run (the scripted graph) | A random pick, with the skip option removed |
The random arm with skipping excluded was added after the first counted pilot. The main
experiment adds an eighth label, mod_planner_dup, which is the planner-decided arm run a
second time to measure noise.
The plan written before any run also had arms in which a planner-written graph was given the scripted graph’s four decision points, decided by the decision model or by a rule. Those arms were never built.
The planner, budgets and grading are the same in every arm
Every arm has the same planner, the same group of packages, the same starting folder, and the same list of project tools (the checks, the standards and the examples). The limits are the same too:
- A time limit per run of 10,800 seconds for the three-package group and 7,200 for the four-package group.
- A turn budget per run, enforced by the meter: 330 model calls for the three-package group and 112 for the four-package group. How the two budgets were chosen is in Appendix E. A decision call to the planner is a short call of its own and is not counted against this budget, so the arm decided by the planner has the same budget for writing code as the other arms. The turn counts in the report leave decision calls out as well.
- A cap of 32,000 output tokens on any one model call.
Every model call passes through the meter described in Appendix A, where its tokens and cost are recorded, and every run is graded the same way at the end (Appendix D).
The harness’s built-in tools are not the same in every arm. The loop has shell, read, edit, write and search tools. The planner-written graph arm has those five switched off and acts only through the graph tool, which returns 1,200 characters of each step’s output where the loop’s tools return up to 8,192. What the missing tools and the shorter output did to the comparisons with the planner-written graph arm is set out in chapter 2.
The loop arm
The loop arm is one harness session for the whole run. The prompt holds the names of the
packages, the statement that each is graded on its own by hidden tests, and the list of the
31 tools. The planner has a shell and file tools, and runs a listed tool with
toolbox run <name>. The order of the packages and the moment the checks are run are left to
the planner’s own tool calls. The session ends when the planner’s reply reports the work
done or when the time runs out. The harness’s web, to-do, sub-agent and workflow tools are
switched off.
The scripted graph
The five scripted-graph arms run the same procedure, one package at a time in the listed order. Each package meets a decision point before the write (D1), after a failed check (D3), after clean checks (D5) and after a review (D4).
- Scripts gather the inputs: the package’s specification, the shared data contract and the list of files in its folder. No model is involved.
- At D1, at most 5 of the 19 documents are selected by the decider.
- In the write step the planner gets the specification, the data contract, the file list and the selected documents in one prompt, and writes the package’s files. In a model step the planner has file tools only. It has no shell, so it can’t run the tests or the linter itself. The prompt states this, and states that the checks will be run for the planner.
- Scripts run the checks. Two automatic fixers go first (lint fixes and formatting), then four checks that block: the files compile and import, the public tests pass, the linter is clean and the formatter is clean. A fifth, a scan for the project’s style rules, is reported and no longer blocks (it failed on 5 of 13 reference builds, Appendix E).
- If any check fails, the choice between repair, rewrite and skip is made by the decider at D3. Repair and rewrite are model steps with the failing output in their prompt, and the checks then run again. One repair or rewrite followed by the checks is a round, and a package gets at most six rounds.
- If the checks are clean and the package hasn’t been reviewed, the choice between review
and stopping (
donein the data files) is made by the decider at D5. - In the review step the planner reads the files against the specification and writes a list of up to 8 problems. Each problem is listed with the exact sentence of the specification that the planner reports the code as breaking. The review prompt carries an instruction not to change any source file. A package is reviewed at most once.
- At D4 each problem on the list is kept or dropped by the decider, and the problems to keep are those where the specification really requires what the review reports. If any are kept, they go to a repair step and the checks run again. If none are kept, the package is finished.
Each model step has its own cap on model calls: 24 for a write or rewrite, 16 for a repair and 8 for a review. When a step hits its cap the next call is rejected by the meter, the step ends, and the checks run on whatever is on disk.
What each decider is given at the four decision points
A random pick is always uniform and seeded from the run’s name, so a rerun under the same run name produces the same picks.
D1: which documents go into the write prompt?
At most 5 of the 19 standards and example files are selected.
| Decider | What is sent, or how the option is produced |
|---|---|
| Planner | One call holding every document’s name and one-line description and the specification. The prompt opens with a developer about to build the work package, the “they” of the instruction, and building it is the “it”: “Choose which of the project’s documents they should be given: at most 5, only those they need to do it correctly.” The reply is a list of names |
| Decision model | One request holding 19 yes-or-no questions, one per document: “Would a developer building the work package described in the state need to read this document to do it correctly?” followed by that document’s description. The documents are then sorted by the probability of “yes”, those at 0.5 or above are kept, and the top 5 are taken |
| Rule | Always the Python style standard. Then each document whose subject is mentioned in the specification (for example, the database-model standard if tables or constraints are mentioned), most mentions first |
| Random | 5 documents at random |
D3: after a failed check, what next?
One of three is taken: repair (“give the failing check output to the model and have it fix the existing files”), rewrite (“discard the approach and have the model write the files again from the specification, told what went wrong”), or skip (“stop work on this package and move on”).
The situation given to the decider is the package, which checks failed, how many repair rounds there have been, whether the same checks failed last round, how many model calls and packages are left, and the first and last parts of the failing output (1,500 characters).
| Decider | What is sent, or how the option is produced |
|---|---|
| Planner | One call with the question, the three options with their descriptions, and the situation. The reply is one option’s name |
| Decision model | One multiple-choice question over the three options, with the same situation |
| Rule | Repair. Rewrite instead if the same checks failed twice running and this is the third round. Skip after four rounds |
| Random | One of the three at random |
The request to the decision model at D3 carries the question as instructions and the three
options as criteria:
ask_jev(
state, # the situation described above
{"q": {
"type": "choice",
"instructions": "Checks on this work package failed. What should happen next?",
"criteria": {
"repair": "Give the failing check output to the model and have it fix the existing files.",
"rewrite": "Discard the approach and have the model write the files again from the specification, told what went wrong.",
"skip": "Stop work on this package and move on, keeping the turns for other packages.",
},
}},
"D3",
)
The reply holds one option’s name and a probability for each option. The same question,
options and situation are sent to the planner as plain text, and its reply is
{"choice": "<option name>"}.
D5: after clean checks, review or stop?
The two options here are “review” and “stop” in the chapters, and audit and done in the
data files.
One of the two is taken: audit (“spend model turns on a review of the code against the specification, then repair what it finds”) or done (“call this package finished and move on, keeping the turns for other packages”).
The decider is given the package, the rounds so far, and how many model calls and packages are left.
| Decider | What is sent, or how the option is produced |
|---|---|
| Planner | One call, as for D3 |
| Decision model | One multiple-choice question over the two options |
| Rule | Review (audit) if enough model calls are left for this review and the packages not yet started. Otherwise stop (done) |
| Random | One of the two at random |
D4: which review problems are real?
Each problem on the review’s list is kept or dropped.
| Decider | What is sent, or how the option is produced |
|---|---|
| Planner | One call listing every problem with its quoted sentence, and the specification: “decide whether the specification really requires what the reviewer says, so that the problem is a real defect”. The reply is the numbers of the real ones |
| Decision model | One request holding one yes-or-no question per problem: “Does the specification really require what the reviewer says, so that the reported problem would be a real defect?” Problems at 0.5 or above are kept |
| Rule | Keep a problem only if its quoted sentence appears word for word in the specification |
| Random | A coin flip per problem |
Two planted false problems are mixed into every review’s list by the graph, so that every list at D4 holds problems known to be false. What the planted problems did to the arms with a review step is in chapter 2.
At D1 and D4 the decider is given the whole specification. An early version included only the first 12,000 characters, and what the cut did is in Appendix E.
When a decider fails
If the decision model can’t be reached, or a planner’s reply isn’t one of the options, the rule’s answer is used and the fallback is recorded. The rule’s answer is also recorded beside every decision, whichever decider was in use. One of the gates in Appendix E is that the choice really came from the intended decider at 90% or more of the decision points reached.
What is recorded in a graph run
Every decision is logged with its point, its package, the options, the choice, the rule’s answer, whether the fallback was used, the situation given to the decider, and the decision model’s probabilities where there are any. A model step leaves its full prompt in a file of its own, the harness’s event stream, how many model calls the step used, how long the step took and how it ended. For a script the record is shorter: which tool, the tool’s result and how long the script took.
Every model call goes into the meter’s ledger with its fresh input, cached input and output tokens, the thinking tokens, and the cost. The planner’s decision calls are metered and costed like any other call, under their own label, which is how the meter keeps them out of the turn budget.
How each package ended is recorded as well: clean after review, clean with no review, skipped, out of rounds, out of time, or never started.
What differs between arms besides the decider
The five scripted-graph arms differ in the decider and nothing else, with one cost
exception: when the planner is the decider, each decision is an extra call to the planner,
and when the decision model is the decider, each decision is a call to the decision model.
The mod_random_ns arm also has no skip option at D3.
The loop differs from the scripted-graph arms in several things at once, so a difference between the loop and a scripted-graph arm can’t be pinned on one cause.
| Loop | Scripted graph | |
|---|---|---|
| Sessions | One for the whole run, history kept throughout | A fresh one per model step, nothing carried over but the files |
| Tools | Shell and file tools | File tools only |
| Checks are run by | The planner’s tool calls, at no fixed point | Scripts, after every model step |
| Documents | Any of the 19, at any time by tool call | At most 5, selected once per package |
| Order of packages | Left to the planner | The listed order |
The three designs side by side
Three ways of organising the same work were tested in this study: the loop and the scripted graph described above, and the follow-up’s DAG harness.
| Loop | Scripted graph | DAG harness (follow-up) | |
|---|---|---|---|
| Order of work is fixed by | The planner, one call at a time | Code written ahead of time | A plan of steps with dependencies, written by the planner or by me, and checked by the harness before it runs |
| Conversations | One for the whole run | A fresh session for each model step | A fresh conversation for each worker, which builds or repairs one package |
| Packages at a time | Left to the planner | One, in a fixed order | Up to four |
| Turn budget | One for the run | One for the run, with no cap per package | A share for each worker, set in the plan |
| Checks | Run when called by the planner | Run by script after every step | Run by the harness after every round |
| Lint and format fixers | Run when called by the planner | Run by script before every check | Run only if a worker calls them |
| Choices left open | All of them | Four decision points | The plan, and a new plan after a failed round, at most twice |
Appendix D: How a run is graded
A run is one attempt by one agent setup to build one group of work packages (or all seven, in a third of the follow-up’s runs), and it is graded once, at the end. A work package is one stage of the module, built from its own specification (Appendix B). The code one run produces for one package is a build.
Each package has two sets of tests. The public tests ship in the package’s folder, where the agent can read and run them. The hidden tests, 45 to 51 per package, can’t be read by the agent. They are kept by a separate account and run after the run has ended.
Four conditions and no partial credit
A package passes when all of these hold:
- Every hidden test passes.
- The linter is clean on the files the package must produce.
- The formatter is clean on the same files.
- Every file named in the specification is present.
The linter and formatter are both ruff, with the settings of the business system the
module is written for. The linter flags code faults and style breaks, and the formatter checks
layout.
There is no partial credit inside a package. A package with all tests but one passing fails, and so does a package with every test passing and a formatting fault.
A run’s score is the share of its packages that pass: 0, 1/3, 2/3 or 1 for the three-package group, quarters for the four-package group, and sevenths for the follow-up’s task of all seven packages. This is the study’s one measure. Where the hidden tests and the linter or formatter disagree, chapters 2 and 3 also give the hidden-test result on its own (weak point 3 below). Each package’s test counts and the names of the tests that failed are also recorded in the grade file.
The registered meaning of “passing” is wider than this. The pre-registration is the plan written before the runs. Under its Amendment 1, a package passes when its build passes the hidden tests and a second set called the probe suite, which was to be made by turning the checklists of a written quality rubric into tests. Those checklists exist for the seven packages and were never turned into tests. So every score in this study, the main experiment’s included, is on the four conditions above. The missing probe suite is one of the registered requirements recorded as not met in Appendix E.
How one package is graded
The grading starts when the run’s process has exited. The agent’s files can’t change after that, because nothing of the run is still running.
The grader is the script that scores one package, and also the account on the run machine that runs it. The code is tested against the stand-in, a small copy of the business system the module is written for, with the same function signatures.
- The batch script opens the run’s files for reading by the grader account. (The harness’s file tool writes files only their owner can read. Before this step was added the grader couldn’t read them.)
- The grader script runs as the
graderaccount, once per package, on that package’s folder. - A temporary folder is built. The stand-in goes in first, from the kit, the installed copy
of the stand-in that belongs to the tool account (
toolsvcin the table below). The agent can neither read nor change the kit. The agent’s files are then copied over the stand-in. - Every stand-in file is then put back from the kit, and the frozen data contract from the grader’s own copy. So if the agent edited a stand-in or the contract to make its code pass, the edit is thrown away before the tests run.
- The hidden tests are copied in and run. A test with no reported result, because the code failed to import, crashed or ran out of time, counts as failed.
- The linter and the formatter run on the files the package must produce. Database migration files are left out, as they are in the business system itself.
- One result is printed. Grading one package is limited to 300 seconds.
What each account can read
The agent is kept away from the answers by four separate accounts on the run machine.
| Account | What it runs | What it can read |
|---|---|---|
agent |
The harness and everything requested by the planner | The run’s own folder. Not the stand-in, the standards, or the hidden tests |
toolsvc |
The 31 listed tools, for the agent account | The stand-in, the standards and example files, the project’s Python environment |
grader |
The grading script | The hidden tests, which it owns and no other account can read, plus the agent’s files and the stand-in |
runner |
The meters and the decision-model broker | The provider keys and the run settings, neither of which the agent can read |
This separation is checked each time the setup script installs the kit. Reading a standards file and listing the hidden tests are both attempted as the agent account, and the setup stops if either works. The hidden tests are also never in the run’s folder and never named in any prompt. The only mention of them in the prompt is that the work is “graded by acceptance tests you cannot see”.
Where the hidden tests came from
The round before this study, E14, was 288 runs in which each run built one package. Its 281 graded builds are the only earlier evidence on how well the hidden tests work.
The hidden tests for the seven existing packages were written for E14, by the same author and model family that wrote the specifications. That is listed as a fault of E14 in the programme design: “Specifications, tests, catalog, rubric and readers all from one author and one model family”. One of the tests was corrected before the pilots (below). After the first counted pilot two more were changed: Sanitize’s test of 14 kinds of instruction became one case per kind, and one Extract test was given an input that separates two orderings. The rest are as they were in E14.
Tests for new packages are written by a model from a second family, gpt-6.2-sol, through a
script (write_hidden_tests.py). The model is sent the specification, the shared types, the
test helpers and one public test as a style example. It is never sent the reference build or
the package’s rule list, the file of specification rules that each new package was written
with, alongside its planted defects. The specification rule checked by each test has to be
named in the test’s first line, so that a failure can be traced to a rule. Six new packages
had their tests written this way. The six ran in the first counted pilot, proved too easy (17
of their 18 package builds passed under the loop) and were dropped. So no package in use has
tests from a second model family.
What is already known about the tests
Before any pilot run, the existing hidden tests were compared with E14’s 281 builds, each of which already had a grade and a rubric review. In a rubric review a finished build is read against a written rubric by a model and rated critical (a serious defect), major, or sound. Every number in this section comes from those E14 builds and describes the tests, so none of them is a result of the redone study.
One test failed good code. A test for the verify package counted lines in the build’s own prompt wording, which is left open in the specification, and 16 builds rated sound failed that test. The test has since been fixed. Four other sound builds fail a test each, and in every case the build breaks a numbered rule that the review had scored as minor, so those tests stand.
Bad code is caught less reliably, and how reliably depends on the package and on how serious the defect is.
| Package | Builds with a critical finding | Caught by a hidden test | Builds with only major findings | Caught by a hidden test |
|---|---|---|---|---|
| Sanitize | 16 | 16 | 20 | 3 |
| Attachments | 11 | 5 | 12 | 0 |
| Extract | 16 | 16 | 7 | 0 |
| Verify | 15 | 13 | 5 | 1 |
| Persist | 0 | 0 | 0 | 0 |
| Mailbox poll | 4 | 3 | 17 | 8 |
| Airtable push | 4 | 4 | 19 | 11 |
| All | 66 | 57 (86%) | 80 | 23 (29%) |
One gate (a check whose pass mark was written down before the pilots, Appendix E) requires 90% of planted defects to be caught. A substitute for that measure, using defects found by reviewers in place of planted ones, gives 86% for critical findings and 29% for major ones. Attachments is the weakest suite.
Whether every test tests anything is not known. 161 of the 315 hidden tests never failed in any E14 build, including 43 of 45 for Attachments and 41 of 45 for Persist. A test that never fails either checks something that is right in every build or checks nothing. Planted defects are the planned way to separate the two.
Six weak points in the grading
-
A pass doesn’t mean the code is right. By the table above, about one build in seven with a critical finding fails no hidden test, and nor do most builds with only major findings.
-
After E14, three specifications were reworded and their hidden tests were not. At that point the reworded rules (in Sanitize, Attachments and Airtable push) were all graded by tests written for the old wording. Sanitize’s tests have been changed since the rewording. The hidden tests for Attachments and Airtable push were last changed before it, so those two rules are still graded by the old tests. For Attachments the new rule names an error class that appears in no hidden test, so that rule is not tested at all. The two rules still graded by old tests are carried as a limit in chapter 4.
Apart from the rewording, one Sanitize hidden test is unstable. When the follow-up’s runs were regraded in a container, the outcome of one Sanitize test varied from one process to the next on some builds. That test alone separated 2 of 256 Sanitize packages from a pass in the main experiment and 5 of 256 in the follow-up (chapter 3).
-
A package whose tests all pass can still fail on the linter. In one setup run the tests passed in all four packages and the linter failed in each, so the run scored 0 of 4. That is the rule working as written. It means the score mixes “does it work” with “is it tidy”, so the share of packages passing every hidden test is reported beside the score. In the main experiment 45 of 1,056 packages passed every hidden test and still failed, 11 of them the loop’s on the delivery group (chapter 2). In the follow-up 112 of 1,680 packages did the same, of which 110 were built by the DAG arms (chapter 3).
-
The probe suite was never built, as said above, so it isn’t in the score.
-
The reviewers are language models, and a reviewer from another model family is still a model. The human check of 20 builds was registered and not done, and no pilot build was reviewed (Appendix E).
-
Grading means running model-written code. The code runs under the grader account on the run machine, never on the workstation, but the grader account can read the hidden tests, and code under test runs with that account’s rights. The run being graded is over, so nothing can be read back to that run. But a batch runs several runs at once, and the grader account’s group can write to those runs’ folders. No build has been seen to use that write access. The grading step is the one place where the separation between accounts is thinner than it looks in the table.
Appendix E: The pilot runs and the checks on the instruments
Before the main experiment I ran 126 pilot runs and one wiring check with no builds. The pilots exist because less was learned from the round before this study, 288 runs of one package each, than was spent on it. No pilot run is counted with a later experiment, and none is evidence about which harness is better.
The 126 runs fall in four pilots. They are called the counted pilots here because their runs count towards the checks this appendix reports. The setup runs made before them, to get the machinery working, do not.
What went wrong in the round before
For each fault of that round there is a rule for this study. An arm, named in two of the rules, is one agent setup, such as the loop or the scripted graph with one decider.
| Fault in the earlier round | Rule for this study |
|---|---|
| The decision model was almost never called by the planner, and nobody checked until 105 runs were spent | No run is counted as a result before a check that each arm does what it is meant to do |
| One hidden test failed correct code, and the tests passed code with serious defects | Tests are checked against known-good and known-bad code before use |
| Nearly every package passed under two planners and nearly none under a third | Under the loop, some packages must pass and others fail in the pilot |
| The choices returned by the decision model didn’t change the outcome, so no arm could differ | An arm in which options are chosen at random must score measurably worse in the pilot |
Each rule became a gate: a check, written down with its pass mark before the pilots, that has to pass before the main experiment may start.
Faults found in the pilots
Six faults turned up, and they are what made the pilots worth running. I fixed each one before the next pilot after it was found. Some of the counts below run past the seven packages of chapter 1. The first counted pilot also ran six new packages, dropped afterwards (next section), so there were thirteen packages then, each with one reference build.
The public tests couldn’t run for eight packages. The code is tested against the stand-in, a small copy of the business system the module is written for. When a check tool laid a package over the stand-in, one of the package’s starting files replaced the application’s startup code. The same fault was in the earlier round, where the logs show the import error in 34 of 41 Extract runs and 41 of 42 Verify runs.
In the scripted graph a style scan was treated as blocking, and no correct build could clear it. The scan failed 5 of the 13 reference builds. A package gets a limited number of repair rounds, each one a repair or rewrite followed by the checks. Repairs were repeated until those rounds ran out, so the review decision was almost never reached. The scan’s result is now reported without blocking anything.
The grader counted a test with several cases as passed when any one case passed.
Deciders were shown only the first 12,000 characters of a specification. The truncation was caught in the wiring check, where the decision model was sent the same requests the graph sends, on 208 review findings with known answers. A review finding quotes a sentence of the specification, and the decider is asked whether the specification really requires what the finding says. Of the 27 findings that quote a sentence past character 12,000, 13 were answered correctly by the decision model with the truncation and all 27 with the whole text. Six of the seven packages in use have a specification that long, so the truncation was removed.
The agent’s account could list other runs’ folders. Every tool call in the earlier round’s runs and in the setup runs was audited, and none had opened another run’s files. The hidden tests were never readable. The folders were then closed to the agent’s account.
One build used about 6 GB of memory and took a batch down. Runs and grading now have memory caps.
Design changes made after the pilots
The main experiment has two groups of packages, the intake group and the delivery group. Six new packages were written for two more groups, but 17 of the 18 builds of those six packages passed under the loop. Packages that easy can’t separate one arm from another, so I dropped the six and their two groups.
Each group got its own turn budget. A loop-only pilot was run at four budgets to find, for each group, a budget at which at least two packages pass in some runs and fail in others. The budgets found were 330 turns for the intake group and 112 for the delivery group.
In the first counted pilot the random arm’s lower score came mainly from skipped packages: 17 of its 39 packages were skipped and all 17 failed. So I added a second random arm, one in which packages can’t be skipped, to separate the effect of poor choices from the effect of skipping.
Deciders are compared on the intake group only. On the delivery group the turns ran out before the scripted graph’s last package whichever decider was used, so the arms that differ only in their decider couldn’t differ there.
What passed the gates and what didn’t
| Gate | Verdict |
|---|---|
| No hidden test fails correct code for something left open by the specification | Checked in part. One faulty test was found and corrected. There is one reference build per package where five were required |
| At least 90% of planted defects are caught | Could not be checked. The seven packages in use have no planted defects. On the earlier round’s builds, the hidden tests failed 57 of 66 builds with a critical finding (86%) and 23 of 80 with only major ones |
| The score under the loop is between 0.30 and 0.70 | Passed on the number, with the loop’s score inside the range. The gate was then replaced by the per-group budgets above, because packages that always pass were averaged in that score with packages that never do |
| At least 90% of decisions are answered by the named decider, and the step chosen is the step the graph runs | Passed. Every logged decision was answered by the named decider: 412 of 412, 332 of 332 and 280 of 280 in the three counted pilots that had deciders. The fourth ran the loop alone |
| Random choices score at least 0.15 lower than choices decided by the planner | Passed as worded, through skipping only. The random arm with skipping allowed scored 0.22 to 0.33 lower. The one with skipping excluded scored within 0.01 of the planner-decided arm in the last pilot |
| Every pilot build reviewed for defects that trace to the specification | Not run |
| 30 pilot builds reviewed twice by models from different families | Not run |
| Every check treated as blocking in the graph passes on every reference build | Passed after the style-scan fix |
The fifth row, the random-choice gate, was the early warning for the main result. In the pilots, no choice except skipping a package was seen to change the score.
What the registration required and didn’t get
Six things were written into the plan before the runs and not done. None can be met without new runs or new tests, so I decided to state them as limits on the results.
- The hidden tests were to come from a second model family. The tests for the seven packages were written by the same author and model family as their specifications.
- Every package was to have planted defects. None exist for the seven in use.
- The two review gates in the table above were not run.
- A second set of tests was to be made by turning the checklists of a written quality rubric into tests. That set was never built, so every score here rests on the hidden tests, the linter and the formatter.
- Each package was to have five reference builds from two model families. Each has one.
- The main experiment was to have enough runs to detect a difference of 0.10. The experiment was sized for 0.15.
The human spot check of 20 builds was also not done.
What the main experiment’s size rests on
In the simulation used to size the main experiment, a difference of 0.15 was detected 86% of the time between loop and graph and 83% of the time between deciders. Both figures rest on the assumption that the pass rate can move on every package, including Extract, which passed in 0 of 7 pilot runs of the decider arms, the three in which the scripted graph is decided by the planner, the decision model or a rule. If packages stuck at zero stay at zero, the decider figure falls to about 59%. So “no difference found” between deciders means no difference of the size the main experiment could detect, and the intervals are in chapter 2.
The pilots cost $19.95 and every run was graded
The four counted pilots cost $19.95 in model calls, and all 126 of their runs were graded. Every figure in this appendix was recomputed from the run archives by scripts written for this study.