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): compose stale verdicts with main [E8]

Corey Olson5c589443bf55
diff --cc src/engine.js
index 37ca6398,4948b094..48e19787
--- a/src/engine.js
+++ b/src/engine.js
@@@ -1,8 -1,8 +1,8 @@@
/** Versioned, deterministic replay through the CLI's existing board engine [H3,H16]. */
import { createHash, randomUUID } from 'node:crypto';
import * as store from './board.js';
- import { refusalDocument } from './json.js';
+ import { recordedRefusal } from './recorded-refusal.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';
diff --cc src/next-steps.js
index 00000000,d8afe8fe..5b07bc0c
mode 000000,100644..100644
--- a/src/next-steps.js
+++ b/src/next-steps.js
@@@ -1,0 -1,408 +1,411 @@@
+ /**
+ * The next step for every refusal code the CLI and API can raise (P4, W4).
+ *
+ * A raise site that knows more (an item id, a commit, a path) says so in its message or passes its
+ * own step to Refused; this table is the step a refusal falls back to when it does neither, so no
+ * refusal ends without one. Each step is a command or an action that gets past the rule, never a
+ * step that leads straight back to the same refusal. test/refusal-next-steps.test.js checks that
+ * every code raised in src/ has a row here.
+ */
+ import { RECORDED_GENERIC_NEXT } from './recorded-refusal.js';
+
+ /** @type {Readonly<Record<string, string>>} */
+ export const NEXT_STEPS = Object.freeze({
+ A5_GRAMMAR_VERSION: 'upgrade Pullboard: npm install -g pullboard@latest',
+ AGENT_SESSION: 'run pullboard takeover from the agent session that should own this checkout',
+ ALREADY_ANSWERED: 'read the answer with pullboard inbox; ask again with a new pullboard shout <to> "<text>" --decision',
+ ALREADY_JOINED: 'create a worktree for the other lane: pullboard worktree <lane> --model "<model name>", then work from the path it prints',
+ ALREADY_MERGED: 'file the follow-up as a new item: pullboard add <lane> "<title>"',
+ AMBIGUOUS: 'name the code with an explicit line range: path:line-line@commit',
+ API_ORIGIN: 'call the API from the address pullboard serve printed',
+ API_LISTEN: 'choose a free port with --port 0, then retry pullboard serve',
+ API_POLL: 'pass a poll interval from 10 to 60000 milliseconds',
+ APPROVED_ROW_CHANGE: 'restore the committed file: git checkout HEAD -- <file>',
+ AUTH_REQUIRED: 'run pullboard relay on to sign in again, or use the address and secret pullboard serve printed',
+ B26_PERSON_ANSWER: 'ask your coordinator to answer or pass the decision: pullboard shout coordinator "<question>" --decision',
+ B26_PERSON_APPROVAL: 'ask the person to decide in pullboard view',
+ B26_PERSON_CHANNEL: 'record it as the person through pullboard view or the person\'s own terminal',
+ B26_PERSON_DECISION: 'ask your coordinator: pullboard shout coordinator "<question>" --decision',
+ BAD_BOARD: 'run the command from the board\'s own repo, where pullboard status names its board id',
+ BAD_BROWSER_RESOURCE: 'request the "gate" resource with browser: true',
+ BAD_CHECK: 'ask your coordinator to set the check: pullboard edit <id> --check "<command>"',
+ BAD_CHECK_BASELINE: 'the coordinator sets the check again: pullboard edit <id> --check "<command>"',
+ BAD_CONFIG: 'fix pullboard.json as the message says, then commit it: git commit -m "chore: fix pullboard config" pullboard.json',
+ BAD_CURSOR: 'pass a nonnegative integer from the last response you received',
+ BAD_DECISION: 'choose accept or reject with a supported reason: pullboard verify <id> reject --reason TEST_FAILURE --note "<what failed>"',
+ BAD_DEPENDENCIES: 'use --after with item ids, such as --after 1,2, or --after none',
+ BAD_EVIDENCE: 'pass the evidence fields the message names, then retry',
+ BAD_FACT_ID: 'upgrade to the current Pullboard engine, then retry the original fact operation',
+ BAD_FACT_KIND: 'use a supported kind, such as note: pullboard fact <id> note "<what you observed>"',
+ BAD_FACT_REF: 'cite code as path:line[-line]@<full 40-character commit>, from git rev-parse HEAD',
+ BAD_FIRST_COMMIT: 'commit the repository first, then run pullboard spec signers add',
+ BAD_LANE: 'choose a lane name made of lowercase letters, digits and dashes, then retry pullboard lane add',
+ BAD_LANE_PATH: 'give pullboard lane add a folder path inside the repository, relative to its root',
+ BAD_GATE_SLOTS: 'choose a positive gateSlots value no lower than browserSlots shown by pullboard settings: pullboard settings gateSlots <n>',
+ BAD_BROWSER_SLOTS: 'choose browserSlots from 1 through gateSlots shown by pullboard settings: pullboard settings browserSlots <n>',
+ BAD_MACHINE_SETTINGS: 'fix or remove the machine settings file the message names, then run pullboard settings',
+ MACHINE_HOME_NOT_WRITABLE: 'give the agent write access to the named machine-home directory, or run the command outside the sandbox',
+ BAD_REASON: 'accept with --note "how you proved it", or reject with --reason TEST_FAILURE, BEHAVIOR_MISMATCH, INSUFFICIENT_EVIDENCE, STALE_HEAD or OTHER',
+ BAD_REF: 'name the code as path:line-line@commit using a full 40-character commit SHA, such as src/serve.js:12-30@<full-sha>',
+ BAD_BLUEPRINT: 'fix the blueprint JSON fields named in the message, then run pullboard blueprint add <file> again',
+ BAD_REMOTE_RESOURCE: 'request remote execution through the machine gate with name: "gate"',
+ BAD_RUNNER: 'run pullboard runner add <ssh-host> --slots <positive-count> --browser <count-from-zero-through-slots>; remote node and root overrides must be absolute paths',
+ BAD_RUNNER_POOL: 'fix runnerProvider to return an array of unique hosts with positive slots and browser capacity from zero through slots',
+ BAD_RUNNER_SETTINGS: 'pass updateRunnerSettings a nonempty configured host and a function that persists its settings',
+ BAD_REQUEST: 'send the request body the message names as an application/json object',
+ BAD_RESOURCE_CAPACITY: 'pass a positive integer capacity',
+ BAD_RESOURCE_METADATA: 'pass the resource item and kind as text',
+ BAD_RESOURCE_NAME: 'pass a nonempty resource name',
+ BAD_RESOURCE_PRIORITY: 'request the slot as one kind: a landing, an item check or a diagnostic',
+ BAD_RESOURCE_SCOPE: 'use the machine or repo scope',
+ BAD_ROUTE: 'use --route light, mid or strong',
+ BAD_SIGNATURE: 'make sure the signer is listed, then record a fresh sign-off: pullboard spec signoff <ids>',
+ BAD_SIGNER: 'set git config user.email, or pass --by <principal>',
+ BAD_SIGNERS_BASE: 'restore .pullboard/signers.initial and its hash from git: git checkout HEAD -- .pullboard',
+ BAD_SIGNOFF: 'sign the current approved rows from this repository: pullboard spec signoff <ids>',
++ BAD_VERDICT_REVIEW: 'restore the submitted commit and reviewed Git objects, then re-review the clean composition with current Pullboard',
+ BAD_SIGNOFFS: 'restore the sign-off file from git: git checkout HEAD -- .pullboard/signoffs.jsonl',
+ BAD_SINCE: 'pass a date: --since 2026-10-08',
+ BLOCKED: 'take another item with pullboard next, or shout the lane it waits on: pullboard shout <lane> "<text>"',
+ BLUEPRINT_EXISTS: 'choose a file that does not exist: pullboard blueprint save <new-file>',
+ BLUEPRINT_URL: 'download and read the blueprint yourself, then run pullboard blueprint add <local-file>',
+ BOARD_BUSY: 'wait for the other pullboard process to finish, then retry',
+ BOARD_SCOPE_UNAVAILABLE: 'link the board: pullboard relay on',
+ BOARD_UNAVAILABLE: 'restore the repo, or drop it: pullboard forget <path>',
+ BRIEF_LANE: 'split the item by lane, or add the other lane\'s part as its own item and wait on it with --after',
+ BRIEF_TOO_LONG: 'shorten the brief and point to a longer doc by path, or pass --brief-file <file>',
+ BROWSER_SLOT_REQUIRED: 'release the gate lease and take it again with browser: true',
+ CANNOT_SIGN: 'sign only approved rows: pullboard spec signoff <approved ids>',
+ CHECKOUT_SESSION: 'run pullboard takeover from the agent session that owns this checkout',
+ CHECK_CANNOT_FAIL: 'write a check that exits nonzero on the problem, then add the item again',
+ CHECK_CONFIRM: 'read the check command, then run pullboard check <id> --yes',
+ CHECK_RED: 'reject with what failed: pullboard verify <id> reject --reason TEST_FAILURE --note "<what failed>"',
+ CHECK_UNVERIFIED: 'restore the install or check environment, then run pullboard verify <id> again',
+ CHILDREN_OPEN: 'finish the child items (pullboard list --all), or ask the coordinator to withdraw them',
+ CLOSED: 'read its state with pullboard show <id>, then take open work: pullboard next',
+ CODE_NOT_AVAILABLE: 'read code through pullboard view or a local pullboard serve',
+ COMMAND_FAILED: 'read the reported output above, fix what it names, and run the command again',
+ CORE_BARE: 'turn off core.bare: git config core.bare false',
+ COORDINATOR_CHECK: 'ask your coordinator to set the check: pullboard shout coordinator "please set a check on #<id>"',
+ COORDINATOR_ONLY: 'ask the coordinator to do it: pullboard shout coordinator "<what you need>"',
+ COORDINATOR_VERIFIES: 'leave the review to the coordinator; shout it when the item is ready: pullboard shout coordinator "#<id> is ready to verify"',
+ CRITERIA_CHANGED: 'ask the coordinator to refreeze it: pullboard shout coordinator "please refreeze #<id>"',
+ DELTA_NOT_AVAILABLE: 'read the full board state from this API instead of since=N',
+ DEPENDENCY_CYCLE: 'change --after so no item waits on itself',
+ DEVICE_CRYPTO: 'use Node 22 or newer, or a browser on a secure (https) page',
+ DEVICE_ENDPOINT: 'upgrade Pullboard on this machine and the phone, then retry',
+ DEVICE_ENROLLMENT: 'make a fresh pairing link: pullboard relay on --all',
+ DEVICE_ENROLL_AUTH: 'make a fresh pairing link: pullboard relay on --all',
+ DEVICE_EXISTS: 'make a fresh pairing link: pullboard relay on --all',
+ DEVICE_FORMAT: 'make a fresh pairing link: pullboard relay on --all',
+ DEVICE_ID: 'list paired devices with pullboard relay devices and name one of them',
+ DEVICE_KEY: 'pair the device again: pullboard relay on --all',
+ DEVICE_NOT_ENROLLED: 'list paired devices with pullboard relay devices, or pair one: pullboard relay on --all',
+ DEVICE_PAIR_EXPIRED: 'make a fresh pairing link: pullboard relay on --all',
+ DEVICE_PAIR_SECRET: 'open the pairing link exactly as printed, or make a fresh one: pullboard relay on --all',
+ DEVICE_PAIR_USED: 'make a fresh pairing link: pullboard relay on --all',
+ DEVICE_REVOKED: 'pair the device again: pullboard relay on --all',
+ DEVICE_WRAP_AUTH: 'pair the device again: pullboard relay on --all',
+ DEVICE_WRAP_BINDING: 'upgrade Pullboard, then pair the device again: pullboard relay on --all',
+ DEVICE_WRAP_KEY: 'pair the device again: pullboard relay on --all',
+ DIFF_TOO_LARGE: 'split the change into smaller commits',
+ DIRTY: 'commit your changes, then run the command again',
+ EMPTY_FACT: 'give nonempty fact text: pullboard fact <id> note "<what you saw>"',
+ EMPTY_BLUEPRINT: 'ask the person to approve exportable rows written as "<rule> Why: <reason>", then run pullboard blueprint save again',
+ EMPTY_NOTE: 'say why: pullboard pass <id> --note "<reason>"',
+ EMPTY_SHOUT: 'give the shout text: pullboard shout <to> "<text>"',
+ EMPTY_SIGNERS: 'restore the signer list from Git: git restore --source=HEAD -- .pullboard/signers',
+ ENGINE_VERSION: 'upgrade Pullboard: npm install -g pullboard@latest',
+ EVENT_LOG_VERSION: 'upgrade Pullboard: npm install -g pullboard@latest',
+ EXPORT_EXISTS: 'name an empty folder for the export',
+ FACT_JUDGEMENT: 'use a nonjudgement fact kind such as note, or ask the coordinator to record a judgement: pullboard fact <id> note "<what you observed>"',
+ FLAG_NOT_ALLOWED: 'drop the flag; pullboard help spec lists what each spec command takes',
+ GATE_RED: 'fix what the gate report names, commit, and submit again',
+ GATE_SLOT_LEASE_LOST: 'let the parent process take the gate slot again, then restart the child',
+ GATE_SLOT_LEASE_REQUIRED: 'start the child test process with the live gate lease',
+ GATE_SLOT_MARKER_INVALID: 'restart the child with gateSlotEnvironment(lease)',
+ GATE_SLOT_TOKEN_REQUIRED: 'restart the child with gateSlotEnvironment(lease)',
+ GIT_GRAFTS: 'ask the coordinator to remove the git graft file: pullboard shout coordinator "please remove .git/info/grafts"',
+ HEAD_NOT_NEW: 'commit the rework, then pullboard submit <id>',
+ HELD: 'take another item: pullboard next',
+ HUMAN_REQUIRED: 'send it from the paired phone, or run pullboard relay on --all from the person\'s terminal',
+ IMPORT_FORMAT: 'make an export with pullboard export > board.json, then import that file',
+ 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',
+ 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_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>"',
+ 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',
+ LAND_DIAGNOSTIC: 'read the landing log the message names, and make the test reporter print file names',
+ LAND_DIRTY: 'inspect the landing worktree, commit or remove its edits, then pullboard land --adopt',
+ LAND_FLAKE: 'fix the flaky test, or ask the person for a waiver: pullboard land --waive <test> --until <date> --reason "why"',
+ LAND_HEADER: 'shorten the item\'s cited rows (pullboard edit <id>), then pullboard land',
+ LAND_INTERACTION: 'read the batch\'s failing tests, then land the items in separate batches',
+ LAND_ITEM_MOVED: 'rebuild the batch from current verified work: pullboard land',
+ LAND_MERGE: 'inspect the landing worktree and its hooks, then pullboard land --adopt',
+ LAND_MOVED: 'read pullboard resume, then adopt the current batch: pullboard land --adopt',
+ LAND_NOT_PUSHED: 'push the batch, then pullboard land --adopt',
+ LAND_PERSON_ONLY: 'ask the person to waive it from their terminal or pullboard view',
+ LAND_PUSH: 'inspect the remote and hooks, then pullboard land --adopt',
+ LAND_REMOTE_MOVED: 'inspect the remote branch, then pullboard land --adopt',
+ LAND_TRUNK: 'check the recorded trunk branch with pullboard resume, then switch the main checkout to that branch: git switch <trunk-branch>',
+ LAND_TRUNK_MOVED: 'rebuild the batch from the new main: pullboard land',
+ LAND_WAIVER: 'pullboard land --waive <test> --until <date> --reason "why"',
+ LAND_WORKTREE: 'restore the landing worktree the message names, then pullboard land --adopt',
+ LANE_HELD: 'wait for the lane: pullboard next --wait 9 (minutes)',
+ LOCAL_RUNNER_REQUEUE: 'call requeueRunner only on a lease with a runner; release a local lease normally',
+ MAIN_IS_COORDINATOR: 'use an independent agent checkout for agent work, or run person-only actions from the main checkout as the coordinator',
+ MERGE_CHECK_FAILED: 'use Git 2.38 or newer (git --version), then retry',
+ MERGE_CONFLICT: 'merge main into your branch, resolve the conflicts, commit, and run the command again',
+ MILESTONES_CORRUPT: 'restore the board from a known-good export: pullboard import <file>',
+ MILESTONE_EDIT: 'pass --name or --note: pullboard milestone edit <name> --note "<text>"',
+ MILESTONE_EXISTS: 'pick another name, or edit the existing one: pullboard milestone edit <name>',
+ MILESTONE_ITEMS: 'list item ids once each: pullboard milestone add <name> --items 1,2',
+ MILESTONE_NAME: 'pullboard milestone add <name>',
+ MILESTONE_NOTE: 'pass the note text: --note "<text>"',
+ MILESTONE_ORDER: 'move it before a different milestone; see pullboard roadmap',
+ MISSING_SIGNATURE: 'have the person repeat approval for the named row: pullboard spec approve <id>',
+ MISSING_SIGNERS: 'restore the signer list from git: git checkout HEAD -- .pullboard/signers',
+ MODEL_REQUIRED: 'pass --model "<model name>", or set PULLBOARD_MODEL in this shell',
+ MOVED_DURING_GATE: 'leave the worktree alone until the gate finishes, then submit again',
+ NOTE_REQUIRED: 'add --note "<what happened>"',
+ NOTHING_FREE: 'wait for work: pullboard next --wait 9 (minutes)',
+ NOT_AT_COMMIT: 'check out the submitted commit shown by pullboard show <id>: git switch --detach <commit>',
+ NOT_A_DECISION: 'reply with a shout: pullboard shout <to> "<text>"',
+ NOT_A_REPO: 'cd into a git repo, or make one: git init',
+ NOT_CLAIMABLE: 'take open work: pullboard next',
+ NOT_COMMITTED: 'commit the files the message names, then run the command again',
+ NOT_COORDINATOR_DECISION: 'list open decisions with pullboard decisions and answer one of those',
+ NOT_HELD: 'see what is held with pullboard status',
+ NOT_HOLDING: 'name an item: pullboard check <id>, or run the project gate: pullboard gate',
+ NOT_JOINED: 'join a lane from this worktree: pullboard join <lane> --model "<model name>" (see: pullboard lanes)',
+ NOT_MAIN: 'run this coordinator-owned operation from the main checkout, or ask the coordinator to do it',
+ NOT_MERGED: 'merge the item\'s commit onto the trunk, then pullboard merged <id>',
+ NOT_SSH_KEY: 'add a valid OpenSSH public key: pullboard spec signers add --key ~/.ssh/id_ed25519.pub',
+ NOT_SSH_KEY_PATH: 'set user.signingkey to an SSH key file: git config user.signingkey ~/.ssh/id_ed25519.pub',
+ NOT_SUBMITTED: 'see its state with pullboard show <id>; verify only submitted items: pullboard next --verify',
+ NOT_VERIFIED: 'merge only verified items; see pullboard list --all',
+ NOT_YOURS: 'shout its holder or the coordinator: pullboard shout coordinator "<what you need>"',
+ NOT_YOUR_CHECKOUT: 'make an independent checkout with git worktree add -b <lane>/<n> ../<repo>-<lane>-<n>, then run pullboard join <lane> --model "<model name>" there; the same agent in a new session should run pullboard takeover from its own shell',
+ SANDBOX_BLOCKED: 'ask the person to allow the named operation, or run the gate outside the sandbox; keep the tests unchanged',
+ NOT_YOUR_DECISION: 'answer only decisions addressed to you; see pullboard inbox',
+ NO_AGENT: 'create and join a lane worktree: pullboard worktree <lane> --model "<model name>"',
+ NO_BOARD: 'initialize the board in this repository: pullboard init',
+ NO_BLUEPRINT: 'choose a bundled blueprint named in the message, or pass an existing local JSON file to pullboard blueprint add',
+ NO_BRIEF: 'add the missing fields with pullboard edit <id> --brief "..." --criterion "..."',
+ NO_CHECK: 'run the project gate: pullboard gate',
+ NO_COMMIT: 'commit your work, or name a commit that exists: git log --oneline',
+ NO_CONFIG: 'run pullboard init in the main checkout and commit pullboard.json',
+ NO_ENDPOINT: 'use a path under /api/v1/boards',
+ NO_EVIDENCE: 'cite the row id in a test name, or build it first',
+ NO_FACT: 'name a fact id from pullboard show <id> --json',
+ NO_FILE: 'check the path and pass a file that exists',
+ NO_FILES_LANE: 'run pullboard lanes, then file the build in a lane that owns files, or pass --after <id> if it reviews that item',
+ NO_FIRST_COMMIT: 'commit the repo, then pullboard spec signers add',
+ NO_GATE: 'set "gate" in pullboard.json, such as "npm test", and commit it',
+ NO_ITEM: 'find the item id: pullboard list --all',
+ NO_LANE: 'pick a lane from pullboard lanes',
+ NO_LINES: 'name a line range inside the file',
+ NO_MILESTONE: 'name a milestone from pullboard roadmap',
+ NO_POLICY: 'restore and commit pullboard.json, then run the command again',
+ NO_READER: 'name a lane, an agent or all: pullboard shout all "<text>"',
+ NO_REPO: 'run pullboard init in the repo, or pick a project in pullboard view',
+ NO_ROLE: 'choose one of the roles listed by pullboard skills',
+ NO_ROW: 'list the rows with pullboard spec --json, then name one of them',
+ NO_SECTION: 'add a section heading such as "## G · Goals" to the spec, then draft the row',
+ NO_SHOUT: 'name a shout id from pullboard inbox',
+ NO_SIGNERS: 'add an SSH signer: pullboard spec signers add',
+ NO_SIGNING_COMMIT: 'commit the repo, then sign again',
+ NO_SPEC: 'run pullboard init',
+ NO_TITLE: 'give a title: pullboard add <lane> "<title>"',
+ NO_TRUNK: 'in the main checkout, switch to the repository’s trunk branch and run pullboard inbox',
+ O2_FAMILY_MATCH: 'ask the coordinator for a verifier from another family: pullboard shout coordinator "#<id> needs a verifier from another family"',
+ OAUTH_CANCELLED: 'start sign-in again: pullboard relay on',
+ OAUTH_CLEANUP: 'run pullboard relay on again once the relay answers',
+ OAUTH_EXPIRED: 'start sign-in again: pullboard relay on',
+ ONE_CLAIM: 'submit or release the item you hold: pullboard release <id> --note "why"',
+ ONE_COORDINATOR: 'make a lane worktree and join it as an agent: pullboard worktree <lane> --model "<model name>"',
+ OUTSIDE_LANE: 'move those changes out of this commit, and shout the lane that owns them: pullboard shout <lane> "<text>"',
+ PAIR_BUSY: 'let sync finish, then pair again: pullboard relay pair',
+ PAIR_CODE_INVALID: 'ask the linked device for a new code: pullboard relay pair',
+ PAIR_LINK_LONG: 'open the printed link instead of scanning the code',
+ PAIR_PACKAGE: 'make a fresh code on the linked device: pullboard relay pair',
+ PAIR_PACKAGE_SIZE: 'ask the linked device for a smaller package, or join from a fresh clone',
+ PAIR_PENDING: 'finish sync first (pullboard status), then pair again',
+ PAIR_RELAY: 'run pullboard relay join with the relay address the code came from',
+ PAIR_REPOSITORY: 'ask the linked device for a fresh code, then join inside the matching clone',
+ PAIR_STATE: 'sync this device (pullboard status), then pair again',
+ PATH_OWNED: 'choose a folder no existing lane owns, or edit the lane ownership in pullboard.json from the main checkout',
+ PARENT_CLOSED: 'add the item without --parent, or under an open parent',
+ PARENT_LANE: 'add the child in its parent\'s lane',
+ PENDING_REFREEZE: 'the coordinator runs pullboard refreeze <id>',
+ PRIVATE_BLUEPRINT: 'choose a blueprint name and title that identify no person or private project, then retry pullboard blueprint save',
+ RATCHET_ROSE: 'fix the new doctrine problems named in the report, commit, and submit again; only the person can sign an increased count',
+ RATCHET_UNCOUNTED: 'fix the named doctrine check to exit zero or one within its configured timeout, or ask the coordinator to repair it, then submit again',
+ PERSON_REQUEST_CLOSED: 'read the request\'s original result in pullboard view',
+ PERSON_REQUEST_ID: 'reload the paired view and send a new request',
+ PERSON_REQUEST_RECEIPT: 'upgrade Pullboard on the linked machine, then retry from the paired view',
+ PERSON_REQUEST_TAKEN: 'wait for the other machine\'s receipt in pullboard view',
+ PERSON_REQUEST_VERSION: 'upgrade Pullboard on the linked machine and reload the view',
+ PHONE_APPROVAL_AUTH: 'request a fresh approval on the phone and retry',
+ PHONE_APPROVAL_CONTEXT: 'request approval for this exact board, action and command',
+ PHONE_APPROVAL_EXPIRED: 'run the command again and approve it on the phone',
+ PHONE_APPROVAL_UNAVAILABLE: 'retry the phone approval when the relay answers; if it repeats, pair again with pullboard relay on --all',
+ PHONE_APPROVAL_PENDING: 'approve the named action on the paired phone before it expires',
+ PHONE_NOT_PAIRED: 'pair the phone: pullboard relay on --all',
+ PIN_FAILED: 'fix what git reported, then run pullboard run again',
+ PIPEFAIL_UNAVAILABLE: 'rewrite the gate in pullboard.json without a pipe',
+ PORT_BUSY: 'pick a free port with --port 0',
+ PROJECT_NOT_REGISTERED: 'run pullboard view --project inside a registered repo, or plain pullboard view',
+ PROJECT_SCOPE: 'scope the API to one registered project repo',
+ PROOF_REQUIRED: 'say how you proved it: --note "what you broke or which edge you tried, and what happened"',
+ RELAY_ACTOR: 'send the move with the token of the agent that makes it',
+ RELAY_ANSWER: 'use pullboard answer <id> "<answer>" or pullboard pass <id> --note "<reason>"',
+ RELAY_BASELINE_EXISTS: 'save the board with pullboard export > board.json, then pullboard relay off',
+ RELAY_BUSY: 'run the command again after the other worktree finishes sending',
+ RELAY_CURSOR: 'fetch a consistent snapshot: pullboard relay',
+ RELAY_DIVERGED: 'run pullboard relay off, then pullboard relay on to link again from this machine',
+ RELAY_KEYCHAIN: 'unlock the system keychain, then run the command again',
+ RELAY_KEY_EXISTS: 'keep this clone\'s key, and join from a fresh device home',
+ RELAY_KEY_FILE_ENV_MISMATCH: 'unset PULLBOARD_RELAY_KEY, or set it to this device\'s key',
+ RELAY_KEY_MISSING: 'pair this device again: pullboard relay on --all',
+ RELAY_KEY_STORAGE: 'restore owner-only permissions: chmod 700 on the relay-keys folder, 600 on its files',
+ RELAY_LINKED: 'run pullboard relay off before linking it elsewhere, or use a fresh clone',
+ RELAY_LOCAL_CHANGED: 'save the board with pullboard export > board.json, then retry the recovery',
+ RELAY_MACHINE_STORAGE: 'restore owner-only permissions on the relay-machine folder (700) and its files (600)',
+ RELAY_MOVE: 'upgrade Pullboard: npm install -g pullboard@latest',
+ RELAY_NOT_LINKED: 'link the board: pullboard relay on --all',
+ RELAY_OFF: 'link the board: pullboard relay on',
+ RELAY_ORDER: 'fetch and apply the missing moves: pullboard relay',
+ RELAY_ORIGIN: 'set a GitHub origin: git remote add origin https://github.com/<owner>/<repo>.git, then pullboard relay on',
+ RELAY_PERSON_ONLY: 'do it as the person from the paired phone or the person\'s own session',
+ RELAY_PRESENTATION_PENDING: 'run pullboard status again',
+ RELAY_RECOVERY_HEALTHY: 'replay it normally: pullboard relay',
+ RELAY_RECOVERY_PENDING: 'finish the saved recovery: pullboard relay recover --skip <sequence>',
+ RELAY_REPLAY_REQUIRED: 'upgrade Pullboard: npm install -g pullboard@latest',
+ RELAY_RESPONSE: 'retry once the relay answers; if it repeats, pair again: pullboard relay on --all',
+ RELAY_REFUSED: 'retry after fixing the displayed relay refusal; if it repeats, upgrade Pullboard and report the refusal to the service owner',
+ RELAY_CHECKPOINT_REFUSED: 'upgrade Pullboard or run pullboard relay off then pullboard relay on --all; if it repeats, report the displayed checkpoint refusal',
+ RELAY_SNAPSHOT_LIMIT: 'reduce the board snapshot until it fits the relay limit, then retry the command',
+ RELAY_RECORD: 'retry the relay action after the displayed blocker is resolved',
+ RELAY_RETRY_PENDING: 'repeat the interrupted command exactly to get its original outcome',
+ RELAY_SEAL: 'continue with the next record: pullboard relay',
+ RELAY_SENDER: 'restore the record\'s sender before replaying it',
+ RELAY_SENDER_MISMATCH: 'send the move as the agent that makes it, from that agent\'s worktree',
+ RELAY_SEQUENCE: 'inspect pullboard relay and skip only the blocked next sequence',
+ RELAY_SESSION: 'link this project and pair the phone: pullboard relay on --all',
+ RELAY_SNAPSHOT: 'fetch a consistent snapshot (pullboard relay), or join by pairing',
+ RELAY_SNAPSHOT_BUSY: 'run the command again',
+ RELAY_STORAGE: 'restore relay.json as an owner-only file (chmod 600), or pullboard relay off and on again',
+ RELAY_UNAVAILABLE: 'keep working offline, and run the command again when the relay answers',
+ RELAY_UNLINK_PENDING: 'finish unlinking: pullboard relay off',
+ RELAY_URL: 'use an HTTPS relay address, such as https://app.pullboard.dev',
+ RELAY_VERSION: 'upgrade Pullboard: npm install -g pullboard@latest',
+ REMOTE_COORDINATOR_MODEL: 'run the command in the coordinator\'s own checkout',
+ REMOTE_GATE_SLOT_NOT_INHERITABLE: 'start a local child with its local gate lease; execute remote children on the runner instead of inheriting its lease locally',
+ RESERVED_RUNNER_RESOURCE: 'request the gate resource with name: "gate"; configure runner capacity with pullboard runner add <ssh-host> --slots <n> --browser <n>',
+ REQUEST_CLOSED: 'read pullboard inbox before answering another request',
+ REQUEST_OUTCOME: 'pullboard answer <id> done "<reason>", or pullboard answer <id> declined "<reason>"',
+ RESOURCE_BUSY: 'check the holder and queue with pullboard resources, wait for the resource to become free, then retry',
+ RESOURCE_CAPACITY_MISMATCH: 'check the configured capacity with pullboard settings, then retry using that capacity',
+ RESOURCE_LEASE_LOST: 'take the resource again, then retry',
+ REVIEW_COOLDOWN: 'take another review: pullboard next --verify',
+ REVIEW_HELD: 'take another review: pullboard next --verify',
+ RUNNER_BUSY: 'wait for the named runner\'s active tests to finish, then retry its settings change',
+ RUNNER_CAPACITY_MISMATCH: 'wait for active runner leases to fit the configured capacity, then retry the run',
+ RUNNER_CLEANUP_TIMEOUT: 'inspect the named job under that runner\'s namespace and confirm its cleanup before starting another run',
+ RUNNER_OUTPUT_LIMIT: 'reduce the command output, or keep the run local',
+ RUNNER_REQUEST_LIMIT: 'keep the run local, or reduce the runner request before retrying',
+ RUNNER_SCAN_LIMIT: 'keep the run local, or reduce the oversized source blob, history or tag set named by the scan',
+ RUNNER_SETUP_REFUSED: 'run pullboard resources and pullboard settings on the named runner, correct its resource pool, then retry the run',
+ RUNNER_SECRET: 'remove the flagged secret or private path from the selected source, history, metadata or command before remote execution',
+ RUNNER_SOURCE: 'restore readable committed Git source and history, then retry; keep unsupported source objects local',
+ RUNNER_SOURCE_CHANGED: 'restore the committed source selected for the queued run, then retry it',
+ RUNNER_TOOLING_CHANGED: 'restore or commit the selected Pullboard tooling revision before remote execution',
+ RUNNER_TOOLING_IDENTITY: 'reinstall Pullboard from a named Pullboard installation before remote execution',
+ RUNNER_TOOLING_SECRET: 'restore a trusted Pullboard installation before transferring runner tooling',
+ ROUTE: 'take an item your route covers: pullboard next',
+ ROW_DECISION: 'pullboard spec approve <ids>, or pullboard spec decline <ids>',
+ SEAL_AUTH_FAILED: 'fetch the board again, or pair this device again: pullboard relay on --all',
+ SEAL_BINDING: 'upgrade Pullboard on this device, then retry',
+ SEAL_CRYPTO: 'use Node 22 or newer, or a browser on a secure (https) page',
+ SEAL_FORMAT: 'fetch the board again: pullboard relay',
+ SEAL_KEY: 'pair this device again: pullboard relay on --all',
+ SEAL_VERSION: 'upgrade Pullboard on this device: npm install -g pullboard@latest',
+ SELF_SHOUT: 'name another agent, a lane or all: pullboard shout all "<text>"',
+ SELF_VERIFY: 'ask a different agent to verify it; from main create its worktree with pullboard worktree <lane> --model "<model name>"',
+ SERVICE_ERROR: 'retry the call; if it repeats, restart pullboard serve',
+ SHALLOW_BEFORE_OPT_IN: 'git fetch --unshallow, then pullboard spec signers add',
+ SHOUT_NOT_AVAILABLE: 'read shouts with pullboard inbox, or refresh the snapshot with a current CLI',
+ SNAPSHOT_FORMAT: 'refresh the snapshot from a linked machine: pullboard relay',
+ SPEC_BEHIND_MAIN: 'git merge main',
+ SPEC_INVALID: 'fix the unparsed row the message names, then pullboard spec check',
+ SPEC_SECTION: 'name a section the spec has; see pullboard spec',
+ SSH_KEY_FAILED: 'check the SSH key and that ssh-keygen is installed: ssh-keygen -l -f <key>',
+ SSH_KEY_NOT_FOUND: 'pass the key path: --key ~/.ssh/id_ed25519.pub',
++ STALE_VERDICT: 'merge current main into the submitted commit, commit a clean composition, then ask another agent to re-review it before landing',
+ STACKED_ON_UNVERIFIED: 'wait for the earlier item to be accepted, or rebuild on main without its commits',
+ STALE_ROW_DECISION: 'ask the person to approve the current row again in pullboard view',
+ TOKENS_NOT_AVAILABLE: 'manage agent tokens in pullboard view or the signed-in relay account',
+ TOKEN_NOT_OWNED: 'name a token id from pullboard relay tokens',
+ TOO_LARGE: 'open the file in your editor instead',
+ UNAUTHORIZED_SIGNERS_CHANGE: 'restore the previous signer list (git checkout HEAD -- .pullboard/signers), or sign the change with a listed key',
+ UNKNOWN_SPEC: 'ask the coordinator to restore the named spec rows or withdraw the item: pullboard shout coordinator "please fix the rows cited by #<id>"',
+ UNLISTED_SIGNER: 'add the signer: pullboard spec signers add --by <principal> --key <path>',
+ UNMERGED_SCHEMA: 'merge this code into the main checkout first, or test it against its own board',
+ UNTRACKED: 'commit or ignore the untracked files, then run the command again',
+ UNKNOWN_TOOL: 'call tools/list and use a tool name returned by that MCP server',
+ USAGE: 'run pullboard help',
++ VERDICT_TRUNK_MOVED: 'merge the latest main into the submitted commit and ask another agent to re-review the clean composition',
+ VIEW_START: 'run pullboard view in the foreground to see why it stopped',
+ VIEW_PAIRING_CLEANUP: 'run pullboard relay off, then pullboard relay on --all to finish pairing cleanup',
+ VIEW_STATE: 'check that the Pullboard home folder is writable, then run pullboard view again',
+ VIEW_UNAVAILABLE: 'start the view with pullboard view, then export again',
+ VIEW_PAIRING_NOT_READY: 'read this sign-in’s status again: pullboard view',
+ VIEW_SIGN_IN_BUSY: 'finish or cancel the sign-in already in progress, then start it again',
+ VIEW_SIGN_IN_LINKING: 'let the current board-linking batch finish before starting another sign-in',
+ VIEW_SIGN_IN_RESPONSE: 'check the configured relay address, then start sign-in again',
+ VIEW_SIGN_IN_STOPPED: 'start sign-in again with pullboard view',
+ VIEW_SIGN_IN_UNKNOWN: 'start sign-in again with pullboard view',
+ WITHDRAWN: 'wait on an item that is not withdrawn; see pullboard list --all',
+ WRONG_BOARD: 'open the repository registered to this board and confirm its identity with pullboard status',
+ WRONG_LANE: 'create a worktree in the required lane with pullboard worktree <lane> --model "<model name>", or take an item in your lane with pullboard next',
+ });
+
+ /**
+ * Take the step a message already spells out: the clause from its first repair word to the end of
+ * that line. One line only, so a multi-line report (a gate digest) is never repeated as the step.
+ *
+ * @param {string} message
+ * @returns {string | undefined}
+ */
+ function stepInMessage(message) {
+ const line = String(message).split('\n')[0];
+ const match = /(?:^|; |\. |: )((?:run|install|upgrade|fix|restore|commit|merge|test|check out|set|give|use|reject|ask your coordinator|answer from the main checkout|the coordinator(?= (?:runs?|sets?|restores?|either|must)\b)|to keep looking|never work around)\b.*)/i.exec(line);
+ const step = match?.[1];
+ // UNKNOWN_MOVE contains a documentation placeholder, not a supported reason value.
+ return step && !/--reason\s+CODE\b/u.test(step) ? step : undefined;
+ }
+
+ /**
+ * The next step for one refusal: its existing final next line, else the step its raise site passed,
+ * else prose guidance or this code's row. Unknown remote codes name the service owner and rule.
+ *
+ * @param {{ code?: string, next?: string } | null | undefined} error
+ * @param {string} message
+ * @returns {string}
+ */
+ export function nextStepFor(error, message) {
+ const code = typeof error?.code === 'string' ? error.code : '';
+ const finalStep = /(?:^|\r?\n)next:[ \t]*([^\r\n]*\S)[ \t]*(?:\r?\n)*$/u.exec(String(message))?.[1];
+ if (finalStep) return finalStep.trim();
+ if (typeof error?.next === 'string' && error.next.trim() && error.next.trim() !== RECORDED_GENERIC_NEXT) return error.next.trim();
+ if (code === 'SPEC_BEHIND_MAIN') return NEXT_STEPS.SPEC_BEHIND_MAIN;
+ return stepInMessage(message) ?? NEXT_STEPS[code]
+ ?? `ask the service owner about refusal code ${code || '(unknown)'}, including the displayed refusal`;
+ }