Contract Necromancer
A Kiro task is done only when its frozen contracts pass.
Design by Contract, from Eiffel (1986), raised for coding agents.
Used on a real repository: in judge-protocol the gate refused Kiro's first tick, which had built only half of a criterion, and the finished fix passed all six frozen contracts and was merged (pull request #29). Read the case study.
- Kiro says task 4 is done. The code loses cents.
- The gate refuses the tick. Failing contracts: R2.1, R2.2 and 7 more.
- After the fix, the gate accepts the tick and writes a receipt. necro verify prints CONFIRMED.
npx -y github:vijaygopalbalasa/contract-necromancer demo
On a task that cannot be finished, across two models, Kiro marked it done in 11 of 11 runs without the gate and 0 of 19 with it. Two models, 3 to 5 runs per cell (a cell is one model with one arm). Under a "do whatever it takes" prompt, one gated run of six got past the gate by patching JavaScript built-ins. That hole is closed and the cheat is kept as a test. See the experiment.
Try the gate on this page
Send the gate a false "done" for task 4, watch it refuse, then send the fix and watch it accept.
The change that loses cents, in src/split.js
Removed:const base = Math.floor(cents / n);
Added:const base = Math.round(cents / n);
Removed:const extra = cents % n;
Added:const extra = 0;
The browser runs 7 of the ledger's 18 contracts, and the other 11 need the ledger's command line.
-
Kiro says task 4 is done, with that change in the code.
-
Put the two lines back as they were, then send the tick again.
-
Change one byte of
src/split.jsand check the receipt's pinned files again.
The browser runs the contracts with small stand-ins for node:test and node:assert, while the gate runs them in Node.js.
How it works
- A person freezes the spec's contracts.
- The gate refuses to tick a task until they pass.
- Every passing task leaves a receipt you can re-run.
npx -y github:vijaygopalbalasa/contract-necromancer demo
Needs Node.js 24 and git, and shows the gate refuse a planted bug, accept the fix and re-check the receipt.
The sample receipt, as it reads when scripts are off:
A risen receipt: 81 contracts alive.
- Requirement 1 (3 of 3 pass)
- Requirement 2 (9 of 9 pass)
- Requirement 3 (15 of 15 pass)
- Requirement 4 (20 of 20 pass)
- Requirement 5 (5 of 5 pass)
- Requirement 6 (10 of 10 pass)
- Requirement 7 (1 of 1 pass)
- Requirement 8 (9 of 9 pass)
- Requirement 9 (4 of 4 pass)
- Requirement 10 (5 of 5 pass)
Receipt
- Spec
- Git commit
- Receipt hash
- Created
- Task
Receipt hash check
Re-run it yourself
This command clones the repository at the commit, takes the receipt from the default branch, and runs
necro verify on it. It needs Git and Node.js 24 and no install, and it changes nothing outside the
folder it clones. It assumes the receipt is in the default place, .necro/receipts/.
The verifier comes from vijaygopalbalasa/contract-necromancer at a fixed commit named in the
command, never from the repository being verified, so a project cannot ship a verifier that always says
CONFIRMED. Verifying runs the project's own contracts, which is code from that repository, so run this command
only for a repository you are willing to run.
Check the pinned files
Fetches each pinned file at the receipt's commit from raw.githubusercontent.com and compares its SHA-256. Nothing is fetched until you press the button. A file kept in Git LFS comes back as a pointer file and shows as different.
About this page
A receipt says which frozen contracts passed when a task was marked done. Open one here to read it and check it yourself.
necro verify re-runs JavaScript contracts and runner contracts (for example pytest) alike. The receipt card checks hashes, not test runs, and the play above runs seven of the example's contracts in your browser.
PASS the contract is alive. FAIL it lies under a gravestone.