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.

test(core): cover landing review event contract [A5,E8,H16]

Corey Olson1b9baec48b8a
diff --git a/docs/api.md b/docs/api.md
index ee54cc88..ed3c0cd8 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -30,7 +30,7 @@ An item's HTTP detail, and each item in the full board state, include `check` an
An accepted item that has not landed can carry `item_verdict_state` in CLI `show`, `list`, and `resume` JSON. Its `code` is `STALE_VERDICT`; `file` and `commit` identify the first known main change to one of the submitted candidate's files, and `reviewedTrunk` and `main` identify the compared tips. HTTP board states, summaries, and item details expose the same observation as optional `verdictState`. Moving main invalidates both cached state and live change notifications even when the served worktree's HEAD stays fixed. Unrelated files leave acceptance current; reverting a relevant main change still requires re-review. Missing reviewed history also fails closed, with a `reason` and null file/commit instead of an invented change.
-Freshness never rewrites the stored ACCEPT or its verdict row. New accept/reject event details carry `review: {commit, trunk, paths}`: the original submitted commit, the known reviewed trunk, and sorted unique submitted paths. Existing receipts replay with their recorded engine and remain unchanged. Older acceptances without captured review metadata use a conservative claim-base bound and may require a new review after upgrading. Recorded or physically landed work no longer needs this freshness check.
+Freshness never rewrites the stored ACCEPT or its verdict row. New accept/reject event details carry `review: {commit, trunk, paths}`: the original submitted commit, the known reviewed trunk, and sorted unique submitted paths. Existing receipts replay with their recorded engine and remain unchanged. Older acceptances without captured review metadata use a conservative claim-base bound and may require a new review after upgrading. Recorded or physically landed work no longer needs this freshness check, except when an older in-flight landing records a different tree from its newer checked review. That append-only `landing-review-moved` receipt projects `STALE_VERDICT` with `landingCode: "LAND_ITEM_MOVED"` and the exact `checked` head beside the immutable landed commit. The coordinator creates a separate correction item; the already-landed original cannot be reopened or re-reviewed. When the checked composition reaches the known trunk, this derived warning clears. A replica missing its checked Git objects retains the warning and the correction-item guidance.
For a stale acceptance, merge current main into the submitted work and commit a clean review HEAD. Another agent runs `pullboard verify <id> accept --note "what was re-reviewed"`; its frozen check runs at that combined HEAD, and a new verdict appends to the history while retaining the original submitted commit. A main move during the check refuses `VERDICT_TRUNK_MOVED` and requires another review. `resume` keeps stale acceptances out of its merge list. `land` excludes stale items (and reports their file and commit); when none remain ready, it refuses `STALE_VERDICT`. Nothing in this observation changes the approved criterion or grants person authority.
diff --git a/docs/formats.md b/docs/formats.md
index be2c4f34..1cb05ba3 100644
--- a/docs/formats.md
+++ b/docs/formats.md
@@ -330,8 +330,8 @@ The `event` table is a SQLite schema object governed by `SCHEMA_VERSION`; its ap
| `release` | builder | — |
| `submit` | builder | `commit`, `tree`, `policyCommit`, engine-9 `criterionDigest` |
| `reserve` | reviewer | `until` |
-| `accept` | reviewer | `reason`, `commit`, engine-20 `implies` |
-| `reject` | reviewer | `reason`, `commit`, engine-20 `implies` |
+| `accept` | reviewer | `reason`, `commit`, engine-20 `implies`, engine-25 `review` |
+| `reject` | reviewer | `reason`, `commit`, engine-20 `implies`, engine-25 `review` |
| `reopen` | coordinator | `commit`, `note`, `judgment`, engine-10 `supersedes`, `landingFailure` |
| `merged` | coordinator | `commit` |
| `landing_batch` | coordinator | `batch` |
diff --git a/docs/formats.test.js b/docs/formats.test.js
index 2dec875f..5886351f 100644
--- a/docs/formats.test.js
+++ b/docs/formats.test.js
@@ -10,6 +10,7 @@ import { COORDINATOR } from '../src/config.js';
import { JSON_SHAPES } from '../src/json.js';
import { exportView } from '../src/serve.js';
import { ENGINE_VERSION } from '../src/machine.js';
+import { applyEngineMove, prepareEngineMove } from '../src/engine.js';
import {
ACCEPT_REASON,
answerDecision,
@@ -28,7 +29,6 @@ import {
recordLandingBatch,
recordLandingWaiver,
recordLandingFlake,
- finishLandingBatch,
openBoard,
passDecision,
PERSON,
@@ -300,18 +300,25 @@ function recordEventContract() {
submit(board, first, { agentId: builder, commit: acceptedCommit, tree: 'b'.repeat(40), files: ['docs/formats.md'], policyCommit: 'a'.repeat(40) });
reserveReview(board, first, { agentId: reviewer, leaseMs: 60_000, policy: 'agents' });
verify(board, first, { agentId: reviewer, decision: 'ACCEPT', reason: ACCEPT_REASON, note: 'checked the example', head: acceptedCommit, digest: 'second', policy: 'agents', implies: [dependency] });
+ verify(board, first, { agentId: reviewer, decision: 'ACCEPT', note: 'checked a newer composition',
+ head: 'd'.repeat(40), digest: 'second', policy: 'agents',
+ review: { commit: acceptedCommit, head: 'd'.repeat(40), trunk: 'b'.repeat(40), paths: ['docs/formats.md'] } });
merged(board, first, { agentId: coordinator, commit: 'c'.repeat(40) });
const batch = recordLandingBatch(board, { agentId: coordinator, batch: { version: 1, id: 'format-example', base: 'a'.repeat(40), tip: 'c'.repeat(40),
root: '/landing', branch: 'refs/heads/main', state: 'pushed', owner: 'format-example', logPath: '/landing.log', items: [{ id: first, commit: acceptedCommit, merge: 'c'.repeat(40) }] } });
recordLandingWaiver(board, { agentId: PERSON, channel: 'terminal', id: 'format-waiver', test: 'test/flaky.test.js', until: '2099-01-01', reason: 'format example' });
recordLandingFlake(board, { agentId: coordinator, test: 'test/flaky.test.js', hash: 'd'.repeat(64), names: ['flaky example'], lane: 'docs', batchId: batch.id });
- finishLandingBatch(board, { agentId: coordinator, id: batch.id, tip: batch.tip });
+ // Exercise the new event's historical-engine semantics here; team-engine.test.js
+ // separately prepares and compares this path with the actual released engine 12.
+ const olderFinish = { ...prepareEngineMove(board, 'finishLandingBatch', [{ agentId: coordinator, id: batch.id, tip: batch.tip }]), engine: 12 };
+ assert.equal(applyEngineMove(board, olderFinish, { sequence: 1, at: '2026-10-17T20:00:00.000Z' }).error, undefined);
const rejected = addItem(board, { by: coordinator, lane: 'docs', title: 'Rejected example' });
claim(board, rejected, { agentId: builder, lane: 'docs', leaseMs: 60_000, freeze: freeze('rejected') });
const rejectedCommit = 'd'.repeat(40);
submit(board, rejected, { agentId: builder, commit: rejectedCommit, tree: 'e'.repeat(40) });
- verify(board, rejected, { agentId: reviewer, decision: 'REJECT', reason: 'TEST_FAILURE', note: 'the fixture failed', head: rejectedCommit, digest: 'rejected', policy: 'agents', implies: [dependency] });
+ verify(board, rejected, { agentId: reviewer, decision: 'REJECT', reason: 'TEST_FAILURE', note: 'the fixture failed', head: rejectedCommit, digest: 'rejected', policy: 'agents', implies: [dependency],
+ review: { commit: rejectedCommit, head: rejectedCommit, trunk: 'a'.repeat(40), paths: ['docs/formats.md'] } });
const corrected = addItem(board, { by: coordinator, lane: 'docs', title: 'Corrected live claim' });
claim(board, corrected, { agentId: builder, lane: 'docs', leaseMs: 60_000, freeze: freeze('before-correction') });