@gtrabanco/pi-agentic-workflow 0.6.0 → 0.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtrabanco/pi-agentic-workflow",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
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: fold-findings
3
3
  user-invocable: true
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  argument-hint: [finding-id …]
6
6
  author: "Gabriel Trabanco <gtrabanco@users.noreply.github.com>"
7
7
  license: MIT
@@ -92,6 +92,37 @@ Folded: n/m · Disputed: k · Blocked: j · Replan: r
92
92
 
93
93
  Omit `· Replan: r` when `r = 0` (preserves the existing three-field format).
94
94
 
95
+ Then print the REPAIR-RECEIPT as the ABSOLUTE-last output, together with the
96
+ branching `→ Next:` block below. The receipt is immutable once printed; a
97
+ later fold prints a new receipt (append-only output history — no ledger row,
98
+ no schema field). Six fields, always present:
99
+
100
+ ```
101
+ ## REPAIR-RECEIPT
102
+ - Repaired: <F-ids with (VF-<n>) refs, joined ` + `, or `none`>
103
+ - Refuted/open: <F-ids joined ` + `, or `none`>
104
+ - Gate: <command> → exit <n> at head <40-hex sha> · n/a when nothing was folded
105
+ - Batch class: <all-repair-in-place | frozen (replan present) | none>
106
+ - Fold diff: <shortstat from a real `git diff` run> · none when nothing was folded
107
+ - Branch: <RE-REVIEW-REQUIRED (delta) | RE-REVIEW-OPTIONAL | RE-REVIEW-SKIPPED | REPLAN-ROUTE>
108
+ ```
109
+
110
+ - The `Gate` line carries the actual exit codes observed at the head the gate
111
+ ran on — green or red. A **failed gate never silences the receipt**: the
112
+ batch is reported with the observed exit codes and nothing folded (a red gate
113
+ is not a silent gap).
114
+ - The `Fold diff` shortstat comes from a real `git diff` run over the batch's
115
+ commits.
116
+ - The `Batch class` derives from the taken queue's frozen rows only — the fold
117
+ never reclassifies (`all-repair-in-place`, `frozen (replan present)`, or
118
+ `none` for an empty queue); the vocabulary comes from
119
+ `review-implementation`'s closed class set.
120
+
121
+ **Freeze-batch (replan present).** When the taken queue contains any row whose
122
+ frozen class is `replan-in-unit` or `decision-required`, nothing folds: no
123
+ `folded: yes` flips, no commits. The receipt records the `REPLAN-ROUTE` branch
124
+ and every retained (unfolded) row id, and the loop stops to route to planning.
125
+
95
126
  ## Guardrails
96
127
 
97
128
  Scope is the ledger (or explicit ID subset); unlisted discoveries are proposals
@@ -139,3 +170,30 @@ or touched outside the queue.
139
170
 
140
171
  Replace placeholders with every actual affected finding ID before printing; never
141
172
  print `<F2>`, `…`, or a single representative ID in a live hand-off.
173
+
174
+ ## Closing-block decision branch (choose one, at emission)
175
+
176
+ The closing block picks exactly one of four outcomes. The **no-decision →
177
+ re-review default** holds whenever the turn carries no recorded prior consumer
178
+ decision to skip.
179
+
180
+ | Batch state | Branch | `→ Next:` (consumer) |
181
+ |---|---|---|
182
+ | freeze-batch (≥ 1 replan-class row) | `REPLAN-ROUTE` | plan-fix/execute-phase on this unit after the user confirms the replan |
183
+ | `all-repair-in-place` + docs-only + no folded row severity `high` + prior consumer skip decision | `RE-REVIEW-SKIPPED` | skip — consumer has explicitly decided to skip the re-review |
184
+ | `all-repair-in-place` + docs-only + no folded row severity `high` | `RE-REVIEW-OPTIONAL` | `/review-change` (default, delta mode) — or the consumer's recorded skip decision |
185
+ | empty batch (class `none`) | `RE-REVIEW-OPTIONAL` | `/review-change` by default — safe: the head is unchanged |
186
+ | anything else (behavioral surface or any folded row `high`) | `RE-REVIEW-REQUIRED (delta)` | `/review-change` — delta mode mandatory default |
187
+
188
+ **Branch-selection decision inputs.**
189
+
190
+ - **Docs-only test (E-D3).** ``RE-REVIEW-OPTIONAL`` requires every fold-diff
191
+ file to be a Markdown/documentation file; otherwise the batch is behavioral
192
+ (→ `RE-REVIEW-REQUIRED (delta)`).
193
+ - **Frozen-severity-`high` override.** A folded row whose frozen severity is
194
+ `high` forces `RE-REVIEW-REQUIRED (delta)` even on a docs-only diff. Frozen
195
+ fields are never edited to reach a branch.
196
+ - **SKIPPED requires prior consumer decision (E-D2).** `RE-REVIEW-SKIPPED`
197
+ is printed only by a turn carrying an explicit prior consumer decision to
198
+ skip. A turn with no recorded prior consumer decision prints
199
+ `RE-REVIEW-OPTIONAL` + the re-review default, **never** `RE-REVIEW-SKIPPED`.
@@ -48,3 +48,16 @@ Never edit an existing test's expectation to match behaviour: a setup repair may
48
48
  only keep assertions at least as strong and never touch expectations; the
