@gtrabanco/pi-agentic-workflow 0.24.0 → 0.24.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtrabanco/pi-agentic-workflow",
3
- "version": "0.24.0",
3
+ "version": "0.24.4",
4
4
  "description": "Pi package: canonical agentic-workflow skills, friendly slash commands, and per-command model routing.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: audit-pr
3
3
  user-invocable: true
4
- version: 5.6.0
4
+ version: 5.6.2
5
5
  argument-hint: <pr-number> (optional — defaults to the current branch's PR)
6
6
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
7
7
  license: MIT
@@ -96,7 +96,8 @@ verdict:
96
96
  that route). The check keys the lane-era/legacy split on evidence, not on an
97
97
  author-controlled artifact (fix/285; the lane-era pipeline structurally never
98
98
  writes `progress.md` or `ACCEPTANCE.md`, so demanding them made the gate
99
- unsatisfiable for every lane-era unit — issue #285):
99
+ unsatisfiable for every lane-era unit; the post-feature 61 unit doc's `## Acceptance
100
+ criteria` is the canonical acceptance source — issue #285):
100
101
  - **Legacy path** — opened only when the unit's `progress.md` carries a
101
102
  `## Pre-execution review receipt v1 — plan` whose digest **re-derives**
102
103
  (`scripts/pre-execution-snapshot.mjs verify --stage plan` exits 0 over the
@@ -108,13 +109,15 @@ verdict:
108
109
  `structural.reasonCode`/`changedPaths` name the drifted dimension), and —
109
110
  for a feature unit — its named `— spec` parent re-derives the same way.
110
111
  The acceptance manifest binds when present (fix/285): a unit that carries
111
- `ACCEPTANCE.md` still binds it in the snapshot. Bound artifacts
112
+ `ACCEPTANCE.md` still binds it in the snapshot; post-feature 61 units bind
113
+ the unit doc's `## Acceptance criteria` section instead. Bound artifacts
112
114
  are frozen: new implementation-phase files are allowed, edits to a bound
113
115
  artifact are not. A receipt that does not re-derive — stale, missing,
114
116
  wrong-stage **or impossible-timeline** — is never a pass: the check falls
115
117
  through to the lane-era path, so a planted or stale `progress.md` cannot
116
118
  buy a weaker gate (and a unit doc with no lane-era surface left is then
117
- **BLOCKED**, `→ Next: /unit-lane <unit>`).
119
+ **BLOCKED**, `→ Next: /unit-lane <unit>`). Restoring the bound artifact or obtaining explicit user approval for a
120
+ SPEC amendment and replacement manifest, then write a fresh receipt.
118
121
  - **Lane-era path** (feature 61's single-doc contract) — the unit doc's
119
122
  Evidence section carries the `## Triaged steps` block whose `Steps:` /
120
123
  `Skipped:` / `Budget:` lines re-derive identically from the doc's own
@@ -154,5 +157,6 @@ verdict:
154
157
  A legacy unit with no ledgers is not exempt: the missing ledgers must be constructed
155
158
  and reviewed through the adoption route (the pre-execution gate in `execute-phase`'s
156
159
  preflight) before MERGE-READY. The audit never coerces old evidence into the new
157
- format, never edits `ACCEPTANCE.md`, and never accepts a hand-written table that the
160
+ format, never edits `ACCEPTANCE.md` (legacy (pre-feature 61)) or the unit doc's acceptance
161
+ section (post-feature 61), and never accepts a hand-written table that the
158
162
  plan snapshot does not bind.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: pre-execution-review
3
3
  user-invocable: false
4
- version: 2.7.0
4
+ version: 2.7.1
5
5
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
6
6
  license: MIT
7
7
  description: >
@@ -55,7 +55,7 @@ task | implementation-owner | validator | required-evidence | status
55
55
  | `authority-source` | the SPEC/acceptance/criterion or ledger row that *requires* it — never the implementation |
56
56
  | `phase` / `task` | exactly one phase and one task; a row needing two phases means the phase cut is wrong |
57
57
  | `implementation-owner` | the skill/role that performs it (usually `execute-phase`) |
58
- | `validator` | the command or check that proves it, copied from `ACCEPTANCE.md` or the phase's done-when |
58
+ | `validator` | the command or check that proves it, copied from the acceptance artifact (`ACCEPTANCE.md` for legacy (pre-feature 61) units; `sed -n '/^## Acceptance criteria/,/^## /p' <unit>/SPEC.md \| git hash-object --stdin` for post-feature 61) or the phase's done-when |
59
59
  | `required-evidence` | what must be recorded where (test name, receipt line, ledger row) |
60
60
  | `status` | `planned \| in-progress \| verified \| n/a \| deferred` |
61
61
 
@@ -147,7 +147,7 @@ progress | docs/features/<NN>-<slug>/SPEC.md · docs/fix/<issue>-<topic>/SPEC.md
147
147
  known-issues | docs/features/<NN>-<slug>/known-issues.md · docs/fix/<issue>-<topic>/known-issues.md | unit-lane:known-entries + execute-phase:blocker-entries-and-status | none | none | bun test scripts/ledger-ownership.test.mjs
148
148
  decisions | docs/features/<NN>-<slug>/decisions.md · docs/fix/<issue>-<topic>/decisions.md | unit-lane:decisions + execute-phase:phase-decisions + human-owner:ratified-verdicts | none | none | bun test scripts/ledger-ownership.test.mjs
149
149
  roadmap | docs/features/ROADMAP.md · docs/fix/README.md | unit-lane:row-registration + execute-phase:status-and-pr-link + audit-docs:low-risk-row-repair | none | none | bun test scripts/bounded-delivery-loops.test.mjs
150
- acceptance-manifest | docs/features/<NN>-<slug>/ACCEPTANCE.md · docs/fix/<issue>-<topic>/ACCEPTANCE.md | unit-lane:acceptance-freeze + human-owner:approved-amendment | none | none | git hash-object docs/features/<NN>-<slug>/ACCEPTANCE.md
150
+ acceptance-manifest | docs/features/<NN>-<slug>/ACCEPTANCE.md · docs/fix/<issue>-<topic>/ACCEPTANCE.md | unit-lane:acceptance-freeze + human-owner:approved-amendment | none | none | git hash-object docs/features/<NN>-<slug>/ACCEPTANCE.md (legacy pre-feature 61) · sed -n '/^## Acceptance criteria/,/^## /p' <unit>/SPEC.md then git hash-object --stdin (unit doc era, post-feature 61)
151
151
  # no-script-writer: SPEC.md · PLAN.md · TASKS.md · CHECKLIST.md · testing.md · architecture-notes.md · planning-evidence.md · planning-obligations.md · delegated-evidence.md
152
152
  ```
153
153
 
@@ -63,7 +63,7 @@ in the unit's unbound `progress.md`:
63
63
  ## Wording-only determination v1 — <spec|plan>
64
64
  - Determination: <opaque id>
65
65
  - Artifact revision: <the rotated artifactRevisionId>
66
- - Acceptance fingerprint: <the ACCEPTANCE.md blob the batch left unmoved>
66
+ - Acceptance fingerprint: <the acceptance artifact (ACCEPTANCE.md for legacy (pre-feature 61), unit doc ## Acceptance criteria for post-feature 61) blob the batch left unmoved>
67
67
  - Intent and authority unchanged: yes
68
68
  ```
69
69
 
@@ -149,7 +149,8 @@ One rule, same shape for every consumer:
149
149
 
150
150
  - **Construct, never coerce.** Add what the unit is missing — the planning-evidence
151
151
  and obligation ledgers, built from the artifacts as they stand today — and leave
152
- `ACCEPTANCE.md`, `PLAN.md`, `TASKS.md`, the phase commits and any older receipt
152
+ `ACCEPTANCE.md` (legacy (pre-feature 61)), the unit doc's `## Acceptance criteria` (post-feature
153
+ 61), `PLAN.md`, `TASKS.md`, the phase commits and any older receipt
153
154
  byte-identical. Rewriting an old verdict, its digest, or its date is forgery.
