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
feat(checks): a check green on main waits for the person [C7,V4]
Corey Olson427b9824e6e5
diff --git a/docs/api.md b/docs/api.mdindex 282435fa..a4465f8a 100644--- a/docs/api.md+++ b/docs/api.md@@ -18,7 +18,7 @@ The memory hold is opt-in per machine with `"gate": { "memoryFloorMB": <n> }` inWhen `add` or `edit` supplies a new nonempty check, it records the item before measuring that check in a background temporary checkout of the captured `main` commit. Use `--wait` to wait for the measurement before returning, or `args.wait: true` for an HTTP add/edit move. The item returned by `add`, `edit`, `show`, and `next --verify` may include `item_check_baseline`: `{command, main, result, request?, seconds?, reason?, warning?}`. `main` is the commit id or `null`, and `result` is `pending`, `green`, `red`, or `unavailable`. A background request carries an opaque `request` identity; an older completion cannot overwrite a newly edited or cleared check.-An item's HTTP detail, and each item in the full board state, include `check` and, when recorded, `checkBaseline` with the same observation fields. A green result carries `warning: "CRITERION_PROVES_NOTHING"`; text output names that warning when showing or reserving the item for review, and when filing it with `--wait`. An exact match with the project gate configured at that main commit records green with `reason: "repo gate"` without running it again. A missing main records unavailable with `reason: "no main"` and still files the item. Changing the check replaces this observation; clearing it removes the observation. Captured observations and completions travel through ordered board moves, so replicas store results without executing commands. A completed result awaiting relay delivery stays on the measuring device and is retried by the next normal CLI command.+An item's HTTP detail, and each item in the full board state, include `check` and, when recorded, `checkBaseline` with the same observation fields. A green result carries `warning: "CRITERION_PROVES_NOTHING"`. When accepted main's `pullboard.json` sets `checks.provesNothing` to `"hold"` (`pullboard init` writes it for new boards), claim and submit refuse that item with `CRITERION_PROVES_NOTHING` until the check changes to one whose baseline is not green, or the person accepts the check as it reads with `pullboard check accept <id>`, or the local view sends `check-accept` with the item. The acceptance carries the check's SHA-256 digest, so a changed check needs a new one; it refuses agent shells, remote shells, agent worktrees, the API channel and MCP. With no setting it stays a warning: text output names it when showing or reserving the item for review, and when filing it with `--wait`. An exact match with the project gate configured at that main commit records green with `reason: "repo gate"` without running it again. A missing main records unavailable with `reason: "no main"` and still files the item. Changing the check replaces this observation; clearing it removes the observation. Captured observations and completions travel through ordered board moves, so replicas store results without executing commands. A completed result awaiting relay delivery stays on the measuring device and is retried by the next normal CLI command.`pullboard stats [--since <date>] --json` returns `{version: 1, stats: {...}}` from the append-only event log. `submissions` and `rejections` count moves, including repeated attempts; `rejectionShare` is rejections divided by submissions (zero when the window has no submissions). `merged` counts distinct items with a merge move; `mergedWithoutAccept` counts those whose merge lacks an earlier acceptance of the latest submitted commit. That audit uses earlier history even when the acceptance falls before the selected window. Current item and verdict rows do not replace event evidence.@@ -87,6 +87,7 @@ For example: `flow: review wait average 61 min (1 measured; > 60 min); bottlenec| `sweep` | `version:number`, `messages:array` || `next` | `version:number`, `item:object`, `review:boolean`, `held:boolean`, `shared:array` || `check` | `version:number`, `id:number`, `green:boolean`, `seconds:number`, `check:string`, `report:string` |+| `check accept` | `version:number`, `id:number`, `digest:string`, `check:string` || `claim` | `version:number`, `id:number`, `renewed:boolean`, `leaseUntil:string`, `digest:string` || `hold` | `version:number`, `lane:string`, `held:boolean` || `release` | `version:number`, `id:number` |diff --git a/docs/formats.md b/docs/formats.mdindex 08417b90..3c04e090 100644--- a/docs/formats.md+++ b/docs/formats.md@@ -102,7 +102,7 @@ The board file is in the repository's Git common directory at `.git/pullboard/bo| `row grammar` | `1` | `SPEC_GRAMMAR_VERSION` in `src/spec.js`; optional `<!-- pullboard-grammar N -->` line in either file (absence means the current grammar) | Both files share the version. A declared version must match; an incompatible grammar change requires a coordinated version bump and compatible files. No automatic conversion occurs. || `board schema` | `2` | `SCHEMA_VERSION` in `src/board.js`, persisted as `PRAGMA user_version` | Create missing tables and indexes, add missing columns in place with declared defaults, restore missing or changed triggers, and remove stale machine triggers without replacing rows. || `event log` | `1` | `EVENT_LOG_VERSION` in `src/board.js`, persisted in `board_meta` as `event_log_version` | Older event-log versions upgrade in place; newer versions are refused with `EVENT_LOG_VERSION`. Preserve event rows when the board schema changes. |-| `move engine` | `12` | `ENGINE_VERSION` in `src/machine.js`, carried as `engine` in every sealed executable move | Bump when a move's meaning changes, independently of the event log and sealed envelope. A newer engine is refused with `ENGINE_VERSION`, naming both versions and asking you to upgrade Pullboard. |+| `move engine` | `24` | `ENGINE_VERSION` in `src/machine.js`, carried as `engine` in every sealed executable move | Bump when a move's meaning changes, independently of the event log and sealed envelope. A newer engine is refused with `ENGINE_VERSION`, naming both versions and asking you to upgrade Pullboard. |<!-- format-versions:end -->Pullboard 0.6.1 released engine 1. Engine 2 records a fresh explicit-build claim's skipped-review snapshot. Pullboard 0.8.1 released engine 3, including lane-sensitive graft refusals and authenticated relay senders. Engine 4 adds captured background-baseline completions through `completeCheckBaseline`; released engine-3 clients stop with `ENGINE_VERSION` before interpreting this new operation or advancing their replay cursor. Engine 5 requires a one-line reason when releasing a review and gives that reviewer a one-hour cooldown for the current submission. Each sealed move replays under its recorded engine version: engines 1 through 4 retain the original release event and review-reservation behavior. Engine 5 retains support for older moves, including engine-4 baseline completions. Pullboard 0.8.3 released engine 6, adding board-scoped machine credentials and permitting machine execution only for one exact, earlier authenticated phone request, including its payload digest. Engine 7 adds ordered item holds through `holdItem` and `releaseItemHold`; engine-6 clients stop with `ENGINE_VERSION` before interpreting either operation or advancing their replay cursor. Engine 8, shared by the 0.8.5 move changes, retains merged-item exception notes, selects the next review in roadmap order, and adds coordinator-only `reopen` for a submission returned without a verdict; engine-7 clients stop with `ENGINE_VERSION` before interpreting this new operation or advancing their replay cursor. Recorded engines 1 through 7 retain their original tier-first review selection. Engine 8 also adds durable refusal recovery for blocked relay positions; each explicit skip publishes the readable prefix even when another unsupported record follows. Engine 8 also permits coordinator criterion/check edits on a live claim as pending corrections; the holder cannot renew or submit until a refreeze adopts the correction while preserving the claim. Older request receipts retain their recorded engine semantics. Upgrade every linked device before using the new moves. Each release shares one engine bump across its changed moves. Engine 8 also retains declared model labels on registration and records each registered agent move's model snapshot; engines 1 through 7 retain their original registration and event details without these model fields. Pullboard 0.8.8 released engine 9, which allows resubmitting the same rejected commit after a corrected criterion is refrozen, but only when the rejection names a different frozen digest. Engine 8 retains its HEAD_NOT_NEW refusal and prior submit-event detail. Engine-9 submit events add `criterionDigest`, and engine-8 boards replay with the original refusal and event history.@@ -113,6 +113,8 @@ Engine 11 permits resubmitting the same commit after a coordinator no-verdict reEngine 12 records declined person row decisions without replacing the exact source text: the row becomes `wont` and the reason stays in the decision record. Engine-11 decline receipts retain their original reason-as-row-text validation and replay outcome. Engine-11 clients refuse engine-12 moves before interpreting them; upgrade linked clients before recording new decline decisions.+Engine 24 adds the person's `acceptCheck`: an item's current check, named by its SHA-256 digest, accepted so a check already green on main no longer holds the item on a board whose `checks.provesNothing` is `"hold"`. Only the person may send it, from the terminal or the view; the relay refuses it from an agent or a machine. A move from an older engine is refused before it changes the board or replay cursor, and older clients refuse engine-24 moves before interpreting them.+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, includingrevoked 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;diff --git a/docs/lifecycle.md b/docs/lifecycle.mdindex 4d6325e6..b1c3a68e 100644--- a/docs/lifecycle.md+++ b/docs/lifecycle.md@@ -51,10 +51,10 @@ Each move checks its guards in this order and refuses with the first one that do| Move | From | To | Who | Guards, in order; result refusals || --- | --- | --- | --- | --- |-| claim | open, claimed | claimed | agent, coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_CLAIMABLE), 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) |+| 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), 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), 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), gateGreen (GATE_RED or PIPEFAIL_UNAVAILABLE), treeStillDuringGate (MOVED_DURING_GATE), 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 | 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), 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), itemCheckGreen (CHECK_RED or CHECK_UNVERIFIED), proofNoted (PROOF_REQUIRED), result (LAND_HEADER) || reject | submitted | 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), notBuilder (SELF_VERIFY), routeAllows (ROUTE), policyAllows (COORDINATOR_VERIFIES), familyAllows (O2_FAMILY_MATCH), reviewFree (REVIEW_HELD), criterionUnchanged (CRITERIA_CHANGED), reasonCoded (BAD_REASON), noteGiven (NOTE_REQUIRED), result (LAND_HEADER) |@@ -124,6 +124,7 @@ Each move checks its guards in this order and refuses with the first one that do| RATCHET_UNCOUNTED | every touched doctrine check counts (exit 0 or 1), none rises above its committed count and no changed file gains a problem; watch-mode rules only count, only when accepted main has an approved doctrine rule with gate: check | fix the check so it exits 0 or 1 within its timeout, then submit again || CHECK_RED | the frozen item check passes at the exact submitted commit | reject the failing behavior; the builder fixes and resubmits || CHECK_UNVERIFIED | the frozen item check passes at the exact submitted commit | restore the frozen install or check environment and retry |+| CRITERION_PROVES_NOTHING | the item's check does not already pass on main, or the person accepted that exact check, only when accepted main sets checks.provesNothing to "hold" | set a check that fails before the work, or the person runs pullboard check accept <id> || GATE_RED | the gate, which submit runs itself every time, is green at HEAD | fix what the digest names, commit, submit again || PIPEFAIL_UNAVAILABLE | the gate, which submit runs itself every time, is green at HEAD | rewrite the gate without a pipe || MOVED_DURING_GATE | when the gate ends, HEAD and every tracked file are as they were when it started | leave the worktree alone until the gate finishes, then submit again |diff --git a/src/api-moves.js b/src/api-moves.jsindex efc7f29c..9636aeb7 100644--- a/src/api-moves.js+++ b/src/api-moves.js@@ -6,6 +6,7 @@ const MOVES = {'spec-approve': { prefix: ['spec', 'approve'], positions: ['ids'], flags: ['by', 'text'] },'spec-decline': { prefix: ['spec', 'decline'], positions: ['ids'], flags: ['reason'] },'spec-answer': { prefix: ['spec', 'answer'], positions: ['row', 'answer'] },+ 'check-accept': { prefix: ['check', 'accept'], item: true },add: { positions: ['lane', 'title'], flags: ['criterion', 'specs', 'parent', 'after', 'brief', 'route', 'check'], booleans: ['wait'], booleans: ['wait'] },edit: { item: true, flags: ['criterion', 'brief', 'route', 'check'], booleans: ['wait'], booleans: ['wait'] },fact: { item: true, positions: ['kind', 'text'], flags: ['supersedes', 'ref'] },diff --git a/src/board.js b/src/board.jsindex a0f677e4..a6c2f7b9 100644--- a/src/board.js+++ b/src/board.js@@ -16,6 +16,7 @@ import { COORDINATOR } from './config.js';import { ENGINE_VERSION, GUARDS, IN_STATE, MOVES, STATES, UNKNOWN_MOVE, effectiveGuards, storeTriggers } from './machine.js';import { Refused } from './refused.js';import { parseSpec } from './spec.js';+export { acceptCheck } from './check-accept.js';export const ACCEPT_REASON = 'CRITERION_MET';export const PERSON = 'person';@@ -425,15 +426,13 @@ export function atomic(board, work) {* @param {number | null} itemId* @param {object} [detail]*/-function logEvent(board, by, kind, itemId, detail = {}) {+export function logEvent(board, by, kind, itemId, detail = {}) {const model = agentModel(board, by);const isAgent = Boolean(board.db.prepare('SELECT 1 FROM agent WHERE agent_id = ?').get(by));const recorded = (board.executionEngineVersion ?? ENGINE_VERSION) >= 8 && isAgent? { ...detail, model: model ?? 'unknown' } : detail;const inserted = board.db- .prepare(- 'INSERT INTO event (event_at, event_by, event_kind, item_id, event_detail) VALUES (?, ?, ?, ?, ?)',- )+ .prepare('INSERT INTO event (event_at, event_by, event_kind, item_id, event_detail) VALUES (?, ?, ?, ?, ?)').run(now(board), by, kind, itemId, JSON.stringify(recorded));board.lastEvent = board.db.prepare('SELECT * FROM event WHERE event_id = ?').get(inserted.lastInsertRowid);(board.emittedEvents ??= []).push(board.lastEvent);@@ -1053,7 +1052,7 @@ export function claim(board, id, { agentId, lane, leaseMs, freeze, head = null,let frozen = null;const item = moveItem(board, id, 'claim', {checks: {- joined: null,+ joined: null, checkProvesSomething: null,[IN_STATE]: (found) => new Refused('NOT_CLAIMABLE', `item #${id} is ${found.item_status}`),inLane: (found) => {if (found.item_lane === lane) return null;@@ -1191,7 +1190,7 @@ export function submit(board, id, { agentId, commit, tree, files = [], policyComconst notYours = () => new Refused('NOT_YOURS', `item #${id} is not claimed by you; claim it first`);moveItem(board, id, 'submit', {checks: {- joined: null,+ joined: null, checkProvesSomething: null,[IN_STATE]: notYours,isHolder: (found) => (found.item_owner === agentId ? null : notYours()),correctionRefrozen: () => pendingRefreezeProblem(board, id),diff --git a/src/check-accept.js b/src/check-accept.jsnew file mode 100644index 00000000..9d2d5bc6--- /dev/null+++ b/src/check-accept.js@@ -0,0 +1,89 @@+/**+ * A check that already passes on main proves nothing, so a board that asks for it holds the item+ * until the person accepts that exact check [V2,V4,B26].+ */+import { createHash } from 'node:crypto';+import { PERSON, atomic, itemById, logEvent } from './board.js';+import { Refused } from './refused.js';++/** The engine that first replays a person's check acceptance; older engines refuse the move unread [H16]. */+export const CHECK_ACCEPT_ENGINE = 24;++/** The setting value that turns today's warning into a hold. */+export const PROVES_NOTHING_HOLD = 'hold';++/**+ * Digest one check's exact text. An acceptance names this digest, so it binds to the words the+ * person read and cannot carry over to a different check.+ *+ * @param {string} command+ * @returns {string}+ */+export function checkDigest(command) {+ return createHash('sha256').update(String(command)).digest('hex');+}++/**+ * Record the person's acceptance of an item's current check, as an ordered board move.+ * Only the person, from the terminal or the view, may make it; the digest must match the check+ * the item carries now, so an acceptance prepared for one check cannot land on another.+ *+ * @param {any} board+ * @param {number} id+ * @param {{ agentId: string, channel: string, digest: string }} who+ * @returns {{ id: number, digest: string, check: string }}+ */+export function acceptCheck(board, id, { agentId, channel, digest }) {+ if (agentId !== PERSON) throw new Refused('CHECK_ACCEPT_PERSON_ONLY', 'only the person accepts a check that already passes on main; ask the coordinator to bring it to the person');+ if (!['terminal', 'view'].includes(channel)) throw new Refused('B26_PERSON_CHANNEL', 'a check acceptance uses the person’s terminal or view; run pullboard view');+ return atomic(board, () => {+ const item = itemById(board, id);+ if (!item.item_check) throw new Refused('NO_CHECK', `#${id} has no check command to accept; its proof is the project gate`);+ if (typeof digest !== 'string' || digest !== checkDigest(item.item_check)) {+ throw new Refused('CHECK_ACCEPT_STALE', `#${id}'s check changed since this acceptance was prepared; read the current check with pullboard show ${id} and accept it again`);+ }+ logEvent(board, PERSON, 'check_accept', id, { digest, channel });+ return { id, digest, check: item.item_check };+ });+}++/**+ * The person's live acceptance of the item's current check, or null.+ * It counts only when its digest names the current check text and no later edit set a+ * different check, so changing the check (even back to an old one) needs a new acceptance.+ *+ * @param {any} board+ * @param {any} item+ * @returns {{ event: number, digest: string } | null}+ */+export function checkAcceptance(board, item) {+ if (!item?.item_check) return null;+ const digest = checkDigest(item.item_check);+ const rows = board.db.prepare("SELECT event_id, event_by, event_kind, event_detail FROM event WHERE item_id = ? AND event_kind IN ('check_accept', 'edit') ORDER BY event_id").all(item.item_id);+ let accepted = null;+ for (const row of rows) {+ const detail = JSON.parse(row.event_detail);+ if (row.event_kind === 'check_accept' && row.event_by === PERSON && detail.digest === digest) accepted = { event: row.event_id, digest };+ else if (row.event_kind === 'edit' && Object.hasOwn(detail, 'check') && detail.check !== item.item_check) accepted = null;+ }+ return accepted;+}++/**+ * Refuse a claim or submit whose check already passes on main, when the board's+ * checks.provesNothing setting is "hold" and the person has not accepted that check.+ * With no setting the green baseline stays a warning, as on boards made before the setting.+ *+ * @param {() => any} mainConfig - reads accepted main's config, so a worktree's uncommitted edit cannot+ * lift the hold; called only for a green, unaccepted check, so other claims never read main for it+ * @param {any} board+ * @param {any} item - as getItem returns it, with item_check_baseline+ */+export function refuseProvesNothing(mainConfig, board, item) {+ const base = item?.item_check_baseline;+ if (base?.result !== 'green' || base.command !== item.item_check || checkAcceptance(board, item)) return;+ if (mainConfig()?.checks?.provesNothing !== PROVES_NOTHING_HOLD) return;+ throw new Refused('CRITERION_PROVES_NOTHING',+ `#${item.item_id} is held: its check already passes on main ${String(base.main).slice(0, 12)}, so it proves nothing: ${base.command}`,+ `the coordinator sets a check that fails before the work (pullboard edit ${item.item_id} --check "<command>"), or the person accepts this one: pullboard check accept ${item.item_id}`);+}diff --git a/src/cli.js b/src/cli.jsindex 4e4dbff7..51ef5eaa 100644--- a/src/cli.js+++ b/src/cli.js@@ -62,6 +62,7 @@ import {import { answerQuestion, bundledBlueprints, planBlueprint, readBlueprint, saveBlueprint } from './blueprints.js';import { briefFiles } from './brief.js';import { checkBaseline, prepareCheckBaseline, refuseCheckSyntax, sayCheckBaseline } from './check-baseline.js';+import { checkDigest, refuseProvesNothing } from './check-accept.js';import { retryCheckBaselines, startCheckBaseline } from './check-baseline-worker.js';import { compareMainFailures, mainRedMessage, mainRedReworkItems } from './main-red.js';import { runItems } from './run.js';@@ -2244,6 +2245,7 @@ async function submitHere(ctx, id) {const policy = itemPolicy(root, held);const acceptedMain = mainPolicy(root);ctx = { ...ctx, config: policy.config };+ withBoard(ctx, (board) => refuseProvesNothing(() => acceptedMain.config, board, store.getItem(board, id)));const dependencies = withBoard(ctx, board => dependencySnapshots(board.db, held));submissionPaths(root, held, headCommit(root), { mainCommit: acceptedMain.commit, dependencies });const { me, claimHead } = withBoard(ctx, (board) => {@@ -2318,6 +2320,27 @@ async function submitHere(ctx, id) {log: gate.log, profile: gate.profile, profilePath: gate.profilePath, proofLog: gate.proofLog, proofProfilePath: gate.proofProfilePath }, doctrine);}+/**+ * The person accepts an item's check as it reads now, which lifts a hold on a check already green+ * on main. A person-only move (P6): an agent shell, a remote shell, a worktree, the API and MCP are+ * refused, and the move carries the check's digest so a changed check needs a new acceptance.+ */+async function checkAccept(io, first, rest) {+ requirePersonChannel(io.personChannel);+ if (!/^#?\d+$/u.test(first ?? '') || rest.length) throw new Refused('USAGE', 'pullboard check accept <id>');+ const ctx = context(io);+ return withBoard(ctx, async (board) => {+ if (!ctx.info.isMain || whoAmI(ctx, board).id !== COORDINATOR) throw new Refused('B26_PERSON_APPROVAL', 'only the person accepts a check, from the main checkout or the view', 'ask the person to accept it in pullboard view, or in their own terminal at the main checkout');+ const item = store.getItem(board, idArg(first));+ if (!item.item_check) throw new Refused('NO_CHECK', `#${item.item_id} has no check command to accept; its proof is the project gate: pullboard gate`);+ const accepted = await ordered(ctx, board, 'acceptCheck', [item.item_id, { agentId: store.PERSON, channel: io.personChannel ?? 'terminal', digest: checkDigest(item.item_check) }]);+ io.result?.({ id: accepted.id, digest: accepted.digest, check: accepted.check });+ io.say(`accepted #${accepted.id}'s check as it reads now: ${accepted.check}`);+ io.say('a changed check needs the person to accept it again');+ return 0;+ });+}+/** Report and pin the original submitted commit, including a recovered acknowledged outcome. */function reportSubmission(ctx, id, commit, gate, doctrine = []) {const { root } = ctx.info;@@ -2961,6 +2984,7 @@ function workCommands(io, args) {sweep: () => act((ctx, board, me) => sweepHere(ctx, board, me, values)),next: () => nextHere(io, { ...values, verifyId: first }),check: async () => {+ if (first === 'accept') return checkAccept(io, second, rest);const ctx = context(io);const { item, author, caller, agents } = withBoard(ctx, (board) => {const me = first ? (ctx.info.isMain ? { id: COORDINATOR } : { id: store.agentAt(board, ctx.info.root)?.agent_id }) : whoAmI(ctx, board);@@ -3003,6 +3027,8 @@ function workCommands(io, args) {},claim: () => act(async (ctx, board, me) => {const id = idArg(first);+ const claimable = store.getItem(board, id);+ if (['open', 'claimed'].includes(claimable.item_status)) refuseProvesNothing(() => mainPolicy(ctx.info.root).config, board, claimable);let result;for (;;) {try {diff --git a/src/config.js b/src/config.jsindex 63355376..5b1c28b9 100644--- a/src/config.js+++ b/src/config.js@@ -186,6 +186,11 @@ export function configProblems(config) {if (typeof config.check !== 'object' || config.check === null || Array.isArray(config.check)) {problems.push('"check" is an object with optional "install" and "timeout" fields');}+ // Absent, a check already green on main is only a warning, as on boards made before the setting.+ if (config.checks !== undefined && (typeof config.checks !== 'object' || config.checks === null || Array.isArray(config.checks)+ || Object.keys(config.checks).some((key) => key !== 'provesNothing') || !['hold', 'warn'].includes(config.checks.provesNothing))) {+ problems.push('"checks" is { "provesNothing": "hold" or "warn" }: "hold" refuses claim and submit while an item\'s check already passes on main');+ }if (typeof config.check?.install !== 'string') problems.push('"check.install" is an install command string');const timeout = typeof config.check?.timeout === 'string' ? CHECK_TIMEOUT_RE.exec(config.check.timeout) : null;const timeoutMs = timeout ? Number(timeout[1]) * CHECK_TIMEOUT_MS[timeout[2]] : NaN;diff --git a/src/engine.js b/src/engine.jsindex 4948b094..3c1c9190 100644--- a/src/engine.js+++ b/src/engine.js@@ -2,12 +2,13 @@import { createHash, randomUUID } from 'node:crypto';import * as store from './board.js';import { recordedRefusal } from './recorded-refusal.js';+import { CHECK_ACCEPT_ENGINE } from './check-accept.js';import { ENGINE_VERSION } from './machine.js';import { Refused } from './refused.js';import { requestMoveProblem, recordRequestMove } from './relay-requests.js';import { relayMoveActor, relaySenderProblem, validRelaySender } from './relay-sender.js';-const ITEM_ID_FIRST_ARGUMENT = new Set(['editItem', 'escalate', 'recordAttempt', 'claim', 'release', 'submit', 'reserveReview', 'verify', 'merged', 'withdraw', 'refreeze', 'reopen', 'appendFact']);+const ITEM_ID_FIRST_ARGUMENT = new Set(['acceptCheck', 'editItem', 'escalate', 'recordAttempt', 'claim', 'release', 'submit', 'reserveReview', 'verify', 'merged', 'withdraw', 'refreeze', 'reopen', 'appendFact']);/** Only these public board operations may be requested by an encrypted move. */export const ENGINE_OPERATIONS = Object.freeze([@@ -16,11 +17,11 @@ export const ENGINE_OPERATIONS = Object.freeze(['withdraw', 'refreeze', 'reopen', 'shout', 'passDecision', 'answerDecision', 'holdLane', 'releaseLane', 'holdItem', 'releaseItemHold','addMilestone', 'editMilestoneItems', 'moveMilestone', 'editMilestone', 'removeMilestone','recordRowDecisions', 'applyRowDecisions', 'appendFact',- 'recordLandingBatch', 'recordLandingWaiver', 'recordLandingFlake', 'finishLandingBatch',+ 'recordLandingBatch', 'recordLandingWaiver', 'recordLandingFlake', 'finishLandingBatch', 'acceptCheck',]);/** Engine version at which each ordered operation first has stable replay semantics. */-const OPERATION_ENGINE = Object.freeze({ reopen: 8, recordLandingBatch: 8, recordLandingWaiver: 8, recordLandingFlake: 8, finishLandingBatch: 8 });+const OPERATION_ENGINE = Object.freeze({ reopen: 8, recordLandingBatch: 8, recordLandingWaiver: 8, recordLandingFlake: 8, finishLandingBatch: 8, acceptCheck: CHECK_ACCEPT_ENGINE });/** Dependency edits add engine-10 meaning without changing ordinary historical edit envelopes. */function minimumOperationEngine(operation, args) {diff --git a/src/help.js b/src/help.jsindex ce71173b..0821a2b4 100644--- a/src/help.js+++ b/src/help.js@@ -87,6 +87,8 @@ Workin the main checkout, verifying needs --as coordinatorpullboard check [id] [--yes] show and run your item's check; --yes confirms a check set by someone elsethe command and its author print first; the project gate is pullboard gate+ pullboard check accept <id> the person accepts an item's check that already passes on main, as it reads now;+ with checks.provesNothing "hold", claim and submit refuse that item until thenpullboard claim <id> take or renew a lease; the first claim freezes the criterionpullboard release <id> [--note "why"] hand it back; a review release needs a one-line reasonpullboard submit <id> needs a clean tree, item check and affected tests green at HEAD (alias: done)@@ -190,7 +192,7 @@ Reject reasons: TEST_FAILURE, BEHAVIOR_MISMATCH, INSUFFICIENT_EVIDENCE, STALE_HEconst HELP_NAMES = ['tour', 'init', 'worktree', 'join', 'takeover', 'whoami', 'lanes', 'lane', 'lane add', 'status', 'resources', 'settings', 'view', 'view export','serve', 'mcp', 'relay', 'relay recover', 'resume', 'hooks', 'add', 'edit', 'escalate', 'run', 'list', 'doctor', 'skills', 'show', 'next', 'land',- 'check', 'claim', 'release', 'submit', 'done', 'verify', 'fact', 'shout', 'answer', 'pass', 'decisions', 'inbox', 'export', 'import',+ 'check', 'check accept', 'claim', 'release', 'submit', 'done', 'verify', 'fact', 'shout', 'answer', 'pass', 'decisions', 'inbox', 'export', 'import','sweep', 'merged', 'withdraw', 'refreeze', 'reopen', 'hold', 'stats', 'ledger', 'log', 'spec', 'spec check', 'spec view','spec show', 'spec unmet', 'spec signoff', 'spec draft', 'spec signers', 'spec signers add', 'doctrine', 'doctrine check', 'forget', 'prompt', 'gate', 'hook','hook pre-commit', 'hook pre-merge-commit', 'hook commit-msg', 'hook pre-push', 'view export', 'version', 'lifecycle', 'help',diff --git a/src/json.js b/src/json.jsindex 8bbba358..d666cdeb 100644--- a/src/json.js+++ b/src/json.js@@ -49,6 +49,7 @@ export const JSON_SHAPES = {sweep: shape({ messages: 'array' }),next: shape({ item: 'object', review: 'boolean', held: 'boolean', shared: 'array' }),check: shape({ id: 'number', green: 'boolean', seconds: 'number', check: 'string', report: 'string' }),+ 'check accept': shape({ id: 'number', digest: 'string', check: 'string' }),claim: shape({ id: 'number', renewed: 'boolean', leaseUntil: 'string', digest: 'string' }),hold: shape({ lane: 'string', held: 'boolean' }),release: shape({ id: 'number' }),diff --git a/src/machine.js b/src/machine.jsindex 71b60afe..2fc8df86 100644--- a/src/machine.js+++ b/src/machine.js@@ -10,7 +10,7 @@*//** Executable move semantics, carried by every sealed move and retained during replay [H16]. */-export const ENGINE_VERSION = 12;+export const ENGINE_VERSION = 24;/** @typedef {'agent' | 'coordinator' | 'clock'} Role */@@ -124,6 +124,7 @@ export const GUARDS = [{ id: 'doctrineHolds', refuse: 'RATCHET_ROSE', alsoRefuses: [{ code: 'RATCHET_UNCOUNTED', next: 'fix the check so it exits 0 or 1 within its timeout, then submit again' }], rule: "every touched doctrine check counts (exit 0 or 1), none rises above its committed count and no changed file gains a problem; watch-mode rules only count", next: "fix the new problems, commit, submit again; only the person's signature raises count:", source: 'cli', when: 'only when accepted main has an approved doctrine rule with gate: check' },{ id: 'itemCheckGreen', refuse: 'CHECK_RED', alsoRefuses: [{ code: 'CHECK_UNVERIFIED', next: 'restore the frozen install or check environment and retry' }], rule: 'the frozen item check passes at the exact submitted commit', next: 'reject the failing behavior; the builder fixes and resubmits', source: 'cli' },+ { id: 'checkProvesSomething', refuse: 'CRITERION_PROVES_NOTHING', rule: "the item's check does not already pass on main, or the person accepted that exact check", next: 'set a check that fails before the work, or the person runs pullboard check accept <id>', source: 'cli', when: 'only when accepted main sets checks.provesNothing to "hold"' },{ id: 'gateGreen', refuse: 'GATE_RED', alsoRefuses: [{ code: 'PIPEFAIL_UNAVAILABLE', next: 'rewrite the gate without a pipe' }], rule: 'the gate, which submit runs itself every time, is green at HEAD', next: 'fix what the digest names, commit, submit again', source: 'cli' },{ id: 'treeStillDuringGate', refuse: 'MOVED_DURING_GATE', rule: 'when the gate ends, HEAD and every tracked file are as they were when it started', next: 'leave the worktree alone until the gate finishes, then submit again', source: 'cli' },{ id: 'childrenDone', refuse: 'CHILDREN_OPEN', rule: 'every child item is verified or withdrawn', next: 'finish the child items, or the coordinator withdraws them', source: 'board' },@@ -147,7 +148,7 @@ export const GUARDS = [export const MOVES = [{verb: 'claim', from: ['open', 'claimed'], to: 'claimed', by: ['agent', 'coordinator'], refuse: 'NOT_CLAIMABLE',- guards: ['joined', 'itemExists', IN_STATE, 'itemNotHeld', 'inLane', 'routeAllows', 'dependenciesVerified', 'notHeldByAnother', 'correctionRefrozen', 'laneOpen', 'oneLiveClaim', 'rowsInForce'],+ guards: ['joined', 'itemExists', IN_STATE, 'checkProvesSomething', 'itemNotHeld', 'inLane', 'routeAllows', 'dependenciesVerified', 'notHeldByAnother', 'correctionRefrozen', 'laneOpen', 'oneLiveClaim', 'rowsInForce'],sets: ['item_owner', 'item_lease_until', 'item_frozen_digest'], command: 'pullboard claim <id>',},{@@ -157,7 +158,7 @@ export const MOVES = [{ verb: 'lapse', from: ['claimed'], to: 'open', by: ['clock'], guards: [], when: 'its lease runs out' },{verb: 'submit', from: ['claimed'], to: 'submitted', by: ['agent', 'coordinator'], refuse: 'NOT_YOURS',- guards: ['joined', 'itemExists', IN_STATE, 'isHolder', 'correctionRefrozen', 'criterionUnchanged', 'treeClean', 'nothingUntracked', 'hasCommit', 'withinLane', 'trunkMergeClean', 'noUnverifiedStack', 'doctrineHolds', 'gateConfigured', 'gateGreen', 'treeStillDuringGate', 'childrenDone', 'headIsNew'],+ guards: ['joined', 'itemExists', IN_STATE, 'isHolder', 'correctionRefrozen', 'checkProvesSomething', 'criterionUnchanged', 'treeClean', 'nothingUntracked', 'hasCommit', 'withinLane', 'trunkMergeClean', 'noUnverifiedStack', 'doctrineHolds', 'gateConfigured', 'gateGreen', 'treeStillDuringGate', 'childrenDone', 'headIsNew'],sets: ['item_built_by', 'item_commit'], command: 'pullboard submit <id>',},{diff --git a/src/mcp.js b/src/mcp.jsindex cb8791ec..b0c073ee 100644--- a/src/mcp.js+++ b/src/mcp.js@@ -21,9 +21,9 @@ export const MCP_CHANNEL = 'mcp';/*** Tool names that read as a person's own move: approving or declining rows, answering a decision,- * signing off. Matched anywhere in the normalized name, so a client cannot reach one by renaming it.+ * signing off, accepting a check that already passes on main. Matched anywhere in the normalized name, so a client cannot reach one by renaming it.*/-const PERSON_MOVE = /approv|declin|answer|sign_?off|decide|decision/u;+const PERSON_MOVE = /approv|declin|answer|sign_?off|decide|decision|check_?accept/u;/** The tools this server offers: name, what it does, and its exact input schema. */export const MCP_TOOLS = Object.freeze([@@ -109,7 +109,7 @@ function normalizedToolName(name) {*/export function refusePersonMove(name) {if (!PERSON_MOVE.test(normalizedToolName(name))) return;- throw new Refused('HUMAN_REQUIRED', `${name} is a person's move; approving or declining rows, answering decisions and signing off come only from the person, never through MCP; ask your coordinator to bring it to the person, with the shout tool or pullboard shout coordinator --decision`);+ throw new Refused('HUMAN_REQUIRED', `${name} is a person's move; approving or declining rows, answering decisions, accepting checks and signing off come only from the person, never through MCP; ask your coordinator to bring it to the person, with the shout tool or pullboard shout coordinator --decision`);}/**diff --git a/src/next-steps.js b/src/next-steps.jsindex 0958f3cd..604e2561 100644--- a/src/next-steps.js+++ b/src/next-steps.js@@ -79,6 +79,8 @@ export const NEXT_STEPS = Object.freeze({CANNOT_SIGN: 'sign only approved rows: pullboard spec signoff <approved ids>',CHECKOUT_SESSION: 'run pullboard takeover from the agent session that owns this checkout',CHECK_SYNTAX: 'close the quote the shell names, then set the check again: inside single quotes write an apostrophe as \'\\\'\' or match it with ., and test with sh -n -c "<command>"',+ CHECK_ACCEPT_PERSON_ONLY: 'ask the coordinator to bring the check to the person: pullboard shout coordinator "#<id> needs the person to accept its check" --decision',+ CHECK_ACCEPT_STALE: 'read the current check with pullboard show <id>, then the person accepts it again: pullboard check accept <id>',CHECK_CANNOT_FAIL: 'write a check that exits nonzero on the problem, then add the item again',CHECK_CONFIRM: 'read the check command, then run pullboard check <id> --yes',CHECK_RED: 'reject with what failed: pullboard verify <id> reject --reason TEST_FAILURE --note "<what failed>"',@@ -92,6 +94,7 @@ export const NEXT_STEPS = Object.freeze({COORDINATOR_ONLY: 'ask the coordinator to do it: pullboard shout coordinator "<what you need>"',COORDINATOR_VERIFIES: 'leave the review to the coordinator; shout it when the item is ready: pullboard shout coordinator "#<id> is ready to verify"',CRITERIA_CHANGED: 'ask the coordinator to refreeze it: pullboard shout coordinator "please refreeze #<id>"',+ CRITERION_PROVES_NOTHING: 'set a check that fails before the work: pullboard edit <id> --check "<command>", or ask the person to accept this one: pullboard check accept <id>',DELTA_NOT_AVAILABLE: 'read the full board state from this API instead of since=N',DEPENDENCY_CYCLE: 'change --after so no item waits on itself',DEVICE_CRYPTO: 'use Node 22 or newer, or a browser on a secure (https) page',diff --git a/src/relay-sender.js b/src/relay-sender.jsindex e6a284d3..5cbb6940 100644--- a/src/relay-sender.js+++ b/src/relay-sender.js@@ -10,7 +10,7 @@ export function relayMoveActor(move) {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;- if (['completeCheckBaseline', 'appendFact', 'editItem', 'escalate', 'recordAttempt', 'claim', 'submit', 'reserveReview', 'verify', 'merged', 'withdraw', 'refreeze',+ if (['acceptCheck', 'completeCheckBaseline', 'appendFact', 'editItem', 'escalate', 'recordAttempt', 'claim', 'submit', 'reserveReview', 'verify', 'merged', 'withdraw', 'refreeze','passDecision', 'answerDecision', 'holdLane', 'releaseLane', 'holdItem', 'releaseItemHold', 'reopen', 'editMilestoneItems', 'moveMilestone', 'editMilestone', 'removeMilestone'].includes(move.operation)) return args[1]?.agentId ?? null;return null;}diff --git a/src/templates.js b/src/templates.jsindex c6c970c6..f72e02c0 100644--- a/src/templates.js+++ b/src/templates.js@@ -9,7 +9,8 @@ export const AGENTS_START = '<!-- pullboard:start -->';export const AGENTS_END = '<!-- pullboard:end -->';/**- * The starting pullboard.json: the gate and the fixers init detected, the spec, and no lanes yet.+ * The starting pullboard.json: the gate and the fixers init detected, the spec, no lanes yet, and+ * checks.provesNothing at "hold", so a new board holds an item whose check already passes on main.** @param {string} gate* @param {{ run: string, files: string[] }[]} [fix]@@ -28,6 +29,7 @@ export function configTemplate(gate, fix = []) {lanes: { review: { owns: [], starts: 'any time: verifiers check submitted work and own no folders' } },shared: [],commits: { requireIds: ['feat', 'fix'] },+ checks: { provesNothing: 'hold' },};return `${JSON.stringify(config, null, 2)}\n`;}@@ -119,7 +121,7 @@ It prints the folder to work in and what to run there first. Every join needs th**The loop.**1. \`pullboard resume\` at the start of every session and after your context is compacted: your claim, what came back, unread shouts and the next step. Then \`pullboard inbox\`.-2. \`pullboard next\` claims the next item in your lane that is free to start. When everything is waiting on other work, \`pullboard next --wait 9\` keeps looking for up to 9 minutes, which fits one tool call with a ten-minute timeout; run it again to keep waiting. A claim is a 2-hour lease; claim again to renew. The criterion freezes now: \`pullboard show <id>\` is the bar your work is judged against, and its brief says how to start.+2. \`pullboard next\` claims the next item in your lane that is free to start. When everything is waiting on other work, \`pullboard next --wait 9\` keeps looking for up to 9 minutes, which fits one tool call with a ten-minute timeout; run it again to keep waiting. A claim is a 2-hour lease; claim again to renew. The criterion freezes now: \`pullboard show <id>\` is the bar your work is judged against, and its brief says how to start. A claim or submit refused as CRITERION_PROVES_NOTHING names a check that already passes on main, so it proves nothing: shout the coordinator for a check that fails before the work. Only the person accepts a check as it stands, with \`pullboard check accept <id>\` from the main checkout or the view.3. Build inside your lane's folders (\`pullboard lanes\`). Pre-commit refuses anything else; shout the owner instead.4. Commit, then \`pullboard submit <id>\`. It needs a clean tree and the gate green at HEAD.5. A different agent verifies: \`pullboard next --verify\` names the next item to check. It checks out the submitted commit and runs \`pullboard verify <id> accept --note "how it proved it"\`, or \`pullboard verify <id> reject --reason TEST_FAILURE --note "what failed"\`.diff --git a/test/agent-model-engine.test.js b/test/agent-model-engine.test.jsindex e85e2e8d..1d6bac04 100644--- a/test/agent-model-engine.test.js+++ b/test/agent-model-engine.test.js@@ -11,7 +11,7 @@ import { tmpdir } from 'node:os';import { join } from 'node:path';test('model declarations and event snapshots retain engines 1 through 11 semantics [O8,O3,H16]', (t) => {- assert.equal(ENGINE_VERSION, 12, 'engine 12 preserves the released engine-8 through engine-11 model behavior');+ assert.equal(ENGINE_VERSION, 24, 'engine 24 preserves the released engine-8 through engine-11 model behavior');for (const version of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ENGINE_VERSION]) {const board = store.openBoard(':memory:');t.after(() => store.closeBoard(board));diff --git a/test/api-http.test.js b/test/api-http.test.jsindex b0024d56..7f640257 100644--- a/test/api-http.test.js+++ b/test/api-http.test.js@@ -311,7 +311,8 @@ function fixture(t) {}git('init', '-q', '-b', 'main');cli(root, 'init');- const config = JSON.parse(readFileSync(join(root, 'pullboard.json'), 'utf8'));+ // HTTP fixtures file "true" checks to move items, so they keep a board with no hold setting.+ const { checks: _hold, ...config } = JSON.parse(readFileSync(join(root, 'pullboard.json'), 'utf8'));writeFileSync(join(root, 'pullboard.json'), JSON.stringify({ ...config, gate: 'true', lanes: { app: { owns: ['app/'] }, review: { owns: [] } } }));writeFileSync(join(root, 'SPEC.md'), '# HTTP fixture\n\n## Goals\n- G1 [approved, must] Keep the board. | gate: true\n');writeFileSync(join(root, 'DOCTRINE.md'), '');diff --git a/test/api.test.js b/test/api.test.jsindex 0dd259bc..58a72839 100644--- a/test/api.test.js+++ b/test/api.test.js@@ -161,7 +161,8 @@ function project() {const initialized = json(box, repo, 'init');if (inheritedModel !== undefined) box.env.PULLBOARD_MODEL = inheritedModel;const configFile = join(repo, 'pullboard.json');- const config = JSON.parse(readFileSync(configFile, 'utf8'));+ // These fixtures prove API shapes with "true" checks, so they keep a board with no hold setting.+ const { checks: _hold, ...config } = JSON.parse(readFileSync(configFile, 'utf8'));writeFileSync(configFile, `${JSON.stringify({...config,gate: 'true',@@ -268,7 +269,7 @@ function json(box, cwd, command, args = [], subcommand) {const result = box.run(cwd, command, ...args, '--json');assert.equal(result.status, 0, `${command} ${args.join(' ')}: ${result.stderr}${result.stdout}`);const document = JSON.parse(result.stdout);- if (command === 'check') {+ if (command === 'check' && subcommand !== 'accept') {assert.equal(result.stderr, `check #${document.id} set by ${document.by} (unknown): ${document.check}\n`, 'check attribution is visible before execution while stdout remains one JSON document');} else assert.equal(result.stderr, '', `${command} --json must keep stderr empty`);assert.equal(document.version, 1, `${command} --json has a version 1 envelope`);@@ -974,6 +975,7 @@ test('[A1] every catalog command and subcommand has a real CLI exercise', () =>json(source, source.repo, 'milestone', ['remove', 'Later'], 'remove');json(source, source.repo, 'milestone', ['remove', 'Release'], 'remove');const reopenItem = json(source, source.repo, 'add', ['coordinator', 'Reopen catalog item', '--criterion', 'Exercise the versioned reopen result.', '--check', 'true'], 'add').item;+ assert.equal(json(source, source.repo, 'check', ['accept', String(reopenItem.item_id)], 'accept').check, 'true', 'the person accepts the check as it reads');json(source, source.repo, 'claim', [String(reopenItem.item_id)]);json(source, source.repo, 'submit', [String(reopenItem.item_id)]);json(source, source.repo, 'reopen', [String(reopenItem.item_id), '--note', 'exercise the versioned reopen result']);diff --git a/test/check-baseline.test.js b/test/check-baseline.test.jsindex a95a0eb1..92fb583c 100644--- a/test/check-baseline.test.js+++ b/test/check-baseline.test.js@@ -9,6 +9,10 @@ import { openBoard, closeBoard, getItem } from '../src/board.js';import { checkBaseline, prepareCheckBaseline } from '../src/check-baseline.js';import { exportBoard, importBoard } from '../src/exchange.js';import { applyEngineMove, prepareEngineMove } from '../src/engine.js';+import { CHECK_ACCEPT_ENGINE, acceptCheck, checkDigest } from '../src/check-accept.js';+import { refusePersonMove } from '../src/mcp.js';+import { AGENT_SHELL_MARKERS, SSH_SHELL_MARKERS } from '../src/person.js';+import { relaySenderProblem } from '../src/relay-sender.js';const BIN = resolve(import.meta.dirname, '../bin/pullboard.js');const BOARD_FILE = '.git/pullboard/board.sqlite';@@ -63,8 +67,12 @@ function sandbox() {return { dir, env, git, run };}-/** Initialize an isolated repo and optional real web/review worktrees. */-function project({ gate = 'true', content = 'green', commit = true, worktrees = false } = {}) {+/**+ * Initialize an isolated repo and optional real web/review worktrees. Fixtures keep init's+ * checks.provesNothing hold only when asked: the other tests here prove today's warning, which a+ * board with no setting keeps.+ */+function project({ gate = 'true', content = 'green', commit = true, worktrees = false, hold = false } = {}) {const box = sandbox();const repo = join(box.dir, 'repo');mkdirSync(repo);@@ -74,9 +82,10 @@ function project({ gate = 'true', content = 'green', commit = true, worktrees =const initialized = box.run(repo, ['init']);assert.equal(initialized.status, 0, initialized.stderr);const configFile = join(repo, 'pullboard.json');- const config = JSON.parse(readFileSync(configFile, 'utf8'));+ const { checks, ...config } = JSON.parse(readFileSync(configFile, 'utf8'));writeFileSync(configFile, `${JSON.stringify({...config,+ ...(hold ? { checks } : {}),gate,spec: 'SPEC.md',lanes: {@@ -90,7 +99,7 @@ function project({ gate = 'true', content = 'green', commit = true, worktrees =box.git(repo, 'add', '-A');box.git(repo, 'commit', '-q', '-m', 'chore: set up check baseline fixture');}- const fixture = { ...box, repo, web: null, review: null };+ const fixture = { ...box, repo, web: null, review: null, initChecks: checks };if (worktrees) {fixture.web = addWorktree(fixture, 'web', 'web/agent');fixture.review = addWorktree(fixture, 'review', 'review/agent');@@ -468,3 +477,113 @@ test('[C7,V4] a check that is not valid shell is refused when set', () => {assert.equal(accepted.status, 0, `a valid check is accepted on edit: ${accepted.stdout}${accepted.stderr}`);assert.equal(showItem(box, item.item_id).item.item_check, revised);});++/** The person's own terminal: the fixture environment with every agent and SSH marker dropped. */+function personEnv(env) {+ const clean = { ...env };+ for (const marker of [...AGENT_SHELL_MARKERS, ...SSH_SHELL_MARKERS]) delete clean[marker];+ return clean;+}++/** Read one refused CLI move's JSON error, asserting it exited 1. */+function refusal(result, label) {+ assert.equal(result.status, 1, `${label}: ${result.stdout}${result.stderr}`);+ return JSON.parse(result.stdout).error;+}++/** Send one move through the local API handler on a chosen channel, as the view and agent API do. */+function apiMove(box, move, channel, env) {+ const apiModule = new URL('../src/api.js', import.meta.url).href;+ const cliModule = new URL('../src/cli.js', import.meta.url).href;+ const source = `+ const { executeMove } = await import(${JSON.stringify(apiModule)});+ const { main } = await import(${JSON.stringify(cliModule)});+ const response = await executeMove(process.cwd(), ${JSON.stringify(move)}, main, undefined, ${JSON.stringify(channel)});+ process.stdout.write(JSON.stringify(response));+ `;+ const child = runFixtureChild(process.execPath, ['--input-type=module', '-e', source], { cwd: box.repo, env, encoding: 'utf8' });+ assert.equal(child.status, 0, child.stdout + child.stderr);+ return JSON.parse(child.stdout);+}++/** Commit one tracked change in an agent worktree so submit has a clean head to prove. */+function commitIn(box, cwd, content, message) {+ writeFileSync(join(cwd, 'web', 'result.txt'), `${content}\n`);+ box.git(cwd, 'add', 'web/result.txt');+ box.git(cwd, 'commit', '-q', '-m', message);+}++test('[V2,V4,B26,P6] a check green on main holds the item until the person accepts it', () => {+ const box = project({ content: 'green', worktrees: true, hold: true });+ const env = personEnv(box.env);+ const file = join(box.repo, BOARD_FILE);+ assert.deepEqual(box.initChecks, { provesNothing: 'hold' }, 'pullboard init writes checks.provesNothing "hold" for a new board');+ const main = box.git(box.repo, 'rev-parse', 'refs/heads/main');+ const green = fileCheck('green', 'held-check-marker.txt');+ const { item } = addChecked(box, 'Held green check', green);+ const id = String(item.item_id);+ assert.equal(item.item_check_baseline.result, 'green');++ const held = refusal(box.run(box.web, ['claim', id, '--json']), 'claim');+ assert.equal(held.code, 'CRITERION_PROVES_NOTHING', 'claiming an item whose check is green on main is refused');+ assert.ok(held.message.includes(green), `the refusal names the check: ${held.message}`);+ assert.ok(held.message.includes(`main ${main.slice(0, 12)}`), `the refusal names main: ${held.message}`);+ assert.match(held.next, new RegExp(`pullboard check accept ${id}`, 'u'), 'the next step names the person’s move');++ const shell = refusal(box.run(box.repo, ['check', 'accept', id, '--json'], undefined, { env: { ...env, CLAUDECODE: '1' } }), 'agent shell');+ assert.equal(shell.code, 'B26_PERSON_CHANNEL', 'an agent shell in the main checkout cannot accept a check');+ const remote = refusal(box.run(box.repo, ['check', 'accept', id, '--json'], undefined, { env: { ...env, SSH_CONNECTION: '10.0.0.1 22 10.0.0.2 22' } }), 'remote shell');+ assert.equal(remote.code, 'B26_PERSON_CHANNEL', 'a remote shell cannot accept a check');+ const worktree = refusal(box.run(box.web, ['check', 'accept', id, '--json'], undefined, { env }), 'worktree');+ assert.equal(worktree.code, 'B26_PERSON_APPROVAL', 'an agent worktree cannot accept a check, even from a clean terminal');+ const api = apiMove(box, { verb: 'check-accept', item: item.item_id }, 'api', env);+ assert.equal(api.status, 409, JSON.stringify(api));+ assert.equal(api.body.error.code, 'B26_PERSON_CHANNEL', 'the agent API is not the person channel');+ assert.throws(() => refusePersonMove('check_accept'), { code: 'HUMAN_REQUIRED' }, 'MCP refuses a check acceptance as a person move');+ const digest = checkDigest(green);+ const move = withBoard(file, (board) => prepareEngineMove(board, 'acceptCheck', [item.item_id, { agentId: 'person', channel: 'terminal', digest }], { id: 'agent-relay-accept' }));+ assert.equal(move.engine, CHECK_ACCEPT_ENGINE);+ assert.equal(relaySenderProblem(move, { kind: 'agent', userId: 'user-1', agent: 'web-1' }, 'move')?.code, 'RELAY_PERSON_ONLY', 'the relay refuses an agent sending the person’s acceptance');+ withBoard(file, (board) => {+ assert.throws(() => acceptCheck(board, item.item_id, { agentId: 'web-1', channel: 'terminal', digest }), { code: 'CHECK_ACCEPT_PERSON_ONLY' });+ assert.throws(() => applyEngineMove(board, { ...move, engine: CHECK_ACCEPT_ENGINE - 1 }, { sequence: 1, at: '2026-10-17T00:00:00.000Z' }), { code: 'RELAY_MOVE' },+ 'an engine older than the acceptance refuses the move before changing anything');+ assert.equal(board.db.prepare("SELECT COUNT(*) AS n FROM event WHERE event_kind = 'check_accept'").get().n, 0, 'no refused path recorded an acceptance');+ });+ assert.equal(refusal(box.run(box.web, ['claim', id, '--json']), 'claim after refusals').code, 'CRITERION_PROVES_NOTHING');++ const accepted = box.run(box.repo, ['check', 'accept', id, '--json'], undefined, { env });+ assert.equal(accepted.status, 0, `${accepted.stdout}${accepted.stderr}`);+ assert.deepEqual(JSON.parse(accepted.stdout).digest, digest, 'the acceptance binds to the exact check text');+ const claimed = box.run(box.web, ['claim', id, '--json']);+ assert.equal(claimed.status, 0, `the person's acceptance lifts the hold: ${claimed.stdout}${claimed.stderr}`);++ const changed = fileCheck('green', 'changed-check-marker.txt');+ const edited = box.run(box.repo, ['edit', id, '--check', changed, '--wait', '--json'], undefined, { env });+ assert.equal(edited.status, 0, `${edited.stdout}${edited.stderr}`);+ assert.equal(JSON.parse(edited.stdout).item.item_check_baseline.result, 'green', 'the changed check gets a new baseline');+ assert.equal(box.run(box.repo, ['refreeze', id]).status, 0);+ commitIn(box, box.web, 'done', 'test: change the held fixture');+ const resubmitted = refusal(box.run(box.web, ['submit', id, '--json']), 'submit after a changed check');+ assert.equal(resubmitted.code, 'CRITERION_PROVES_NOTHING', 'a changed check needs a new acceptance: submit is refused');+ assert.ok(resubmitted.message.includes(changed), `the submit refusal names the changed check: ${resubmitted.message}`);++ const red = fileCheck('done', 'red-check-marker.txt');+ const corrected = box.run(box.repo, ['edit', id, '--check', red, '--wait', '--json'], undefined, { env });+ assert.equal(corrected.status, 0, `${corrected.stdout}${corrected.stderr}`);+ assert.equal(JSON.parse(corrected.stdout).item.item_check_baseline.result, 'red');+ assert.equal(box.run(box.repo, ['refreeze', id]).status, 0);+ const submitted = box.run(box.web, ['submit', id, '--json']);+ assert.equal(submitted.status, 0, `a red new baseline lifts the hold: ${submitted.stdout}${submitted.stderr}`);++ const plain = project({ content: 'green', worktrees: true });+ const { result: warned, item: open } = addChecked(plain, 'Unheld green check', fileCheck('green', 'plain-check-marker.txt'));+ assert.match(warned.stdout, /CRITERION_PROVES_NOTHING/u, 'a board with no setting keeps today’s warning');+ const plainClaim = plain.run(plain.web, ['claim', String(open.item_id), '--json']);+ assert.equal(plainClaim.status, 0, `a board with no setting claims the green check: ${plainClaim.stdout}${plainClaim.stderr}`);+ writeFileSync(join(plain.web, 'web', 'proof.txt'), 'submitted\n');+ plain.git(plain.web, 'add', 'web/proof.txt');+ plain.git(plain.web, 'commit', '-q', '-m', 'test: submit the unheld fixture');+ const plainSubmit = plain.run(plain.web, ['submit', String(open.item_id), '--json']);+ assert.equal(plainSubmit.status, 0, `a board with no setting submits the green check: ${plainSubmit.stdout}${plainSubmit.stderr}`);+});diff --git a/test/doctrine-name.test.js b/test/doctrine-name.test.jsindex cc8c6bf1..41665bf4 100644--- a/test/doctrine-name.test.js+++ b/test/doctrine-name.test.js@@ -411,6 +411,8 @@ test('[D4,A5] verify in a detached checkout reads the trunk baseline for a doctrconst builder = join(box.dir, 'verify-doctrine-builder');box.git(source, 'worktree', 'add', '-q', '-b', 'web/doctrine-review', builder);assert.equal(box.run(builder, 'join', 'web').status, 0);+ // This doctrine check already passes on main by design; the person accepts it so the new board's hold lifts.+ assert.equal(box.run(source, 'check', 'accept', String(id)).status, 0);assert.equal(box.run(builder, 'claim', String(id)).status, 0);mkdirSync(join(builder, 'web'));writeFileSync(join(builder, 'web/candidate.txt'), 'doctrine verification fixture\n');diff --git a/test/machine.test.js b/test/machine.test.jsindex 86bc20d7..776c882e 100644--- a/test/machine.test.js+++ b/test/machine.test.js@@ -838,8 +838,8 @@ test('pullboard help lists each role\'s moves from the declaration, and pullboar/** Guards checked before the explicit transition: CLI facts and optional roadmap selection. */const PRECHECKED = {- claim: ['joined'],- submit: ['joined', 'criterionUnchanged', 'treeClean', 'nothingUntracked', 'hasCommit', 'withinLane', 'trunkMergeClean', 'doctrineHolds', 'gateConfigured', 'gateGreen', 'treeStillDuringGate', 'noUnverifiedStack'],+ claim: ['joined', 'checkProvesSomething'],+ submit: ['joined', 'checkProvesSomething', 'criterionUnchanged', 'treeClean', 'nothingUntracked', 'hasCommit', 'withinLane', 'trunkMergeClean', 'doctrineHolds', 'gateConfigured', 'gateGreen', 'treeStillDuringGate', 'noUnverifiedStack'],reserve: ['coordinatorSaysAs', 'joined', 'roadmapReadable'],accept: ['coordinatorSaysAs', 'joined', 'atSubmittedCommit', 'trunkMergeClean', 'itemCheckGreen', 'noUnverifiedStack'],reject: ['coordinatorSaysAs', 'joined', 'atSubmittedCommit'],diff --git a/test/pending-refreeze.test.js b/test/pending-refreeze.test.jsindex 15ad01aa..1119998d 100644--- a/test/pending-refreeze.test.js+++ b/test/pending-refreeze.test.js@@ -252,7 +252,7 @@ async function checkDependencyLegacyClients(cleanup, directory, snapshot, targetconst oldSnapshot = legacyExchange.exportBoard(old);const currentSnapshot = exportBoard(current);assert.equal(oldSnapshot.tables.board_meta.find((row) => row.meta_key === 'relay_engine_version').meta_value, '10');- assert.equal(currentSnapshot.tables.board_meta.find((row) => row.meta_key === 'relay_engine_version').meta_value, '12');+ assert.equal(currentSnapshot.tables.board_meta.find((row) => row.meta_key === 'relay_engine_version').meta_value, String(ENGINE_VERSION));assert.deepEqual(withoutEngineMarker(currentSnapshot), withoutEngineMarker(oldSnapshot),'the sole snapshot difference is the intentionally newer writer-version marker');}@@ -261,7 +261,7 @@ async function checkDependencyLegacyClients(cleanup, directory, snapshot, target}test('dependency edits replay the same on every engine [B3,V2,H16]', async (t) => {- assert.equal(ENGINE_VERSION, 12);+ assert.equal(ENGINE_VERSION, 24);const directory = mkdtempSync(join(tmpdir(), 'pullboard-dependency-engines-'));const cleanup = [];t.after(() => {diff --git a/test/row-decisions-replay.test.js b/test/row-decisions-replay.test.jsindex 8f048ccf..2e69ba00 100644--- a/test/row-decisions-replay.test.js+++ b/test/row-decisions-replay.test.js@@ -144,7 +144,7 @@ test('captured person decisions and coordinator apply replay identically without});test('engine 12 records preserved decline text and replays a separate reason [S18,S19,H16]', (t) => {- assert.equal(ENGINE_VERSION, 12);+ assert.ok(ENGINE_VERSION >= 12, 'engine 12 decline semantics hold in every later engine');const { source, copies: [one, two] } = decisionCopies(t);const preserved = {kind: 'spec', file: 'SPEC.md', id: 'G2',diff --git a/test/view.test.js b/test/view.test.jsindex aacf3d7a..08d0957e 100644--- a/test/view.test.js+++ b/test/view.test.js@@ -64,7 +64,8 @@ function privateProject(box, name) {const init = box.run(repo, 'init', '--json');assert.equal(init.status, 0, init.failure ?? init.stderr);const configPath = join(repo, 'pullboard.json');- const config = JSON.parse(readFileSync(configPath, 'utf8'));+ // View fixtures file "true" checks to show items, so they keep a board with no hold setting.+ const { checks: _hold, ...config } = JSON.parse(readFileSync(configPath, 'utf8'));writeFileSync(configPath, `${JSON.stringify({ ...config, name, gate: 'true', spec: 'SPEC.md', practice: 'DOCTRINE.md',lanes: { app: { owns: ['app/'], specs: ['G1'] }, review: { owns: [] } }, shared: [] }, null, 2)}\n`);writeFileSync(join(repo, 'SPEC.md'), API_SPEC);