Running an AI-Built Project

Contracts, rulings, planted bugs and gates: notes on knowing that code written by AI agents is right.

Authorapolloh0
PublishedOctober 2026
UpdatedNovember 2026
ProjectNablaframe
Code and recordsapolloh0/nablaframe
Contents

TL;DR: Practices for knowing that code written by AI agents is right, on projects long enough to run in phases and too large for anyone to hold in their head. They come from running Nablaframe through Phases 0 to 7, with AI agents writing almost all of its code, and each example links to its record. The one design idea: no one grades their own work, and every claim traces back to something written down. The practices that paid for themselves: keep the roles apart; ship contracts with failing tests before anyone implements; break a private implementation on purpose to test the tests; and take results only from generated, validated reports on one fixed reference machine. The evidence is one project, with one person deciding, and its first technical report is Nablaframe: Beating the Null Isn’t Enough.

Spec and rulings Delta Parallel threads Draft PRs Review and merge Gates on the Mac Generated reports Findings the governor decidesevery open choice stubs fail exactlythe listed tests named tests pass,with no skips every open readinglisted for review fresh clone, fulllane, real data status must matchthe numbers into the notebookand the next spec a contradiction: stop and report changes asked bars set fromearlier experiments
Figure 1. Code reaches main only through review, and results come only from the Mac. Each box is a hand-off, and the line under each name is its check. Work flows clockwise; review can send a PR back to its thread, an agent who finds a contradiction stops and reports it for a ruling, and findings from the gates feed the next spec.

Introduction #

When AI agents write most of the code, the hard part of the project is no longer writing it. It is knowing that what got written is right, and keeping a long project from drifting while nobody holds all of it in their head.

The practices here are meant for projects of that kind: long enough to run in phases, with enough parts that several agents build at once. The worked example throughout is Nablaframe, a small GPT trained from scratch so that its training and forward pass can be replayed and inspected, with Phases 0 to 7 complete. Almost every line of its code was written by AI implementers, against specs and tests written by an AI spec partner, with me deciding what counts, and the numbers below come from its records. Its first technical report, Nablaframe: Beating the Null Isn’t Enough, shows what the process has produced so far.

The one design idea underneath everything: no one grades their own work, and every claim traces back to something written down. Each mechanism below is a hand-off between roles, and each hand-off has a check that catches one kind of failure.

Back to contents

The cast #

Four roles, kept apart on purpose. The separation matters more than any tool.

RoleOwnsNever doesIn Nablaframe
GovernorRulings, phase sign-off, running the gatesWrites the codeMe
Spec partnerSpecs, contracts, tests, review, mergingWrites the shipped implementationOne long-running Claude session, on Opus 5.5 by the record from Phase 7’s third delta, when it began committing its own deltas and rulings
ImplementersThe code for one package, a PRChanges a contract, a test or a reportClaude Code threads in a Project, one per package, on Opus or Sonnet (see “Which model, and how much effort”)
Reference machineEvery gate resultAnything else: no numbers from elsewhere countMy Mac

The spec partner and the implementers are the same kind of model, but they never share a context. An implementer sees only the repo: the contracts, the spec and the decision log. That is what makes their agreement mean something.

Back to contents

Contracts first: the delta #

The unit of work is a delta: one slice of the spec turned into contracts and failing tests, applied to main before anyone implements it.

A delta ships:

The point is that the implementer’s job is small and checkable. It doesn’t decide what to build; it makes named tests pass without touching the contract.

Back to contents

Testing the tests #

A test suite written by the same model that will be judged by it is easy to fool. So every delta is proven twice before it ships.

The reference has a second use: when an implementer’s PR arrives, both versions run on real trained models, and their outputs have to match value for value.

Back to contents

Rulings #

Every choice that could reasonably go either way becomes a numbered entry in a decision log: its date, the decision, and the evidence it rests on. The project has more than 60. Committing an entry is the ruling, so only the governor does it.

Two rules make the log work:

Most new rulings arrive mid-build, not in planning. One came from a wrong function that could never fail. Another came from tracing what a code change would do to records written a phase earlier. Another came from a gate that couldn’t run as specified (below). Each took the governor a minute to decide, because the options and the evidence arrived written down.

Back to contents

Implementers, PRs and review #