154
155
  - **Re-review, then resume.** The adopted unit re-runs the lane's `review` step like any other and
155
156
  `execute-phase` resumes **only** on that current verdict. A pre-lane unit
@@ -61,7 +61,8 @@ Rules the builder enforces and no caller may improvise around:
61
61
  `Depends on:` line plus the closure roadmap rows); the unit's artifacts and the
62
62
  authorities above stay bound.
63
63
  - **A snapshot digest is not a git blob id.** `git hash-object` stays the convention
64
- for the frozen `ACCEPTANCE.md` manifest receipt only; comparing it to a snapshot
64
+ for the frozen `ACCEPTANCE.md` manifest receipt only (legacy pre-feature 61) or the post-feature
65
+ 61 unit doc acceptance section; comparing it to a snapshot
65
66
  digest proves nothing and a sensor that does so is wrong, not cheap.
66
67
 
67
68
  ### Re-verifying a receipt (consumers)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: review-change
3
3
  user-invocable: true
4
- version: 3.12.0
4
+ version: 3.12.1
5
5
  argument-hint: <path-or-glob> [--adversarial N] [--synthesize]
6
6
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
7
7
  license: MIT
@@ -59,7 +59,8 @@ or edits code. A `REVIEW-FAIL`/`NEEDS-DECISION` turn closes when the report
59
59
  block is printed (report step 13).
60
60
 
61
61
  Consume the internal [verification contract](<../verification-contract/SKILL.md>);
62
- the reviewer checks the same frozen `ACCEPTANCE.md` blob as the executor before
62
+ the reviewer checks the same frozen acceptance artifact (legacy (pre-feature 61) `ACCEPTANCE.md`
63
+ or post-feature-61 unit doc `## Acceptance criteria`) as the executor before
63
64
  mapping candidate evidence.
64
65
 
65
66
  ## When to use
@@ -31,8 +31,8 @@
31
31
  2. Review the **fold diff only** (`git diff <pre-batch HEAD>..<batch HEAD>`
32
32
  over the commits this turn's batch produced);
33
33
  3. Require the **gate green at the reviewed head** and the sibling
34
- `ACCEPTANCE.md` blob recomputed to an **exact match** — the step-2
35
- structural precondition, unchanged and still mandatory;
34
+ acceptance-manifest (step-2 artifact) blob recomputed to an **exact match**
35
+ — the step-2 structural precondition, unchanged and still mandatory.
36
36
  4. Append the normal `review-mark@1` `REVIEW-RAN` mark — delta cycles count
37
37
  toward the two-cycle cap from the unchanged source (marks + forge
38
38
  receipts), never a fresh reset;
@@ -52,13 +52,14 @@
52
52
  read from `git diff --unified=0` hunk headers);
53
53
  - **Size** — added+deleted changed lines **> 200**, or changed files
54
54
  **> 15** (`git diff --numstat`).
55
- 2. **Frozen acceptance + SPEC drift check (structural).** Locate sibling
56
- `ACCEPTANCE.md`, recompute its blob, and require an exact match with the
57
- execution receipt before assessing the candidate. Missing/mismatch is a
58
- `workflow` fix-now finding and no passing receipt may be posted. Legacy units
59
- use the verification contract's committed SPEC-blob fallback. Then build a
60
- **per-criterion coverage table** from the manifest — one row per acceptance
61
- criterion, no free-form comparison:
55
+ 2. **Frozen acceptance + SPEC drift check (structural).** Locate the acceptance
56
+ artifact — legacy (pre-feature 61) `ACCEPTANCE.md` or the unit doc's
57
+ `## Acceptance criteria` section (post-feature 61) — recompute its blob,
58
+ and require an exact match with the execution receipt before assessing the
59
+ candidate. Missing/mismatch is a `workflow` fix-now finding and no passing
60
+ receipt may be posted. Legacy units use the verification contract's
61
+ committed SPEC-blob fallback. Then build a **per-criterion coverage table**
62
+ from the manifest — one row per acceptance criterion, no free-form comparison:
62
63
 
