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.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(relay): compose seat standing with trunk [H2,V1,H16]
Corey Olson78d2584437ce
diff --cc docs/formats.mdindex 3a3ca7b1,31a2239e..6690d81c--- a/docs/formats.md+++ b/docs/formats.md@@@ -134,11 -134,13 +134,15 @@@ Engine 24 adds the person's `acceptChecEngine 30 lets a reject and a reopen carry a cause key (`cause`: `test:<file>::<title>`, `refusal:<CODE>`, `row:<id>` or `doctrine:<id>`) and lets the person record a never-again fact with `cause` and `neverAgain: true`, for `pullboard rigor`. Only a move that carries one of these needs engine 30; engine-29 and older moves replay unchanged, and clients on an older engine refuse an engine-30 move with `RELAY_MOVE` before changing their board or cursor. Engine 20 is the implied-items engine above; engine numbers 21 through 29 are allocated to other changes.+Engine 35 records on each new seat the seat that created it (`createdBy`: an agent id, or `machine` for a join no seat made), lets a creator name the new seat (`id`), and applies verifier standing to relay-replayed verdicts, review reservations and offers on a linked board: the verifier's line of creating seats must reach the coordinator through seats enrolled by the relay, without the builder or a machine join. Replicas apply a register move by another seat only with the relay's receipt for its target, creator, position and digest. The relay stamps every record it stores with `policy: 35`; a stamped move below engine 35 is refused. Engine-12 and older moves, and unstamped records, replay as they did. On an unlinked board who may verify is unchanged.++ Engine 38 records submission test selections and normalized landing evidence. A `submit` carrying `submissionProof` or a `recordLandingBatch` carrying `invariantEvidence` requires engine 38; earlier engines refuse these envelopes before applying them, and a missing or malformed proof is refused with `SUBMISSION_PROOF` on a modern submit before its item or events change. Moves recorded under engines 37 and earlier replay without inferred coverage. Recorded invariant evidence is append-only when a landing batch is adopted; adopting or finishing a batch already carrying that evidence requires engine 38, even when the incoming move omits the evidence field. Engine slots 25 through 37 are allocated to earlier train changes; preserve their semantics when composing this item.++ Engine 42 adds ordered `recordHealthFindings` observations. A scan retains its board event revision, emits new and resolved sentinel notices once, and records `health-failure` receipts under their refusal cause keys. Rigor counts repeated health episodes without inventing a changed code commit. Older engines refuse this operation before replay; earlier move meanings and feature minima stay unchanged.+The CLI declares its engine in every relay request's `X-Pullboard-Engine` header.-A linked board requires at least engine 3 after issuing any agent token, including-revoked or expired tokens. Issuing any machine credential raises that board’s minimum to engine 6, including after revocation or expiry. The minimum survives reopening the auth database;+A linked board requires at least engine 35 after issuing any agent token or machine credential, including+revoked or expired ones; before engine 35 these minimums were 3 and 6. The minimum survives reopening the auth database;unlink removes the board and ends its lifetime. A missing declaration is legacyengine 1. Board-content requests below their minimum, and malformed declarations,receive `ENGINE_VERSION` with upgrade guidance before records are returned ordiff --cc docs/lifecycle.mdindex daa5035f,8f5550ff..bc2f086c--- a/docs/lifecycle.md+++ b/docs/lifecycle.md@@@ -56,10 -56,10 +56,10 @@@ Each move checks its guards in this ord| claim | open, claimed | claimed | agent, coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_CLAIMABLE), checkProvesSomething (CRITERION_PROVES_NOTHING), itemNotHeld (ITEM_HELD), inLane (WRONG_LANE), routeAllows (ROUTE), dependenciesVerified (BLOCKED), notHeldByAnother (HELD), correctionRefrozen (PENDING_REFREEZE), laneOpen (LANE_HELD), oneLiveClaim (ONE_CLAIM), rowsInForce (UNKNOWN_SPEC or A5_GRAMMAR_VERSION or NO_POLICY or BAD_CONFIG or SPEC_BEHIND_MAIN) || release | claimed | open | agent, coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_YOURS), isHolder (NOT_YOURS), reviewReleaseExplained (NOTE_REQUIRED) || lapse | claimed | open | clock, when its lease runs out | none |- | submit | claimed | submitted | agent, coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_YOURS), isHolder (NOT_YOURS), correctionRefrozen (PENDING_REFREEZE), checkProvesSomething (CRITERION_PROVES_NOTHING), criterionUnchanged (CRITERIA_CHANGED), treeClean (DIRTY), nothingUntracked (UNTRACKED), hasCommit (NO_COMMIT), withinLane (OUTSIDE_LANE or NO_POLICY or BAD_CONFIG or GIT_GRAFTS), trunkMergeClean (MERGE_CONFLICT or MERGE_CHECK_FAILED or NO_POLICY or NO_TRUNK), noUnverifiedStack (STACKED_ON_UNVERIFIED), doctrineHolds (RATCHET_ROSE or RATCHET_UNCOUNTED), gateConfigured (NO_GATE), queuedItemLease (ITEM_LEASE_LOST or A5_GRAMMAR_VERSION or SPEC_BEHIND_MAIN or NOT_A_REPO or NO_CONFIG), gateGreen (GATE_RED or PIPEFAIL_UNAVAILABLE), treeStillDuringGate (MOVED_DURING_GATE), childrenDone (CHILDREN_OPEN), headIsNew (HEAD_NOT_NEW) |+ | submit | claimed | submitted | agent, coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_YOURS), isHolder (NOT_YOURS), correctionRefrozen (PENDING_REFREEZE), checkProvesSomething (CRITERION_PROVES_NOTHING), criterionUnchanged (CRITERIA_CHANGED), treeClean (DIRTY), nothingUntracked (UNTRACKED), hasCommit (NO_COMMIT), withinLane (OUTSIDE_LANE or NO_POLICY or BAD_CONFIG or GIT_GRAFTS), trunkMergeClean (MERGE_CONFLICT or MERGE_CHECK_FAILED or NO_POLICY or NO_TRUNK), noUnverifiedStack (STACKED_ON_UNVERIFIED), doctrineHolds (RATCHET_ROSE or RATCHET_UNCOUNTED), gateConfigured (NO_GATE), queuedItemLease (ITEM_LEASE_LOST or A5_GRAMMAR_VERSION or SPEC_BEHIND_MAIN or NOT_A_REPO or NO_CONFIG), gateGreen (GATE_RED or PIPEFAIL_UNAVAILABLE), treeStillDuringGate (MOVED_DURING_GATE), submissionProofValid (SUBMISSION_PROOF), childrenDone (CHILDREN_OPEN), headIsNew (HEAD_NOT_NEW) |-| reserve | submitted | submitted | agent, coordinator | coordinatorSaysAs (MAIN_IS_COORDINATOR), joined (NOT_JOINED), roadmapReadable (MILESTONES_CORRUPT), itemExists (NO_ITEM), inState (NOT_SUBMITTED), reviewCooldownElapsed (REVIEW_COOLDOWN), notBuilder (SELF_VERIFY), routeAllows (ROUTE), policyAllows (COORDINATOR_VERIFIES), familyAllows (O2_FAMILY_MATCH), reviewFree (REVIEW_HELD) |-| accept | submitted, verified | verified | agent, coordinator | coordinatorSaysAs (MAIN_IS_COORDINATOR), joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_SUBMITTED), atSubmittedCommit (NOT_AT_COMMIT or OUTSIDE_LANE or NO_POLICY or BAD_CONFIG or GIT_GRAFTS), notMerged (ALREADY_MERGED), verdictReviewRecorded (BAD_VERDICT_REVIEW), reviewTreeCurrent (STALE_VERDICT or DIRTY or UNTRACKED or VERDICT_TRUNK_MOVED), notBuilder (SELF_VERIFY), routeAllows (ROUTE), policyAllows (COORDINATOR_VERIFIES), familyAllows (O2_FAMILY_MATCH), reviewFree (REVIEW_HELD), criterionUnchanged (CRITERIA_CHANGED), reasonIsMet (BAD_REASON), trunkMergeClean (MERGE_CONFLICT or MERGE_CHECK_FAILED or NO_POLICY or NO_TRUNK), noUnverifiedStack (STACKED_ON_UNVERIFIED), queuedItemLease (ITEM_LEASE_LOST or A5_GRAMMAR_VERSION or SPEC_BEHIND_MAIN or NOT_A_REPO or NO_CONFIG), itemCheckGreen (CHECK_RED or CHECK_UNVERIFIED), proofNoted (PROOF_REQUIRED), result (LAND_HEADER), result (ENGINE_VERSION) |-| reject | submitted, verified | open | agent, coordinator | coordinatorSaysAs (MAIN_IS_COORDINATOR), joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_SUBMITTED), atSubmittedCommit (NOT_AT_COMMIT or OUTSIDE_LANE or NO_POLICY or BAD_CONFIG or GIT_GRAFTS), notMerged (ALREADY_MERGED), verdictReviewRecorded (BAD_VERDICT_REVIEW), reviewTreeCurrent (STALE_VERDICT or DIRTY or UNTRACKED or VERDICT_TRUNK_MOVED), notBuilder (SELF_VERIFY), routeAllows (ROUTE), policyAllows (COORDINATOR_VERIFIES), familyAllows (O2_FAMILY_MATCH), reviewFree (REVIEW_HELD), criterionUnchanged (CRITERIA_CHANGED), reasonCoded (BAD_REASON), noteGiven (NOTE_REQUIRED), causeWellFormed (BAD_CAUSE), result (LAND_HEADER), result (ENGINE_VERSION) |+| reserve | submitted | submitted | agent, coordinator | coordinatorSaysAs (MAIN_IS_COORDINATOR), joined (NOT_JOINED), roadmapReadable (MILESTONES_CORRUPT), itemExists (NO_ITEM), inState (NOT_SUBMITTED), reviewCooldownElapsed (REVIEW_COOLDOWN), notBuilder (SELF_VERIFY or VERIFIER_STANDING), routeAllows (ROUTE), policyAllows (COORDINATOR_VERIFIES), familyAllows (O2_FAMILY_MATCH), reviewFree (REVIEW_HELD) |+| accept | submitted, verified | verified | agent, coordinator | coordinatorSaysAs (MAIN_IS_COORDINATOR), joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_SUBMITTED), atSubmittedCommit (NOT_AT_COMMIT or OUTSIDE_LANE or NO_POLICY or BAD_CONFIG or GIT_GRAFTS), notMerged (ALREADY_MERGED), verdictReviewRecorded (BAD_VERDICT_REVIEW), reviewTreeCurrent (STALE_VERDICT or DIRTY or UNTRACKED or VERDICT_TRUNK_MOVED), notBuilder (SELF_VERIFY or VERIFIER_STANDING), routeAllows (ROUTE), policyAllows (COORDINATOR_VERIFIES), familyAllows (O2_FAMILY_MATCH), reviewFree (REVIEW_HELD), criterionUnchanged (CRITERIA_CHANGED), reasonIsMet (BAD_REASON), trunkMergeClean (MERGE_CONFLICT or MERGE_CHECK_FAILED or NO_POLICY or NO_TRUNK), noUnverifiedStack (STACKED_ON_UNVERIFIED), queuedItemLease (ITEM_LEASE_LOST or A5_GRAMMAR_VERSION or SPEC_BEHIND_MAIN or NOT_A_REPO or NO_CONFIG), itemCheckGreen (CHECK_RED or CHECK_UNVERIFIED), proofNoted (PROOF_REQUIRED), result (LAND_HEADER), result (ENGINE_VERSION) |+| reject | submitted, verified | open | agent, coordinator | coordinatorSaysAs (MAIN_IS_COORDINATOR), joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_SUBMITTED), atSubmittedCommit (NOT_AT_COMMIT or OUTSIDE_LANE or NO_POLICY or BAD_CONFIG or GIT_GRAFTS), notMerged (ALREADY_MERGED), verdictReviewRecorded (BAD_VERDICT_REVIEW), reviewTreeCurrent (STALE_VERDICT or DIRTY or UNTRACKED or VERDICT_TRUNK_MOVED), notBuilder (SELF_VERIFY or VERIFIER_STANDING), routeAllows (ROUTE), policyAllows (COORDINATOR_VERIFIES), familyAllows (O2_FAMILY_MATCH), reviewFree (REVIEW_HELD), criterionUnchanged (CRITERIA_CHANGED), reasonCoded (BAD_REASON), noteGiven (NOTE_REQUIRED), causeWellFormed (BAD_CAUSE), result (LAND_HEADER), result (ENGINE_VERSION) || reopen | submitted, verified | open | coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_SUBMITTED), coordinatorOnly (COORDINATOR_ONLY), noteGiven (NOTE_REQUIRED), causeWellFormed (BAD_CAUSE), notMerged (ALREADY_MERGED), landingFailureRecorded (LANDING_FAILURE_REQUIRED) || escalate | open, claimed | open | agent, coordinator | joined (NOT_JOINED), noteGiven (NOTE_REQUIRED), itemExists (NO_ITEM), holderOrCoordinator (NOT_YOURS), inState (CLOSED) || refreeze | open, claimed, submitted | open | coordinator, when there is no live claim awaiting a coordinator correction | joined (NOT_JOINED), coordinatorOnly (COORDINATOR_ONLY), itemExists (NO_ITEM), inState (CLOSED), rowsInForce (UNKNOWN_SPEC or A5_GRAMMAR_VERSION or NO_POLICY or BAD_CONFIG or SPEC_BEHIND_MAIN) |diff --cc src/machine.jsindex d2cb4643,e11f776b..6df15633--- a/src/machine.js+++ b/src/machine.js@@@ -10,15 -10,9 +10,15 @@@*//** Executable move semantics, carried by every sealed move and retained during replay [H16]. */- export const ENGINE_VERSION = 35;+ export const ENGINE_VERSION = 42;-/** The engine at which a reject, reopen or person fact can carry a cause key (#713); older moves replay unchanged [D1,H16]. */+/**+ * The engine whose relay moves carry seat provenance and verifier standing (#579). It is its own+ * constant because engine slots are allotted per item: whoever lands second renumbers this line.+ */+export const VERIFIER_STANDING_ENGINE = 35;++/** The engine at which reject, reopen and person facts may carry cause keys [D1,H16]. */export const CAUSE_ENGINE = 30;/** First released engine binding the checked composition, review trunk and paths [E8,H16]. */diff --cc src/next-steps.jsindex 2e1bbc60,e69019ea..e0cfa3f5--- a/src/next-steps.js+++ b/src/next-steps.js@@@ -390,8 -392,7 +394,9 @@@ export const NEXT_STEPS = Object.freezeSTALE_VERDICT: 'merge current main into the submitted commit, commit a clean composition, then ask another agent to re-review it before landing',STACKED_ON_UNVERIFIED: 'wait for the earlier item to be accepted, or rebuild on main without its commits',STALE_ROW_DECISION: 'ask the person to approve the current row again in pullboard view',+ SUBMISSION_PROOF: 'rerun pullboard submit <id> with the current CLI so its selected files and fallback are recorded',+ TOKEN_EXPIRED: 'ask the coordinator for a fresh seat: pullboard worktree <lane> --model "<model name>"; for the coordinator\'s own token, the person runs pullboard relay on in the main checkout',+ TOKEN_REVOKED: 'stop using this seat and ask the coordinator for a fresh one: pullboard worktree <lane> --model "<model name>"',TOKENS_NOT_AVAILABLE: 'manage agent tokens in pullboard view or the signed-in relay account',TOKEN_NOT_OWNED: 'name a token id from pullboard relay tokens',TOO_LARGE: 'open the file in your editor instead',diff --cc src/relay-sender.jsindex 3dff21f2,2c0005b9..f69b7a01--- a/src/relay-sender.js+++ b/src/relay-sender.js@@@ -6,9 -5,9 +6,10 @@@ import { Refused } from './refused.js'export function relayMoveActor(move) {const args = move?.args;if (!Array.isArray(args)) return null;+ if (move.operation === 'register' && move.engine >= VERIFIER_STANDING_ENGINE) return args[0]?.createdBy === 'machine' ? null : args[0]?.createdBy ?? null;if (move.operation === 'addItem') return args[0]?.by ?? null;if (move.operation === 'shout') return args[0]?.from ?? null;+ if (move.operation === 'recordHealthFindings') return args[0]?.agentId ?? null;if (['holdLane', 'releaseLane'].includes(move.operation) && args[1]?.asPerson) return 'person';if (move.operation === 'release') return args[1] ?? null;if (['reserveNextReview', 'addMilestone', 'recordRowDecisions', 'applyRowDecisions', 'recordLandingBatch', 'recordLandingWaiver', 'recordLandingFlake', 'finishLandingBatch'].includes(move.operation)) return args[0]?.agentId ?? null;diff --cc test/agent-model-engine.test.jsindex c5ef2f92,31861391..b28dad6b--- a/test/agent-model-engine.test.js+++ b/test/agent-model-engine.test.js@@@ -5,13 -6,13 +6,15 @@@ import * as store from '../src/board.jsimport { applyEngineMove, prepareEngineMove } from '../src/engine.js';import { exportBoard, importBoard } from '../src/exchange.js';import { ENGINE_VERSION } from '../src/machine.js';++import { VERIFIER_STANDING_ENGINE } from '../src/machine.js';import { configProblems, defaults, loadConfig } from '../src/config.js';import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join } from 'node:path';- test('model declarations and event snapshots retain engines 1 through 35 semantics [O8,O3,H16]', (t) => {- assert.equal(ENGINE_VERSION, 35, 'engine 35 retains every historical model snapshot');-test('model declarations and event snapshots retain engines 1 through 34 semantics [O8,O3,H16]', (t) => {++test('model declarations and event snapshots retain all recorded engine semantics [O8,O3,H16]', (t) => {+ assert.ok(ENGINE_VERSION >= HEALTH_SENTINEL_ENGINE, 'the current writer retains the sentinel minimum and historical behavior');++ assert.ok(ENGINE_VERSION >= VERIFIER_STANDING_ENGINE, 'the current writer retains verifier standing');for (const version of Array.from({ length: ENGINE_VERSION }, (_, index) => index + 1)) {const board = store.openBoard(':memory:');t.after(() => store.closeBoard(board));diff --cc test/pending-refreeze.test.jsindex 727586b1,f9a15d76..374ca582--- a/test/pending-refreeze.test.js+++ b/test/pending-refreeze.test.js@@@ -9,6 -10,6 +10,7 @@@ import * as store from '../src/board.jsimport { appliedSequence, applyRelayMove, engineReceipt, prepareEngineMove } from '../src/engine.js';import { exportBoard, importBoard } from '../src/exchange.js';import { ENGINE_VERSION } from '../src/machine.js';++import { VERIFIER_STANDING_ENGINE } from '../src/machine.js';import { createE2eHelpers } from './e2e-helpers.js';import { unpackRelease } from './release-archive.js';@@@ -261,7 -262,7 +263,8 @@@ async function checkDependencyLegacyCli}test('dependency edits replay the same on every engine [B3,V2,H16]', async (t) => {- assert.equal(ENGINE_VERSION, 35, 'the next writer retains all recorded dependency-edit behavior');+ assert.ok(ENGINE_VERSION >= HEALTH_SENTINEL_ENGINE, 'the current writer retains the sentinel minimum and historical behavior');++ assert.ok(ENGINE_VERSION >= VERIFIER_STANDING_ENGINE, 'the current writer retains verifier standing');const directory = mkdtempSync(join(tmpdir(), 'pullboard-dependency-engines-'));const cleanup = [];t.after(() => {diff --cc test/relay-mint.test.jsindex 1a611655,00000000..b2778125mode 100644,000000..100644--- a/test/relay-mint.test.js+++ b/test/relay-mint.test.js@@@ -1,367 -1,0 +1,368 @@@+/** An agent in its worktree cannot mint a relay token or borrow another seat's verifier standing [H2,V1,E3,E5,P6] (#579). */+import assert from 'node:assert/strict';+import { createHash } from 'node:crypto';+import { DatabaseSync } from 'node:sqlite';+import { chmodSync, copyFileSync, existsSync, mkdtempSync, readdirSync, readFileSync, rmSync, statSync } from 'node:fs';+import { dirname, join } from 'node:path';+import { tmpdir } from 'node:os';+import { test } from 'node:test';+import * as store from '../src/board.js';++import { submitFixture } from './board-submit-fixture.js';+import { appliedSequence, applyRelayMove } from '../src/engine.js';+import { ENGINE_VERSION, VERIFIER_STANDING_ENGINE } from '../src/machine.js';+import { createRelayJournal } from '../relay/journal.js';+import { runFixtureChild } from './fixture-child.js';+import { relayClientFixture } from './relay-client-fixture.js';++const TOKEN = /^pa_[A-Za-z0-9_-]{43}$/u;+const POLICY = { version: 1, commit: 'a'.repeat(40), verify: { policy: 'any', family: 'off' } };++/** Run fixture Git with hooks off: this test is about relay credentials, not the installed hooks. */+function git(root, env, args) {+ const result = runFixtureChild('git', ['-c', 'core.hooksPath=/dev/null', ...args], { cwd: root, env, encoding: 'utf8' });+ assert.equal(result.status, 0, result.failure ?? `fixture git ${args[0]} succeeds`);+ return result.stdout.trim();+}++/** Send one credentialed request to the loopback relay; bearer values never enter a message. */+async function call(origin, token, method, path, body) {+ const response = await fetch(origin + path, {+ method, headers: { authorization: `Bearer ${token}`, 'x-pullboard-engine': String(ENGINE_VERSION),+ ...(body === undefined ? {} : { 'content-type': 'application/json' }) },+ ...(body === undefined ? {} : { body: JSON.stringify(body) }),+ });+ return { status: response.status, document: await response.json() };+}++/** Read the shared link file every worktree of this repository can read. */+function link(box) { return JSON.parse(readFileSync(box.linkFile, 'utf8')); }++/** Every file under a directory, for a scan that no person session sits on disk (#299). */+function files(directory) {+ if (!existsSync(directory)) return [];+ return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {+ const path = join(directory, entry.name);+ return entry.isDirectory() ? files(path) : entry.isFile() ? [path] : [];+ });+}++/** Freeze a criterion with a valid verify policy, as the CLI does at claim. */+function freezer() {+ const text = JSON.stringify({ criterion: 'an independent seat accepts it', policy: POLICY });+ return () => ({ text, digest: createHash('sha256').update(text).digest('hex') });+}+- /** Put one item in submitted state on a board, built by `builder`. */++/** Create synthetic submitted history for the credential test; this fixture does not run a gate. */+function submitted(board, builder, lane) {+ const added = store.addItem(board, { by: 'coordinator', lane, title: 'provenance review', criterion: 'an independent seat accepts it' });+ const item = { item_id: typeof added === 'number' ? added : added.item_id };+ store.claim(board, item.item_id, { agentId: builder, lane, leaseMs: 3_600_000, freeze: freezer(), head: 'a'.repeat(40) });- store.submit(board, item.item_id, { agentId: builder, commit: 'b'.repeat(40), tree: 'c'.repeat(40) });++ submitFixture(board, item.item_id, { agentId: builder, commit: 'b'.repeat(40), tree: 'c'.repeat(40) });+ return store.getItem(board, item.item_id);+}++test('an agent in its worktree cannot mint a relay token [H2,V1,E3,E5,P6]', async (t) => {+ const box = await relayClientFixture(t);+ const lane = box.lane;+ git(box.root, box.env, ['add', '-A']);+ git(box.root, box.env, ['commit', '-q', '-m', 'test: private relay mint fixture']);+ const head = git(box.root, box.env, ['rev-parse', 'HEAD']);++ // A seat the coordinator made before the board was linked: it builds, but it was never enrolled.+ const prelinked = await box.cli('worktree', lane, '--model', 'Prelinked Seat');+ assert.equal(prelinked.code, 0, prelinked.failure ?? 'the unlinked coordinator makes a worktree');+ await box.link();+ const start = link(box);+ assert.match(start.agentTokens?.coordinator?.token ?? '', TOKEN, 'relay on sets up the coordinator token from the person sign-in');+ const session = await call(box.origin, start.agentTokens.coordinator.token, 'GET', `/auth/session?board=${start.board}`);+ assert.equal(session.document.session.root, true, 'the coordinator token is the person-made root');++ // A manual join: no seat made it, so the machine credential gives it a build-only token, with no person action.+ const manualRoot = join(dirname(box.root), 'manual-join');+ git(box.root, box.env, ['worktree', 'add', '-q', '--detach', manualRoot, head]);+ const before = box.transit.length;+ const manualJoin = await box.cliAt(manualRoot, 'join', lane, '--model', 'Manual Seat');+ assert.equal(manualJoin.code, 0, manualJoin.failure ?? 'a manual join enrolls with no person action');+ const manual = manualJoin.document.agent;+ const manualTraffic = box.transit.slice(before);+ const manualMint = manualTraffic.find((entry) => entry.method === 'POST' && entry.path === '/auth/tokens');+ assert.equal(JSON.parse(manualMint.request.toString('utf8')).agent, manual, 'the machine credential first-mints the manual seat');+ assert.match(JSON.parse(manualMint.response.toString('utf8')).token ?? '', TOKEN);+ assert.equal(manualTraffic.some((entry) => /approvals|authorize|\/auth\/device/u.test(entry.path)), false, 'no phone or person step');++ // Fresh seats from their creators: the first token comes back in the creator's own registration request.+ /** Make one seat from a creator's checkout and return its id, path and registration exchange. */+ const created = async (cwd, model) => {+ const from = box.transit.length;+ const result = cwd === box.root ? await box.cli('worktree', lane, '--model', model) : await box.cliAt(cwd, 'worktree', lane, '--model', model);+ assert.equal(result.code, 0, result.failure ?? `the creator makes ${model}`);+ const traffic = box.transit.slice(from);+ const registration = traffic.findLast((entry) => entry.method === 'POST' && entry.path.endsWith('/moves') && JSON.parse(entry.request.toString('utf8')).registration+ && JSON.parse(entry.response.toString('utf8')).enrollment);+ assert.ok(registration, 'the registration move carries its seat receipt');+ const reply = JSON.parse(registration.response.toString('utf8'));+ assert.equal(reply.enrollment.agent, result.document.agent, 'the registration reply enrolls the new seat');+ assert.match(reply.enrollment.token ?? '', TOKEN, 'its creator receives the first token in that same request');+ assert.equal(reply.event.registration.target, result.document.agent, 'the public event names the target');+ assert.equal(JSON.stringify(reply.event).includes(reply.enrollment.token), false, 'the token never enters the public event');+ assert.equal(traffic.some((entry) => entry.method === 'POST' && entry.path === '/auth/tokens'), false, 'no separate first mint');+ assert.equal(traffic.some((entry) => /approvals|authorize|\/auth\/device/u.test(entry.path)), false, 'enrollment stays zero-tap');+ return { id: result.document.agent, path: result.document.path, registration };+ };+ const builder = await created(box.root, 'Builder Seat');+ const reviewer = await created(box.root, 'Reviewer Seat');+ const child = await created(builder.path, 'Child Seat');+ const grandchild = await created(child.path, 'Grandchild Seat');+ const prelinkedActs = await box.cliAt(prelinked.document.path, 'shout', 'all', 'a seat from before the link keeps building');+ assert.equal(prelinkedActs.code, 0, prelinkedActs.failure ?? 'an existing seat keeps working after the link');++ const boardCopy = join(mkdtempSync(join(tmpdir(), 'pullboard-mint-board-')), 'board.sqlite');+ t.after(() => rmSync(dirname(boardCopy), { recursive: true, force: true }));+ copyFileSync(join(box.root, '.git', 'pullboard', 'board.sqlite'), boardCopy);+ const board = store.openBoard(boardCopy);+ t.after(() => store.closeBoard(board));+ assert.equal(store.agentCreator(board, manual), 'machine', 'a manual join records that no seat made it');+ assert.equal(store.agentCreator(board, builder.id), 'coordinator');+ assert.equal(store.agentCreator(board, reviewer.id), 'coordinator');+ assert.equal(store.agentCreator(board, child.id), builder.id, 'every registration records the seat that created it');+ assert.equal(store.agentCreator(board, grandchild.id), child.id);+ assert.equal(store.seatEnrolled(board, child.id), true);+ assert.equal(store.seatEnrolled(board, manual), false);+ assert.equal(store.seatEnrolled(board, prelinked.document.agent), false, 'a seat made before linking was never enrolled');++ await t.test('every credential a worktree can reach is refused against every existing seat', async () => {+ const state = link(box);+ const shared = readFileSync(box.linkFile, 'utf8');+ for (const path of [box.linkFile, ...files(join(box.root, '.git', 'pullboard')), ...files(box.env.PULLBOARD_HOME), ...files(box.env.PULLBOARD_MACHINE_HOME)]) {+ if (statSync(path).size < 2_000_000) assert.equal(/ps_[A-Za-z0-9_-]{43}/u.test(readFileSync(path, 'latin1')), false, 'no person session is stored where a worktree can read it');+ }+ assert.match(state.token, /^pm_[A-Za-z0-9_-]{43}$/u, 'the shared link file holds the machine credential');+ const seats = Object.keys(state.agentTokens);+ for (const seat of ['coordinator', manual, prelinked.document.agent, builder.id, reviewer.id, child.id, grandchild.id]) assert.ok(seats.includes(seat), `${seat} has a cached token`);+ assert.equal(seats.length, store.listAgents(board).length, 'every registered seat holds a token');+ const credentials = [['machine', state.token], ...seats.map((seat) => [seat, state.agentTokens[seat].token])];+ const copied = JSON.parse(builder.registration.request.toString('utf8')).registration;+ let attempts = 0;+ for (const [holder, credential] of credentials) {+ for (const target of seats) {+ if (holder === target) continue; // A seat's own token renewing itself is the one decided exception (7bbf20c0).+ for (const body of [{ board: state.board, agent: target }, { board: state.board, agent: target, recover: true }, { board: state.board, agent: target, registration: copied }]) {+ if (body.recover && holder === 'coordinator' && [builder.id, reviewer.id].includes(target)) continue; // Its creator's reissue.+ if (body.recover && holder === builder.id && target === child.id) continue;+ if (body.recover && holder === child.id && target === grandchild.id) continue;+ const attempt = await call(box.origin, credential, 'POST', '/auth/tokens', body);+ attempts += 1;+ assert.ok(attempt.status >= 400, `${holder} cannot mint for ${target}`);+ assert.ok(['TOKEN_EXISTS', 'TOKEN_AGENT', 'REGISTRATION_IN_MOVE'].includes(attempt.document.error?.code), `${holder} is refused by name for ${target}`);+ }+ }+ const root = await call(box.origin, credential, 'POST', '/auth/coordinators', { board: state.board });+ assert.equal(root.status, 403, `${holder} cannot set up the coordinator credential`);+ assert.equal(root.document.error?.code, 'HUMAN_REQUIRED');+ }+ assert.ok(attempts > 90, 'the sweep covers every reachable credential against every existing seat');+ assert.equal(readFileSync(box.linkFile, 'utf8'), shared, 'no refused attempt changed the shared link file');+ });++ await t.test('a seat renews only with its own token, and only its creator reissues a lost one', async () => {+ const state = link(box);+ const own = state.agentTokens[grandchild.id].token;+ const renewed = await call(box.origin, own, 'POST', '/auth/tokens', { board: state.board, agent: grandchild.id });+ assert.equal(renewed.status, 201, 'the current token renews its own seat');+ assert.equal((await call(box.origin, own, 'GET', `/auth/session?board=${state.board}`)).status, 401, 'renewal revokes the old token');+ assert.equal((await call(box.origin, renewed.document.token, 'GET', `/auth/session?board=${state.board}`)).document.session.agent, grandchild.id);+ const reissued = await call(box.origin, state.agentTokens[child.id].token, 'POST', '/auth/tokens', { board: state.board, agent: grandchild.id, recover: true });+ assert.equal(reissued.status, 201, 'the creator reissues a lost token');+ assert.equal((await call(box.origin, renewed.document.token, 'GET', `/auth/session?board=${state.board}`)).status, 401, 'reissue revokes the old one');+ // Once every token of a seat is revoked or expired, the machine credential still cannot renew it.+ const person = await box.phoneSession();+ await box.auth.revoke(person.token, reissued.document.id);+ const machineRenewal = await call(box.origin, state.token, 'POST', '/auth/tokens', { board: state.board, agent: grandchild.id });+ assert.equal(machineRenewal.document.error?.code, 'TOKEN_EXISTS', 'the machine credential never renews a registered seat that held a token');+ // A machine-minted seat has no receipt to fall back on: its first-mint history alone refuses.+ await box.auth.revoke(person.token, state.agentTokens[prelinked.document.agent].id);+ const machineRemint = await call(box.origin, state.token, 'POST', '/auth/tokens', { board: state.board, agent: prelinked.document.agent });+ assert.equal(machineRemint.document.error?.code, 'TOKEN_EXISTS', 'the machine credential never renews a seat that held a token');+ const manualRecover = await call(box.origin, state.agentTokens[manual].token, 'POST', '/auth/tokens', { board: state.board, agent: manual, recover: true });+ assert.equal(manualRecover.document.error?.code, 'TOKEN_AGENT', 'a machine-origin seat has no creator to reissue it');+ // Retrying the exact registration returns the same issuance, and no token.+ const first = JSON.parse(reviewer.registration.response.toString('utf8')).enrollment;+ const retry = await call(box.origin, state.agentTokens.coordinator.token, 'POST', reviewer.registration.path, JSON.parse(reviewer.registration.request.toString('utf8')));+ assert.equal(retry.status, 200, 'an exact registration retry is accepted');+ assert.equal(retry.document.enrollment.id, first.id, 'it returns the same issuance');+ assert.equal(retry.document.enrollment.expires, first.expires);+ assert.equal(retry.document.enrollment.token, undefined, 'the relay holds no token to return');+ });++ await t.test('a machine-origin seat stays build-only and its name cannot be registered', async () => {+ const state = link(box);+ const sealed = Buffer.from('opaque fixture move').toString('base64url');+ const registration = { target: manual, creator: builder.id, sequence: state.sequence + 1, digest: createHash('sha256').update(sealed).digest('hex') };+ const later = await call(box.origin, state.agentTokens[builder.id].token, 'POST', `/api/v1/boards/${state.board}/moves`, { sequence: registration.sequence, sealed, registration });+ assert.equal(later.document.error?.code, 'SEAT_TAKEN', 'registering a machine-minted name is refused, not upgraded');+ // A pre-mint of the next name makes the creator take the one after it, still with no person action.+ const target = store.nextSeatId(board, lane);+ const premint = await call(box.origin, state.token, 'POST', '/auth/tokens', { board: state.board, agent: target });+ assert.equal(premint.status, 201, 'the machine credential first-mints a never-issued name');+ const skipped = await created(box.root, 'After Premint');+ assert.notEqual(skipped.id, target, 'the pre-minted name is skipped, not upgraded');+ const claimed = await box.cliAt(manualRoot, 'shout', 'all', 'manual seat still builds');+ assert.equal(claimed.code, 0, claimed.failure ?? 'the build-only seat keeps acting under its own token');+ });++ await t.test('a registration interrupted before enrollment still claims its seat from the machine', async () => {+ // Causal control for the 5e76ff75 reject: fail after the journal append, before enrollment.+ const enroll = box.auth.enrollSeat;+ let injected = 0;+ box.auth.enrollSeat = (...args) => {+ if (injected++ === 0) throw new Error('injected failure between the journal append and enrollment');+ return enroll.apply(box.auth, args);+ };+ const from = box.transit.length;+ let interrupted;+ try { interrupted = await box.cli('worktree', lane, '--model', 'Interrupted Seat'); }+ finally { box.auth.enrollSeat = enroll; }+ assert.notEqual(interrupted.code, 0, 'the creator sees the failed registration');+ const failed = box.transit.slice(from).find((entry) => entry.method === 'POST' && entry.path.endsWith('/moves') && JSON.parse(entry.request.toString('utf8')).registration);+ assert.ok(failed, 'the registration reached the relay');+ const body = JSON.parse(failed.request.toString('utf8'));+ const state = link(box);+ const snapshot = await call(box.origin, state.token, 'GET', `/api/v1/boards/${state.board}/state`);+ const events = await call(box.origin, state.token, 'GET', `/api/v1/boards/${state.board}/events?after=${snapshot.document.state.sequence}`);+ assert.equal(events.status, 200, JSON.stringify(events.document.error ?? {}));+ assert.ok(events.document.events.some((event) => event.registration?.target === body.registration.target), 'the move and its receipt were published');+ assert.equal(box.auth.seatRecord(state.board, body.registration.target), null, 'no first-issuance history was written');+ const race = await call(box.origin, state.token, 'POST', '/auth/tokens', { board: state.board, agent: body.registration.target });+ assert.equal(race.document.error?.code, 'TOKEN_EXISTS', 'the machine credential cannot first-mint a name its published receipt claims');+ const retry = await call(box.origin, state.agentTokens.coordinator.token, 'POST', failed.path, body);+ assert.equal(retry.status, 200, 'the creator\'s exact retry is accepted');+ assert.equal(retry.document.enrollment.agent, body.registration.target);+ assert.match(retry.document.enrollment.token ?? '', TOKEN, 'the exact retry finishes the enrollment with the first token');+ assert.equal(box.auth.seatRecord(state.board, body.registration.target).origin, 'registered');+ const after = await call(box.origin, state.token, 'POST', '/auth/tokens', { board: state.board, agent: body.registration.target });+ assert.equal(after.document.error?.code, 'TOKEN_EXISTS');+ });++ await t.test('linked verify refuses the builder line and seats without standing, in one line', () => {+ const item = submitted(board, builder.id, lane);+ /** The accept arguments a seat sends for this item. */+ const verdict = (agentId) => [item.item_id, { agentId, decision: 'ACCEPT', reason: 'CRITERION_MET', note: 'checked the proof', head: 'd'.repeat(40), digest: item.item_frozen_digest }];+ let id = 0;+ /** Replay one stamped engine-35 relay move from an agent on the linked board copy. */+ const move = (operation, args, sender, extra = {}) => applyRelayMove(board, { version: 1, engine: ENGINE_VERSION, id: `standing-${++id}`, operation, args }, {+ sequence: appliedSequence(board) + 1, at: new Date().toISOString(), kind: 'move', sender: { kind: 'agent', userId: '1', policy: VERIFIER_STANDING_ENGINE, ...sender }, ...extra,+ });+ for (const seat of [child.id, grandchild.id, manual, prelinked.document.agent]) {+ const refused = move('verify', verdict(seat), { agent: seat });+ assert.equal(refused.error?.code, 'VERIFIER_STANDING', `${seat} has no verifier standing on the linked board`);+ assert.equal(refused.error.message.includes('\n'), false, 'the refusal is one line');+ assert.match(refused.error.message, /pullboard worktree <lane> --model "<model name>"/u, 'it names the coordinator command');+ }+ assert.equal(move('verify', verdict(builder.id), { agent: builder.id }).error?.code, 'SELF_VERIFY');+ assert.equal(move('verify', verdict('coordinator'), { agent: 'coordinator' }).error?.code, 'VERIFIER_STANDING', 'a coordinator token the person did not set up has no standing');+ const next = move('reserveNextReview', [{ agentId: child.id, lane, leaseMs: 60_000, policy: 'any' }], { agent: child.id });+ assert.equal(next.result.item, null, 'next --verify offers the builder\'s child nothing');+ assert.match(next.result.reasons.join('\n'), /pullboard worktree <lane> --model/u);+ const forged = move('register', [{ lane, path: '/forged-seat', model: 'Forged', createdBy: builder.id, id: `${lane}-900` }], { agent: builder.id });+ assert.equal(forged.error?.code, 'RELAY_REGISTRATION', 'a seat registered without its relay receipt is refused');+ const accepted = move('verify', verdict(reviewer.id), { agent: reviewer.id });+ assert.equal(accepted.result?.decision, 'ACCEPT', 'a seat the coordinator made outside the builder line verifies');+ // The literal rule holds for the coordinator too (decision 11096): its seats share its lineage.+ const own = submitted(board, 'coordinator', 'coordinator');+ const ownVerdict = move('verify', [own.item_id, { ...verdict(reviewer.id)[1], digest: own.item_frozen_digest }], { agent: reviewer.id });+ assert.equal(ownVerdict.error?.code, 'VERIFIER_STANDING', 'a coordinator-made seat cannot verify the coordinator\'s own work');+ assert.match(ownVerdict.error.message, /another machine's registration lineage, or the person/u);++ // The positive half of 11099: the coordinator on machine A builds; a seat from machine B's+ // registration lineage, or the person, verifies it, while machine A's own seats still cannot.+ const machineA = { agent: 'coordinator', root: true, lineage: '11111111-1111-4111-8111-111111111111' };+ const machineB = { agent: 'coordinator', root: true, lineage: '22222222-2222-4222-8222-222222222222' };+ /** Enroll one seat through a replayed, receipt-bound coordinator registration from one machine. */+ const enrollFrom = (sender, n) => {+ const target = `${lane}-${n}`;+ const digest = String(n % 10).repeat(64);+ const sequence = appliedSequence(board) + 1;+ const made = move('register', [{ lane, path: `/lineage-seat-${n}`, model: 'Lineage Seat', createdBy: 'coordinator', id: target }], sender,+ { registration: { target, creator: 'coordinator', sequence, digest }, digest });+ assert.equal(made.result, target, `machine ${sender.lineage.slice(0, 1)} enrolls ${target}`);+ return target;+ };+ const seatA = enrollFrom(machineA, 801);+ const seatB = enrollFrom(machineB, 802);+ /** Claim and submit one coordinator item through replayed moves from machine A. */+ const builtOnA = () => {+ const itemId = store.addItem(board, { by: 'coordinator', lane: 'coordinator', title: 'coordinator-built on machine A', criterion: 'another lineage accepts it' });+ const frozen = freezer()();+ assert.equal(move('claim', [itemId, { agentId: 'coordinator', lane: 'coordinator', leaseMs: 3_600_000, head: 'a'.repeat(40), frozen, freezeError: null }], machineA).error, undefined);+ assert.equal(move('submit', [itemId, { agentId: 'coordinator', commit: 'b'.repeat(40), tree: 'c'.repeat(40) }], machineA).error, undefined);+ return store.getItem(board, itemId);+ };+ const coordinatorItem = builtOnA();+ const accept = (item) => [item.item_id, { agentId: seatB, decision: 'ACCEPT', reason: 'CRITERION_MET', note: 'checked the proof', head: 'd'.repeat(40), digest: item.item_frozen_digest }];+ const sameLine = move('verify', [coordinatorItem.item_id, { ...accept(coordinatorItem)[1], agentId: seatA }], { agent: seatA });+ assert.equal(sameLine.error?.code, 'VERIFIER_STANDING', 'a seat from the building machine\'s own lineage is refused');+ const otherMachine = move('verify', accept(coordinatorItem), { agent: seatB });+ assert.equal(otherMachine.result?.decision, 'ACCEPT', 'a seat from another machine\'s registration lineage verifies coordinator-built work');+ const forPerson = builtOnA();+ const person = move('verify', [forPerson.item_id, { ...accept(forPerson)[1], agentId: seatA }], { kind: 'person', agent: undefined });+ assert.equal(person.result?.decision, 'ACCEPT', 'the person verifies coordinator-built work');+ });++ // 19 (bar corrections, #470) and 20 (implies, #469) are main's engines before #579; their journals replay as they did too.+ for (const engine of [11, 12, 19, 20]) await t.test(`an engine-${engine} journal replays as before`, (t) => {+ const directory = mkdtempSync(join(tmpdir(), `pullboard-mint-engine${engine}-`));+ t.after(() => rmSync(directory, { recursive: true, force: true }));+ const historical = store.openBoard(':memory:');+ t.after(() => store.closeBoard(historical));+ historical.executionEngineVersion = engine;+ store.register(historical, { lane: 'coordinator', path: '/repo' });+ const legacyBuilder = store.register(historical, { lane: 'web', path: '/repo-web-1', createdBy: 'machine' });+ const legacyReviewer = store.register(historical, { lane: 'web', path: '/repo-web-2' });+ delete historical.executionEngineVersion;+ assert.equal(store.agentCreator(historical, legacyBuilder), null, `engine ${engine} records no provenance`);+ const item = submitted(historical, legacyBuilder, 'web');+ const recorded = { version: 1, engine, id: `engine-${engine}-verify`, operation: 'verify',+ args: [item.item_id, { agentId: legacyReviewer, decision: 'ACCEPT', reason: 'CRITERION_MET', note: 'checked', head: 'd'.repeat(40), digest: item.item_frozen_digest }] };+ const boardId = 'e'.repeat(32);+ const path = join(directory, boardId + '.journal.sqlite');+ const db = new DatabaseSync(path);+ chmodSync(path, 0o600);+ db.exec(`CREATE TABLE journal_meta (key TEXT PRIMARY KEY, value TEXT NOT NULL);+ CREATE TABLE journal_record (sequence INTEGER PRIMARY KEY, received_at TEXT NOT NULL, kind TEXT NOT NULL CHECK(kind IN ('move','request')),+ payload BLOB NOT NULL, sender_kind TEXT NOT NULL CHECK(sender_kind IN ('person','agent','machine')), sender_user TEXT NOT NULL, sender_agent TEXT);+ CREATE TABLE journal_head (slot INTEGER PRIMARY KEY CHECK(slot=1), sequence INTEGER NOT NULL, last_activity_at TEXT);+ CREATE TABLE journal_snapshot (slot INTEGER PRIMARY KEY CHECK(slot=1), sequence INTEGER NOT NULL, received_at TEXT NOT NULL, payload BLOB NOT NULL,+ sender_kind TEXT NOT NULL, sender_user TEXT NOT NULL, sender_agent TEXT);`);+ db.prepare('INSERT INTO journal_meta (key,value) VALUES (?,?),(?,?)').run('board', boardId, 'format', '3');+ db.prepare("INSERT INTO journal_record VALUES (1,'2026-10-08T10:00:00.000Z','move',?,'agent','202',?)").run(Buffer.from(JSON.stringify(recorded)), legacyReviewer);+ db.prepare("INSERT INTO journal_head VALUES (1,1,'2026-10-08T10:00:00.000Z')").run();+ db.close();+ const journal = createRelayJournal({ directory, boardId });+ const [record] = journal.after();+ journal.close();+ assert.deepEqual(record.sender, { kind: 'agent', userId: '202', agent: legacyReviewer }, `the engine-${engine} record gains no stamp`);+ assert.equal(record.registration, undefined);+ assert.deepEqual(JSON.parse(record.bytes.toString('utf8')), recorded, 'its move bytes are unchanged');+ const fresh = store.openBoard(':memory:');+ t.after(() => store.closeBoard(fresh));+ const stamped = applyRelayMove(fresh, recorded, { sequence: 1, at: record.receivedAt, kind: 'move',+ sender: { ...record.sender, policy: VERIFIER_STANDING_ENGINE } });+ assert.equal(stamped.error?.code, 'ENGINE_VERSION', 'a newly stored record cannot claim an old engine');+ const replayed = applyRelayMove(historical, JSON.parse(record.bytes.toString('utf8')), { sequence: 1, at: record.receivedAt, kind: record.kind, sender: record.sender });+ assert.equal(replayed.error, undefined, `the engine-${engine} verdict replays with its old rules`);+ assert.equal(replayed.result.decision, 'ACCEPT');+ });++ await t.test('an unlinked board verifies exactly as before', (t) => {+ const local = store.openBoard(':memory:');+ t.after(() => store.closeBoard(local));+ store.register(local, { lane: 'coordinator', path: '/repo' });+ const localBuilder = store.register(local, { lane: 'web', path: '/repo-web-1', createdBy: 'machine' });+ const localReviewer = store.register(local, { lane: 'web', path: '/repo-web-2', createdBy: 'machine' });+ const item = submitted(local, localBuilder, 'web');+ const result = store.verify(local, item.item_id, { agentId: localReviewer, decision: 'ACCEPT', reason: 'CRITERION_MET', note: 'checked the proof',+ head: 'd'.repeat(40), digest: item.item_frozen_digest, policy: 'any' });+ assert.equal(result.decision, 'ACCEPT', 'an existing seat verifies another builder\'s item with no standing check');+ assert.equal(store.reviewOffer(local, { agentId: localReviewer, lane: 'web', ratio: 0 }), null, 'nothing left to review');+ });+});diff --cc test/relay-sealed.test.jsindex ee1a9ca5,b4c4050e..0117b479--- a/test/relay-sealed.test.js+++ b/test/relay-sealed.test.js@@@ -530,14 -531,12 +531,14 @@@ test('two real clients enforce the veriassert.equal(JSON.parse(refreshed.item_frozen).policy.version, 1, 'explicit refreeze repairs malformed captured policy metadata');assert.deepEqual(JSON.parse(refreshed.item_frozen).policy.verify, { policy: 'coordinator', family: 'require' }, 'explicit native refreeze upgrades the legacy claim policy');assert.notEqual(refreshed.item_frozen_digest, legacyDigest, 'explicit refreeze establishes a new digest for the newly captured policy');- store.submit(afterRefreeze, 1, { agentId: builderId, commit, tree, files: [] });+ submitFixture(afterRefreeze, 1, { agentId: builderId, commit, tree, files: [] });store.register(afterRefreeze, { lane: 'coordinator', path: box.root, family: 'Coordinator Family' });- store.register(afterRefreeze, { lane, path: join(box.directory, 'verifier-same'), family: 'Builder Family' });+ store.register(afterRefreeze, { lane, path: join(box.directory, 'verifier-same'), family: 'Builder Family', createdBy: 'coordinator' });verifierSame = store.agentAt(afterRefreeze, join(box.directory, 'verifier-same')).agent_id;- store.register(afterRefreeze, { lane, path: join(box.directory, 'verifier-other'), family: 'Reviewer Family' });+ store.register(afterRefreeze, { lane, path: join(box.directory, 'verifier-other'), family: 'Reviewer Family', createdBy: 'coordinator' });verifierOther = store.agentAt(afterRefreeze, join(box.directory, 'verifier-other')).agent_id;+ // These seats stand in for verifiers the coordinator enrolled through the relay (#579 standing).+ for (const seat of [verifierSame, verifierOther]) afterRefreeze.db.prepare('INSERT INTO board_meta (meta_key, meta_value) VALUES (?, ?)').run(`agent_enrolled:${seat}`, 'coordinator');/** Freeze test items with a specific historical policy document, keeping engine inputs deterministic. */const makeFrozen = (verify, version = 1) => item => {diff --cc test/team-engine.test.jsindex b0898885,33894970..00201ca9--- a/test/team-engine.test.js+++ b/test/team-engine.test.js@@@ -153,15 -154,13 +154,16 @@@ test('a landing snapshot binds the checbranch: 'refs/heads/main', root: '/fixture/landing', owner: 'fixture', logPath: '/fixture/landing.log',candidates: [entry], items: [entry], revision: 0 };const record = prepareEngineMove(one, 'recordLandingBatch', [{ agentId: 'coordinator', batch }], { id: 'checked-landing-snapshot' });+ assert.equal(VERDICT_REVIEW_ENGINE, 33, 'checked reviews retain their stable first engine');// A new move carries the writer's current engine; the checked-review feature only sets the minimum (17 Oct: pinning the// current version to the feature number broke every later engine item).- assert.equal(record.engine, ENGINE_VERSION);+ assert.equal(VERDICT_REVIEW_ENGINE, 33, 'checked compositions retain their stable introduction engine');+ assert.equal(record.engine, ENGINE_VERSION, 'new landing envelopes use the current writer independently of the feature minimum');assert.ok(record.engine >= VERDICT_REVIEW_ENGINE, 'the checked-review snapshot is written at or above its feature engine');const before = exportBoard(one);- assert.throws(() => applyEngineMove(one, { ...record, engine: 12 }, { sequence: 2, at: AT }), { code: 'RELAY_MOVE' });+ for (const engine of [12, VERDICT_REVIEW_ENGINE - 1]) {+ assert.throws(() => applyEngineMove(one, { ...record, engine }, { sequence: 2, at: AT }), { code: 'RELAY_MOVE' });+ }assert.deepEqual(exportBoard(one), before, 'a downgraded checked-head snapshot cannot mutate the prefix');assert.deepEqual(applyEngineMove(one, record, { sequence: 2, at: AT }), applyEngineMove(two, record, { sequence: 2, at: AT }));acceptAt(COMMIT, 3);