49
49
  test-immutability contract (`verification-contract`) owns the sole amendment
50
50
  path.
51
+
52
+ ## Reproducer handoff (materialize, never re-derive)
53
+
54
+ Before repairing a **behavioral** finding, read the row's `finding-mark@1`
55
+ `recheck` cell (method + reproducer, written by `review-change` at verification
56
+ time) and materialize it as the regression check — the method as written (red
57
+ test first, reproducible command output, or direct read). The fold runner
58
+ **never invents or re-derives** the reproducer; it consumes the cell as the
59
+ allowed materialization.
60
+
61
+ - A `recheck` cell that cannot be materialized as a runnable check yields
62
+ `BLOCKED <missing input>` and names the missing input.
63
+ - Never substitute a weaker re-derived check for the recorded reproducer.
@@ -2,7 +2,9 @@
2
2
 
3
3
  1. **Build the queue.** Take every `folded: no` fix-now row, or the explicit ID
4
4
  subset, in severity/id order. `replan-in-unit` rows emit `REPLAN`; they stay
5
- on the same SPEC/branch/PR and never become issues.
5
+ on the same SPEC/branch/PR and never become issues. **Empty batch:** an
6
+ empty queue (zero findings taken) prints a REPAIR-RECEIPT with batch class `none`
7
+ and nothing folded — a receipt only, no flips, no commits.
6
8
  2. **Form the fewest atomic correction groups.** Findings may share one group
7
9
  only when all boxes pass:
8
10
 
@@ -33,9 +35,44 @@
33
35
  member so no finding disappears inside the batch.
34
36
  6. **Continue groups.** A blocked/disputed group does not prevent independent
35
37
  groups from folding. Leave its rows `no` and emit individual outcomes.
36
- 7. **Disputes.** Non-reproducible/already-fixed/wrong findings become
38
+ **Failed gate:** if the group's gate is red, do not fold the group — the
39
+ receipt records the observed gate exit codes and nothing is folded for it;
40
+ never silence the receipt and never commit red.
41
+ 7. **Batch classification.** The batch class derives from the taken queue's
42
+ frozen rows only, and the fold never reclassifies:
43
+
44
+ | Condition over the taken batch | Batch class | Fold behavior |
45
+ |---|---|---|
46
+ | ≥ 1 row with frozen class `replan-in-unit` or `decision-required` | `frozen (replan present)` | **freeze-batch** — nothing folds, no `folded: yes` flips, no commits; the receipt records the REPLAN-ROUTE and every retained (unfolded) row id; the loop stops and routes to planning |
47
+ | all taken rows foldable, none replan-class | `all-repair-in-place` | fold as today (group → fix → gate → commit → flip) |
48
+ | empty queue (zero findings taken) | `none` | receipt only |
49
+
50
+ The batch-class vocabulary references only `review-implementation`'s closed
51
+ class set (`CLASSIFY.md`); the receipt invents no parallel vocabulary.
52
+
53
+ The emitted branch follows the closing-block decision inputs in the skill:
54
+ a freeze-batch always selects `REPLAN-ROUTE`; otherwise the docs-only
55
+ file-set test (E-D3) and the frozen-severity-`high` override (E-D2) select
56
+ `RE-REVIEW-OPTIONAL` vs `RE-REVIEW-REQUIRED (delta)`.
57
+ 8. **Disputes.** Non-reproducible/already-fixed/wrong findings become
37
58
  `DISPUTED <evidence → user decision>`; never edit classification or create an
38
59
  issue.
39
- 8. **Replan.** If the smallest correct group exceeds a reviewable correction,
60
+ 9. **Replan.** If the smallest correct group exceeds a reviewable correction,
40
61
  emit `REPLAN` with proposed phases appended to the same unit. After user
41
62
  confirmation, `/execute-phase <unit>` completes them and ticks the rows.