63
64
  ```
64
65
  | criterion | evidence (file:line or command run) | met | unmet | untouched |
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: review-implementation
3
3
  user-invocable: false
4
- version: 1.11.0
4
+ version: 1.11.1
5
5
  argument-hint: <path-or-glob>
6
6
  allowed-tools: Read, Grep, Glob, Bash, WebFetch
7
7
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
@@ -42,7 +42,7 @@ A finding **blocks** only when the reviewer cites which single-owner source
42
42
  fails — blocking is a table lookup over cited sources, never a severity
43
43
  opinion. The four citation categories are:
44
44
 
45
- 1. **ACCEPTANCE criterion** unverified or failed.
45
+ 1. **ACCEPTANCE criterion** (legacy `ACCEPTANCE.md` or post-feature 61 unit doc `## Acceptance criteria`) unverified or failed.
46
46
  2. **Obligation row** in the unit's ledger is not `verified` or `n-a`.
47
47
  3. **Gate is red** at the reviewed head (the project gate exited non-zero at
48
48
  the exact head under review).
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: unit-lane
3
3
  user-invocable: true
4
- version: 2.0.0
4
+ version: 2.2.0
5
5
  argument-hint: <NN-slug | "<idea>"> [--retriage] | --fix <issue-number> | --from-issue <issue-number>
6
6
  description: >
7
7
  One-shot lane conductor for a delivery unit: triage, implement, evidence, and
@@ -25,6 +25,12 @@ done:
25
25
  is inferred: a gap re-enters provenance → research, and a gap surviving both
26
26
  runs `node scripts/needs-input.mjs <unit-dir>` and stops with the
27
27
  `open-questions@1` block routed back to the owning stage.
