pincer-workflow 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +9 -7
  2. package/bin/pincer.js +58 -5
  3. package/package.json +3 -3
  4. package/template/.agents/skills/pincer-code/SKILL.md +117 -12
  5. package/template/.agents/skills/pincer-evaluate/SKILL.md +57 -10
  6. package/template/.agents/skills/pincer-narrow/SKILL.md +48 -8
  7. package/template/.agents/skills/pincer-plan/SKILL.md +12 -4
  8. package/template/.agents/skills/pincer-release/SKILL.md +32 -3
  9. package/template/.agents/skills/pincer-status/SKILL.md +25 -2
  10. package/template/.claude/commands/pincer-code.md +117 -12
  11. package/template/.claude/commands/pincer-evaluate.md +57 -10
  12. package/template/.claude/commands/pincer-narrow.md +48 -8
  13. package/template/.claude/commands/pincer-plan.md +12 -4
  14. package/template/.claude/commands/pincer-release.md +32 -3
  15. package/template/.claude/commands/pincer-status.md +25 -2
  16. package/template/.claude/hooks/hook-policy.cjs +24 -3
  17. package/template/.claude/references/prd-template.md +11 -4
  18. package/template/.claude/references/ticket-template.md +4 -0
  19. package/template/.codex/README.md +3 -2
  20. package/template/.github/prompts/pincer-code.prompt.md +117 -12
  21. package/template/.github/prompts/pincer-evaluate.prompt.md +57 -10
  22. package/template/.github/prompts/pincer-narrow.prompt.md +48 -8
  23. package/template/.github/prompts/pincer-plan.prompt.md +12 -4
  24. package/template/.github/prompts/pincer-release.prompt.md +32 -3
  25. package/template/.github/prompts/pincer-status.prompt.md +25 -2
  26. package/template/AGENTS.md +22 -0
  27. package/template/docs/dry-run-checklist.md +70 -6
  28. package/template/docs/release-checklist.md +5 -2
  29. package/template/docs/runtime-contracts.md +1683 -0
  30. package/template/scripts/pincer-evidence.cjs +13 -229
  31. package/template/scripts/pincer-runtime/adopt.cjs +132 -0
  32. package/template/scripts/pincer-runtime/agreement.cjs +240 -0
  33. package/template/scripts/pincer-runtime/authorization.cjs +167 -0
  34. package/template/scripts/pincer-runtime/changes.cjs +517 -0
  35. package/template/scripts/pincer-runtime/checks.cjs +48 -0
  36. package/template/scripts/pincer-runtime/coverage.cjs +361 -0
  37. package/template/scripts/pincer-runtime/dispositions.cjs +95 -0
  38. package/template/scripts/pincer-runtime/evidence.cjs +676 -0
  39. package/template/scripts/pincer-runtime/fsutil.cjs +37 -0
  40. package/template/scripts/pincer-runtime/gates.cjs +73 -0
  41. package/template/scripts/pincer-runtime/identity.cjs +163 -0
  42. package/template/scripts/pincer-runtime/impact.cjs +177 -0
  43. package/template/scripts/pincer-runtime/io.cjs +41 -0
  44. package/template/scripts/pincer-runtime/lifecycle.cjs +311 -0
  45. package/template/scripts/pincer-runtime/locator.cjs +158 -0
  46. package/template/scripts/pincer-runtime/migrate.cjs +204 -0
  47. package/template/scripts/pincer-runtime/parse.cjs +316 -0
  48. package/template/scripts/pincer-runtime/phases.cjs +245 -0
  49. package/template/scripts/pincer-runtime/readiness.cjs +97 -0
  50. package/template/scripts/pincer-runtime/requirements.cjs +255 -0
  51. package/template/scripts/pincer-runtime/resume.cjs +205 -0
  52. package/template/scripts/pincer-runtime/routing.cjs +54 -0
  53. package/template/scripts/pincer-runtime/runner.cjs +242 -0
  54. package/template/scripts/pincer-runtime/sanitize.cjs +63 -0
  55. package/template/scripts/pincer-runtime/source.cjs +129 -0
  56. package/template/scripts/pincer-runtime/state.cjs +314 -0
  57. package/template/scripts/pincer-runtime/status.cjs +514 -0
  58. package/template/scripts/pincer-runtime/transaction.cjs +200 -0
  59. package/template/scripts/pincer-runtime/transitions.cjs +134 -0
  60. package/template/scripts/pincer-runtime.cjs +661 -0
  61. package/template/scripts/pincer-status.sh +11 -162
  62. package/template/scripts/pincer-ticket.sh +19 -139
  63. package/template/scripts/pincer-ticket-lib.sh +0 -321
@@ -160,11 +160,23 @@ function dangerousReason(source, depth = 0) {
160
160
  }
161
161
 
162
162
  const TICKET_PATH = /(^|[\\/])tickets[\\/]T-[0-9]+[^\\/]*\.md$/;
163
+ // Runtime-owned state: local attempts under .pincer/, change records under
164
+ // .prd/changes/ (with their agreement snapshots), evaluation locators under
165
+ // .prd/evidence/changes/ and the inventory/map snapshots a strict evaluation writes
166
+ // under .prd/evidence/prd-vN/<candidate>/coverage/ are written only by
167
+ // pincer-runtime.cjs. The coverage map .prd/coverage/<id>.json is authored by hand.
168
+ // The runtime owns .pincer/runtime/ and .pincer/backups/ (and the directory as a
169
+ // whole); .pincer/drafts/ is the agent's own scratch space for evidence drafts.
170
+ const RUNTIME_PATH = /(^|[\\/])\.pincer(?:[\\/](?:runtime|backups)(?:[\\/]|$)|[\\/]?$)/;
171
+ const BINDING_PATH = /(^|[\\/])\.prd[\\/](?:changes|evidence[\\/]changes|evidence[\\/]prd-v[0-9]+[\\/][0-9a-f]{40}[\\/]coverage)([\\/]|$)/;
163
172
  const PROTECTED = ['status', 'started', 'last_check', 'verified', 'finished'];
164
173
 
165
174
  function ticketPath(value) {
166
175
  return typeof value === 'string' && TICKET_PATH.test(value);
167
176
  }
177
+ function runtimePath(value) {
178
+ return typeof value === 'string' && (RUNTIME_PATH.test(value) || BINDING_PATH.test(value));
179
+ }
168
180
 
