Skip to content

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

chore(merge): integrate accepted stale verdicts [E8,H16]

Corey Olsond07d1dd5f8c0
diff --cc docs/api.md
index 430497a3,b29dccb6..f12576a7
--- a/docs/api.md
+++ b/docs/api.md
@@@ -18,16 -20,12 +20,18 @@@ Release priority is separately opt-in w
The memory hold is opt-in per machine with `"gate": { "memoryFloorMB": <n> }` in `~/.pullboard/settings.json`; absent, it is off and the pool admits by slots alone, as before. When set, before admitting a run the machine gate pool reads the machine's memory: on macOS the kernel's memory pressure level and free percentage, on Linux `MemAvailable` and the pressure stall averages in `/proc/pressure/memory`. The whole queue, landings included, waits in place while pressure is critical or free memory is under that many megabytes (`0` leaves only the pressure check). A held run prints one line naming why and the three biggest processes by memory, with pid, size and working directory, and starts once memory recovers. While the floor is set, `pullboard resources` prints the same line and returns it as `memory` in JSON; with no floor it reads no memory and `memory` is `null`. Where memory cannot be read, the pool admits by slots alone and prints one warning that memory is not checked there.
+ Short gate slots are opt-in per machine with `pullboard settings gate.shortSlots <n>`, stored as `"gate": { "shortSlots": n }`; the default `0` keeps them off and the pool behaves as before. With `n` above `0`, up to `n` runs that name their test files (a `pullboard check` or a review whose check is a literal `node bin/run-tests.js` call over test files, or a direct `node bin/run-tests.js <files>`) are admitted on short slots while every gate slot is held. Whole suites, directories, landings, diagnostics and anything the parser cannot read never use them, and a child that does not name its files cannot reuse a short lease (`SHORT_SLOT_FULL_SUITE`). Short slots do not add to `gateSlots`, and browser runs still count against `browserSlots`. `pullboard settings` prints `gate.shortSlots`; `pullboard resources --json` reports `shortSlots`, each gate holder's `slot` (`gate` or `short`), and `requestedSlot: "short-eligible"` on a waiting run that may take one.
+
When `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.
+An accepted item that has not landed can carry `item_verdict_state` in CLI `show`, `list`, and `resume` JSON. Its `code` is `STALE_VERDICT`; `file` and `commit` identify the first known main change to one of the submitted candidate's files, and `reviewedTrunk` and `main` identify the compared tips. HTTP board states, summaries, and item details expose the same observation as optional `verdictState`. Moving main invalidates both cached state and live change notifications even when the served worktree's HEAD stays fixed. Unrelated files leave acceptance current; reverting a relevant main change still requires re-review. Missing reviewed history also fails closed, with a `reason` and null file/commit instead of an invented change.
+
+Freshness never rewrites the stored ACCEPT or its verdict row. New accept/reject event details carry `review: {commit, trunk, paths}`: the original submitted commit, the known reviewed trunk, and sorted unique submitted paths. Existing receipts replay with their recorded engine and remain unchanged. Older acceptances without captured review metadata use a conservative claim-base bound and may require a new review after upgrading. Recorded or physically landed work no longer needs this freshness check.
+
+For a stale acceptance, merge current main into the submitted work and commit a clean review HEAD. Another agent runs `pullboard verify <id> accept --note "what was re-reviewed"`; its frozen check runs at that combined HEAD, and a new verdict appends to the history while retaining the original submitted commit. A main move during the check refuses `VERDICT_TRUNK_MOVED` and requires another review. `resume` keeps stale acceptances out of its merge list. `land` excludes stale items (and reports their file and commit); when none remain ready, it refuses `STALE_VERDICT`. Nothing in this observation changes the approved criterion or grants person authority.
+
`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.
`stats.bars` counts bar corrections, keyed by agent: `{corrections, barRejects, buildRejects}`. A correction is an `edit --criterion` or `--check` on an item that was ever claimed. It must carry `--reason "what the old bar got wrong"` (HTTP `args.reason`); without one it is refused with `BAR_REASON`. A correction that follows the item's newest, unexplained reject marks that reject as caused by the bar, counted to the correcting agent; every other reject counts to the build, under the agent who added the item. Text `stats` prints one `bars:` line per agent, and text `show` prints each correction with its reason.
diff --cc docs/img/lifecycle.svg
index 55fbcf7e,55fbcf7e..49dbe46b
--- a/docs/img/lifecycle.svg
+++ b/docs/img/lifecycle.svg
@@@ -1,5 -1,5 +1,5 @@@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 840 392" width="840" height="392" role="img" aria-labelledby="title desc">
--<title id="title">An item's life</title><desc id="desc">Drawn from src/machine.js. An item starts open and ends withdrawn. open to claimed: claim. claimed to open: release, lapse (clock), escalate, refreeze. claimed to submitted: submit. submitted to verified: accept. submitted to open: reject, reopen, refreeze. verified to open: reopen. open to withdrawn: withdraw. claimed to withdrawn: withdraw. submitted to withdrawn: withdraw.</desc>
++<title id="title">An item's life</title><desc id="desc">Drawn from src/machine.js. An item starts open and ends withdrawn. open to claimed: claim. claimed to open: release, lapse (clock), escalate, refreeze. claimed to submitted: submit. submitted to verified: accept. submitted to open: reject, reopen, refreeze. verified to open: reject, reopen. open to withdrawn: withdraw. claimed to withdrawn: withdraw. submitted to withdrawn: withdraw.</desc>
<style>
text { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif; fill: #1f2328; }
.mono { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; }
@@@ -56,7 -56,7 +56,7 @@@
<g class="plain"><rect x="25" y="150" width="160" height="58" rx="8"/><text class="t1" x="105" y="175" text-anchor="middle">open</text><text class="t2" x="105" y="193" text-anchor="middle">↻ escalate · refreeze</text></g>
<g class="plain"><rect x="235" y="150" width="160" height="58" rx="8"/><text class="t1" x="315" y="175" text-anchor="middle">claimed</text><text class="t2" x="315" y="193" text-anchor="middle">↻ claim · refreeze</text></g>
<g class="plain"><rect x="445" y="150" width="160" height="58" rx="8"/><text class="t1" x="525" y="175" text-anchor="middle">submitted</text><text class="t2" x="525" y="193" text-anchor="middle">↻ reserve</text></g>
--<g class="done"><rect x="655" y="150" width="160" height="58" rx="8"/><text class="t1" x="735" y="184" text-anchor="middle">verified</text></g>
++<g class="done"><rect x="655" y="150" width="160" height="58" rx="8"/><text class="t1" x="735" y="175" text-anchor="middle">verified</text><text class="t2" x="735" y="193" text-anchor="middle">↻ accept</text></g>
<g class="plain" data-final="withdrawn"><rect x="445" y="284" width="160" height="58" rx="8"/><rect x="449" y="288" width="152" height="50" rx="5" fill="none"/><text class="t1" x="525" y="318" text-anchor="middle">withdrawn</text></g>
<path class="edge" d="M 185 179 L 231 179" marker-end="url(#tip)"/>
<text class="label" x="208" y="171" text-anchor="middle">claim</text>
@@@ -70,7 -70,7 +70,7 @@@
<path class="edge back" d="M 545 150 L 545 66 L 115 66 L 115 146" marker-end="url(#tip-back)"/>
<text class="label back" x="330" y="58" text-anchor="middle">reject · reopen · refreeze</text>
<path class="edge back" d="M 815 179 L 830 179 L 830 8 L 15 8 L 15 179 L 25 179" marker-end="url(#tip-back)"/>
--<text class="label back" x="425" y="30" text-anchor="middle">reopen</text>
++<text class="label back" x="425" y="30" text-anchor="middle">reject · reopen</text>
<path class="edge" d="M 105 208 L 105 313 L 441 313" marker-end="url(#tip)"/>
<text class="label" x="210" y="305" text-anchor="middle">withdraw</text>
<path class="edge" d="M 315 208 L 315 313"/>
diff --cc docs/lifecycle.md
index 2f106c8e,79620154..ac8a9170
--- a/docs/lifecycle.md
+++ b/docs/lifecycle.md
@@@ -53,13 -51,13 +53,13 @@@ Each move checks its guards in this ord
| 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), result (ENGINE_VERSION) |
-| 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), result (ENGINE_VERSION) |
+| 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), 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), 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), 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) |
@@@ -124,8 -122,9 +124,9 @@@
| STACKED_ON_UNVERIFIED | the candidate range contains no other item's unverified submitted commit | wait for that item to be accepted, or rebuild without its commits |
| RATCHET_ROSE | 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 new problems, commit, submit again; only the person's signature raises count: |
| 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 |
+| CHECK_RED | the frozen item check passes at the submitted commit, or its clean reviewed composition for a stale acceptance | reject the failing behavior; the builder fixes and resubmits |
+| CHECK_UNVERIFIED | the frozen item check passes at the submitted commit, or its clean reviewed composition for a stale acceptance | 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 --cc src/cli.js
index 06d881fc,e207be1f..e8fab185
--- a/src/cli.js
+++ b/src/cli.js
@@@ -2580,24 -2573,15 +2592,25 @@@ async function verifyHere(ctx, id, { se
}
if (decision === 'ACCEPT') {
if (digest !== item.item_frozen_digest) throw new Refused('CRITERIA_CHANGED', 'the criterion changed; ask the coordinator to refreeze this item before checking it');
- const trunk = requireTrunkMerge(root, commit);
- refuseUnverifiedStack(root, board, item, commit, trunk);
+ const checkedCommit = reReview ? head : commit;
+ const checkedLabel = reReview ? 'reviewed composition' : 'submitted commit';
+ const trunk = requireTrunkMerge(root, checkedCommit);
+ if (reReview) {
+ if (!isClean(root)) throw new Refused('DIRTY', 'commit the reviewed composition before re-reviewing the stale verdict');
+ if (untracked(root).length) throw new Refused('UNTRACKED', 'commit or ignore untracked files before re-reviewing the stale verdict');
+ if (!contains(root, trunk.commit, head)) throw staleVerdictRefusal(item, stale);
+ }
+ review = captureVerdictReview(root, board, item, trunk.commit, checkedCommit);
+ refuseUnverifiedStack(root, board, item, checkedCommit, trunk);
+ const checkedItem = reReview ? { ...item, item_commit: checkedCommit } : item;
if (frozenCheck(item)) {
- const browser = !browserFreeChecksEnabled() || await checkNeedsBrowser(root, frozenCheck(item), { commit, onFallback: browserAdmissionReporter(ctx.io, ctx.io.relayJson) });
- const shortEligible = Boolean(await explicitCheckFiles(root, frozenCheck(item), { commit }));
- check = await withGateSlot(root, (lease) => checkAtCommit(root, item, { waitMs: lease.waitMs, gateLease: lease }), { browser, agent: me.id, item: String(id), kind: 'review', itemCheck: true, shortEligible, onWait: gateWaitReporter(ctx.io) });
+ const browser = !browserFreeChecksEnabled() || await checkNeedsBrowser(root, frozenCheck(item), { commit: checkedCommit, onFallback: browserAdmissionReporter(ctx.io, ctx.io.relayJson) });
- check = await withGateSlot(root, (lease) => checkAtCommit(root, checkedItem, { waitMs: lease.waitMs, gateLease: lease }), { browser, agent: me.id, item: String(id), kind: 'review', itemCheck: true, onWait: gateWaitReporter(ctx.io) });
++ const shortEligible = Boolean(await explicitCheckFiles(root, frozenCheck(item), { commit: checkedCommit }));
++ check = await withGateSlot(root, (lease) => checkAtCommit(root, checkedItem, { waitMs: lease.waitMs, gateLease: lease }), { browser, agent: me.id, item: String(id), kind: 'review', itemCheck: true, shortEligible, onWait: gateWaitReporter(ctx.io) });
} else {
- check = checkAtCommit(root, item);
+ check = checkAtCommit(root, checkedItem);
}
+ invalidateGitFacts(); // A private check can outlive changes in the reviewer's live checkout.
refuseSandboxBlocked(check);
verificationProfile = check.profile ?? null;
const evidence = check.checked
diff --cc src/engine.js
index 97e42081,ccf5a337..13b6deea
--- a/src/engine.js
+++ b/src/engine.js
@@@ -4,7 -4,8 +4,8 @@@ import * as store from './board.js'
import { recordedRefusal } from './recorded-refusal.js';
import { BAR_ENGINE, carriesBarReason } from './bar-corrections.js';
import { carriesImplies, IMPLIES_ENGINE } from './implies.js';
+ import { CHECK_ACCEPT_ENGINE } from './check-accept.js';
-import { ENGINE_VERSION } from './machine.js';
+import { ENGINE_VERSION, VERDICT_REVIEW_ENGINE } from './machine.js';
import { Refused } from './refused.js';
import { requestMoveProblem, recordRequestMove } from './relay-requests.js';
import { relayMoveActor, relaySenderProblem, validRelaySender } from './relay-sender.js';
@@@ -22,19 -23,11 +23,19 @@@ export const ENGINE_OPERATIONS = Object
]);
/** 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, edit reasons engine-19 and implied items engine-20, without changing ordinary historical envelopes. */
-function minimumOperationEngine(operation, args) {
+/** Dependency edits, bar reasons and sealed review metadata retain their distinct recorded engine meanings. */
+function minimumOperationEngine(operation, args, board) {
const options = args[1];
+ if (board && ['recordLandingBatch', 'finishLandingBatch'].includes(operation)) {
+ const id = operation === 'recordLandingBatch' ? args[0]?.batch?.id : args[0]?.id;
+ const prior = id && store.landingBatches(board).find(batch => batch.id === id);
+ if (prior && ['items', 'candidates'].some(key => Array.isArray(prior[key]) && prior[key].some(entry => entry && Object.hasOwn(entry, 'reviewedCommit')))) return VERDICT_REVIEW_ENGINE;
+ }
+ if (operation === 'verify' && options && Object.hasOwn(options, 'review')) return VERDICT_REVIEW_ENGINE;
+ if (operation === 'recordLandingBatch' && args[0]?.batch
+ && ['items', 'candidates'].some(key => Array.isArray(args[0].batch[key]) && args[0].batch[key].some(entry => entry && typeof entry === 'object' && Object.hasOwn(entry, 'reviewedCommit')))) return VERDICT_REVIEW_ENGINE;
if (carriesImplies(operation, args)) return IMPLIES_ENGINE;
if (carriesBarReason(operation, args)) return BAR_ENGINE;
return operation === 'editItem' && options && Object.hasOwn(options, 'after') && options.after !== undefined
diff --cc src/machine.js
index c91af937,29bc60d8..e0fb9878
--- a/src/machine.js
+++ b/src/machine.js
@@@ -10,12 -10,8 +10,11 @@@
*/
/** Executable move semantics, carried by every sealed move and retained during replay [H16]. */
-export const ENGINE_VERSION = 24;
+export const ENGINE_VERSION = 25;
+
+/** First released engine binding the checked composition, review trunk and paths [E8,H16]. */
+export const VERDICT_REVIEW_ENGINE = 25;
-
/** @typedef {'agent' | 'coordinator' | 'clock'} Role */
/**
@@@ -126,8 -122,9 +125,9 @@@ export const GUARDS =
{ id: 'trunkMergeClean', refuse: 'MERGE_CONFLICT', alsoRefuses: [{ code: 'MERGE_CHECK_FAILED', next: 'use Git 2.38 or newer, restore its objects and retry' }, { code: 'NO_POLICY', next: 'restore the primary repository metadata' }, { code: 'NO_TRUNK', next: 'check out the trunk branch in the main checkout once and run pullboard inbox' }], rule: 'the candidate merges cleanly into the current primary branch without changing an index or worktree', next: 'merge the trunk into your branch, resolve conflicts, commit and resubmit', source: 'cli' },
{ id: 'noUnverifiedStack', refuse: 'STACKED_ON_UNVERIFIED', rule: "the candidate range contains no other item's unverified submitted commit", next: 'wait for that item to be accepted, or rebuild without its commits', source: 'cli' },
{ 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: '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 submitted commit, or its clean reviewed composition for a stale acceptance', 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' },
diff --cc test/agent-model-engine.test.js
index a704c37c,1d6bac04..f1059499
--- a/test/agent-model-engine.test.js
+++ b/test/agent-model-engine.test.js
@@@ -10,9 -10,9 +10,9 @@@ import { mkdtempSync, rmSync, writeFile
import { tmpdir } from 'node:os';
import { join } from 'node:path';
- test('model declarations and event snapshots retain engines 1 through 19 semantics [O8,O3,H16]', (t) => {
- assert.equal(ENGINE_VERSION, 25, 'the next writer preserves every historical model snapshot through main engine 19');
-test('model declarations and event snapshots retain engines 1 through 11 semantics [O8,O3,H16]', (t) => {
- 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]) {
++test('model declarations and event snapshots retain engines 1 through 24 semantics [O8,O3,H16]', (t) => {
++ assert.equal(ENGINE_VERSION, 25, 'the next writer preserves every historical model snapshot through main engine 24');
+ for (const version of Array.from({ length: ENGINE_VERSION }, (_, index) => index + 1)) {
const board = store.openBoard(':memory:');
t.after(() => store.closeBoard(board));
const registration = prepareEngineMove(board, 'register', [{ lane: 'web', path: '/web', model: 'First Model' }]);
diff --cc test/machine.test.js
index bfb4a316,8da47698..8504c2df
--- a/test/machine.test.js
+++ b/test/machine.test.js
@@@ -839,11 -842,11 +842,11 @@@ test('pullboard help lists each role\'
/** 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'],
+ accept: ['coordinatorSaysAs', 'joined', 'atSubmittedCommit', 'reviewTreeCurrent', 'trunkMergeClean', 'itemCheckGreen', 'noUnverifiedStack'],
+ reject: ['coordinatorSaysAs', 'joined', 'atSubmittedCommit', 'reviewTreeCurrent'],
};
/**