28
+ ✓ Every claim the SPEC or the plan asserts (objective, why, ACs, tasks) cites
29
+ its source — `path:line`, a doc, or an owner answer in the unit folder's
30
+ `sources.md`. A claim with none is a question, never a default.
31
+ ✓ Every question asked is recorded with its resolution (owner answer, "Decide
32
+ for me" + reason, or the explicit `none — no questions` line) in
33
+ `decisions.md`; no question the user already answered is asked twice.
28
34
  ✓ Triage ran (bun scripts/unit-route.mjs --triage <slug>) and its block pasted
29
35
  verbatim into the unit doc's Evidence section as the authoritative step list
30
36
  ✓ Unit doc exists at docs/features/<NN>-<slug>/SPEC.md (created from template
@@ -135,7 +141,10 @@ execution work hands off one phase per turn:
135
141
  ```
136
142
 
137
143
  `<k>` is the first unfinished phase (the unit doc's Progress log records the
138
- phases done so far; `bun scripts/unit-route.mjs <NN-slug>` prints it) and
144
+ phases done so far; `bun scripts/unit-route.mjs <NN-slug>` prints it — when every
145
+ phase is recorded but the index still reads `in-progress`, the router refuses with
146
+ `UNIT ROUTE — error … settle the index or roadmap status` and exits 1: settle the
147
+ status, then continue the ladder) and
139
148
  `<tier>` is the `implement` entry of the triage block's `Tiers:` line. Never
140
149
  print the bare whole-unit `/execute-phase <NN-slug>` — whole-unit loop mode
141
150
  survives only as an explicit operator choice. When the last phase's turn
@@ -13,9 +13,10 @@ Cheap-to-change defaults are recorded as assumptions, never silent.
13
13
 
14
14
  ## Purpose
15
15
 
16
- Run the gap interview, induce acceptance criteria from user scenarios, and
17
- close entity, role, and expectation boundaries — distilled from the full design
18
- skill's closure.
16
+ Run **investigate → orient → ask → decide**: every claim the SPEC makes is
17
+ entered in a ledger that cites its source, and entity, role, and expectation
18
+ boundaries close. The unit of progress is a **claim with a source** — a claim no
19
+ source or owner answer supports is a defect, not a judgment call.
19
20
 
20
21
  ## Inputs
21
22
 
@@ -24,20 +25,63 @@ skill's closure.
24
25
  installed tooling — whatever they already answer is never asked again
25
26
  - Research findings from the research step
26
27
 
27
- ## The gap interview (runs before acceptance criteria lock)
28
+ ## Stage 1 — investigate
28
29
 
29
- Collect every open decision the unit depends on and filter each one:
30
+ Open with a provenance search, then journal every claim. **The first action of
31
+ this stage is a search, not a sentence**: no design claim is written before the
32
+ repository has been asked.
30
33
 
31
- | The gap… | The lane does |
34
+ 1. **Provenance search.** Run the greps and reads whose result would settle the
35
+ claim (`grep -rn "<term>" docs/ src/`, the documentation map, the architecture
36
+ doc, the roadmap, prior units' `decisions.md`), and record **where you
37
+ looked**: `path:line` hits and the greps run. A "not found" without that
38
+ receipt is the defect this stage exists to catch.
39
+ 2. **Journal** — append one row per claim to the unit folder's `sources.md`:
40
+
41
+ | id | claim | source | certainty |
42
+ |---|---|---|---|
43
+ | INV-001 | <the claim, one line> | `<path:line>`, `<doc#anchor>`, `owner answer <Q-id>`, or `user request` | confirmed / inferred / unknown |
44
+
45
+ `confirmed` = verifiable by a command or documented; `inferred` = deduced,
46
+ not yet verified; `unknown` = no evidence found (→ the orient stage must ask).
47
+ 3. **Induce acceptance criteria** from user scenarios — each AC is a claim too,
48
+ and cites the scenario or owner answer it came from.
49
+ 4. **Close boundaries**: entities and their roles, actors, accepted and rejected
50
+ inputs (the expectation sweep), deferrals (→ `## Future`).
51
+
52
+ Pass only if: ✓ the provenance search ran and its receipt is recorded ✓ every
53
+ claim is a `sources.md` row ✓ every AC is induced from a user scenario.
54
+
55
+ ## Stage 2 — orient
56
+
57
+ Filter each `INV-*` claim with three fixed tiers, in order — the lowest tier that
58
+ settles the claim wins, and the repository always speaks first:
59
+
60
+ | Tier | When it settles the claim | What this stage does |
61
+ |---|---|---|
62
+ | **0 · provenance** | A recorded `path:line`, doc, or prior decision answers it | Nothing to ask — point the row at the source |
63
+ | **1 · research** | External and unresearched, in tier 0 or outside it | Research it into 2–3 options with trade-offs |
64
+ | **2 · ask** | No evidence exists anywhere | Backlog it for the ask stage — never decided here |
65
+
66
+ The tier-2 backlog is then filtered by cost of being wrong — expensive to undo
67
+ = **scope** (personal / team / global), **stack**, **architecture pattern**,
68
+ **data model**, **deployment target**, **security configuration**:
69
+
70
+ | The claim… | The lane does |
32
71
  |---|---|
33
- | The request, the repo, or the installed tooling already answers it | Never asks |
34
72
  | Blocks now and is expensive to undo once code sits on top | Asks |
35
73
  | Blocks a later task that is already foreseeable | Asks now as a possibility; re-asks only if conditions change |
36
- | Cheap to change later | Takes a reasonable default and records it as an assumption — never silent |
74
+ | Cheap to change later | Takes a reasonable default, records it as a dated assumption — never silent |
75
+
76
+ Pass only if: ✓ every `INV-*` row carries a tier and a cost verdict ✓ every
77
+ tier-0 row names the source that settled it ✓ no claim was researched or asked
78
+ before the provenance tier ran.
37
79
 
38
- Expensive to undo = the choices that cost a lot to change once code exists on
39
- top: **scope** (personal / team / global), **stack**, **architecture pattern**,
40
- **data model**, **deployment target**, and **security configuration**.
80
+ ## Stage 3 — ask
81
+
82
+ Batch the tier-2 claims from the orient stage. This stage reads the **orient
83
+ output and the ask backlog** — never re-derives a claim the provenance tier
84
+ settled, never re-asks an answer the user already gave.
41
85
 
42
86
  Mechanics — one batched form-turn, never one-question-per-turn:
43
87
 
@@ -49,52 +93,104 @@ Mechanics — one batched form-turn, never one-question-per-turn:
49
93
  - Every slot carries: the **recommended option with its why**, one
50
94
  alternative, **"Decide for me"**, and **"Explain the options"** — the user
51
95
  may always answer freely.
52
- - **"Decide for me"**: the lane chooses, then records the choice and its
53
- reason as a dated row in the unit folder's `decisions.md` — explicit, never
54
- guessed silently.
55
- - **"Explain the options"**: explain each alternative didactically, then
56
- re-ask only that slot.
57
96
  - A tool the project lacks may be offered as one more option (with its
58
97
  recommendation and why); installing it always needs the user's explicit
59
98
  consent.
60
- - **Ready when:** no expensive-to-undo blocking gap remains unanswered — not
61
- when no gaps remain. An answer the user already gave is never re-asked.
99
+ - **Ready when:** no expensive-to-undo blocking claim remains unanswered — not
100
+ when no questions remain.
101
+
102
+ The questions are the `open-questions@1` block of the unit folder's
103
+ `decisions.md` — the grammar `scripts/needs-input.mjs` reads, published in the
104
+ template agent guide's question protocol. Append the block (never a table of
105
+ your own invention) and carry a search receipt on every question:
62
106
 
63
- Deferred ideas ("down the road I'd like…") are never implemented, never turned
64
- into spec or tasks by this unit: they go verbatim to the unit doc's
65
- `## Future` section, dated, so the architecture may accommodate them without
66
- building them.
107
+ ```text
108
+ open-questions@1
109
+ id | date | type | question | blocks | search-receipt | options | route
110
+ Q1 | <YYYY-MM-DD> | open-question | <the decision being asked> | <why nothing proceeds without it> | <where the repository was searched: path:line, greps, prior units> | <option A — trade-off> \| <option B — trade-off> \| Decide for me \| Explain the options | design
111
+ ```
112
+
113
+ ## Stage 4 — decide
114
+
115
+ Record every answer — the user's, and every "Decide for me" choice with its
116
+ reason — as a `decision` row of the same block, newest last. Only the owner
117
+ closes a question; the row carries where the answer is recorded (a chat paste, an
118
+ issue comment) and what was discarded:
119
+
120
+ ```text
121
+ D1 | <YYYY-MM-DD> | decision | Q1 | human-owner | <where the answer is recorded> | <what was chosen> | <what was discarded and why>
122
+ ```
123
+
124
+ A cheap default taken in stage 2 goes to the file's `## Assumptions` as a dated
125
+ row, correctable by the user. Then fill the unit doc's **Acceptance criteria**
126
+ (induced from a concrete scenario, command-verified where possible, numbered).
67
127
 
68
128
  ## Fixed output contract
69
129
 
70
- Fill the unit doc's **Acceptance criteria** section. Each AC must be:
71
- - Induced from a concrete user scenario ("I do X and observe Y")
72
- - Command-verified where possible (not "feel correct")
73
- - Numbered (AC1, AC2, …)
130
+ The step owns four panes of the unit folder and nothing else:
131
+
132
+ <!-- sources:start -->
133
+ `sources.md` — one row per claim, each with a source or an owner answer. A
134
+ claim row with an empty, `—`, or `n/a` source is a **defect**: either find the
135
+ source in the provenance tier or convert the claim into a question.
136
+ <!-- sources:end -->
137
+
138
+ <!-- questions:start -->
139
+ The unit folder's `decisions.md` — the `open-questions@1` block the ask stage
140
+ appended, plus the `decision` rows the decide stage appended (one per question
141
+ closed). The step also refreshes `BRIEF.md`, the reviewer brief that restates
142
+ them, so a reviewer never has to re-derive the step's questions.
143
+
144
+ | Asked | Resolution |
145
+ |---|---|
146
+ | <question id + the decision being asked> | <what was chosen, by whom (owner answer / Decide for me), and why> |
147
+
148
+ When the orient stage left an empty ask backlog, write exactly
149
+ ``none — no questions: every claim was settled by provenance or research``.
150
+ An empty table is never that line — the form is a decision, the blank is a
151
+ missing one.
152
+ <!-- questions:end -->
153
+
154
+ <!-- deferred:start -->
155
+ `## Future` in the unit doc — deferred ideas ("down the road I'd like…"),
156
+ verbatim and dated. They are never implemented, never turned into spec or tasks
157
+ by this unit, and are reviewed at close, on resume, and when work returns to the
158
+ area.
159
+ <!-- deferred:end -->
160
+
161
+ <!-- acceptance:start -->
162
+ The unit doc's **Acceptance criteria** section, numbered and command-verified.
163
+ <!-- acceptance:end -->
74
164
 
75
165
  ## Checklist (pass only if)
76
166
 
77
- - [ ] The gap interview ran before the ACs locked: one batched form-turn,
78
- each gap filtered through the table above
79
- - [ ] No expensive-to-undo blocking gap remains unanswered
167
+ - [ ] The provenance search ran first and its receipt is recorded (`path:line`, the greps, prior units)
168
+ - [ ] Every claim (objective, why, every AC, non-goals) cites its source or an owner answer in `sources.md`, and none lacks one
169
+ - [ ] Every claim carries a certainty (`confirmed` / `inferred` / `unknown`); an `unknown` claim became a question
170
+ - [ ] Every acceptance criterion (AC1, AC2, …) is induced from a user scenario and cites what induced it
171
+ - [ ] The orient tiers ran in order: provenance before research before ask
172
+ - [ ] Every question asked was recorded with its resolution — or the questions pane says `none` explicitly
173
+ - [ ] No expensive-to-undo blocking claim remains unanswered
80
174
  - [ ] Every "Decide for me" choice is recorded with its reason in `decisions.md`
81
- - [ ] Cheap defaults are recorded as assumptions, correctable by the user
82
- - [ ] Deferred user ideas landed in `## Future`, not in scope
83
- - [ ] Every AC is induced from a user scenario, not inferred from vague intent
84
- - [ ] Acceptance criteria are command-verified where possible
175
+ - [ ] Cheap defaults are recorded as dated assumptions, correctable by the user
85
176
  - [ ] Entity closure: every entity mentioned has its role in the unit stated
86
177
  - [ ] Role closure: every actor/role that interacts with the unit is listed
87
178
  - [ ] Expectation sweep: user's accepted and rejected inputs are bounded
88
- - [ ] Vague items → ask the user with concrete options, never invent
179
+ - [ ] Deferrals landed in `## Future`, not in scope
89
180
 
90
181
  ## Forbidden
91
182
 
183
+ - Never infer a claim: one that is not in the repository and not derivable from
184
+ it is a question for the owner, never a default. A claim with no source and no
185
+ owner answer is the defect, not a judgment call
186
+ - Do not write a design claim before the provenance search ran
92
187
  - Do not ask what the request, the repo, or the installed tooling already answers
93
188
  - Do not ask one question per turn when slots are independent
189
+ - Do not invent a question table of your own: the ask stage writes the
190
+ `open-questions@1` block the dispatcher reads
191
+ - Do not decide at the ask stage — asking and answering are different stages
94
192
  - Do not implement, spec, or task anything from `## Future`
95
193
  - Do not install a missing tool without explicit user consent
96
194
  - Do not build a separate DESIGN.md — one SPEC, all in the unit doc
97
- - Do not invent product scope the user did not confirm
98
195
  - Do not pre-fill engineering content (phases, tests, architecture)
99
196
  - Do not stamp "designed" with an incomplete closure row
100
- - An incomplete row silently un-does the skill's purpose
@@ -22,8 +22,10 @@ At each execution boundary, print exactly one phase hand-off and end the turn:
22
22
  ```
23
23
 
24
24
  `<k>` = first unfinished phase (lowest `P<n>` bullet the Progress log does not
25
- record; `bun scripts/unit-route.mjs <NN-slug>` prints it). `<tier>` = the
26
- `implement` entry of the triage block's `Tiers:` line. Never the bare
25
+ record; `bun scripts/unit-route.mjs <NN-slug>` prints it — if every phase is
26
+ recorded while the index still reads `in-progress`, the router refuses with
27
+ `UNIT ROUTE — error … settle the index or roadmap status` and exits 1). `<tier>` =
28
+ the `implement` entry of the triage block's `Tiers:` line. Never the bare
27
29
  whole-unit command.
28
30
 
29
31
  When the last phase's turn closes, `execute-phase` resumes the lane. Verify
@@ -2,16 +2,96 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- Cut tasks from acceptance criteria. Each task names its validator. Smallest
6
- first. No future-phase work.
5
+ Run **investigate → orient → ask → decide** over the plan itself: cite every
6
+ task, sweep every claim against what the repository already decided, ask only
7
+ what no source answers, and record the answers. Each task names its validator;
8
+ smallest first; no future-phase work.
7
9
 
8
10
  ## Inputs
9
11
 
10
- - The unit's Acceptance criteria (filled by the design step)
11
- - The unit's non-goals
12
+ - The unit doc: acceptance criteria, non-goals, and the design step's four panes
13
+ (`sources.md`, `decisions.md`)
14
+ - The unit's Impact section — the surface the executor must sweep
15
+
16
+ ## Stage 1 — investigate
17
+
18
+ Open with the same provenance search the design step ran, aimed at the plan's own
19
+ claims ("does a validator for this exist?", "is this module already covered?",
20
+ "did a prior unit decide this?"). Journal each claim as a row of the unit
21
+ folder's `sources.md`, with the id prefix `CLAIM-`:
22
+
23
+ | id | claim | source | certainty |
24
+ |---|---|---|---|
25
+ | CLAIM-001 | <the plan claim, one line> | `<path:line>`, prior `decisions.md:line`, or `owner answer <Q-id>` | confirmed / inferred / unknown |
26
+
27
+ Two claims never need a search: the unit's own acceptance criteria (the design
28
+ step cited them) and its non-goals. Everything else does — a plan claim with no
29
+ source and no owner answer is the defect this stage exists to catch.
30
+
31
+ ## Stage 2 — orient
32
+
33
+ Re-run the provenance tier over the plan's claims, then sweep every one of them
34
+ against what the repository has **already decided in writing** — a plan must not
35
+ contradict a prior decision in architecture, engineering, product, or any other
36
+ domain. A claim the provenance search explains is settled at tier 0: point the
37
+ row at `path:line` and move on. **Record where you looked** for every row the
38
+ search did not settle — the greps meant for it and the prior units of the same
39
+ area. In the same pass, check that the acceptance criteria are the plan's
40
+ *input*, not a claim it re-decides: a task that would change an AC belongs to the
41
+ design step, not here.
42
+
43
+ **Candidate sources** — deterministic keyword/FTS matching, no new index and no
44
+ new tooling: `docs/features/<NN>-<slug>/decisions.md`,
45
+ `docs/fix/<issue>-<topic>/decisions.md`, the project's architectural invariants,
46
+ the Normalized Repository State (`discover-repository-state` /
47
+ `resolve-repository-state`), `AGENTS.md`, and a unit SPEC's `## Design status`
48
+ (legacy marker, units ≤ 60).
49
+
50
+ **Advisory only — no new authority.** `contradicts` routes to
51
+ `resolve-repository-state` only when the hit is against a frozen NRS fact (its
52
+ only candidate source that carries a `<contradiction-id>` row after a
53
+ `discover-repository-state` step); hits against `decisions.md` / `AGENTS.md` /
54
+ architectural invariants / `## Design status` surface a `NEEDS-DECISION` for the
55
+ user, per the existing rules. A plan with **no candidate match is clean and
56
+ proceeds** — a miss never blocks it, a missed candidate can never void a plan,
57
+ and the sweep issues no stage verdict and grants no gate of its own.
58
+
59
+ Pass only if: ✓ the provenance search ran and where you looked is recorded ✓ every `CLAIM-*` row was swept ✓ every `contradicts` hit is either
60
+ resolved from a frozen NRS fact or backlogged for the ask stage ✓ no task
61
+ re-decides an acceptance criterion.
62
+
63
+ ## Stage 3 — ask
64
+
65
+ Only `contradicts` hits and `unknown` claims that no source settles reach this
66
+ stage — a plan asks after the repository has spoken, never before. Batch them
67
+ into **one** form-turn (≤6 slots) using the design step's mechanics: recommended
68
+ option with its why, one alternative, "Decide for me", "Explain the options".
69
+
70
+ The questions are the same `open-questions@1` block the dispatcher reads — append
71
+ the block to the unit folder's `decisions.md` (route `unit-lane`: these are
72
+ plan-owned facts), never a table of your own:
73
+
74
+ ```text
75
+ open-questions@1
76
+ id | date | type | question | blocks | search-receipt | options | route
77
+ Q2 | <YYYY-MM-DD> | open-question | <the decision being asked> | <why nothing proceeds without it> | <where the repository was searched: path:line, greps, prior units> | <option A — trade-off> \| <option B — trade-off> \| Decide for me \| Explain the options | unit-lane
78
+ ```
79
+
80
+ A plan with an empty backlog writes the explicit `none` line instead — never a
81
+ blank.
82
+
83
+ ## Stage 4 — decide
84
+
85
+ Record every answer as a `decision` row of the same block (newest last), and a
86
+ `Decide for me` choice with its reason — then cut the tasks:
87
+
88
+ ```text
89
+ D2 | <YYYY-MM-DD> | decision | Q2 | human-owner | <where the answer is recorded> | <what was chosen> | <what was discarded and why>
90
+ ```
12
91
 
