Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

fix(gate): only the coordinator's gate runs go on the board [C7,D1]

Corey Olson4a24776e5a5d
diff --git a/docs/formats.md b/docs/formats.md
index 8373f83d..40f0f098 100644
--- a/docs/formats.md
+++ b/docs/formats.md
@@ -184,7 +184,7 @@ Engine 64 (`LOCAL_LANDING_ENGINE`) lets a landing batch reach the state `trunk`:
Engine 65 (`CI_FLAKE_ENGINE`) records flake observations imported from CI with `pullboard flakes import <folder>`. Such an observation has kind `ci`, a `ci` record (provider, run id, the failed attempt and its rerun attempt, job, runner and Node version) and a `load` of null, because a hosted runner reports no host load. A failed attempt whose rerun at the same commit passes the test is a flake; one whose TAP names no test by file stays unclassified. Observations of the other kinds replay as at engine 61.
-Engine 67 (`GATE_RUN_ENGINE`) records gate runs and the flake quarantine they prove. The gate writes a receipt for each real run of the accepted gate command on a clean, committed tree, under the common git directory at `pullboard/gate-receipts/<id>.json`: its id, kind (`gate`, `submit` or `land`), tree, head, accepted main, the command's SHA-256, its result, the committed file and name of each test that failed, the host load and the time. The writer is private to the gate and takes the result from the process it just ran; a run of any other command, or one whose checkout was dirty or moved, leaves no receipt. `recordGateRun` carries that receipt, and both a direct call and a sealed move are refused (`GATE_RUN_UNBOUND`) unless the store beside the board holds the same receipt byte for byte, so a run made up by hand is never recorded. A replayed move is applied as its origin checked it. When the coordinator's runs have found one tree both red and green for the same test, the board files one ordinary repair item for that test, with the runs as evidence, and records a `test-quarantine` event; a seat's own runs are recorded but prove nothing. Quarantine itself is the coordinator's `flakes.quarantine` setting in pullboard.json, read from accepted main and off by default: with it off, runs and the repair item are still recorded, but nothing stops blocking a landing. With it on, a quarantined test still runs and reports, but a landing treats it as covered, like a waiver naming that file and test, as long as every run that proved it is a receipt on the landing machine and its repair item is not verified or withdrawn; it then blocks again, and only a newer red-and-green proof files a new item. A different red in the same run is never covered. An older engine refuses the move with `ENGINE_VERSION`.
+Engine 67 (`GATE_RUN_ENGINE`) records gate runs and the flake quarantine they prove. The gate writes a receipt for each real run of the accepted gate command on a clean, committed tree, under the common git directory at `pullboard/gate-receipts/<id>.json`: its id, kind (`gate`, `submit` or `land`), tree, head, accepted main, the command's SHA-256, its result, the committed file and name of each test that failed, the host load and the time. The writer is private to the gate and takes the result from the process it just ran; a run of any other command, or one whose checkout was dirty or moved, leaves no receipt. The coordinator's gate runs, from the main checkout and the landing, go on the board as `recordGateRun`; a seat's run keeps only its receipt. `recordGateRun` carries that receipt, and both a direct call and a sealed move are refused (`GATE_RUN_UNBOUND`) unless the store beside the board holds the same receipt byte for byte, so a run made up by hand is never recorded. A replayed move is applied as its origin checked it. When the coordinator's runs have found one tree both red and green for the same test, the board files one ordinary repair item for that test, with the runs as evidence, and records a `test-quarantine` event; a run any other seat recorded proves nothing. Quarantine itself is the coordinator's `flakes.quarantine` setting in pullboard.json, read from accepted main and off by default: with it off, runs and the repair item are still recorded, but nothing stops blocking a landing. With it on, a quarantined test still runs and reports, but a landing treats it as covered, like a waiver naming that file and test, as long as every run that proved it is a receipt on the landing machine and its repair item is not verified or withdrawn; it then blocks again, and only a newer red-and-green proof files a new item. A different red in the same run is never covered. An older engine refuses the move with `ENGINE_VERSION`.
The CLI declares its engine in every relay request's `X-Pullboard-Engine` header.
A linked board requires at least engine 48 after issuing any agent token or machine credential, including
diff --git a/src/native-flake-cli.js b/src/native-flake-cli.js
index f2b40a38..1c7dddb6 100644
--- a/src/native-flake-cli.js
+++ b/src/native-flake-cli.js
@@ -32,9 +32,13 @@ export function observer(ctx, { kind, board, main, commit, privateCheck = false,
// Diagnostics cannot block an existing check when its coordinator is detached or its observer cannot initialize.
return async run => { if (!run.isGreen) diagnosticUnavailable({ run }, error); };
}
- /** Record the receipt the gate just wrote for its run; the board reads the receipt itself, never a run object [C7,D1]. */
+ /**
+ * Record the receipt the gate just wrote for its run; the board reads the receipt itself, never a run object [C7,D1].
+ * Only the coordinator's runs go on the board, since only they can prove a flake; a seat's run keeps its receipt on
+ * disk, so every seat's gate does not add a board move to each submit.
+ */
const recordRun = async receiptId => {
- const receipt = readGateReceipt(receiptStore(ctx.info.root), receiptId);
+ const receipt = agentId === COORDINATOR ? readGateReceipt(receiptStore(ctx.info.root), receiptId) : null;
if (!receipt) return;
const owners = receipt.failures.map(failure => laneOf(acceptedConfig, failure.file)).filter(owner => owner !== COORDINATOR);
const lane = owners[0] ?? Object.keys(acceptedConfig.lanes)[0];