63
+
64
+ ## REPAIR-RECEIPT — fixed printed block (verbatim copy)
65
+
66
+ Printed after the per-finding table and tally, as part of the ABSOLUTE-last
67
+ output together with the branching `→ Next:` block. Six fields, always
68
+ present:
69
+
70
+ ```text
71
+ ## REPAIR-RECEIPT
72
+ - Repaired: <F-ids with (VF-<n>) refs, joined ` + `, or `none`>
73
+ - Refuted/open: <F-ids joined ` + `, or `none`>
74
+ - Gate: <command> → exit <n> at head <40-hex sha> · n/a when nothing was folded
75
+ - Batch class: <all-repair-in-place | frozen (replan present) | none>
76
+ - Fold diff: <shortstat from a real `git diff` run> · none when nothing was folded
77
+ - Branch: <RE-REVIEW-REQUIRED (delta) | RE-REVIEW-OPTIONAL | RE-REVIEW-SKIPPED | REPLAN-ROUTE>
78
+ ```
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: pre-execution-review
3
3
  user-invocable: false
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  author: "Gabriel Trabanco <gtrabanco@users.noreply.github.com>"
6
6
  license: MIT
7
7
  description: >
@@ -194,3 +194,9 @@ counter-evidence in the same report and **never becomes a row**, a fold task,
194
194
  or a re-review trigger. The mark's `confirmed | refuted` value and the
195
195
  `recheck` cell (the method the finding's axis demands) are what let a driver
196
196
  outside the repo consume the verification the review performed.
197
+
198
+ `fold-findings` reads the `recheck` cell to **materialize** the finding's
199
+ reproducer as its regression check — it never re-derives it; a `recheck` cell
200
+ that cannot be materialized yields `BLOCKED <missing input>`. This consumption
201
+ leaves the row shape, the `VF-` exclusions, and the `review-change`
202
+ single-writer rule untouched.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: review-change
3
3
  user-invocable: true
4
- version: 3.3.0
4
+ version: 3.4.0
5
5
  argument-hint: <path-or-glob> [--adversarial N] [--synthesize]
6
6
  author: "Gabriel Trabanco <gtrabanco@users.noreply.github.com>"
7
7
  license: MIT
@@ -21,6 +21,37 @@
21
21
  same location. A cycle ≥ 2 that produces any new fix-now row appends the
22
22
  `CONVERGENCE-ANOMALY` block (`pre-execution-review/references/POLICY.md` §4)
23
23
  to the report.
24
+
25
+ **Delta mode (default on a post-fold re-review).** When the preceding fold
26
+ receipt's branch is `RE-REVIEW-REQUIRED (delta)` — or `RE-REVIEW-OPTIONAL`
27
+ acted on with the re-review decision — the review runs **delta mode**:
28
+
29
+ 1. Re-verify every `folded: yes` row at the `file:line` cited in its
30
+ `review-findings.md` row (the existing cycle-≥2 rule above);
31
+ 2. Review the **fold diff only** (`git diff <pre-batch HEAD>..<batch HEAD>`
32
+ over the commits this turn's batch produced);
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;
36
+ 4. Append the normal `review-mark@1` `REVIEW-RAN` mark — delta cycles count
37
+ toward the two-cycle cap from the unchanged source (marks + forge
38
+ receipts), never a fresh reset;
39
+ 5. Admit a candidate only when **genuinely new**: a same-`file:line`+axis
40
+ re-report inside the delta scope is admitted only as
41
+ `regression of <id>` or `DISPUTED`, never a plain new row (extending the
42
+ cycle-2 rule to the whole delta scope);
43
+ 6. A clean delta pass posts the normal SHA-bound `REVIEW-PASS`.
44
+
45
+ **Escalation to a full pass.** Either trigger escalates a delta review to a
46
+ full pass, and the escalation **states which trigger fired and the observed
47
+ numbers**:
48
+
49
+ - **Width** — any changed file outside the union of the batch's cited files
50
+ (the folded rows' `file:line`), or any changed line in a cited file more
51
+ than **50 lines** from every cited line in that file (changed-line starts
52
+ read from `git diff --unified=0` hunk headers);
53
+ - **Size** — added+deleted changed lines **> 200**, or changed files
54
+ **> 15** (`git diff --numstat`).
24
55
  2. **Frozen acceptance + SPEC drift check (structural).** Locate sibling
25
56
  `ACCEPTANCE.md`, recompute its blob, and require an exact match with the
26
57
  execution receipt before assessing the candidate. Missing/mismatch is a
@@ -129,8 +160,10 @@
129
160
 
130
161
  The review→fold loop runs at most **two** review→fold cycles per unit, counted
131
162
  unit-level and family-agnostic from the ledger's `REVIEW-RAN` marks and forge
132
- receipts — new finding families do not reset the count. After two cycles without
133
- convergence, the review prints
163
+ receipts — new finding families do not reset the count. **Delta cycles count
164
+ from the same unchanged source** (the `review-mark@1` marks + forge receipts), so
165
+ a delta-scoped re-review does not escape or reset the two-cycle bound. After two
166
+ cycles without convergence, the review prints
134
167
 
135
168
  ```text
136
169
  LOOP CAP REACHED — <unit>