13
92
  ## Fixed output contract
14
93
 
94
+ <!-- tasks:start -->
15
95
  Fill the unit doc's **Tasks** section:
16
96
 
17
97
  ```
@@ -30,39 +110,27 @@ backticked command **and** an expected outcome, e.g. `exits 0`), and the nested
30
110
  `Relevant files:` line is **metadata, never a task** — it is that phase's read
31
111
  set, written from the planner's own discovery, and a file that is missing from
32
112
  it is never out of scope for the executor.
113
+ <!-- tasks:end -->
33
114
 
34
- ## Prior-decisions contradiction sweep
35
-
36
- Before the plan is accepted, sweep its claims against what the repository has
37
- **already decided in writing** — a plan must not contradict a prior decision in
38
- architecture, engineering, product, or any other domain.
39
-
40
- **Candidate sources** — deterministic keyword/FTS matching, no new index and no
41
- new tooling: `docs/features/<NN>-<slug>/decisions.md`,
42
- `docs/fix/<issue>-<topic>/decisions.md`, the project's architectural invariants,
43
- the Normalized Repository State (`discover-repository-state` /
44
- `resolve-repository-state`), `AGENTS.md`, and a unit SPEC's `## Design status`
45
- (legacy marker, units ≤ 60).
46
-
47
- **Fixed evidence shape** — one row per candidate hit, the decision quoted from
48
- its source:
115
+ <!-- sources:start -->
116
+ `sources.md` — every `CLAIM-*` row with a source or an owner answer. A claim row
117
+ whose source is empty, `—`, or `n/a` is a **defect**: find the source in the
118
+ provenance tier or convert the claim into a question.
119
+ <!-- sources:end -->
49
120
 