Each implementer is a thread with a fresh context and one package: named files, named tests, and an objective “done when”. Threads that don’t depend on each other run in parallel, each on its own cloud machine; those that do run in waves. A thread opens a draft PR and lists every reading it had to make where the docstring left a choice open.

Review is where the independence pays off. For each PR the spec partner:

  1. Applies the diff to a fresh clone of main, and checks that no docstring, test or out-of-scope file moved.
  2. Runs the thread’s named tests, the full lane, and the whole wave applied together.
  3. Runs the code on real data, where it exists, against the private reference.
  4. Posts the review as a PR comment, verdict first, with a ruling on each listed reading.
  5. Merges only when every condition holds: the reviewed commit, only the allowed files, no decision left open, a passing lane, and the governor hasn’t asked to hold it.

Back to contents

Gates and the machine of record #

Tests say the code does what the contract says. Gates say whether the project’s claims hold. A gate is a script that runs on the reference machine, measures something against a bar set from earlier experiments, and writes one report.

A case study: eight probe pairs #

One Phase 7 gate traces a small modular-addition model on a fixed probe of 8 input pairs. Before tracing, the engine runs an oracle that requires the model’s plain pass and its recording pass to produce bit-identical logits. That policy was ruled long ago and had held on every model since.

While exercising the gate on a cloud machine, the implementer found the two passes 1 float32 rounding step apart on about a third of the logits. The first suspect was the machine: a different CPU, more threads. A second machine with another CPU gave exactly the same counts, so it wasn’t the hardware. Then the Mac failed too.

The cause was size. Each pair is only 3 tokens, so 8 pairs make 24 rows, and at that size the compiler builds the two passes differently. From 48 pairs the passes agree bit for bit; the earlier models’ probes had never been small enough to notice. A 64-pair probe passed the oracle at all 45 trained checkpoints and an 8-pair probe at none. The ruling (D60 in the decision log): trace 64 pairs and keep the oracle strict. From first report to ruling took an afternoon, and no gate result was ever at risk, because the gate would have failed loudly instead of passing quietly.

Back to contents

Which model, and how much effort #

The roles decide who does a job. A second dial decides how much intelligence the job gets: which model tier, and how much reasoning effort. The size of the task is the wrong axis for setting it. What matters is how expensive the output is to check, and what a wrong output costs downstream.

Cheap to checkExpensive to check
Low consequenceCheap model, low effort, let it retry. Repo chores, formatting, renames.Mid model, medium effort, accept imperfection. First drafts, notes, README prose.
High consequenceMid model, high effort, with automated checks. An implementer’s package against its failing tests; data pipelines.Frontier model, high effort, an independent critique, and my own review. Specs and contracts, experiment design, “is this a real finding?”, anything published.

The bottom-right cell is where intelligence pays for itself. A bad experimental design burns weeks before anyone notices, and no test catches it. The top-left cell is where it’s easiest to overspend. When a test or a type checker says at once whether the output is right, a cheaper model in a retry loop does the job. This is where the delta pays twice: its failing tests are what let an implementer’s package sit in the cheap-to-check column.

Six rules sit under the grid:

One consequence runs against intuition: bigger per token can be cheaper per task. On work that stretches a smaller model, the larger one often finishes in fewer tries, and retries, half-done work and my time cleaning up are costs that per-token prices hide.

One phase and one report, as they were routed. Each delta names the model and effort for every implementation thread it starts, so the routing is on record in docs/deltas/, and the first report’s handoff note names the model for each of its steps. Phase 7, crystallize-this with modular addition, shows the implementation side best: by then the routing had settled. Its threads ran on Opus 5.5 and Sonnet 5.5, the current models then; the last delta names them by version. The table takes nine of its twelve threads, in five rows, and the three report steps that needed the most judgement.

TaskModelEffortWhy
Report rules: Phase 7’s, and G7.5’sSonnet 5.5mediumThey follow Phase 6’s rules, and a fixture report checks them at once
Modular addition: the task, its declaration, every run’s functionsSonnet 5.5highFully specified, with known answers to test against
crystallize-this’s payloads and badges for the viewerSonnet 5.5highEvery value is copied from a record, never computed
Gate helpers, gates G7.1 to G7.4, G7.5 and the phase summaryOpus 5.5highA gate’s numbers become the record, and a wrong one can still pass
crystallize-this: replace a component with an explicit function, measure what changesOpus 5.5highThe core algorithm; tests pin examples, not every case
Report: related work, and choosing the headline claimsFable 5.2defaultPure judgement, and a wrong headline costs the whole report; no test can check it
Report: the overclaiming reviewFable 5.2defaultDeciding what the evidence supports; it found controls claimed as new that had prior work
Report: the source pass, reading every cited sourceFable 5.2defaultA different model from the drafter (Opus 5.5), checking each citing sentence against its source

