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.

Merge branch 'main' into core/777-claude

Corey Olsonefb5a9b8480f
diff --cc docs/api.md
index abf674ef,a34aeed7..01b20740
--- a/docs/api.md
+++ b/docs/api.md
@@@ -329,7 -352,7 +352,7 @@@ The coordinator maintains the roadmap w
| `stream` | `version:number`, `event:object` |
<!-- api-http-shapes:end -->
- A move body is `{verb, item, args, agent}`. `item` is the positive integer id when the move needs one. `args` names its CLI positional arguments and flags; text values stay literal, including leading dashes. Omit `agent` to act as the coordinator, or name a registered agent to run in its worktree. Coordinator verification takes `args.as: "coordinator"`, matching the CLI's explicit identity check. The local session secret may act as any agent on that board. `result` is the CLI's JSON result. `next` claims work atomically; when a claim is already held it renews it and returns the renewal event. With no work available it returns the CLI's `NOTHING_FREE` refusal. Waiting remains a CLI option. `reopen` is coordinator-only: `args.note` is required, and it returns a submitted item to open without adding a verdict or replacing its last submitted commit. `args.conflict` names the files of an accepted item that conflicts with the trunk instead, as one exact path or an array of exact paths, each passed as its own `--conflict` flag and compared byte for byte with Git's conflict list; it needs no note, records the trunk commit, and the item reads `needs main merge` until its next verdict.
-A move body is `{verb, item, args, agent}`. `item` is the positive integer id when the move needs one. `args` names its CLI positional arguments and flags; text values stay literal, including leading dashes. Omit `agent` to act as the coordinator, or name a registered agent to run in its worktree. Coordinator verification takes `args.as: "coordinator"`, matching the CLI's explicit identity check. The local session secret may act as any agent on that board. `result` is the CLI's JSON result. `next` claims work atomically; when a claim is already held it renews it and returns the renewal event. With no work available it returns the CLI's `NOTHING_FREE` refusal. Waiting remains a CLI option. `reopen` is coordinator-only: `args.note` is required, and it returns a submitted item to open without adding a verdict or replacing its last submitted commit. A reject (`verify` with `decision: "reject"`) and a `reopen` may name `args.cause`, the failure's cause key for `pullboard rigor`.
++A move body is `{verb, item, args, agent}`. `item` is the positive integer id when the move needs one. `args` names its CLI positional arguments and flags; text values stay literal, including leading dashes. Omit `agent` to act as the coordinator, or name a registered agent to run in its worktree. Coordinator verification takes `args.as: "coordinator"`, matching the CLI's explicit identity check. The local session secret may act as any agent on that board. `result` is the CLI's JSON result. `next` claims work atomically; when a claim is already held it renews it and returns the renewal event. With no work available it returns the CLI's `NOTHING_FREE` refusal. Waiting remains a CLI option. `reopen` is coordinator-only: `args.note` is required, and it returns a submitted item to open without adding a verdict or replacing its last submitted commit. A reject (`verify` with `decision: "reject"`) and a `reopen` may name `args.cause`, the failure's cause key for `pullboard rigor`. For a `reopen`, `args.conflict` names the files of an accepted item that conflicts with the trunk, as one exact path or an array of exact paths, each passed as its own `--conflict` flag and compared byte for byte with Git's conflict list; it needs no note, records the trunk commit, and the item reads `needs main merge` until its next verdict.
Decision moves keep the CLI's routing: `shout` with `args.decision: true` may omit `args.to`; agents ask their coordinator, and the coordinator asks the person. `pass` takes the decision's id as `item` and `args.note`. Answering a decision addressed to the person requires `answer` with `args.as: "person"` from the coordinator's main checkout. Other callers receive the CLI's refusal.
diff --cc docs/formats.md
index 60704d25,e6137d4b..c3fc1a09
--- a/docs/formats.md
+++ b/docs/formats.md
@@@ -113,7 -113,7 +113,7 @@@ The board file is in the repository's G
| `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` | `28` | `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` | `33` | `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` | `36` | `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.
@@@ -128,8 -130,10 +130,12 @@@ Engine 33 binds a review to the immutab
Engine 20 lets a decision name the items it changes. An `appendFact`, `answerDecision` or `verify` move may carry `implies`, a list of existing item ids, and an `answerDecision` move may carry `supersedes`, the shout id of an earlier answer. Either makes the move an engine-20 move: an older engine refuses it with `RELAY_MOVE` before changing its board or cursor, and a board replaying an older engine refuses `implies` with `ENGINE_VERSION`. Engine 20 also tells implied items when a decision is superseded: by a fact's `supersedes`, by an answer's `supersedes`, or by the next verdict on the same item. Moves recorded under engines 19 and earlier replay without these notices. Engine numbers 13 to 18 are allocated to other changes; whichever lands later renumbers, keeping every earlier engine's replay unchanged.
- Engine 28 reopens an accepted item that conflicts with the trunk for a main merge. A `reopen` move may carry `conflict: {files, trunk}`: the files that conflict, and the full trunk commit they conflict with. The CLI takes one exact path per `--conflict <file>` flag and splits or trims nothing inside it, so a path with spaces or commas is named as Git reports it in `git merge-tree --write-tree --name-only -z`; `files` holds those exact paths, nonempty and without NUL. The CLI fills `trunk` from Git and refuses `NOT_CONFLICTING` when the accepted commit merges cleanly, or `CONFLICT_FILES` when a named file is not one Git reports as conflicting. The board refuses `NOT_ACCEPTED` unless the item is verified with an accept at its commit, and `BAD_CONFLICT` for a malformed conflict. A conflict needs no note and no landing failure; the event records `supersedes`, the accept it sets aside, `conflict`, and `cause: "refusal:MERGE_CONFLICT"`, never `landingFailure`, so rigor counts it as a merge conflict and never as a failing test. The item reads `needs main merge` until its next verdict, and the re-review checks the frozen check at the new head. A `reopen` move carrying `conflict` requires engine 28, and older engines refuse it with `RELAY_MOVE` before changing their board or cursor; a board replaying an older engine refuses it with `ENGINE_VERSION`. Moves recorded under engines 27 and earlier replay unchanged. Engine numbers 21 to 27 are allocated to other changes; a gap is fine, a reused number is not.
+ 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. Engines 21 through 23 are allocated to other changes.
+
+ Engine 30 lets a reject and a reopen carry a cause key (`cause`: `test:<file>::<title>`, `refusal:<CODE>`, `row:<id>` or `doctrine:<id>`) and lets the person record a never-again fact with `cause` and `neverAgain: true`, for `pullboard rigor`. Only a move that carries one of these needs engine 30; engine-29 and older moves replay unchanged, and clients on an older engine refuse an engine-30 move with `RELAY_MOVE` before changing their board or cursor. Engine 20 is the implied-items engine above; engine numbers 21 through 29 are allocated to other changes.
+
++Engine 36 reopens an accepted item that conflicts with the trunk for a main merge. A `reopen` move may carry `conflict: {files, trunk}`: the files that conflict, and the full trunk commit they conflict with. The CLI takes one exact path per `--conflict <file>` flag and splits or trims nothing inside it, so a path with spaces or commas is named as Git reports it in `git merge-tree --write-tree --name-only -z`; `files` holds those exact paths, nonempty and without NUL. The CLI fills `trunk` from Git and refuses `NOT_CONFLICTING` when the accepted commit merges cleanly, or `CONFLICT_FILES` when a named file is not one Git reports as conflicting. The board refuses `NOT_ACCEPTED` unless the item is verified with an accept at its commit, and `BAD_CONFLICT` for a malformed conflict. A conflict needs no note and no landing failure; the event records `supersedes`, the accept it sets aside, `conflict`, and `cause: "refusal:MERGE_CONFLICT"`, never `landingFailure`, so rigor counts it as a merge conflict and never as a failing test. The item reads `needs main merge` until its next verdict, and the re-review checks the frozen check at the new head. A `reopen` move carrying `conflict` requires engine 36, and older engines refuse it with `RELAY_MOVE` before changing their board or cursor; a board replaying an older engine refuses it with `ENGINE_VERSION`. Moves recorded under engines 35 and earlier replay unchanged. Engines 34 and 35 are allocated to other changes; a gap is fine, a reused number is not.
+
The CLI declares its engine in every relay request's `X-Pullboard-Engine` header.
A linked board requires at least engine 3 after issuing any agent token, including
revoked or expired tokens. Issuing any machine credential raises that board’s minimum to engine 6, including after revocation or expiry. The minimum survives reopening the auth database;
@@@ -328,11 -332,12 +334,12 @@@ The `event` table is a SQLite schema ob
| `release` | builder | — |
| `submit` | builder | `commit`, `tree`, `policyCommit`, engine-9 `criterionDigest` |
| `reserve` | reviewer | `until` |
- | `accept` | reviewer | `reason`, `commit`, engine-20 `implies` |
- | `reject` | reviewer | `reason`, `commit`, engine-20 `implies` |
- | `reopen` | coordinator | `commit`, `note`, `judgment`, engine-10 `supersedes`, `landingFailure`, engine-28 `conflict`, `cause` |
+ | `accept` | reviewer | `reason`, `commit`, engine-20 `implies`, engine-33 `review` |
+ | `reject` | reviewer | `reason`, `commit`, engine-20 `implies`, engine-33 `review` |
-| `reopen` | coordinator | `commit`, `note`, `judgment`, engine-10 `supersedes`, `landingFailure` |
++| `reopen` | coordinator | `commit`, `note`, `judgment`, engine-10 `supersedes`, `landingFailure`, engine-30 `cause`, engine-36 `conflict` |
| `merged` | coordinator | `commit` |
| `landing_batch` | coordinator | `batch` |
+ | `landing-review-moved` | coordinator | `code`, `batch`, `verdict`, `checked`, `landed` |
| `landing_waiver` | person | `waiver` |
| `landing_flake` | coordinator | `flake` |
| `main-moved` | coordinator | `batch`, `items`, `sha` |
diff --cc docs/lifecycle.md
index 598cf85d,4fec2d60..0b427b54
--- a/docs/lifecycle.md
+++ b/docs/lifecycle.md
@@@ -51,14 -53,14 +53,14 @@@ 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), queuedItemLease (ITEM_LEASE_LOST or A5_GRAMMAR_VERSION or SPEC_BEHIND_MAIN or NOT_A_REPO or NO_CONFIG), gateGreen (GATE_RED or PIPEFAIL_UNAVAILABLE), treeStillDuringGate (MOVED_DURING_GATE), childrenDone (CHILDREN_OPEN), headIsNew (HEAD_NOT_NEW) |
| 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) |
- | 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), trunkConflicts (NOT_CONFLICTING or CONFLICT_FILES or NO_TRUNK or MERGE_CHECK_FAILED), conflictAccepted (NOT_ACCEPTED or BAD_CONFLICT or 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), queuedItemLease (ITEM_LEASE_LOST or A5_GRAMMAR_VERSION or SPEC_BEHIND_MAIN or NOT_A_REPO or NO_CONFIG), itemCheckGreen (CHECK_RED or CHECK_UNVERIFIED), proofNoted (PROOF_REQUIRED), result (LAND_HEADER), result (ENGINE_VERSION) |
+ | reject | submitted, verified | open | agent, coordinator | coordinatorSaysAs (MAIN_IS_COORDINATOR), joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_SUBMITTED), atSubmittedCommit (NOT_AT_COMMIT or OUTSIDE_LANE or NO_POLICY or BAD_CONFIG or GIT_GRAFTS), notMerged (ALREADY_MERGED), verdictReviewRecorded (BAD_VERDICT_REVIEW), reviewTreeCurrent (STALE_VERDICT or DIRTY or UNTRACKED or VERDICT_TRUNK_MOVED), notBuilder (SELF_VERIFY), routeAllows (ROUTE), policyAllows (COORDINATOR_VERIFIES), familyAllows (O2_FAMILY_MATCH), reviewFree (REVIEW_HELD), criterionUnchanged (CRITERIA_CHANGED), reasonCoded (BAD_REASON), noteGiven (NOTE_REQUIRED), causeWellFormed (BAD_CAUSE), result (LAND_HEADER), result (ENGINE_VERSION) |
-| reopen | submitted, verified | open | coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_SUBMITTED), coordinatorOnly (COORDINATOR_ONLY), noteGiven (NOTE_REQUIRED), causeWellFormed (BAD_CAUSE), notMerged (ALREADY_MERGED), landingFailureRecorded (LANDING_FAILURE_REQUIRED) |
++| reopen | submitted, verified | open | coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_SUBMITTED), coordinatorOnly (COORDINATOR_ONLY), noteGiven (NOTE_REQUIRED), causeWellFormed (BAD_CAUSE), notMerged (ALREADY_MERGED), landingFailureRecorded (LANDING_FAILURE_REQUIRED), trunkConflicts (NOT_CONFLICTING or CONFLICT_FILES or NO_TRUNK or MERGE_CHECK_FAILED), conflictAccepted (NOT_ACCEPTED or BAD_CONFLICT or ENGINE_VERSION) |
| 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) |
| refreeze | claimed | claimed | agent, coordinator, when a live claim has a pending coordinator correction | joined (NOT_JOINED), itemExists (NO_ITEM), holderOrCoordinator (NOT_YOURS), inState (CLOSED), rowsInForce (UNKNOWN_SPEC or A5_GRAMMAR_VERSION or NO_POLICY or BAD_CONFIG or SPEC_BEHIND_MAIN) |
@@@ -144,15 -157,9 +157,16 @@@
| NOTE_REQUIRED | a review release gives a nonempty one-line reason, engine 5 or newer, only when freeing a submitted review reservation | release with --note "why", or --note-file <file> |
| REVIEW_COOLDOWN | the reviewer has not released this submission within the past hour, engine 5 or newer, only for the same reviewer and current submission | let another reviewer take it, or wait an hour or for a new submission |
| NOTE_REQUIRED | the move carries a note: what failed, what was tried, or why | --note "..." or --note-file <file> |
+ | BAD_CAUSE | a cause, when given, is test:<file>::<title>, refusal:<CODE>, row:<id> or doctrine:<id> | fix --cause, or leave it out |
| ALREADY_MERGED | the item has no recorded merge receipt | a merged item cannot be reopened |
-| LANDING_FAILURE_REQUIRED | a verified item note names the failing test and landing merge commit | cite the recorded batch, or name the test and merge commit in a manual note |
+| LANDING_FAILURE_REQUIRED | a verified item note names the failing test and landing merge commit, unless the reopen names a trunk conflict | cite the recorded batch, or name the test and merge commit in a manual note; work that only conflicts with the trunk reopens with --conflict <file> for each conflicting file |
+| NOT_CONFLICTING | the accepted commit no longer merges onto the trunk, and every named file is one that conflicts, only for reopen --conflict by the coordinator on accepted, unmerged work | merge it, or reopen after a red landing with --note "<test file>: <test name>; merge commit <sha>" |
+| CONFLICT_FILES | the accepted commit no longer merges onto the trunk, and every named file is one that conflicts, only for reopen --conflict by the coordinator on accepted, unmerged work | name only files Git reports as conflicting with the trunk |
+| NO_TRUNK | the accepted commit no longer merges onto the trunk, and every named file is one that conflicts, only for reopen --conflict by the coordinator on accepted, unmerged work | check out the trunk branch in the main checkout once and run pullboard inbox |
+| MERGE_CHECK_FAILED | the accepted commit no longer merges onto the trunk, and every named file is one that conflicts, only for reopen --conflict by the coordinator on accepted, unmerged work | use Git 2.38 or newer, restore its objects and retry |
- | NOT_ACCEPTED | a trunk conflict reopens an accepted item, names its files and the full trunk commit, and replays only under engine 28 or later, only for reopen --conflict | reopen a submission with --note "why" |
- | BAD_CONFLICT | a trunk conflict reopens an accepted item, names its files and the full trunk commit, and replays only under engine 28 or later, only for reopen --conflict | run pullboard reopen <id> --conflict <file> from the main checkout |
- | ENGINE_VERSION | a trunk conflict reopens an accepted item, names its files and the full trunk commit, and replays only under engine 28 or later, only for reopen --conflict | upgrade Pullboard on every linked device before using --conflict |
++| NOT_ACCEPTED | a trunk conflict reopens an accepted item, names its files and the full trunk commit, and replays only under engine 36 or later, only for reopen --conflict | reopen a submission with --note "why" |
++| BAD_CONFLICT | a trunk conflict reopens an accepted item, names its files and the full trunk commit, and replays only under engine 36 or later, only for reopen --conflict | run pullboard reopen <id> --conflict <file> from the main checkout |
++| ENGINE_VERSION | a trunk conflict reopens an accepted item, names its files and the full trunk commit, and replays only under engine 36 or later, only for reopen --conflict | upgrade Pullboard on every linked device before using --conflict |
| LAND_HEADER | a displayed merge command fits the commit-header limit (accept result) | shorten the item title or cited rows so the merge header fits |
| ENGINE_VERSION | a verdict that implies items replays only under engine 20 or later (accept result) | upgrade Pullboard on every linked device before using --implies |
| LAND_HEADER | a displayed merge command fits the commit-header limit (reject result) | shorten the item title or cited rows so the merge header fits |
diff --cc src/api-moves.js
index 97adf559,496cc51b..a3304689
--- a/src/api-moves.js
+++ b/src/api-moves.js
@@@ -17,7 -18,7 +18,7 @@@ const MOVES =
merged: { item: true, positions: ['commit'] },
withdraw: { item: true, positions: ['reason'] },
refreeze: { item: true },
- reopen: { item: true, flags: ['note'], lists: ['conflict'] },
- reopen: { item: true, flags: ['note', 'cause'] },
++ reopen: { item: true, flags: ['note', 'cause'], lists: ['conflict'] },
escalate: { item: true, flags: ['note'] },
hold: { positions: ['lane'], flags: ['reason'], booleans: ['off'] },
shout: { positions: ['to', 'text'], optional: ['to'], booleans: ['decision'], flags: ['evidence', 'outcome', 'item', 'commit'] },
diff --cc src/board.js
index 134dbe28,38f376bc..08d1f179
--- a/src/board.js
+++ b/src/board.js
@@@ -13,12 -15,16 +15,17 @@@ import { DatabaseSync } from 'node:sqli
import { boardNotWritable } from './board-access.js';
import { briefFiles, briefSections } from './brief.js';
import { COORDINATOR } from './config.js';
- import { ENGINE_VERSION, GUARDS, IN_STATE, MOVES, STATES, UNKNOWN_MOVE, effectiveGuards, storeTriggers } from './machine.js';
+ import { ENGINE_VERSION, VERDICT_REVIEW_ENGINE, GUARDS, IN_STATE, MOVES, STATES, UNKNOWN_MOVE, effectiveGuards, storeTriggers } from './machine.js';
import { Refused } from './refused.js';
+ import { causeProblem, requireNeverAgain } from './rigor.js';
import { barCorrectionFields } from './bar-corrections.js';
+import { conflictDetail, conflictNote, conflictProblem } from './trunk-conflict.js';
+ import { factReference } from './fact-reference.js';
import { factFromEvent, requestAnswerRefusal, tellAnswerImplications, tellFactImplications, tellVerdictImplications } from './implies.js';
+ import { landingFlakes, landingWaiverCovers, landingWaiverKind } from './landing-exceptions.js';
import { parseSpec } from './spec.js';
+ export { landingFlakes, landingWaiverCovers, landingWaiverKind };
+ export { acceptCheck } from './check-accept.js';
export const ACCEPT_REASON = 'CRITERION_MET';
export const PERSON = 'person';
@@@ -1540,13 -1558,12 +1559,13 @@@ export function verify(board, id, { age
*
* @param {any} board
* @param {number} id
- * @param {{ agentId: string, note: string }} request
+ * @param {{ agentId: string, note: string, cause?: string }} request
* @returns {{ id: number, commit: string, supersedes?: number, landingFailure?: object }}
*/
- export function reopen(board, id, { agentId, note = '', conflict }) {
-export function reopen(board, id, { agentId, note, cause }) {
++export function reopen(board, id, { agentId, note = '', conflict, cause }) {
return atomic(board, () => {
let submittedCommit = null;
+ const forMerge = conflict !== undefined && conflict !== null;
let supersedes;
let landingFailure;
const currentEngine = board.executionEngineVersion ?? ENGINE_VERSION;
@@@ -1558,7 -1575,8 +1577,8 @@@
joined: null,
[IN_STATE]: (found) => new Refused('NOT_SUBMITTED', `item #${id} is ${current(board, found).item_status}, not submitted`),
coordinatorOnly: () => onlyCoordinator(agentId, 'reopens submissions'),
- noteGiven: () => (note.trim() ? null : new Refused('NOTE_REQUIRED', 'say why the criterion needs correction: --note "why"')),
+ noteGiven: () => (forMerge || note.trim() ? null : new Refused('NOTE_REQUIRED', 'say why the criterion needs correction: --note "why"')),
+ causeWellFormed: () => causeProblem(cause),
notMerged: (found) => found.item_status !== 'verified' || !found.item_merged_commit
? null
: new Refused('ALREADY_MERGED', `item #${id} was merged as ${found.item_merged_commit}; merged items cannot be reopened`),
@@@ -1596,9 -1612,9 +1616,10 @@@
};
},
});
- logEvent(board, agentId, 'reopen', id, { commit: submittedCommit, note: note.trim(), judgment: null,
- ...(supersedes ? { supersedes, landingFailure } : {}), ...(cause !== undefined && cause !== null ? { cause } : {}) });
- return { id: item.item_id, commit: submittedCommit, ...(supersedes ? { supersedes, landingFailure } : {}) };
+ const returned = forMerge ? { supersedes, ...conflictDetail(conflict) } : supersedes ? { supersedes, landingFailure } : {};
- logEvent(board, agentId, 'reopen', id, { commit: submittedCommit, note: note.trim() || conflictNote(conflict), judgment: null, ...returned });
++ logEvent(board, agentId, 'reopen', id, { commit: submittedCommit, note: note.trim() || conflictNote(conflict), judgment: null,
++ ...(cause !== undefined && cause !== null ? { cause } : {}), ...returned });
+ return { id: item.item_id, commit: submittedCommit, ...returned };
});
}
diff --cc src/cli.js
index c38b1405,c8c764bb..ce11fea0
--- a/src/cli.js
+++ b/src/cli.js
@@@ -86,7 -90,8 +91,8 @@@ import { serveMcp } from './mcp.js'
import { doctorProblems, doctrineProblems } from './doctor.js';
import { boardHealth, healthLines } from './health.js';
import { staleFrozenItems, staleItemFinding } from './approved-rows.js';
-import { mainPolicy, policyAt, itemPolicy, submissionPaths, frozenCheck, checkAtCommit, dependencySnapshots, requireTrunkMerge, trunkRef } from './trusted-policy.js';
+import { mainPolicy, policyAt, itemPolicy, submissionPaths, frozenCheck, checkAtCommit, dependencySnapshots, requireTrunkMerge, trunkMerge, trunkRef } from './trusted-policy.js';
+ import { captureVerdictReview, staleVerdictRefusal, verdictProjector, verdictTrunk } from './verdict-freshness.js';
import { proofStats } from './stats.js';
import { flowLines, flowAlertLine } from './stats-flow.js';
import { releaseHeadlinesBetween } from './changelog.js';
@@@ -311,7 -320,8 +321,9 @@@ const OPTIONS =
commit: { type: 'string' },
ref: { type: 'string' },
supersedes: { type: 'string' },
+ conflict: { type: 'string', multiple: true },
+ cause: { type: 'string' },
+ 'never-again': { type: 'boolean' },
implies: { type: 'string' },
owns: { type: 'string' },
help: { type: 'boolean', short: 'h' },
@@@ -860,10 -890,11 +892,11 @@@ function itemLine(item, name = (id) =>
const specs = item.item_spec_ids ? ` [${item.item_spec_ids}]` : '';
const parent = item.item_parent_id ? ` under #${item.item_parent_id}` : '';
const after = item.item_after ? ` after ${item.item_after.split(',').map((id) => `#${id}`).join(',')}` : '';
- const rejected = item.item_status === 'open' && item.item_verdict === 'REJECT' ? ' (rejected)' : '';
+ const rejected = item.item_status === 'open' && item.item_verdict === 'REJECT' ? ' (rejected)' : mainMerge ? ` (${MAIN_MERGE_LABEL})` : '';
const light = item.item_route === 'strong' ? '' : ` ${item.item_route}`;
+ const staleVerdict = item.item_verdict_state ? ` ${item.item_verdict_state.code}` : '';
const hold = item.item_hold_reason ? ` held by ${name(item.item_hold_by)}: ${item.item_hold_reason}` : '';
- return `#${item.item_id} ${item.item_status}${holder}${verifier}${rejected} ${item.item_lane} ${item.item_title}${specs}${parent}${after}${light}${hold}`;
+ return `#${item.item_id} ${item.item_status}${holder}${verifier}${rejected} ${item.item_lane} ${item.item_title}${specs}${parent}${after}${light}${hold}${staleVerdict}`;
}
/** Format a stable agent id for human-facing CLI output. */
@@@ -1393,9 -1436,9 +1439,10 @@@ function resumeHere(io, view)
for (const { item, verdict } of card.sentBack) {
say(`sent back: #${item.item_id} ${verdict ? `${verdict.verdict_reason} by ${name(verdict.verdict_by)}: ${firstLine(verdict.verdict_note)}` : 'rejected'}`);
}
+ for (const { item, merge } of card.mainMerges) say(mainMergeLines(item, merge, name).join('; '));
if (isMain && card.staleFollowUps.count) say(`${plural(card.staleFollowUps.count, 'stale follow-up')}; list them with ${card.staleFollowUps.list}`);
else if (!isMain) for (const item of card.stale) say(`stale: ${item.message}; next: ${item.next}`);
+ for (const item of card.staleVerdicts) say(staleVerdictRefusal(item, item.item_verdict_state).message);
if (card.awaiting.length) say(`awaiting a verdict: ${card.awaiting.map((item) => `#${item.item_id} (${span(ctx, item.item_updated_at)})`).join(', ')}`);
if (isMain) {
for (const batch of card.landingBatches.filter((entry) => !['landed', 'blocked'].includes(entry.state))) say(`landing ${batch.id}: ${batch.state}, owner ${batch.owner}, tip ${batch.tip}; log ${batch.logPath}; next: pullboard land --adopt`);
@@@ -2030,9 -2027,9 +2031,9 @@@ function readCommands(io, { first, seco
},
list: () => {
const ctx = context(io);
- const { items, agents } = withBoard(ctx, (board) => ({
+ const { items, agents, merging } = withBoard(ctx, (board) => ({
- items: store.listItems(board, { lane: first, all: values.all }),
+ items: store.listItems(board, { lane: first, all: values.all }).map(verdictProjector(ctx.info.root, board).project),
- agents: store.listAgents(board),
+ agents: store.listAgents(board), merging: new Set(store.listItems(board, { lane: first }).filter((item) => mainMergeFor(board, item.item_id)).map((item) => item.item_id)),
}));
const filtered = items.filter((item) => !values.route || item.item_route === values.route);
if (values.json) io.result({ items: filtered });
@@@ -2069,8 -2066,8 +2070,8 @@@
show: () => {
const ctx = context(io);
const id = idArg(first);
- const { item, verdicts, moves, thread, related, reviewer, agents } = withBoard(ctx, (board) => ({
+ const { item, verdicts, moves, thread, related, reviewer, agents, mainMerge } = withBoard(ctx, (board) => ({
- item: store.getItem(board, id),
+ item: verdictProjector(ctx.info.root, board).project(store.getItem(board, id)),
verdicts: store.verdictsFor(board, id),
moves: store.events(board, { itemId: id }).filter((event) => ['attempt', 'escalate'].includes(event.event_kind)),
thread: store.itemThread(board, id),
@@@ -2083,7 -2080,8 +2084,8 @@@
io.result({ ...item, verdicts, thread });
return 0;
}
- io.say(itemLine(item, agentName));
+ io.say(itemLine(item, agentName, Boolean(mainMerge)));
+ if (item.item_verdict_state) io.say(staleVerdictRefusal(item, item.item_verdict_state).message);
if (item.item_criterion) io.say(`criterion: ${item.item_criterion}`);
if (item.item_check) io.say(`check: ${item.item_check}`);
sayCheckBaseline(io, item);
@@@ -3196,9 -3327,12 +3332,11 @@@ function workCommands(io, args)
return 0;
}),
reopen: () => act(async (ctx, board, me) => {
- const result = await ordered(ctx, board, 'reopen', [idArg(first), { agentId: me.id, note: textArg(io, values, 'note') ?? '', ...(values.conflict === undefined ? {} : { conflict: reopenConflict({ item: store.getItem(board, idArg(first)), coordinator: me.id === COORDINATOR, values: values.conflict, trunkMerge: (commit) => trunkMerge(ctx.info.root, commit) }) }) }]);
+ const result = await ordered(ctx, board, 'reopen', [idArg(first), { agentId: me.id, note: textArg(io, values, 'note') ?? '',
- ...(values.cause !== undefined ? { cause: values.cause } : {}) }]);
++ ...(values.cause !== undefined ? { cause: values.cause } : {}),
++ ...(values.conflict === undefined ? {} : { conflict: reopenConflict({ item: store.getItem(board, idArg(first)), coordinator: me.id === COORDINATOR, values: values.conflict, trunkMerge: (commit) => trunkMerge(ctx.info.root, commit) }) }) }]);
io.result?.(result);
- io.say(result.landingFailure
- ? `reopened #${first} after landing failure; previous accept remains recorded at ${result.commit.slice(0, 12)}`
- : `reopened #${first} without a verdict; previous commit ${result.commit.slice(0, 12)} remains recorded`);
+ io.say(reopenedLine(first, result));
return 0;
}),
shout: () => act(async (ctx, board, me) => {
diff --cc src/engine.js
index 4b42551c,a88943bd..10bf1176
--- a/src/engine.js
+++ b/src/engine.js
@@@ -4,8 -4,8 +4,9 @@@ 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 { carriesConflict, CONFLICT_ENGINE } from './trunk-conflict.js';
- import { ENGINE_VERSION } from './machine.js';
+ import { CHECK_ACCEPT_ENGINE } from './check-accept.js';
+ import { CAUSE_ENGINE, 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';
@@@ -23,12 -23,21 +24,22 @@@ 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, implied items engine-20 and trunk conflicts engine-28, without changing ordinary historical envelopes. */
- function minimumOperationEngine(operation, args) {
-/** Dependency edits, bar reasons and sealed review metadata retain their distinct recorded engine meanings. */
++/** Dependency edits, bar reasons, sealed review metadata and trunk conflicts retain their distinct recorded engine meanings. */
+ function minimumOperationEngine(operation, args, board) {
const options = args[1];
+ if (carriesConflict(operation, args)) return CONFLICT_ENGINE;
+ const given = (name) => Boolean(options && typeof options === 'object' && Object.hasOwn(options, name) && options[name] !== undefined && options[name] !== null && options[name] !== false);
+ 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 (['verify', 'reopen', 'appendFact'].includes(operation) && (given('cause') || given('neverAgain') || given('asPerson'))) return CAUSE_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/help.js
index bb75ba95,62625747..1830ca2e
--- a/src/help.js
+++ b/src/help.js
@@@ -129,9 -137,7 +137,9 @@@ Coordinato
pullboard merged <id> <commit> record where verified work landed
pullboard withdraw <id> <reason> drop an item nobody should build
pullboard refreeze <id> adopt a corrected criterion or changed spec rows
- pullboard reopen <id> --note "why" return a submission for criterion correction without a verdict
+ pullboard reopen <id> --note "why" [--cause <key>] return a submission for criterion correction without a verdict
+ pullboard reopen <id> --conflict <file> [--conflict <file>]
+ return accepted work that conflicts with the trunk for a main merge
pullboard hold <lane> --reason "..." pause a lane: next there claims nothing and names the reason
pullboard hold <id> "reason" hold one item so next skips it
pullboard hold <lane|id> --off lift a lane or item hold
@@@ -282,10 -297,9 +299,10 @@@ const HELP_ALIASES =
const HELP_FLAG_EXPLANATIONS = {
'--after': 'claiming waits until those items are verified',
- '--blueprint': 'start from a bundled blueprint or a JSON file',
+ '--blueprint': 'start from a bundled blueprint or a JSON file; repeat it for one product, one architecture and any practice blueprints',
'--brief': 'what a cold agent needs',
'--check': 'the command that proves it',
+ '--conflict': 'one conflicting file, exactly as Git names it; repeat it for each file',
'--doctrine': 'proposes a doctrine ruling; only the person can approve it',
'--family': 'records the family name',
'--model': 'identifies the agent model; required unless PULLBOARD_MODEL is set',
diff --cc src/machine.js
index 1e33cfd7,d569abe7..a7ac792a
--- a/src/machine.js
+++ b/src/machine.js
@@@ -10,7 -10,13 +10,13 @@@
*/
/** Executable move semantics, carried by every sealed move and retained during replay [H16]. */
- export const ENGINE_VERSION = 28;
-export const ENGINE_VERSION = 33;
++export const ENGINE_VERSION = 36;
+
+ /** The engine at which a reject, reopen or person fact can carry a cause key (#713); older moves replay unchanged [D1,H16]. */
+ export const CAUSE_ENGINE = 30;
+
+ /** First released engine binding the checked composition, review trunk and paths [E8,H16]. */
+ export const VERDICT_REVIEW_ENGINE = 33;
/** @typedef {'agent' | 'coordinator' | 'clock'} Role */
@@@ -139,10 -149,9 +149,11 @@@ export const GUARDS =
{ id: 'reviewReleaseExplained', refuse: 'NOTE_REQUIRED', rule: 'a review release gives a nonempty one-line reason', next: 'release with --note "why", or --note-file <file>', source: 'board', when: 'engine 5 or newer, only when freeing a submitted review reservation' },
{ id: 'reviewCooldownElapsed', refuse: 'REVIEW_COOLDOWN', rule: 'the reviewer has not released this submission within the past hour', next: 'let another reviewer take it, or wait an hour or for a new submission', source: 'board', when: 'engine 5 or newer, only for the same reviewer and current submission' },
{ id: 'noteGiven', refuse: 'NOTE_REQUIRED', rule: 'the move carries a note: what failed, what was tried, or why', next: '--note "..." or --note-file <file>', source: 'board' },
+ { id: 'causeWellFormed', refuse: 'BAD_CAUSE', rule: 'a cause, when given, is test:<file>::<title>, refusal:<CODE>, row:<id> or doctrine:<id>', next: 'fix --cause, or leave it out', source: 'board' },
{ id: 'notMerged', refuse: 'ALREADY_MERGED', rule: 'the item has no recorded merge receipt', next: 'a merged item cannot be reopened', source: 'board' },
- { id: 'landingFailureRecorded', refuse: 'LANDING_FAILURE_REQUIRED', rule: 'a verified item note names the failing test and landing merge commit', next: 'cite the recorded batch, or name the test and merge commit in a manual note', source: 'board' },
+ { id: 'landingFailureRecorded', refuse: 'LANDING_FAILURE_REQUIRED', rule: 'a verified item note names the failing test and landing merge commit', next: 'cite the recorded batch, or name the test and merge commit in a manual note; work that only conflicts with the trunk reopens with --conflict <file> for each conflicting file', source: 'board', when: 'unless the reopen names a trunk conflict' },
+ { id: 'trunkConflicts', refuse: 'NOT_CONFLICTING', alsoRefuses: [{ code: 'CONFLICT_FILES', next: 'name only files Git reports as conflicting with the trunk' }, { code: 'NO_TRUNK', next: 'check out the trunk branch in the main checkout once and run pullboard inbox' }, { code: 'MERGE_CHECK_FAILED', next: 'use Git 2.38 or newer, restore its objects and retry' }], rule: 'the accepted commit no longer merges onto the trunk, and every named file is one that conflicts', next: 'merge it, or reopen after a red landing with --note "<test file>: <test name>; merge commit <sha>"', source: 'cli', when: 'only for reopen --conflict by the coordinator on accepted, unmerged work' },
- { id: 'conflictAccepted', refuse: 'NOT_ACCEPTED', alsoRefuses: [{ code: 'BAD_CONFLICT', next: 'run pullboard reopen <id> --conflict <file> from the main checkout' }, { code: 'ENGINE_VERSION', next: 'upgrade Pullboard on every linked device before using --conflict' }], rule: 'a trunk conflict reopens an accepted item, names its files and the full trunk commit, and replays only under engine 28 or later', next: 'reopen a submission with --note "why"', source: 'board', when: 'only for reopen --conflict' },
++ { id: 'conflictAccepted', refuse: 'NOT_ACCEPTED', alsoRefuses: [{ code: 'BAD_CONFLICT', next: 'run pullboard reopen <id> --conflict <file> from the main checkout' }, { code: 'ENGINE_VERSION', next: 'upgrade Pullboard on every linked device before using --conflict' }], rule: 'a trunk conflict reopens an accepted item, names its files and the full trunk commit, and replays only under engine 36 or later', next: 'reopen a submission with --note "why"', source: 'board', when: 'only for reopen --conflict' },
];
/** @type {Move[]} */
@@@ -181,9 -190,9 +192,9 @@@ export const MOVES =
},
{
verb: 'reopen', from: ['submitted', 'verified'], to: 'open', by: ['coordinator'], refuse: 'NOT_SUBMITTED',
- guards: ['joined', 'itemExists', IN_STATE, 'coordinatorOnly', 'noteGiven', 'notMerged', 'landingFailureRecorded', 'trunkConflicts', 'conflictAccepted'],
- guards: ['joined', 'itemExists', IN_STATE, 'coordinatorOnly', 'noteGiven', 'causeWellFormed', 'notMerged', 'landingFailureRecorded'],
++ guards: ['joined', 'itemExists', IN_STATE, 'coordinatorOnly', 'noteGiven', 'causeWellFormed', 'notMerged', 'landingFailureRecorded', 'trunkConflicts', 'conflictAccepted'],
sets: ['item_verdict', 'item_verified_by', 'item_owner', 'item_lease_until', 'item_review_by', 'item_review_until'],
- command: 'pullboard reopen <id> --note "why"',
+ command: 'pullboard reopen <id> --note "why" | --conflict <file> [--conflict <file>]',
},
{
verb: 'escalate', from: ['open', 'claimed'], to: 'open', by: ['agent', 'coordinator'], refuse: 'CLOSED',
diff --cc src/next-steps.js
index 03e7f3fd,22870cc8..139a1886
--- a/src/next-steps.js
+++ b/src/next-steps.js
@@@ -138,15 -150,13 +150,17 @@@ export const NEXT_STEPS = Object.freeze
IMPORT_NOT_EMPTY: 'import into a fresh repo whose board is empty: git init <dir> && cd <dir> && pullboard init',
IMPORT_SCHEMA: 'export and import with the same Pullboard version',
IMPORT_VERSION: 'export the board again with this Pullboard version: pullboard export > board.json',
+ INLINE_GATE: 'use the gate as its own flag: pullboard spec draft "<text>" --gate "<check>"',
INTERNAL: 'run the command again; if it repeats, report it with pullboard shout coordinator "<command and output>"',
ITEM_HELD: 'take another item with pullboard next while the coordinator holds this one',
+ ITEM_LEASE_LOST: 'read pullboard show <id>; if the item is free, claim it again for a build or reserve it with pullboard next --verify <id> for a review, then retry',
ITEM_NOT_AVAILABLE: 'read the item from this API\'s board state',
ITEM_NOT_OPEN: 'hold only open or claimed items; see pullboard list',
- LANDING_FAILURE_REQUIRED: 'reopen with --note "<test file>: <test name>; merge commit <sha>"',
+ LANDING_FAILURE_REQUIRED: 'reopen with --note "<test file>: <test name>; merge commit <sha>", or with --conflict <file> for each conflicting file when it only conflicts with the trunk',
+ NOT_CONFLICTING: 'merge it; reopen only after a red landing, with --note "<test file>: <test name>; merge commit <sha>"',
+ CONFLICT_FILES: 'name only the files Git reports as conflicting with the trunk: pullboard reopen <id> --conflict <file> [--conflict <file>]',
+ NOT_ACCEPTED: 'reopen a submission with --note "why"; --conflict is for accepted work',
+ BAD_CONFLICT: 'run pullboard reopen <id> --conflict <file> [--conflict <file>] from the main checkout',
LANE_TAKEN: 'choose a different lane name with pullboard lane add',
LAND_ADOPT: 'read pullboard resume, then run pullboard land --adopt, or pullboard land when nothing is unfinished',
LAND_BATCH: 'adopt the recorded batch: pullboard land --adopt',
diff --cc src/trunk-conflict.js
index 79021ddd,00000000..4bb74515
mode 100644,000000..100644
--- a/src/trunk-conflict.js
+++ b/src/trunk-conflict.js
@@@ -1,195 -1,0 +1,195 @@@
+/**
+ * An accepted item that conflicts with the trunk reopens for a main merge [B3,D1].
+ *
+ * When two accepted items touch the same lines, the second no longer merges onto the trunk. That
+ * is not a failed test and not a reject: the work was accepted and only needs main merged into
+ * it. `pullboard reopen <id> --conflict <file>` (once per file) records exactly that, naming the conflicting
+ * files and the trunk commit they conflict with, and keeps the original accept on record. The
+ * builder claims it with its bar unchanged, merges main and resubmits; the re-review checks the
+ * frozen check at the new head and nothing else.
+ */
+import { ENGINE_VERSION } from './machine.js';
+import { Refused } from './refused.js';
+
+/** The engine whose reopen may carry a trunk conflict; older engines refuse it before replay. */
- export const CONFLICT_ENGINE = 28;
++export const CONFLICT_ENGINE = 36;
+
+/** The label an item carries from a conflict reopen until its next verdict. */
+export const MAIN_MERGE_LABEL = 'needs main merge';
+
+/**
+ * True when a sealed move carries this engine's meaning, a trunk conflict on a reopen.
+ *
+ * @param {string} operation
+ * @param {any[]} args
+ * @returns {boolean}
+ */
+export function carriesConflict(operation, args) {
+ return operation === 'reopen' && args?.[1]?.conflict !== undefined && args?.[1]?.conflict !== null;
+}
+
+/**
+ * The file paths `--conflict` names: one exact path per flag, in order, without repeats. Nothing is
+ * split or trimmed inside a value, because a Git path may hold spaces, commas or any byte but NUL,
+ * and it must match the path `git merge-tree -z` reports byte for byte.
+ *
+ * @param {string | string[] | undefined} values - one value per --conflict flag
+ * @returns {string[]}
+ */
+export function conflictFiles(values) {
+ return [...new Set([values ?? []].flat())];
+}
+
+/**
+ * A path as a reader sees it in a message or line: plain when it holds only ordinary path
+ * characters, otherwise JSON-quoted, so a space or comma inside a name never reads as two names.
+ *
+ * @param {string} path
+ * @returns {string}
+ */
+export function shownPath(path) {
+ return /^[\w./@+-]+$/u.test(path) ? path : JSON.stringify(path);
+}
+
+/** Paths for a message or line, each shown unambiguously, separated by commas. */
+const shownPaths = (paths) => paths.map(shownPath).join(', ');
+
+/**
+ * Check the trunk for the conflict the coordinator names, so --conflict cannot stand in for a
+ * landing failure note on work that merges cleanly. Every named file must be one Git reports as
+ * conflicting; the trunk commit comes from Git, never from the caller.
+ *
+ * @param {(commit: string) => { ref: string, commit: string, files: string[] | null }} trunkMerge - merges onto the trunk in memory
+ * @param {string} commit - the accepted commit
+ * @param {string[]} files - the files the coordinator names
+ * @returns {{ files: string[], trunk: string }}
+ */
+export function requireTrunkConflict(trunkMerge, commit, files) {
+ if (!files.length || files.some((file) => !file || file.includes('\0'))) throw new Refused('CONFLICT_FILES', 'name each file that conflicts with its own flag: pullboard reopen <id> --conflict <file> [--conflict <file>]');
+ const merge = trunkMerge(commit);
+ const branch = merge.ref.replace(/^refs\/heads\//u, '');
+ if (!merge.files) throw new Refused('NOT_CONFLICTING', `${commit.slice(0, 12)} merges cleanly onto ${branch} at ${merge.commit.slice(0, 12)}; merge it, or reopen with --note "<test file>: <test name>; merge commit <sha>" after a red landing`);
+ const unknown = files.filter((file) => !merge.files.includes(file));
+ if (unknown.length) throw new Refused('CONFLICT_FILES', `${shownPaths(unknown)} ${unknown.length === 1 ? 'does' : 'do'} not conflict with ${branch} at ${merge.commit.slice(0, 12)}; the conflicting files are ${shownPaths(merge.files) || 'unnamed'}; name each with its own --conflict <file>`);
+ return { files, trunk: merge.commit };
+}
+
+/**
+ * The conflict a coordinator's `--conflict` names, with the trunk commit Git reports. Anyone else,
+ * or an item that is not accepted and unmerged, gets the files alone, so the board's own guards
+ * refuse it in their declared order (COORDINATOR_ONLY, NOT_SUBMITTED, ALREADY_MERGED, NOT_ACCEPTED).
+ *
+ * @param {{ item: any, coordinator: boolean, values: string | string[] | undefined, trunkMerge: (commit: string) => { ref: string, commit: string, files: string[] | null } }} request
+ * @returns {{ files: string[], trunk: string | null }}
+ */
+export function reopenConflict({ item, coordinator, values, trunkMerge }) {
+ const files = conflictFiles(values);
+ if (!coordinator || item.item_status !== 'verified' || item.item_merged_commit || !item.item_commit) return { files, trunk: null };
+ return requireTrunkConflict(trunkMerge, item.item_commit, files);
+}
+
+/**
+ * The refusal for a conflict reopen the board cannot record, or null. A conflict reopens only an
+ * accepted item, and only under this engine; it names its files and a full trunk commit.
+ *
+ * @param {any} board
+ * @param {any} item
+ * @param {unknown} conflict
+ * @param {(accept: number) => void} found - receives the id of the accept the reopen sets aside
+ * @returns {Refused | null}
+ */
+export function conflictProblem(board, item, conflict, found) {
+ const engine = board.executionEngineVersion ?? ENGINE_VERSION;
+ if (engine < CONFLICT_ENGINE) return new Refused('ENGINE_VERSION', `a reopen for a main merge requires engine ${CONFLICT_ENGINE}; this board uses engine ${engine}; upgrade Pullboard before using --conflict`);
+ if (item.item_status !== 'verified') return new Refused('NOT_ACCEPTED', `item #${item.item_id} is ${item.item_status}; --conflict reopens accepted work for a main merge, and a submission reopens with --note "why"`);
+ const shape = /** @type {any} */ (conflict);
+ const files = Array.isArray(shape?.files) ? shape.files : [];
+ if (!files.length || files.some((file) => typeof file !== 'string' || !file || file.includes('\0')) || new Set(files).size !== files.length
+ || !/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u.test(shape?.trunk ?? '')) {
+ return new Refused('BAD_CONFLICT', 'a trunk conflict names its files and the full trunk commit; run pullboard reopen <id> --conflict <file> from the main checkout');
+ }
+ const accept = board.db.prepare("SELECT event_id FROM event WHERE item_id = ? AND event_kind = 'accept' AND json_extract(event_detail, '$.commit') = ? ORDER BY event_id DESC LIMIT 1").get(item.item_id, item.item_commit);
+ if (!accept) return new Refused('NOT_ACCEPTED', `item #${item.item_id} has no accept at ${String(item.item_commit).slice(0, 12)}; --conflict reopens accepted work for a main merge`);
+ found(accept.event_id);
+ return null;
+}
+
+/**
+ * The cause key a trunk conflict records: the refusal Pullboard gives work that no longer merges.
+ * Rigor (#713) reads cause keys and never counts a merge conflict, so a conflict reopen is never a
+ * failing test, nor an uncaused reopen; two branches touching the same lines is no rule to learn.
+ */
+export const TRUNK_CONFLICT_CAUSE = 'refusal:MERGE_CONFLICT';
+
+/**
+ * The event fields a conflict reopen records: the conflict itself and its cause key.
+ *
+ * @param {{ files: string[], trunk: string }} conflict
+ * @returns {{ conflict: { files: string[], trunk: string }, cause: string }}
+ */
+export function conflictDetail({ files, trunk }) {
+ return { conflict: { files, trunk }, cause: TRUNK_CONFLICT_CAUSE };
+}
+
+/** The note a conflict reopen records when the coordinator gives none. */
+export function conflictNote({ files, trunk }) {
+ return `conflicts with the trunk at ${trunk.slice(0, 12)} in ${shownPaths(files)}; merge main and resubmit`;
+}
+
+/**
+ * The trunk conflict an item still carries, or null: the newest reopen, accept or reject on it is
+ * a conflict reopen. It names the accept it set aside, so the re-review knows what already passed.
+ *
+ * @param {any} board
+ * @param {number} id
+ * @returns {{ files: string[], trunk: string, commit: string, at: string, accept: { by: string, commit: string } | null } | null}
+ */
+export function mainMergeFor(board, id) {
+ const last = board.db.prepare("SELECT event_detail, event_at FROM event WHERE item_id = ? AND event_kind IN ('reopen', 'accept', 'reject') ORDER BY event_id DESC LIMIT 1").get(id);
+ const detail = last ? JSON.parse(last.event_detail) : null;
+ if (!detail?.conflict) return null;
+ const accept = board.db.prepare('SELECT event_by, event_detail FROM event WHERE event_id = ?').get(detail.supersedes);
+ return { ...detail.conflict, commit: detail.commit, at: last.event_at,
+ accept: accept ? { by: accept.event_by, commit: JSON.parse(accept.event_detail).commit } : null };
+}
+
+/**
+ * The lines `pullboard show` prints for an item that needs a main merge: what conflicts, then
+ * what to do now, for the builder before resubmitting and for the reviewer after.
+ *
+ * @param {any} item
+ * @param {NonNullable<ReturnType<typeof mainMergeFor>>} merge
+ * @param {(id: string) => string} [name]
+ * @returns {string[]}
+ */
+export function mainMergeLines(item, merge, name = (id) => id) {
+ const accepted = merge.accept ? `accepted by ${name(merge.accept.by)} at ${merge.accept.commit.slice(0, 12)}` : 'accepted';
+ const head = `${MAIN_MERGE_LABEL}: ${accepted}; conflicts with the trunk at ${merge.trunk.slice(0, 12)} in ${shownPaths(merge.files)}`;
+ if (item.item_status === 'submitted') return [head, `re-review: main merge only; run the frozen check at ${item.item_commit.slice(0, 12)}; the accept above stands for the rest`];
+ return [head, `next: pullboard claim ${item.item_id} (the bar is unchanged), merge main, resolve ${shownPaths(merge.files)}, commit, pullboard submit ${item.item_id}`];
+}
+
+/**
+ * The items among `items` that still need a main merge, each with its conflict, for resume.
+ *
+ * @param {any} board
+ * @param {any[]} items
+ * @returns {{ item: any, merge: NonNullable<ReturnType<typeof mainMergeFor>> }[]}
+ */
+export function mainMergesFor(board, items) {
+ return items.map((item) => ({ item, merge: mainMergeFor(board, item.item_id) })).filter(({ merge }) => merge);
+}
+
+/**
+ * The line `pullboard reopen` prints: for a main merge, after a landing failure, or without a verdict.
+ *
+ * @param {string} id
+ * @param {{ commit: string, conflict?: { files: string[], trunk: string }, landingFailure?: object }} result
+ * @returns {string}
+ */
+export function reopenedLine(id, result) {
+ if (result.conflict) return `reopened #${id} for a main merge: conflicts with the trunk at ${result.conflict.trunk.slice(0, 12)} in ${shownPaths(result.conflict.files)}; the accept at ${result.commit.slice(0, 12)} stays recorded`;
+ return result.landingFailure
+ ? `reopened #${id} after landing failure; previous accept remains recorded at ${result.commit.slice(0, 12)}`
+ : `reopened #${id} without a verdict; previous commit ${result.commit.slice(0, 12)} remains recorded`;
+}
diff --cc test/agent-model-engine.test.js
index bf85a56f,d0bca12b..3d6edd00
--- 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 11 semantics [O8,O3,H16]', (t) => {
- assert.equal(ENGINE_VERSION, 28, 'engine 28 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 33 semantics [O8,O3,H16]', (t) => {
- assert.equal(ENGINE_VERSION, 33, 'the next writer preserves every historical model snapshot through main engine 30');
++ assert.equal(ENGINE_VERSION, 36, 'the next writer preserves every historical model snapshot through engine 36');
+ 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/pending-refreeze.test.js
index 56a6e4cc,03fb0767..a06023be
--- a/test/pending-refreeze.test.js
+++ b/test/pending-refreeze.test.js
@@@ -261,7 -261,7 +261,7 @@@ async function checkDependencyLegacyCli
}
test('dependency edits replay the same on every engine [B3,V2,H16]', async (t) => {
- assert.equal(ENGINE_VERSION, 28);
- assert.equal(ENGINE_VERSION, 33, 'the next writer retains all recorded dependency-edit behavior');
++ assert.equal(ENGINE_VERSION, 36, 'the next writer retains all recorded dependency-edit behavior');
const directory = mkdtempSync(join(tmpdir(), 'pullboard-dependency-engines-'));
const cleanup = [];
t.after(() => {