50
- | claim | prior decision | source path | relation |
51
- |---|---|---|---|
52
- | <the plan claim> | <the recorded decision> | <path:line> | `contradicts` \| `compatible` |
121
+ <!-- questions:start -->
122
+ The unit folder's `decisions.md` — the `open-questions@1` block the ask stage
123
+ appended, plus the `decision` rows the decide stage appended, one per question
124
+ closed. The step also refreshes `BRIEF.md`, the reviewer brief that restates
125
+ them, so a reviewer never has to re-derive the step's questions:
53
126
 
54
- The cell value is exactly one of two values: `contradicts` or `compatible` —
55
- a row relation, not a stage verdict.
127
+ | Asked | Resolution |
128
+ |---|---|
129
+ | <question id + the decision being asked> | <what was chosen, by whom (owner answer / Decide for me), and why> |
56
130
 
57
- **Advisory only — no new authority.** `contradicts` routes to
58
- `resolve-repository-state` only when the hit is against a frozen NRS fact
59
- (its only candidate source that carries a `<contradiction-id>` row after a
60
- `discover-repository-state` step); hits against
61
- `decisions.md` / `AGENTS.md` / architectural invariants / `## Design status`
62
- surface a `NEEDS-DECISION` for the user, per the existing rules. A plan with **no
63
- candidate match is clean and proceeds** — a miss never blocks it, a missed
64
- candidate can never void a plan, and the sweep issues no stage verdict and grants no
65
- gate of its own.
131
+ When the sweep and the provenance tier left an empty backlog, write exactly
132
+ ``none — no questions: every claim was settled by provenance or research``.
133
+ <!-- questions:end -->
66
134
 