Around the threads, the spec partner, on Opus 5.5, wrote the contracts and failing tests, broke its private reference with 90 planted bugs in one delta, and reviewed every PR. The gates ran on my Mac, and I ruled the phase complete. The report’s other steps ran on Opus 5.5: re-measuring every claim on new seeds, the full draft and its interactive page, and publishing.

In the grid’s terms, Sonnet was the mid tier, Opus the tier above it and Fable the frontier. Sonnet took what a failing test settles, dropping to medium only where a fixture settles it at once. Opus took the work a wrong answer could slip through. Fable took the judgement no test can check, and the check of a draft another model wrote. No implementation thread needed the smallest tier, low effort or xhigh: the spec had already done the hard thinking. Model names and effort scales change every few months, so it’s worth writing the routing down once, per kind of task, and revisiting it after each release, rather than deciding it task by task.

Back to contents

Handing off between sessions #

A long-running session gets expensive. Each turn re-reads the whole conversation, so the cost of a turn grows with the session’s length and a usage quota runs out faster, and a very long conversation eventually gets summarized, which can drop details. So the long-running spec-partner session keeps the decisions and the coordination, and long, self-contained steps go to fresh sessions, one step per session.

What makes that work is a handoff note: one file that every new session reads first, before the repo’s own instructions. It holds:

Every session ends the same way: it updates the note’s status, lists the files it made, and tells me the next step, which model it should run on, which files to attach, and the exact commands to run. That closing reminder is a standing instruction, not something I ask for each time.

Results travel as files, never as conversation. A step writes its numbers to a results file and its verdicts to a short outcome note, and the next session rebuilds its context from those files, the note and the repo, never from an earlier chat. The decision log does the same job across phases. When a step’s output comes back to the main session, it is reviewed like a PR: the re-measuring step, for instance, overturned one of the notebook’s findings, and the correction went into the notebook before anything was written on top of it.

Hand-offs have a cost too. A new session spends its first minutes reading, and some work goes more smoothly in the session that has watched it unfold. In practice I hand off a step when it can be stated in a paragraph with its files listed and its result can be checked from files. Work that needs many small rulings from me, such as rewriting repository history or publishing, stays in the main session. The report went this way over three days and seven steps, each in its own session, with the main session reviewing every result before the next step began.

Back to contents

Where it breaks #

The process has three weak points, and each has shown up in practice.

Back to contents

Comparing notes #

One project is an example, not a rule. What would turn these notes into guidance is the same few numbers from other projects, side by side. These are the ones worth recording, with Nablaframe’s where its records have them:

If you run a project like this, record the same things. A handful of projects side by side would show which of these practices hold in general and which were Nablaframe’s.

Back to contents

Takeaways #

If you run a project of this kind with AI agents doing the building, these are the habits that paid for themselves:

  1. Keep the roles apart: whoever specifies doesn’t implement, whoever implements doesn’t review, and one human decides.
  2. Write contracts where the code lives, and ship them with failing tests before anyone implements.
  3. Prove each contract with a private implementation, then break it on purpose and make sure the tests notice.
  4. Ask of every bar whether it can fail. If it can’t, it isn’t a bar.
  5. Keep a decision log, and make “stop and report” the default answer to a contradiction.
  6. Give implementers small, named jobs and let them list their own readings. Those lists are where the spec’s gaps surface.
  7. Review on real data, not only on tests, and merge only under written conditions.
  8. Pick one machine of record, and let only its generated, validated reports state results.
  9. Make results rebuildable: key everything by its inputs and code, and recompute.
  10. Route model and effort by how hard the output is to check and what a wrong one costs, not by how big the task is.
  11. Hand long, self-contained steps to fresh sessions through one written handoff note, and keep every result in a file, not in a conversation.
  12. Expect the process’s own blind spots. Trace each change’s effect on what already exists before it ships.

Back to contents


Part of Gradprop.

Text and figures: CC BY 4.0. Code: Apache-2.0.