Building an Agent Graph: How You Know
updated 19 min
Confidence the measurement errors are catalogued and real; the corpus is four pull requests with no oracle, which bounds everything else
“What we observe is not nature itself, but nature exposed to our method of questioning.” — Werner Heisenberg, Physics and Philosophy (1958)
Part three of three, sections 11 to 16. Where to Cut and From Rules to Runs build the thing; this is how you find out whether it works, and how wrong your instruments are.
Bottom line up front
- Plan the evaluation corpus early; you do not have to build it first. Accrete it from real runs and label afterwards — the refuted leads are hard negatives sitting exactly at the boundary you care about.
- Pinning is not a holdout. Pinning protects against the arms not being comparable; a holdout protects against fitting the eval. Know which problem you have solved.
- Determinism is architecture, not a sampler setting. Where a verdict is recomputed in code from conditions the model ticked, the model is box-ticking rather than judging — but check the ticking is happening at all. Measured later: the cheap tier emitted a condition report in 3 of 85 dispatches and confirmed findings anyway in 32, so the procedure was skipped and the verdict shipped looking verified.
- Measure the instrument before you trust the measurement. Every measurement error caught in this build flattered the result — which is a selection effect, not luck, and it is why you go looking instead of waiting to be disappointed.
- Write down what makes two findings the same finding, and make sure no part of that key is something the model chooses freely. One site emitting three labels scored as lost and gained at once.
- A flattering error has no symptom, so it survives until somebody audits on purpose. Assume your numbers are too kind and go looking.
11. Evals, corpus, holdouts
Plan the evaluation corpus early. You do not have to build it first.
Say now what it is going to be — which changes count, what a finding on them would look like, who decides — because that shapes the schemas and the telemetry, and retro-fitting it is the expensive version. But the corpus itself can accrete. Run the graph over real work, keep what it produced, and label it afterwards. That is cheaper than assembling a set up front and it is better material: every lead the system refuted is a hard negative sitting exactly at the boundary you care about, which is the argument in Train on What the Gate Throws Away.
And be honest about the status of this: evals, or failing that a handful of worked examples, are best practice rather than a precondition. Plenty of useful systems ship without them, and if the scope is small, the output is cheap to check by eye, and you are the only user, that can be the right call. What it costs you is this part — every claim in it is unavailable until something exists to measure against, so you are shipping on judgment and should know that is what you are doing.
The one thing not worth deferring is keeping the material. A graph that has run for three months with nothing retained has thrown away the corpus it was generating for free.
The honest frame: evals are flawed and they are the best you have. It’s science. You can’t peek inside, so you measure outputs against a hypothesis and go with what fits. The failure isn’t having a flawed instrument. It’s not knowing which way it’s flawed — see §13.
See Evals Aren’t the Moat and Can’t Self-Measure Recall.
The corpus: say what it is, don’t dress it
Four real pull requests, spanning an order of magnitude in size. 100% mined from real work, 0% planted, 0% synthesised. One of them is unmerged prototype work, which turns out to be useful precisely because prototype code violates conventions freely.
And: n=4, and no oracle. Nobody has enumerated the true defect set for any of those four PRs, so every recall number in this build is recall against findings some arm produced, not against ground truth. That’s a hard ceiling on what the eval can tell you, and it’s why Can’t Self-Measure Recall exists.
Mine your corpus rather than planting it. Planted defects are defects you already knew how to describe, so they test the part of the system that was never in doubt. The cost of that choice is the only cheap recall check there is: with no independently enumerated defect set, a mined corpus can tell you an arm lost something another arm found, and never that both missed the same thing. See The Survivorship-Biased Corpus and Train on the Reject Pile.
Pinning is not a holdout
This is the one I’d most like builders to take away, because the first feels exactly like the second.
Everything here is pinned: the PR, the SHA, the config, the arm order, the batch size, the model per arm. The comparison harness refuses to compare two arms at different revisions rather than footnoting the mismatch.
That is real and valuable, and it protects comparability between arms. It does nothing about fitting the eval, because there is no holdout — the eval directory holds exactly two files, no train/test split on disk, and every lever was tuned against the same four PRs its results are reported on.
A holdout protects against fitting the eval. Pinning protects against the arms not being comparable. Two different problems. Know which one you’ve solved.
The noise floor, and why it eats most of your levers
Two baseline draws of one PR at one SHA came back with six findings and eleven — same everything, a 45.5% gap. That is one observation rather than a measured floor, and I want to be exact about it: it tells you jitter of that order is possible here, not that it is the rate. Repeat it across PRs and you would have a floor.
One observation was enough to change the harness, which now sets MIN_DRAWS = 3 and refuses a comparison below it. That was a minimum sample count rather
than a power calculation, so I went and did the arithmetic.
Resampling the three draws of a separate laptop experiment, 2,000 times at each k: the median pair comes out in the wrong order 24.3% of the time at one draw, 11.8% at two, and 2.9% at three. Three looks fine. Then split it by how close the arms are, and three draws mis-order a pair separated by one fixture about a third of the time — 34.7% and 28.1% for the two closest pairs.
So three draws support a coarse ranking and cannot support a close one, which is the comparison you actually want. Two caveats carry it: bootstrapping three draws cannot show variance three draws did not, so those rates are a floor rather than an estimate; and that is a different instrument from the whole- pipeline one quoted above.
Once you have a number of that size in mind, a lot of proposed experiments stop being worth running. An eval whose noise floor exceeds your effect size is not a weak eval — it’s a random number generator that costs money. We use it anyway, because it’s the only whole-pipeline instrument that exists, and using it with the floor in mind beats not measuring.
Two anti-gaming properties are worth copying:
- Fidelity gates cost. Cost only ranks arms that lost nothing we could see — with no enumerated defect set there is no stronger version available. An arm that’s 40% cheaper and drops one observed finding doesn’t win, it’s disqualified. Otherwise every optimiser converges on the arm that does less.
- Floors on the optimiser, for the same reason the tuner in §10 disqualifies vacuous conditions.
The inverse receipt, and the best one-line lesson here
A scout loop took findings from 12 to 30. That looks like a large win and it was reported as one.
Then someone asked whether the runs agreed. Only 1 of the 4 was unanimous. The +18 was mostly noise sampled four times.
The lesson isn’t “loops don’t work.” It’s that count went up and agreement was never checked, and count is the number that’s easy to produce. Ask about agreement.
For contrast: the public architecture catalogue cited in §11 also ships a leaderboard — 35 architectures against a 17-task suite, scored on a single run, with no repeated draws reported. A cell that passed once and a cell that failed once are not distinguishable at that sample size. That’s the default shape of an agent benchmark, and our own 45.5% is exactly what rules it out. A leaderboard with no repeats is a screenshot of one sample.
The price of determinism, stated plainly
Every deterministic instrument in this build measures a part: one condition’s tick consistency, one snippet’s flip rate, one detector’s fixtures. Those are excellent. Meanwhile the only whole-pipeline instrument has a 45% floor.
The eval got narrower than the thing it evaluates. The parts became measurable and the whole did not. That is the real cost of the approach in this guide, and I don’t have a fix for it. Know that you’re buying it.
One thing we do not have, deliberately: an LLM-as-judge scoring whether a finding is any good. Every verdict is either computed from ticks or compared against a pinned prior run. Models do run inside the tooling — the demo validator and the prompt optimisers make real calls — but nothing asks a model to grade quality.
12. Fidelity and determinism
Determinism is an architectural property, not a sampler setting.
Both knobs were unavailable, and that was a gift
temperature: 0 came back 400 — temperature is deprecated for this model.
Three runs, same result. seed came back 400 — extra inputs are not permitted. Neither knob exists on the hosted gateway this runs through.
That looked like a constraint and turned out to be the reason the system is as stable as it is. Every determinism gain here had to be structural, because the cheap knob wasn’t there. Move the verdict out of the model and compute it from ticks. Give each condition a stable name so the label stops wandering. Put a detector in front so the downstream judgment operates on an anchored citation instead of a vibe.
If you can set temperature: 0, you will, you’ll get partial relief, and you
will stop looking. That’s the trap, and it’s this section’s thesis.
The two-regime model
The most useful measured thing in the whole build:
The same model, on the same rule, is stable on a clear lead and irreducibly wobbly on a borderline one.
Receipts on the stable side: 0% deep-flip across 9 sites on a detector-fed rule; disposition stable across 11 runs and 3 SHAs on another.
The consequence engineers miss: a detector isn’t only a coverage lever, it buys the clear-lead regime. Feeding the deep an anchored citation instead of a diff region changes which regime the model is operating in. That’s a second, larger payoff from mechanisation that doesn’t show up in a coverage metric at all.
And the reframe that follows: the model isn’t flaky. The input was ambiguous, and you misread information about your prompt as information about the sampler. See Confidently Wrong.
Flakiness has at least three independent components
Presence (did the finding appear at all), verdict (was it confirmed), and name (what did it get called). Lumping them together as “the model is flaky” sends you hunting for a sampler knob that would fix none of them.
Separated by a real receipt: one rule’s findings were arriving via scout-emitted labels while its detector fired on zero changed lines. The instability was in noticing, not in judging — and no amount of condition-tightening would have touched it. Tightening conditions is the fix for verdict instability. Applied to a presence problem it costs you recall and returns nothing.
Name wobble, sized and fixed
83 distinct issue codes across 105 findings. About one fresh label per run. One defect observed under four different names.
Binding a stable slug to each condition (§12) collapsed 4–5 random labels to 1 deterministic label on 4 of 5 sites over 12 runs. The fifth wobbled between two meaningful labels and needed a block-level parent slug.
Why this matters more than it looks: see §13, where the naming problem turns out to have been corrupting every before/after measurement in the system.
The counter-lever that went backwards
The deep batches six items per call. Halving that roughly doubles deep cost, and the theory says you’re buying attention per item. Pushed all the way down to one item per call, a sweep on one corpus measured flip rising from 0% to 25% while recovering nothing.
Related: Models Narrow the Overlap, Nobody Broke It.
13. Measure the instrument before you trust the measurement
The sharpest transferable lesson in the build, and the one I’d put first if the build order allowed it.
The severity that was identical by construction
A judge schema defined a shared finding’s severity as “the highest claimed by any arm that found it.” Which makes shared findings identical by definition.
Four arms came back at 47/49/48/48% critical-plus-high. That looks like a finding — a striking stability across very different configurations. It’s a definition, plotted.
It is still open upstream. An objective got re-weighted onto that number (§11), and the instrument still can’t produce it.
The most portable receipt in the whole build
Finding identity was keyed on (path, line, label), where the label was the
model’s own name for the defect.
Combine that with §12’s name wobble and you get this: one site emitting three different labels across runs scored as lost and gained at the same time. The instrument manufactured a regression and an improvement out of a renaming.
Moving identity to site + rule removed it entirely. Cosmetic for the reader. Catastrophic for every before/after comparison that keyed on it — which was all of them.
If you take one action from this guide: write down what makes two findings the same finding, and make sure no part of that key is something the model chooses freely.
And the claim this section exists for
Every measurement error caught in this build made the result look better than it was. Not most of them. All of them, across audits months apart.
The shapes are the useful part, because the shapes are what you can go and look for. The severity artifact. The identity key. A count that only counted true positives. The +18 findings that were noise. A refutation evaluated after its own confirmation, so it could never fire, silently banked as precision. A line-grep that returned zero across a very large codebase because a formatter had split the construct across lines — and zero looked like a clean result. A before-and-after that moved twenty points and was entirely regression to the mean, because the things I repaired had been selected for being broken. A power calculation that set its floor on the plentiful side of a ratio while the answer rested on a handful of events on the other side.
None of them were pessimistic — and none was found by being disappointed. I went looking.
That is the whole argument, and it is a selection effect rather than a tally. An error that costs you something shows up: the number looks wrong, you dig in, you fix it that afternoon and it never reaches a catalogue. An error that flatters you has no symptom. Nothing prompts the investigation, so it survives — which is why the errors still in your instrument when you finally audit it are nearly all the flattering ones, and why all of them is what you should expect rather than a surprise.
So assume your numbers are too kind, and go and check rather than waiting to be disappointed. None of this is evidence that I measure carefully. It is evidence of what one deliberate audit turns up in a build where nothing had gone visibly wrong.
Related: Metered the Wrong Thing.
14. Making it improve
Three levers — swap the model behind the schema, tune the prompt at the node, retrain the node — and one question that decides whether any of them compound: does what gets learned in one place reach everywhere else. Improve on a side track rather than in the request path, and put the promotion gate outside the loop that generated the candidate.
At length, with the prior art and the boundaries of what this build can claim: Learning That Isn’t Shared Is Drift.
15. Stay in the loop, because the mistakes look fine
The agent’s upstream decisions — what to optimise, what a finding is worth, which mechanism to reach for — can be wrong while every output looks correct. And you will stop watching, because complacency rises with reliability. The countermeasures are structural rather than attentional.
The one that is specific to instructing models, rather than to automation generally: do not treat the mechanism named in an instruction as part of the instruction. At length: The Mistakes Look Fine.
16. Keep the notes current, and write down the negatives
A note saved as you go is how a later session — a different model family, or you in three months — resumes without re-deriving. Records rot, reliably, and nothing in the system notices when they do.
The entries that do not rot are the negatives: a record of what did not work cannot be invalidated by the code drifting away from it, because it was never describing the code. Write Down the Negatives.
Closing — budget the reads
The guide ends on the criticism with the widest blast radius, and it isn’t about the graph at all. The graph is fine.
This system is superbly instrumented and badly under-read.
The field that tells you what fraction of findings come from detectors rather than the model is populated on every lead, and has never been aggregated. The invalid-output channel is always surfaced, never silent, and has no counter — so I can’t tell you how often a stage emits garbage. The mechanisation process is documented candidate by candidate and has never been tallied, so there’s no pass rate. A mechanism is on record guaranteeing that a false-positive class killed in a detector still arrives through the rule’s other arm, and no sweep has been run for it; the one instance was found by accident.
Notice that the same sentence keeps appearing in this guide: the instrument exists and the reading doesn’t. That distribution is itself the finding.
This isn’t laziness. Reading an instrument costs a run, and runs cost money, so well-instrumented systems accumulate unread dials the way a house accumulates unopened mail. Adding a field is free at the moment you’re already editing the schema. Reading it means scheduling something, paying for it, and possibly learning you were wrong. So the instrumentation gets built and the readings don’t happen, and you end up exactly where I am — able to describe the architecture in detail and unable to answer basic questions about its behaviour.
So: budget the reads, not the logging. Everyone does the logging; logging feels like progress. Put the looking on a schedule, and treat an unread instrument as unbuilt — because nothing in the system fails when nobody runs the query.
Which points at the one guard that does work, and it’s the pattern to generalise from all sixteen sections. The eval harness refuses to compare two runs at different revisions rather than footnoting the mismatch. It refuses fewer than three draws rather than warning about the variance. Both are known lapses of judgment encoded as hard failures in code, and they’re the only form of discipline I’ve seen survive contact with a deadline.
A warning is a note to a person who is busy. A refusal is a decision that’s already been made.
How sure I am: the measurement errors are real and each is traced to a
specific instrument, and every one of them flattered the result. I have
stopped printing a count — it drifted twice as the catalogue grew, which is
its own small instance of the thing this part is about. The corpus is the binding limit on everything else here: four
pull requests, no oracle, no holdout, and every lever tuned against the same
four PRs its results are reported on. So no recall figure in this part is
recall against ground truth; it is recall against findings some arm produced.
The noise floor is one observation of two draws rather than a measured rate,
and MIN_DRAWS = 3 is a minimum sample count rather than a power
calculation. The selection argument for why errors flatter — a costly error
announces itself and gets fixed, a flattering one has no symptom — is
reasoning, and the catalogue is consistent with it rather than a test of it.
Sources
- Heisenberg, Physics and Philosophy (1958) — what we observe is not nature itself but nature exposed to our method of questioning. The epigraph, and the whole of §13.
- The recall ceiling — You Can’t Grade Your Own Misses, for why a reviewer’s recall cannot be computed from its own output, which bounds every number in this part.
- Survivorship in a mined corpus — Your Merged-PR History Is Survivorship-Biased Training Data.
- The specification ceiling — Evals Aren’t the Moat, and Fidelity Was a Vibe, Cost Was a Number for a local metric beating a stated objective.
- My own build: the catalogued measurement errors, the identity-key failure, the noise-floor observation and the four-PR corpus.
Related: Where to Cut — part one; From Rules to Runs — part two; Learning That Isn’t Shared Is Drift — the improvement loop at length; The Mistakes Look Fine — why you stop noticing the upstream decisions; You Can’t Grade Your Own Misses — the ceiling under all of it.