67
135
  ## Planning ledgers (same step)
68
136
 
@@ -89,25 +157,31 @@ name those files instead.
89
157
 
90
158
  ## Checklist (pass only if)
91
159
 
92
- - [ ] Every AC maps to at least one task
160
+ - [ ] The provenance search ran first and its receipt is recorded for every plan claim
161
+ - [ ] Every claim (CLAIM-001, …) cites its source or an owner answer in `sources.md`, including every acceptance criterion it rests on — none is blank, `—`, or `n/a`
162
+ - [ ] Every claim was swept against the candidate sources; each `contradicts` hit is resolved or asked
163
+ - [ ] Every question asked was recorded in `decisions.md` with its resolution (or the questions pane says `none`)
164
+ - [ ] Every AC maps to at least one task, and no task re-decides an AC
93
165
  - [ ] Tasks are ordered smallest first
94
166
  - [ ] Each task names its validator (a backticked command plus its expected outcome)
95
167
  - [ ] Final task is verification (proves the whole unit works)
96
168
  - [ ] No task reaches into a future-phase concern (docs, release, migrations)
97
169
  - [ ] Phases labeled P1, P2, … (never S1, Step 1)
98
- - [ ] Every plan claim touching architecture, engineering or product intent was
99
- swept against the candidate sources above
100
- - [ ] Each candidate hit is one fixed-shape row, with the prior decision cited
101
- at `path:line` and one of the two relations
102
170
  - [ ] Both planning ledgers are cut (planning evidence + obligations), in the
103
171
  sizing rule's home, with stable ids
104
172
 
105
173
  ## Forbidden
106
174
 
175
+ - Never infer a plan claim: one the repository does not answer and no owner
176
+ settled is a question, never a default
177
+ - Do not cut a task before the claim it rests on cites a source or an owner answer
178
+ - Do not invent a question table of your own: the ask stage writes the
179
+ `open-questions@1` block the dispatcher reads
180
+ - Do not decide at the ask stage, and do not re-ask an answered question
107
181
  - Do not bundle across phase boundaries — one phase = one commit
108
182
  - Do not plan work beyond the unit's acceptance criteria
109
183
  - Do not include docs/release tasks here — those are separate catalog steps
110
184
  - Do not invent tasks that the ACs do not demand
111
185
  - Do not turn the sweep into a gate, stage verdict or blocking check — it routes,
112
186
  it never blocks a miss, and it adds no authority
113
- - Do not record a `prior decision` that no source `path:line` cites
187
+ - Do not record a `prior decision` that no source `path:line` cites
@@ -1,13 +1,15 @@
1
1
  ---
2
2
  name: verification-contract
3
3
  user-invocable: false
4
- version: 1.3.0
4
+ version: 1.4.2
5
5
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
6
6
  license: MIT
7
7
  description: >
8
- Internal contract: one compact frozen ACCEPTANCE.md per delivery unit, its
9
- validation ladder, anti-weakening rules, and blob-bound execution receipt.
10
- Consumed by planners, execute-phase, and review-change.
8
+ Internal contract: the acceptance artifact per delivery unit — legacy (pre-
9
+ feature 61) units may carry a frozen `ACCEPTANCE.md` (binding if present);
10
+ post-feature 61 units use the unit doc's `## Acceptance criteria` section as
11
+ the canonical acceptance source; the unit doc's `## Evidence` table serves as
12
+ the execution receipt. Consumed by planners, execute-phase, and review-change.
11
13
  ---
12
14
 
13
15
  # Verification Contract (internal)
@@ -17,12 +19,18 @@ strengthen coverage but cannot move it; review checks the same bytes.
17
19
 
18
20
  ## Artifact
19
21
 