169
181
  function stateFields(content) {
170
182
  const result = Object.fromEntries(PROTECTED.map(key => [key, []]));
@@ -203,6 +215,7 @@ function applyEdit(content, oldText, newText, replaceAll = false) {
203
215
  function guardEdits(tool, toolInput) {
204
216
  const file = toolInput.file_path;
205
217
  if (typeof file !== 'string') block(`${tool} payload must contain a string file_path.`);
218
+ if (runtimePath(file)) block('runtime state (.pincer/), change records (.prd/changes/), evaluation locators and coverage snapshots (.prd/evidence/…/coverage/) are written only by pincer-runtime.cjs; the coverage map .prd/coverage/<id>.json is yours to edit.');
206
219
  if (!ticketPath(file)) return;
207
220
  const before = existingContent(file);
208
221
  if (tool === 'Write') {
@@ -230,9 +243,16 @@ function guardEdits(tool, toolInput) {
230
243
  function isExactPincerCall(source) {
231
244
  const commands = shellCommands(source).filter(command => command.words.length);
232
245
  if (commands.length !== 1 || commands[0].separator) return false;
246
+ // An output redirection is a write, whatever runs in front of it: fall through to
247
+ // ticketShellMutation so its target is tested like any other path. Without this,
248
+ // adding a verb to the list below silently opened a new carrier for it.
249
+ if (commands[0].operators.some(op => op === '>' || op === '>>')) return false;
233
250
  const { executable, args } = commandParts(commands[0]);
234
251
  let words = [executable, ...args];
235
- if (['bash', 'sh'].includes(words[0])) words = words.slice(1);
252
+ if (['bash', 'sh', 'node'].includes(words[0])) words = words.slice(1);
253
+ if (/pincer-runtime\.cjs$/.test(words[0] || '')) {
254
+ return ['start', 'verify', 'done', 'bind', 'register', 'migrate', 'recover', 'check', 'evidence', 'change', 'resume'].includes(words[1]);
255
+ }
236
256
  if (!/pincer-ticket\.sh$/.test(words[0] || '')) return false;
237
257
  const action = words[1];
238
258
  if (!['start', 'verify', 'done', 'bind'].includes(action)) return false;
@@ -321,7 +341,8 @@ function ticketShellMutation(source, depth = 0) {
321
341
  const stdinPathspec = !sub.args.some(arg => !arg.startsWith('-')) || sub.args[sub.args.length - 1] === '--';
322
342
  if (viaXargs && ['checkout', 'restore', 'clean'].includes(sub.name) && stdinPathspec) return true;
323
343
  }
324
- const hasTicket = words.some(ticketPath) || /(^|[\s'"`])tickets[\\/]T-[0-9]+[^\s'"`]*/.test(source);
344
+ const hasTicket = words.some(ticketPath) || /(^|[\s'"`])tickets[\\/]T-[0-9]+[^\s'"`]*/.test(source) ||
345
+ words.some(runtimePath) || /(^|[\s'"`=])\.pincer(?:[\\/](?:runtime|backups)(?:[\\/]|[\s'"`]|$)|[\\/]?(?:[\s'"`]|$))/.test(source) || /(^|[\s'"`=])\.prd[\\/](?:changes|evidence[\\/]changes|evidence[\\/]prd-v[0-9]+[\\/][0-9a-f]{40}[\\/]coverage)([\\/]|[\s'"`]|$)/.test(source);
325
346
  if (!hasTicket) continue;
326
347
  if (command.operators.some(op => op === '>' || op === '>>')) return true;
327
348
  if (['rm', 'mv', 'cp', 'install', 'truncate', 'touch', 'tee', 'ed', 'ex'].includes(executable)) return true;
@@ -344,7 +365,7 @@ if (mode === 'dangerous') {
344
365
  if (['Edit', 'Write', 'MultiEdit'].includes(payload.tool_name)) guardEdits(payload.tool_name, payload.tool_input);
345
366
  else if (payload.tool_name === 'Bash') {
346
367
  if (typeof payload.tool_input.command !== 'string') block('Bash payload must contain a string command.');
347
- if (ticketShellMutation(payload.tool_input.command)) block('shell commands may not write, reset, or restore ticket files (including whole-tree checkout/restore, reset --hard, stash, clean -f); use pincer-ticket.sh for lifecycle state.');
368
+ if (ticketShellMutation(payload.tool_input.command)) block('shell commands may not write, reset, or restore ticket files or runtime state (.pincer/, .prd/changes/), including whole-tree checkout/restore, reset --hard, stash, clean -f; use pincer-ticket.sh or pincer-runtime.cjs for lifecycle state.');
348
369
  }
349
370
  } else {
350
371
  block('hook policy mode is invalid.');
@@ -41,10 +41,17 @@ and never renumbered: a revision keeps existing IDs and adds new ones. Tickets
41
41
  name the IDs they implement and evaluation dispositions every ID.
42
42
 
43
43
  #### R-01 — short title
44
- - Scenario: an observable acceptance scenario (given / when / then, or a command
45
- and its expected output). Add one line per scenario.
46
- - Failure path: what invalid input or the relevant failure produces.
47
- - Preserve: existing behavior this must not change (brownfield).
44
+ - **S-01:** an observable acceptance scenario (given / when / then, or a command
45
+ and its expected output). One bold `S-NN` item per scenario, defined under its
46
+ requirement heading; every requirement has at least one.
47
+ - **S-02:** Failure path: what invalid input or the relevant failure produces.
48
+ - **S-03:** Preserve: existing behavior this must not change (brownfield).
49
+
50
+ Scenario IDs are stable like requirement IDs. The runtime reads exactly this
51
+ grammar (a `##`..`####` heading `R-NN — title`, bold `- **S-NN:** text` items
52
+ under it, continuation lines indented); mentions in prose, tables and fenced
53
+ examples define nothing. On a change with strict coverage the parsed inventory is
54
+ what the coverage map and the evaluation must cover completely.
48
55
 
49
56
  When the user supplied a PRD, keep its meaning and its existing requirement IDs.
50
57
  If its structure needs adapting to this template, add a `Requirement mapping`
@@ -9,6 +9,7 @@ status: open # open | in_progress | done
9
9
  size: S # S | M | L, relative scope; split when it improves verification
10
10
  prd: .prd/prd-v{N}.md # the selected PRD, never inferred from ticket numbering
11
11
  depends_on: [] # e.g. [T-01]
12
+ timeout: 600 # optional, seconds (default 600); part of the check identity
12
13
  ---
13
14
 
14
15
  ## Objective
@@ -58,6 +59,9 @@ Rules:
58
59
  `scripts/pincer-ticket.sh` (`start` / `verify` / `done`). `verify` runs the
59
60
  Verification block verbatim and writes a receipt only on exit 0; `done`
60
61
  requires that receipt to match the current block. Never write these by hand.
62
+ On a migrated project (`.prd/changes/` holds a change binding) `verify` records
63
+ attempts under `.pincer/runtime/` instead of `verified`/`last_check`, and `done`
64
+ consumes the current passing attempt against the current source.
61
65
  - The Verification block is a fenced `bash` block that exits 0 only when the
62
66
  ticket is done — non-interactive, no "check by hand".
63
67
  - The Verification section opens with a one-line `Proves:` statement: what the
@@ -36,8 +36,9 @@ approval_policy = "on-request" # agent asks before escalating
36
36
  sandbox_mode = "workspace-write" # writes confined to the repo; no network by default
37
37
  ```
38
38
 
39
- The ticket scripts are plain bash and work here unchanged:
40
- `scripts/pincer-ticket.sh start|verify|done T-NN` and `scripts/pincer-status.sh`.
39
+ The ticket scripts work here unchanged (`scripts/pincer-ticket.sh
40
+ start|verify|done T-NN` and `scripts/pincer-status.sh`); they are thin wrappers
41
+ around `scripts/pincer-runtime.cjs`, so Node.js 22+ is required.
41
42
  Without a Pincer Codex hook adapter, the rule in `AGENTS.md` carries the weight
42
43
  of stopping hand-edited ticket state; `$pincer-status` warns about any ticket
43
44
  marked done without a receipt.
@@ -18,6 +18,17 @@ Ticket state lives in the ticket file's frontmatter and is written **only** by
18
18
  Verification block and stamps a receipt only on a green exit; `done` refuses without a
19
19
  receipt that matches the current check, or with unticked acceptance criteria. Never edit
20
20
  `status`, `started`, `last_check`, `verified`, or `finished` by hand — on Claude Code a hook blocks it.
21
+ On a migrated project (a change binding under `.prd/changes/`; the `Runtime` line of
22
+ `scripts/pincer-status.sh` names it) `verify` records an attempt under `.pincer/runtime/`
23
+ and writes no receipt into the ticket, and `done` consumes the current passing attempt
24
+ against the current source without re-running the check. `.pincer/`, `.prd/changes/` and `.prd/evidence/changes/`
25
+ are written only by the runtime; never edit or delete them by hand. On a project with
26
+ change records (`Runtime changes …`) every `start`, `verify` and `done` first passes
27
+ the change gate: the ticket's change must be selected in this worktree, `active`
28
+ (`verify` also runs on a `completed` change), on a compatible branch, and authorized
29
+ for the current agreement — otherwise the command refuses with `SELECTION_REQUIRED`,
30
+ `WRONG_CHANGE`, `LIFECYCLE_BLOCKED`, `BASE_MISMATCH`, `DECISION_REQUIRED`,
31
+ `AUTHORIZATION_REQUIRED` or `AGREEMENT_CHANGED` before anything runs or is written.
21
32
 
22
33
  ## Before the loop
23
34
 
@@ -25,7 +36,34 @@ Run `scripts/pincer-status.sh`. It lists every ticket's state, what is blocked,
25
36
  build time from the clock, and the next action. If a ticket is `in_progress`, you are
26
37
  resuming: read it, check `git status` / `git diff` for uncommitted work, and continue
27
38
  from wherever the receipt says you are. Do not ask the user to reconfirm unchanged,
28
- previously authorized work.
39
+ previously authorized work. Read the `Runtime` line before the first ticket. `changes` (change records under
40
+ `.prd/changes/`) → run `node scripts/pincer-runtime.cjs resume` and follow its `Next`
41
+ line: it names the selected change, its lifecycle state, the agreement and the
42
+ authorization verdict, the blockers in order and the exact next command, all from the
43
+ files on disk. Select the change to work on (`node scripts/pincer-runtime.cjs change
44
+ select <id>`; selection is local metadata and touches no source), activate it
45
+ (`change activate <id>`; refused until the user's authorization is recorded with
46
+ `change authorize` and no consequential decision is open) and resume a paused change
47
+ with `change resume <id>`. On a change with strict coverage (`Coverage strict …` in status) also read
48
+ `node scripts/pincer-runtime.cjs coverage` — it names the scenario, ticket, check or
49
+ decision that is next and every structural gap (`COVERAGE_INCOMPLETE`,
50
+ `SCOPE_UNAUTHORIZED`, `OBLIGATION_MISSING`) — and, after any PRD, ticket or map edit,
51
+ `node scripts/pincer-runtime.cjs impact` (`--from G-NN` for another baseline): it
52
+ lists the affected scenarios, tickets and checks with reasons and the dependency
53
+ dependents separately, and reports an unscoped PRD change or unavailable history
54
+ rather than "no impact". `legacy` and no ticket of this PRD carries legacy
55
+ receipts → register now (`node scripts/pincer-runtime.cjs register --prd .prd/prd-vN.md`,
56
+ commit `.prd/changes/` and `.gitignore` as `Register PRD vN`), then record the user's
57
+ approval (`change authorize …`, as `/pincer-narrow` describes), select and activate.
58
+ `legacy` with legacy receipts, or a v0.5.0 binding (`Runtime change <id> · revision …`)
59
+ → run `node scripts/pincer-runtime.cjs migrate --preview --prd .prd/prd-vN.md`, show
60
+ the plan (backups, receipts imported as history, the converted binding, the
61
+ `.gitignore` line, the local selection) and ask once whether to apply. Apply only on
62
+ a yes, then commit the rewritten tickets, `.gitignore` and the record as `Migrate PRD
63
+ vN to the runtime`. The migrated change is planned with no authorization: record the
64
+ user's actual earlier instruction with `change authorize` (the v0.5.0 free text is
65
+ history only) and activate it. Never migrate silently, and never apply when the
66
+ preview reports a conflict.
29
67
 
30
68
  ## Loop (per ticket, in dependency order)
31
69
 
@@ -40,7 +78,9 @@ previously authorized work.
40
78
  dispatch a subagent with a clean prompt: paste the full ticket body, the relevant
41
79
  conventions, and nothing else.
42
80
  3. **Verify:** `scripts/pincer-ticket.sh verify T-{NN}` — runs the Verification block and
43
- writes the receipt only if it exits 0. Red fix and re-run; report the actual output,
81
+ writes the receipt only if it exits 0 (after migration it records an attempt with the
82
+ captured log under `.pincer/runtime/` and writes no receipt into the ticket; readiness
83
+ derives from the latest attempt and the current source). Red → fix and re-run; report the actual output,
44
84
  not assumptions. Green output is the definition of done, not your confidence. If the
45
85
  check only validated syntax or a build, say so — that is not behavioral proof. A
46
86
  visual judgment is recorded separately in evaluation, not as the receipt, and a tool
@@ -58,7 +98,10 @@ previously authorized work.
58
98
  - No error path leaks internals (stack traces, key names with values) to the client.
59
99
  If the review changed code, run `verify` again — the receipt must match the code you commit.
60
100
  5. **Close the ticket:** tick every verified acceptance-criteria checkbox (`- [ ]` → `- [x]`;
61
- editing the checkboxes is allowed), then `scripts/pincer-ticket.sh done T-{NN}`. A
101
+ editing the checkboxes is allowed), then `scripts/pincer-ticket.sh done T-{NN}`. After
102
+ migration `done` consumes the current passing attempt and does not re-run the check; it
103
+ refuses with a reason code (`SOURCE_CHANGED`, `CHECK_CHANGED`, `CHECK_FAILED`,
104
+ `CRITERIA_UNTICKED`, …) and the next step when the latest attempt is not current. A
62
105
  criterion that was cut is a scope change to record in the PRD, not a box to skip.
63
106
  Inspect `git status --short`, preserve pre-existing staged work, and stage only the
64
107
  explicit paths changed for this ticket plus its ticket file. Review `git diff --cached`
@@ -89,20 +132,78 @@ the script or `scripts/pincer-status.sh` printed, and hand the repair to the use
89
132
  performs it in their own terminal. Then return through the lifecycle — `start`,
90
133
  `verify`, `done` — so the ticket carries fresh verification; a restored receipt is
91
134
  never evidence. Do not recommend restoring source files or unrelated edits as routine
92
- ticket repair. One exception: when the PRD is built with valid candidate evidence,
135
+ ticket repair. One exception: when the PRD is built with valid candidate evidence;
93
136
  tracked files other than the ticket file being restored match the evaluated candidate
94
- (or the candidate plus its evidence-only commit) with nothing untracked, and the
95
- ticket's Verification block passes when run
96
- directly rather than through `verify` (which would write a receipt), then
137
+ (or the candidate plus its evidence-only commit) with nothing untracked; the recorded
138
+ failure is explained by a working-tree change that has since been reverted (the failed
139
+ `last_check` was stamped while source differed from the candidate, and that difference
140
+ is gone); and the ticket's Verification block passes when run
141
+ directly rather than through `verify` (which would write a receipt), in the
142
+ same execution context as `verify` — the same shell, working directory, `PATH`
143
+ and environment, with no substituted binary and no repair made first — then
97
144
  the committed evaluation still describes the tree. Say so, name the exact command
98
145
  for the user to restore the ticket file in their own terminal, and
99
146
  do not run `verify`, refresh the receipt or commit anything — the restored file is
100
147
  what is already committed, not new evidence. If the block fails on that clean tree,
101
148
  the failure is real: keep the failed `last_check` and repair through the lifecycle.
149
+ A changed executable, runner, working directory or environment repair requires a
150
+ new recorded verification through `verify`; the exception does not apply to it.
151
+ An unexplained failure cannot be cleared by restoring a receipt: when no
152
+ since-reverted source change explains it (a service down, a missing dependency, a
153
+ check that reads external data), keep the failure, name the cause you observed, and
154
+ ask for the environment to be repaired before `verify` runs again.
102
155
  If source still differs from the candidate, name the differing paths and let the
103
156
  user decide rather than asking which way to fix them; permission to restore a ticket
104
- does not authorize discarding source changes. Automated recovery that preserves
105
- attempt history is later work (M1).
157
+ does not authorize discarding source changes.
158
+ After migration (a change binding exists) recovery is the lifecycle itself: retain the
159
+ failure, repair the cause, run `verify` again; readiness derives from the latest attempt,
160
+ both attempts stay in `.pincer/runtime/` and no tracked file changes. Never restore a
161
+ ticket file or delete `.pincer/runtime` to obtain a green status; the legacy exception
162
+ above applies only before migration. A session that died mid-`verify` leaves a `running`
163
+ attempt: run `node scripts/pincer-runtime.cjs recover`, which finalizes it as
164
+ `interrupted` once the owner process is gone, then `verify` again.
165
+
166
+ ## Changes: pausing, decisions and completion
167
+
168
+ - Stopping before the change is complete (end of session, switching to another
169
+ change): `node scripts/pincer-runtime.cjs change pause <id> --reason "<why>" --note "<handoff for the next session>"`
170
+ and commit the record. Pausing keeps every ticket state, attempt and authorization;
171
+ it refuses while a check is running (`recover` first if its owner died). A fresh
172
+ session runs `resume`, then `change resume <id>` under the existing authorization —
173
+ do not ask the user to re-approve unchanged scope. Another change's work in the
174
+ meantime makes this change's passing attempts `SOURCE_CHANGED`; verify again, do
175
+ not ask for approval again.
176
+ - A newly discovered consequential choice: `node scripts/pincer-runtime.cjs change decide <id> --summary "<the question>"`
177
+ blocks execution (`DECISION_REQUIRED`) until the user answers; record the answer with
178
+ `change decide <id> --resolve D-NN --reference "<where>" --excerpt "<the user's words>"`,
179
+ then `change authorize <id> --agreement <digest> --reference … --excerpt … --decision D-NN`.
180
+ A revision within the user's delegation (for example an added regression check for
181
+ approved behavior) records `change authorize <id> --agreement <digest> --delegated --basis A-NN --explanation "<why it stays within the delegation>"`
182
+ without asking again, and the changed check still needs fresh verification.
183
+ - Editing the PRD under its filename, or a ticket's acceptance text, dependencies,
184
+ size, timeout, association or check — and, with strict coverage, a scenario's text,
185
+ a map link, a declared command or timeout, or a scope entry — changes the agreement:
186
+ execution refuses with `AGREEMENT_CHANGED` (status shows the structural difference;
187
+ `impact` explains it) until its disposition is recorded as above. Ticking criteria, starting or closing tickets and recording
188
+ attempts never change it. An `AGREEMENT_CHANGED` caused by an edit this session
189
+ did not make — a revised PRD, an added or changed ticket found on resume — is a
190
+ consequential decision: raise it with `change decide <id> --summary "<what changed>"`,
191
+ report the structural difference (and the `impact` report) and stop. A general instruction to continue,
192
+ resume or not re-ask never authorizes new scope; record a `user` authorization for
193
+ the revised agreement only for an instruction that names the revised content. With strict coverage a scenario that will not be delivered is
194
+ never dropped from the map or the PRD: it is deferred or removed through a decision
195
+ the user resolves naming it, a `scope` entry (a removal keeps a tombstone naming the
196
+ prior agreement) and an authorization naming that decision; `coverage` reports
197
+ `OBLIGATION_MISSING` or `SCOPE_UNAUTHORIZED` until then, and `change complete`
198
+ refuses. A revised check declaration (a stricter command, an added check) within the
199
+ user's delegation is a `--delegated` authorization and needs fresh verification.
200
+ - When every ticket is done and ready: `node scripts/pincer-runtime.cjs change complete <id>`
201
+ (it refuses unfinished tickets, unticked criteria, stale or failed verification and
202
+ open decisions; with strict coverage also an incomplete map, an unauthorized
203
+ disposition or a missing obligation, before the ticket gate) and commit the record
204
+ as `Complete PRD vN`. Completion never asks for candidate evidence. Completed means ready
205
+ for evaluation, not evaluated or released; a later finding is `change reopen <id> --reason …`
206
+ plus a fix ticket.
106
207
 
107
208
  ## Budget rules
108
209
 
@@ -115,7 +216,8 @@ attempt history is later work (M1).
115
216
 
116
217
  ## When all tickets are done
117
218
 
118
- Update the PRD to `status: built` and commit that change on its own (`PRD vN: built`).
219
+ On a project with change records, complete the change first (`change complete <id>`,
220
+ committed as `Complete PRD vN`). Then update the PRD to `status: built` and commit that change on its own (`PRD vN: built`).
119
221
  The built transition is part of the candidate that `/pincer-evaluate` reviews; it is
120
222
  never moved into a later evidence-only commit. Then finish with:
121
223
  "All tickets built. Run `/pincer-evaluate` for a final quality pass."
@@ -127,6 +229,9 @@ material choice not already authorized, and prepare the concrete proposal before
127
229
  asking. A decision the user delegated (for example "pick the architecture") does not
128
230
  need another approval when you exercise it, but a newly discovered consequential
129
231
  choice is surfaced before implementation. Record the authorization basis and the
130
- scope it covers in the PRD or the handover. An agent-written record or a status
232
+ scope it covers in the PRD or the handover, and on a project with change records as
233
+ a `change authorize` record (the user's words as the excerpt, or a `--delegated`
234
+ disposition with its basis). An agent-written record or a status
131
235
  field is not authenticated human approval. When resuming without the context that
132
- granted authorization, do not invent it — ask.
236
+ granted authorization, do not invent it — read the `resume` report; an authorization
237
+ it reports as `current` needs no repeat approval, and any other verdict is asked.
@@ -21,8 +21,10 @@ run the pipeline, then present results.
21
21
  that uncertainty before claiming a complete review. Record full commit IDs for
22
22
  `base` and `candidate` (`git rev-parse HEAD`), then review `git diff <base>..<candidate>`.
23
23
  The candidate is the clean, committed tree that already includes the implementation,
24
- the ticket closures and the PRD `status: built` commit: `git status --short` must be
25
- empty before review. If anything is uncommitted or the PRD is not yet built, return
24
+ the ticket closures, on a project with change records the `change complete` commit
25
+ (the `Runtime` line reads `… · completed ·`; `check` and `evidence export` refuse an
26
+ active, paused or unauthorized change), and the PRD `status: built` commit:
27
+ `git status --short` must be empty before review. If anything is uncommitted or the PRD is not yet built, return
26
28
  to `/pincer-code`; do not review a dirty tree.
27
29
  2. Dispatch a `code-quality-reviewer` agent with: the diff, the PRD's Success Criteria and
28
30
  Scope sections, and the list of tickets. If the diff is large, split by area and
@@ -30,7 +32,13 @@ run the pipeline, then present results.
30
32
  in a separate pass, applying `.claude/agents/code-quality-reviewer.md` as the rubric.)
31
33
  Keep the reviewer's report — or its explicit no-findings statement — for step 9,
32
34
  where it is saved as an artifact; a review that left no record cannot be audited.
33
- 3. Yourself, in parallel, check spec compliance. For every requirement `R-NN` in the
35
+ 3. Yourself, in parallel, check spec compliance. On a change with strict coverage
36
+ (`Coverage strict …` in status) start from `node scripts/pincer-runtime.cjs coverage`:
37
+ its structure must be complete, and its scenario rows are the obligations — the
38
+ export derives every disposition from the map and the outcomes, so you do not
39
+ author `requirements`; your judgment is recorded as `adequacy` (whether the
40
+ declared checks and reviews really establish their scenarios) and in
41
+ `coverage_review`. Otherwise, for every requirement `R-NN` in the
34
42
  PRD record one disposition: `delivered` (evidence on this candidate), `blocked`
35
43
  (required behavior failed or was left unverified — this blocks PASS; do not relabel
36
44
  it a known limitation to pass), or `deferred` (only with explicit user authorization;
@@ -64,7 +72,41 @@ run the pipeline, then present results.
64
72
  material decision; never make an ad-hoc `review: fixes` commit. Every fix commit
65
73
  produces a new candidate: re-record `candidate`, re-run the checks against it, and
66
74
  write fresh evidence in step 9 — never reuse a manifest from a previous candidate.
67
- 9. Persist evidence for the candidate under `.prd/evidence/prd-vN/<candidate>/`:
75
+ 9. Persist evidence for the candidate under `.prd/evidence/prd-vN/<candidate>/`.
76
+ Strict coverage: run every declared command check as
77
+ `node scripts/pincer-runtime.cjs check C-NN --candidate <sha>` (no command, no
78
+ timeout: the map's declaration is the only source, and a supplied command is
79
+ `CHECK_UNDECLARED`); record each declared review or visual obligation in the
80
+ draft with its `result` and an artifact saved under the candidate's evidence
81
+ directory (a required one that is not passed with an artifact is
82
+ `REVIEW_MISSING`); write `adequacy: { verdict: "adequate" | "inadequate", note }`;
83
+ list every declared check once and no `requirements` (they are derived). The
84
+ export writes the inventory and map snapshots under `coverage/`, derives the
85
+ scenario and requirement rows and `delivery` (original versus agreed scope) and
86
+ validates them against the committed candidate; an `inadequate` judgment or a
87
+ failed required check is recorded honestly and blocks readiness. Migrated
88
+ project without strict coverage (the `Runtime` status line names a change): run
89
+ each executable check through the runtime on the clean candidate view —
90
+ `node scripts/pincer-runtime.cjs check C-NN --candidate <sha> -- <command>` (one
91
+ command per check, the command line as run; `npm test` stays one aggregate check) —
92
+ then write the authored fields to a draft outside the evidence directory, for
93
+ example `.pincer/drafts/<sha>.json`: `environment.tools` and `environment.limitations`,
94
+ `coverage_review`, `requirements`, review and visual checks with their saved
95
+ artifacts, `visual_review`, and a stub `{"id": "C-NN", "kind": "command",
96
+ "required": true|false}` for each executable check. Then run
97
+ `node scripts/pincer-runtime.cjs evidence export --candidate <sha> --base <base> --prd .prd/prd-vN.md --draft <file>`.
98
+ The export writes `checks/C-NN.log` from the captured logs, fills `command`,
99
+ `result`, `provenance: runtime` and `attempt` from the attempts, labels review and
100
+ visual checks `provenance: authored`, computes the digests and writes an evidence
101
+ schema 2 manifest; it refuses a dirty tree, a HEAD that is not the candidate, a stub
102
+ without an attempt, and a `passed` or `failed` command result written by hand. On a
103
+ project with change records the export also appends the evaluation to the change's
104
+ locator `.prd/evidence/changes/<id>.json` (the identity of this change's
105
+ evaluation; root `NOTES.md` stays the human summary and may be overwritten by a
106
+ later change's evaluation without losing this one) — commit the locator with the
107
+ evidence. A tool that cannot run is recorded as an authored command check with
108
+ `result: unverified` and a note, as before. Legacy project (no change binding):
109
+ author the schema 1 manifest as follows.
68
110
  - `checks/C-NN.log` — the command and a redacted summary or safe log of each
69
111
  executable check. Never secrets, never an environment dump. Record
70
112
  one check per command: `command` holds the command line as run, never prose
@@ -104,11 +146,13 @@ run the pipeline, then present results.
104
146
  evidence: .prd/evidence/prd-vN/<candidate>/manifest.json
105
147
  ---
106
148
  ```
107
- Then commit NOTES.md, the manifest and its listed artifacts and nothing else
149
+ Then commit NOTES.md, the manifest, its listed artifacts and (change records) the
150
+ evaluation locator — and nothing else —
108
151
  as `evaluate: PRD vN candidate <short sha>`. Status accepts this later commit only
109
- when its diff from the candidate is limited to `NOTES.md` and the evidence files
110
- the manifest lists; changes to source, tests, configuration, tickets, the PRD or
111
- other evaluations require reevaluation. Legacy notes without these references
152
+ when its diff from the candidate is limited to `NOTES.md`, the candidate's evidence
153
+ directories and evaluation locators; changes to source, tests, configuration,
154
+ tickets, the PRD or the change record (a lifecycle transition after the
155
+ candidate) require reevaluation. Legacy notes without these references
112
156
  do not establish readiness. Then describe what was built, what was cut
113
157
  and why, known issues, and what you'd do next with more time. Then a **Handover**
114
158
  section, written for the stranger who inherits this repo in six months: how to get
@@ -126,6 +170,9 @@ material choice not already authorized, and prepare the concrete proposal before
126
170
  asking. A decision the user delegated (for example "pick the architecture") does not
127
171
  need another approval when you exercise it, but a newly discovered consequential
128
172
  choice is surfaced before implementation. Record the authorization basis and the
129
- scope it covers in the PRD or the handover. An agent-written record or a status
173
+ scope it covers in the PRD or the handover, and on a project with change records as
174
+ a `change authorize` record (the user's words as the excerpt, or a `--delegated`
175
+ disposition with its basis). An agent-written record or a status
130
176
  field is not authenticated human approval. When resuming without the context that
131
- granted authorization, do not invent it — ask.
177
+ granted authorization, do not invent it — read the `resume` report; an authorization
178
+ it reports as `current` needs no repeat approval, and any other verdict is asked.
@@ -34,14 +34,25 @@ discovered consequential choice is surfaced before implementation.
34
34
  - Build the requirement map: for every `R-NN` in the PRD and each of its
35
35
  scenarios, name the ticket that owns the implementation and the executable
36
36
  check that exercises it, or an explicit review method when no executable check
37
- exists. Record the IDs in each ticket's Context as `Implements: R-NN, R-MM`.
38
- Enabling work that implements no requirement states its purpose in the ticket
39
- Objective. Resolve missing coverage and conflicting criteria with the user
40
- before implementation; do not start with an unmapped required scenario.
37
+ exists. Record the IDs in each ticket's Context as `Implements: R-NN, R-MM`
38
+ (a navigation aid). Enabling work that implements no requirement states its purpose
39
+ in the ticket Objective. Resolve missing coverage and conflicting criteria with
40
+ the user before implementation; do not start with an unmapped required scenario. On a change with change records, author the map once as
41
+ `.prd/coverage/<change id>.json` (coverage map schema 1, "Coverage map" in
42
+ `docs/runtime-contracts.md`): one `scenarios` row per `S-NN` naming its
43
+ implementing tickets and declared checks, every ticket of the change in
44
+ `tickets` as `implements` or `enables` (with a rationale), each check declared
45
+ once in `checks` with its kind, `required` flag and, for a command, the exact
46
+ command line and timeout, and a `scope` entry (`deferred` or `removed`) for a
47
+ scenario this change will not deliver, naming the decision that records the
48
+ user's choice. The map is authored work you edit by hand; the runtime never
49
+ rewrites it, and it validates it against the PRD's definitions.
41
50
  - Every ticket gets a runnable command in its Verification block — a fenced `bash`
42
51
  block that exits 0 only when the ticket is done. `scripts/pincer-ticket.sh verify`
43
52
  runs it verbatim and stamps the receipt that `done` requires, so it must be
44
- non-interactive and self-contained (no "check by hand").
53
+ non-interactive and self-contained (no "check by hand"). An optional
54
+ `timeout: <seconds>` frontmatter field (default 600) bounds the run; it is part of
55
+ the check identity, so changing it invalidates earlier passes.
45
56
  - Each Verification section opens with `Proves:` — what the check establishes and
46
57
  which regression it detects. A check for an executable change must exercise
47
58
  observable behavior (including relevant rejection paths and, in brownfield work,
@@ -83,7 +94,33 @@ existing authorization for the same scope and order.
83
94
  inspect existing staged changes, stage that PRD and the explicit new ticket paths,
84
95
  review `git diff --cached`, and commit only those paths. Ask first — and finalize
85
96
  once it is resolved — only when step 4 surfaced a newly discovered consequential
86
- choice or a scope change the PRD does not cover. Finish with:
97
+ choice or a scope change the PRD does not cover. Then register the change when the
98
+ `Runtime` status line says `legacy` and no ticket of this PRD carries legacy
99
+ receipts, or `changes` (the project already keeps change records):
100
+ `node scripts/pincer-runtime.cjs register --prd .prd/prd-vN.md` writes the change
101
+ record `.prd/changes/prd-vN.json` (retaining every earlier change); stage
102
+ `.prd/changes/` and `.gitignore` (registration adds `.pincer/` to it) and commit them
103
+ as `Register PRD vN`. Then record the user's actual approval against the agreement
104
+ the record binds — `node scripts/pincer-runtime.cjs change show prd-vN --json`
105
+ prints the agreement digest — with
106
+ `node scripts/pincer-runtime.cjs change authorize prd-vN --agreement <digest> --reference "<where the user said it>" --excerpt "<the user's approval, quoted>"`,
107
+ select it for this worktree (`node scripts/pincer-runtime.cjs change select prd-vN`)
108
+ and commit `.prd/changes/` as `Authorize PRD vN`. When the map was authored, adopt
109
+ strict coverage explicitly: `node scripts/pincer-runtime.cjs coverage adopt --preview --change prd-vN`
110
+ shows the inventory, the map digest and the agreement it records (it refuses an
111
+ incomplete map, naming the scenario or ticket); `--apply` writes the schema 3
112
+ record with a backup and grants nothing — record the user's approval of that
113
+ agreement with `change authorize` (the same instruction, if it named this
114
+ breakdown; a delegated disposition needs its basis) and commit `.prd/coverage/`
115
+ and `.prd/changes/` as `Adopt strict coverage for PRD vN`. A scenario the user
116
+ deferred or removed is a decision: `change decide --summary "<the choice>"`,
117
+ `--resolve D-NN` with the user's words naming the scenario, the `scope` entry in
118
+ the map, then `change authorize … --decision D-NN`. Never record a disposition
119
+ the user did not state; `coverage` reports `SCOPE_UNAUTHORIZED` until it is. The excerpt records the user's own
120
+ words; running the command proves nothing by itself, and a registration, a PRD
121
+ status or a passing check never becomes an authorization. A project whose tickets
122
+ carry legacy receipts, or that still holds a v0.5.0 binding (`Runtime change <id> ·
123
+ revision …`), is migrated from `/pincer-code` after a preview, never here. Finish with:
87
124
  "Tickets ready in `tickets/`. Run `/pincer-code` to start implementing."
88
125
 
89
126
  ## Authorization rule (shared by plan, narrow, code and evaluate)
@@ -93,6 +130,9 @@ material choice not already authorized, and prepare the concrete proposal before
93
130
  asking. A decision the user delegated (for example "pick the architecture") does not
94
131
  need another approval when you exercise it, but a newly discovered consequential
95
132
  choice is surfaced before implementation. Record the authorization basis and the
96
- scope it covers in the PRD or the handover. An agent-written record or a status
133
+ scope it covers in the PRD or the handover, and on a project with change records as
134
+ a `change authorize` record (the user's words as the excerpt, or a `--delegated`
135
+ disposition with its basis). An agent-written record or a status
97
136
  field is not authenticated human approval. When resuming without the context that
98
- granted authorization, do not invent it — ask.
137
+ granted authorization, do not invent it — read the `resume` report; an authorization
138
+ it reports as `current` needs no repeat approval, and any other verdict is asked.
@@ -93,8 +93,13 @@ concrete scope and architecture; do not repeat an approval already given for the
93
93
  In Requirements, assign stable `R-NN` IDs within the selected PRD: a revision
94
94
  keeps existing IDs and adds new ones, never renumbers. Every requirement has
95
95
  observable acceptance scenarios, the relevant failure paths, and the existing
96
- behavior it must preserve `/pincer-narrow` maps each scenario to a ticket and
97
- a check, and `/pincer-evaluate` dispositions every ID.
96
+ behavior it must preserve, each written as a bold `- **S-NN:** …` item under its
97
+ requirement heading (the template's grammar; the runtime parses exactly these
98
+ definitions into the inventory that strict coverage tracks, and a requirement
99
+ without a scenario is invalid there) — `/pincer-narrow` maps each scenario to a
100
+ ticket and a check in the coverage map, and `/pincer-evaluate` dispositions every
101
+ ID. A supplied PRD keeps its own uppercase IDs (`REQ-1`, `AC-3`); only its
102
+ definition syntax is adapted, and the mapping table records what changed.
98
103
  2. Include optional sections when risk or the product context warrants them.
99
104
  3. Save to the next unused `.prd/prd-v{N}.md` (create `.prd/` if needed), with `N`
100
105
  matching the filename and frontmatter:
@@ -121,6 +126,9 @@ material choice not already authorized, and prepare the concrete proposal before
121
126
  asking. A decision the user delegated (for example "pick the architecture") does not
122
127
  need another approval when you exercise it, but a newly discovered consequential
123
128
  choice is surfaced before implementation. Record the authorization basis and the
124
- scope it covers in the PRD or the handover. An agent-written record or a status
129
+ scope it covers in the PRD or the handover, and on a project with change records as
130
+ a `change authorize` record (the user's words as the excerpt, or a `--delegated`
131
+ disposition with its basis). An agent-written record or a status
125
132
  field is not authenticated human approval. When resuming without the context that
126
- granted authorization, do not invent it — ask.
133
+ granted authorization, do not invent it — read the `resume` report; an authorization
134
+ it reports as `current` needs no repeat approval, and any other verdict is asked.
@@ -28,9 +28,13 @@ durable runtime-owned release record is later work.
28
28
  3. Check every applicable item mechanically where possible:
29
29
  - File existence and frontmatter: read the files.
30
30
  - Commit format and story: `git log --oneline`.
31
- - Receipts: every done ticket carries current `last_check` and `verified` evidence;
32
- any status warning fails the audit. Do not call `pincer-ticket.sh` from Release:
33
- it writes receipts and would invalidate the evaluated candidate.
31
+ - Receipts: every done ticket is ready — on a legacy project current `last_check`
32
+ and `verified` receipts, on a migrated project a current passing attempt
33
+ (`node scripts/pincer-runtime.cjs ready` exits 0); any status warning fails the
34
+ audit. Do not call `pincer-ticket.sh` from Release:
35
+ it writes receipts and would invalidate the evaluated candidate. Release never
36
+ runs `verify`, `check` or `done`; `status`, `ready` and the project gate are its
37
+ only commands.
34
38
  - Evidence: `scripts/pincer-status.sh` runs the shared validator
35
39
  (`scripts/pincer-evidence.cjs`) against the manifest `NOTES.md` names. The `Notes`
36
40
  line must read `current` and the `Evidence` line `ok`; any other text fails the
@@ -38,6 +42,31 @@ durable runtime-owned release record is later work.
38
42
  screenshots described in chat: read the manifest's `checks`, requirement
39
43
  dispositions and `visual_review`. Validation establishes that the record is
40
44
  consistent, not that the commands ran — say so if asked.
45
+ - Provenance: status prints a `Provenance` line for the evaluated candidate:
46
+ `runtime (schema 2)` with local attempts consistent, or `legacy (schema 1, authored
47
+ command results)`. A newer local attempt that failed, timed out, was interrupted or
48
+ is still running for the same check and source inputs fails the audit (`ready`
49
+ exits 1 and names the check). A fresh clone reports `local verification history
50
+ unavailable; saved candidate evidence validated only`: state that limit in the
51
+ verdict rather than claiming local verification.
52
+ - Change records (the `Runtime` line reads `changes`): the selected change is
53
+ `completed`, its authorization is `current` for the current agreement, and its
54
+ evaluation locator `.prd/evidence/changes/<id>.json` names the evaluated
55
+ candidate; `node scripts/pincer-runtime.cjs ready` reports `SELECTION_REQUIRED`,
56
+ `LIFECYCLE_BLOCKED`, `DECISION_REQUIRED`, `AUTHORIZATION_REQUIRED` or
57
+ `AGREEMENT_CHANGED` as failures. Release selects, activates and completes nothing;
58
+ historical evidence of a cancelled or superseded change is inspectable but never
59
+ release-ready.
60
+ - Strict coverage (the status line reads `Coverage strict …`): read
61
+ `node scripts/pincer-runtime.cjs coverage` — structure complete, every in-scope
62
+ scenario `delivered` on the evaluated candidate, deferrals and removals backed by
63
+ their decision and user authorization, `delivery` reported as original versus
64
+ agreed scope (never conflate them), adequacy `adequate`; the manifest is schema 3
65
+ and the `Provenance` line reads `runtime (schema 3)`. `ready` names
66
+ `COVERAGE_INCOMPLETE`, `SCOPE_UNAUTHORIZED`, `OBLIGATION_MISSING`,
67
+ `REVIEW_MISSING` and `ADEQUACY_REQUIRED` as failures. A change labeled
68
+ `Coverage unverified` did not adopt strict coverage: audit it under the rules
69
+ above and say so; never imply strict coverage was established.
41
70
  - Every file the manifest lists is tracked, and `git status --short` is empty before
42
71
  and after the audit.
43
72
  - Run the repository's candidate-wide release gate directly (`npm test`, or the
@@ -15,13 +15,36 @@ start of a session. Read-only: change nothing.
15
15
  1. Run `scripts/pincer-status.sh`. It reads the artifacts on disk (`.prd/`, `tickets/`,
16
16
  `NOTES.md`) and prints the PRD state and profile, every ticket with its state and
17
17
  clock-based elapsed time, what is blocked, wall-clock build time while a ticket is in
18
- progress or against an explicit user budget, the evidence verdict for the evaluated
18
+ progress or against an explicit user budget, the `Runtime` line (legacy receipts or
19
+ the registered change), the evidence verdict and `Provenance` line for the evaluated
19
20
  candidate, any warnings (each readiness problem once), and the next command to run.
21
+ `scripts/pincer-status.sh --json` prints one status object with reason codes and the
22
+ next action for tooling; `node scripts/pincer-runtime.cjs ready [T-NN]` is the
23
+ read-only gate. On a project with change records (`Runtime changes …`) run
24
+ `node scripts/pincer-runtime.cjs resume` as well: it reports the selected change, its
25
+ lifecycle, agreement and authorization, decisions, references, tickets, attempts,
26
+ candidate, the authored handoff note and the next command, and never writes;
27
+ `change list` shows every retained change, `status --change <id>` and
28
+ `resume --change <id>` inspect another one without selecting it. `resume` is the
29
+ report; `change resume <id>` is the lifecycle operation. The `Coverage` line says
30
+ `strict` or `unverified`; on a strict change `node scripts/pincer-runtime.cjs coverage`
31
+ (and `impact` after an edit) name the exact scenario, ticket, check or decision
32
+ that is next — quote them rather than inferring coverage from the ticket list.
20
33
  2. Report in three lines: where the workflow is, what is in progress or blocked, and the
21
- next command. Quote the `Next` line as-is.
34
+ next command. Quote the `Next` line as-is. When the `Runtime` line says `legacy`,
35
+ add the register or migrate command it names as the step that precedes the next
36
+ ticket (fresh project → `register`, legacy receipts → `migrate --preview`, a v0.5.0
37
+ binding → `migrate --preview`, no selection → `change select <id>`).
22
38
  3. If a ticket is `in_progress`, read it and `git status`, then offer to resume it with
23
39
  `/pincer-code T-{NN}`. If the script printed a warning, surface it — a done ticket
24
40
  without a receipt was marked by hand and needs `scripts/pincer-ticket.sh verify T-{NN}`.
25
41
  Never restore a ticket file from git to clear a warning; a failed attempt is a record.
26
42
  The one exception is the tree-back-at-candidate case in the recovery section of
27
43
  `/pincer-code`: the user restores the ticket file, and nothing is verified or committed.
44
+ It applies only when the recorded failure is explained by a since-reverted source
45
+ change and the block passes in the same execution context as `verify`; an
46
+ unexplained failure (a service down, a missing dependency) stays a failure until the
47
+ environment is repaired and `verify` passes again. After migration never restore a
48
+ ticket file or delete `.pincer/runtime` to clear a warning: repair the cause and run
49
+ `verify` again; a dead session's `running` attempt is finalized by
50
+ `node scripts/pincer-runtime.cjs recover`.