Three Agents, One Rule

Last week we published the measurement: Turso's newer database kind does not enforce foreign keys, two of our production apps had built real engineering on opposite beliefs about that, and the one-line fix we recommended died the next morning under a rolling engine build. This is the story of what happened next, because the interesting part was never the pragma. It was watching three coding agents on three codebases, plus the bench that referees them, turn one measurement into one shared rule, with every claim, contradiction and correction written down.
The Channel is a Folder of Markdown Files
The agents do not share a context window. Each works in its own repository: Stem Shovel, the music app whose 441 hand-written cascade lines started this; Replicator, the document platform with 171 foreign keys across 81 tables riding on cascades that never fired; a client's customer portal on the same database platform; and the bench, which runs the registered studies and keeps the rule.
Coordination happens through a directory of dated handoff files. A brief goes in; a response comes back; a correction gets its own dated file. More than a dozen documents crossed that folder in five days, and the result, a coordinated response with five amendments, lives as one authority document every repo cites. One agent works on a machine that cannot reach the folder at all, so a verbatim copy is committed into its repository and kept in sync, like any other dependency.
The protocol matters more than the plumbing: claims in writing, with receipts, reviewable by a human at every step. Nothing was decided in a chat that scrolled away.
Correction Ran in Every Direction
What makes this collaboration rather than delegation is who corrected whom. Everyone got something wrong, and everyone's error was caught by somebody else's instrument.
The portal agent killed the bench's headline claim. The study measured, on November 2nd, that flipping enforcement on persisted at the database level. The portal could not reproduce that on November 3rd, and the bench's own fresh-database probe confirmed it: the behavior was gone, most likely because the platform's cloud engine updates continuously under every database. The correction was published the same day, in the report, on the dashboard, and as a dated postscript on the article.
The portal also beat the bench on its own brief. The brief's hand-written list of foreign-key edges was wrong three ways: a file called safe was not safe, a column was missing, and one delete action was misread because the bench's text parser could not see a reference declared through a typed lambda. The portal's scan, derived from the ORM's own metadata, caught all three. That loss, three to nothing, became Amendment 4: edge lists are never written by hand. They are printed from metadata or they are wrong.
Replicator corrected the bench's sizing judgment. Amendment 2 deferred teardown work for parent tables the bench had verified to have no delete path. Replicator pointed out that its organization and user admin pages had live delete buttons, with code comments promising a cascade that does not exist. The bench had verified prose, not behavior. Amendment 3 restated the criterion: defer only on a mechanically derived classification. Check the behavior, not the description.
And Replicator retracted its own October claim in its own changelog, in words worth keeping: "the code documented protection it lacked, so anyone checking found a reassuring sentence." One click on either of those buttons would have stranded rows across 47 related tables for an organization, or 76 for a user. Both buttons now refuse, in plain language, until their teardowns ship. That refusal was the one call a human made in this chapter: presented with the options, Kevin chose refusing the delete over shipping anything partial.
One Rule, Three Implementations
What converged is deliberately boring: on this database kind, treat foreign-key enforcement as unavailable. Every onDelete in the schema is documentation. A delete removes its children through explicit, per-entity, deepest-first handlers. Metadata generates and guards, humans review, explicit code executes.
Stem Shovel's September code turned out to be the pattern. The 441 lines it wrote the hard way, after orphaned rows crashed a song page, were exactly the shape the rule prescribes, so the other repos converged on it rather than inventing variants.
The portal shipped the reference implementation: a foreign-key graph printed from the ORM's metadata, an orphan scan that cross-checks that metadata against the live database's own catalog, and a repair tool that is dry-run by default and refuses to act on any disagreement between the two. Its first full sweep found 28 orphaned authorship rows left behind by old manual purges, and repaired them. Its release pipeline now gates on the scan.
Replicator shipped the guard rail: a CI check that fails the build when the schema gains a foreign key nothing handles, with every parent table classified as handled, never deleted, or refused, and the classification verified against the code rather than declared. A table marked refused must carry the refusal marker in its source; a table marked never-deleted fails the build the day someone adds a delete. Its handlers honor each edge's declared action individually, because one of its own template edges proves why that matters: a document authored from a template must outlive the template with its link cleared, and a handler that uniformly deleted children would have destroyed user documents because a template was removed.
The Night a Clean Database Failed the Check
The rule's sharpest clause fired within a day of being written. Amendment 1 says every check must assert a floor on what it actually examined, because zero findings from zero inspected is a broken instrument, not a pass.
The portal ran a census against a demo database before seeding it for a client demonstration: 58 of 58 checks clean. The run still exited with a failure, because ten edges from a pending migration existed in the schema but not yet in that database, and the census could not examine what was not there. Before the amendment, the same run printed clean. A check that cannot see part of what it guards now says so instead of passing by omission. Nothing was wrong with the data. Something was wrong with the coverage, and that is a finding.
What Watches the Platform
The behavior that started all this was a snapshot of a rolling build, so the rule's last piece is a watcher. The bench now runs a weekly job against a sandbox database: it probes live enforcement behavior, watches the ORM for signs of first-class support for this database kind, watches the client library for major releases, and reads the platform's own documentation sentence about the default. Any signal opens an issue. Each app repo runs the same five-key probe on its own cadence, reporting the same five keys, so the next time the engine's behavior flips, three codebases notice the same morning, on purpose. A follow-up study is queued to re-measure the pragma surface once the rolling build settles.
What This Was, and Was Not
Nobody here demoed anything. The artifacts are the evidence: a drift test that goes red when a schema outruns its handlers, three repos' probes reporting identical keys, orphan scans clean with their floors asserted, two refusal screens where destructive buttons used to be, and a weekly tripwire on the platform. The humans decided the things humans should decide: whether to refuse a delete, what spend a study gets, what ships to production.
Credit where each catch landed. The portal agent's non-reproduction killed a published claim in under a day, and its implementation became the reference. Replicator argued that orphan sweeps must derive from the database rather than the schema, and flagged the testing hazard that a mocked database makes a cascade test prove nothing precisely where proof matters. Stem Shovel's cascade code became the pattern everyone adopted. The bench held the registrations, wrote the rule, and got corrected like everyone else: its prediction scorecard on the original study was one of three.
The coordinated response, its five amendments, the study and the dated corrections live in the barkup-bench repository and on the research dashboard. The analyst model behind the bench is Claude Fable 5; every number above was produced by committed mechanical code, and every rule lives in a dated document a human reviewed.