20
- Every new feature/fix carries `ACCEPTANCE.md` beside its SPEC. Copy the matching
21
- repository template. Required parts: `Status: frozen`; one stable ID per SPEC
22
- criterion; `Required outcome`; named `Validator`; literal quality floor; project
23
- commands. Prefer commands, otherwise use `read-verified: <evidence>` or
24
- `manual: <exact observation>`. Unlabelled prose is invalid. A planned test may
25
- name its future project runner; it cannot substitute a narrower runner later.
22
+ Legacy (pre-feature 61) units (ACCEPTANCE.md present — binding if present):
23
+ the frozen `ACCEPTANCE.md` beside the SPEC; required parts: `Status: frozen`;
24
+ one stable ID per SPEC criterion; `Required outcome`; named `Validator`; literal
25
+ quality floor; project commands. Prefer commands, otherwise use
26
+ `read-verified: <evidence>` or `manual: <exact observation>`. Unlabelled prose
27
+ is invalid. A planned test may name its future project runner; it cannot
28
+ substitute a narrower runner later.
29
+
30
+ Lane-era units (post-feature 61): the unit doc's `## Acceptance criteria` section is the
31
+ canonical acceptance source. Criteria are numbered, each induced from a concrete
32
+ user scenario, and command-verified where possible (label `read-verified` for
33
+ prose-only checks). Unlabelled prose is invalid.
26
34
 
27
35
  **Validator stability.** A validator must never gate on a surface other workflow
28
36
  actors mutate — the branch diff as a whole, the session log, progress entries,
@@ -33,31 +41,36 @@ diff-based validator enumerates the unit's paths or excludes the
33
41
  workflow-mutated surfaces explicitly (docs/LOGS.md, the unit's own docs
34
42
  directory, harness/toolstate).
35
43
 
36
- ## Freeze and receipt
44
+ **Validator determinism.** A frozen validator must be deterministic — pin network,
45
+ clock, randomness, and unordered-concurrency dependencies (fixed version,
46
+ frozen fixture, recorded input) or downgrade the row to `read-verified:`/
47
+ `manual:`.
37
48
 
38
- At first execution run `git hash-object <unit>/ACCEPTANCE.md` and append to the
39
- unit progress file:
49
+ **Property / fuzz validators.** A planner may emit a property or fuzz validator as
50
+ a bounded `commands` row — deterministic, bounded runtime within the project's
51
+ per-command timeout budgets. No new validator kind in `VerificationPlan
52
+ v1` is needed: property/fuzz rides the existing `commands` class.
40
53
 
41
- ```text
42
- ## Acceptance receipt v1
43
- - Manifest: <path> · Blob: <sha> · Status: frozen · Verified: <date>
44
- ```
54
+ ## Freeze and receipt
45
55
 
46
- Before every phase and final review, recompute it. Exact match continues;
47
- missing/mismatched evidence stops before edits:
56
+ The unit doc's `## Evidence` table is the execution receipt: each Evidence row
57
+ records a validator command, its exit code or blob digest, output excerpt, and
58
+ who verified it. A frozen criterion's receipt is the Evidence row for that
59
+ criterion — exact match continues; missing/mismatched evidence stops before
60
+ edits:
48
61
 
49
62
  ```text
50
63
  ACCEPTANCE GATE — <unit> BLOCKED
51
- Expected blob: <sha|missing> · Actual: <sha|missing>
52
- Reason: the frozen finish line is missing or changed.
64
+ Expected Evidence row for AC<N>: present with blob <sha> · Actual: missing/changed
65
+ Reason: the frozen finish line evidence is missing or changed.
53
66
 
54
67
  → Next: restore the frozen manifest, or obtain explicit user approval for a
55
- SPEC amendment and replacement manifest; then write a fresh receipt
68
+ SPEC amendment and replacement manifest; then record a fresh Evidence row
56
69
  · never edit tests, commands, or acceptance to make the current candidate pass
57
70
  ```
58
71
 
59
72
  A legitimate change requires, in order: explicit user approval; dated SPEC
60
- `## Amendments` row; replacement manifest; committed fresh receipt. The
73
+ `## Amendments` row; replacement manifest; committed fresh Evidence row. The
61
74
  executor never self-authorizes it.
62
75
 
63
76
  Legacy unit with no manifest mention: fingerprint committed `SPEC.md` and record
@@ -99,5 +112,4 @@ semantics are verified against authoritative documentation **before a test encod
99
112
 
100
113
  ## Done when
101
114
 
102
- Frozen manifest + current blob receipt + named validators + literal quality
103
- floor; executor and reviewer evaluate identical bytes.
115
+ Execution receipt (unit doc `## Evidence` table for post-feature 61 units; legacy `ACCEPTANCE.md` manifest binding-if-present) + named validators + literal quality floor; executor and reviewer evaluate identical evidence.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: workflow-status
3
3
  user-invocable: true
4
- version: 3.9.1
4
+ version: 3.9.2
5
5
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
6
6
  license: MIT
7
7
  argument-hint: "[--json-only] [--last-envelope <json|path>] [--compact]"
@@ -24,7 +24,8 @@ For every unit whose resolved status is `defined`, `planned` or `in-progress`:
24
24
  name the dimension that stopped being true, which is what the sensor labels
25
25
  `stale`. A snapshot digest is a canonical
26
26
  SHA-256 over the snapshot object, so `git hash-object` is never a substitute: it
27
- stays correct only for the frozen `ACCEPTANCE.md` manifest blob.
27
+ stays correct only for the frozen acceptance artifact: `ACCEPTANCE.md` (legacy (pre-feature 61)) or the
28
+ unit doc's `## Acceptance criteria` section (post-feature 61).
28
29
  3. The verdict, the reviewed `unit`, the stage, and the author fields
29
30
  (`reviewer` and `authorId` — the receipt's `Reviewer:` / `Author:` lines — and
30
31
  `authorExclusion`).