@gtrabanco/pi-agentic-workflow 0.36.0 → 4.10.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 (52) hide show
  1. package/dist/config/defaults.js +8 -0
  2. package/dist/config/merge.js +20 -0
  3. package/dist/config/schema.js +103 -1
  4. package/dist/config/types.d.ts +60 -0
  5. package/dist/extension/ci-guard.d.ts +29 -0
  6. package/dist/extension/ci-guard.js +39 -0
  7. package/dist/extension/cost-guard.d.ts +30 -0
  8. package/dist/extension/cost-guard.js +50 -0
  9. package/dist/extension/factory.d.ts +11 -4
  10. package/dist/extension/factory.js +4 -1
  11. package/dist/extension/guard-util.d.ts +26 -0
  12. package/dist/extension/guard-util.js +35 -0
  13. package/dist/extension/history-guard.d.ts +59 -0
  14. package/dist/extension/history-guard.js +132 -0
  15. package/dist/extension/index.js +21 -5
  16. package/dist/extension/merge-guard.d.ts +26 -28
  17. package/dist/extension/merge-guard.js +64 -38
  18. package/package.json +7 -6
  19. package/skills/audit-docs/SKILL.md +1 -1
  20. package/skills/audit-pr/SKILL.md +12 -1
  21. package/skills/discover-repository-state/SKILL.md +1 -1
  22. package/skills/execute-phase/SKILL.md +61 -6
  23. package/skills/fold-findings/SKILL.md +126 -8
  24. package/skills/fold-findings/references/FOLD_PROCESS.md +7 -1
  25. package/skills/init-workspace/SKILL.md +1 -1
  26. package/skills/log-session/SKILL.md +1 -1
  27. package/skills/orchestration-envelope/SKILL.md +1 -1
  28. package/skills/phase-contract/SKILL.md +1 -1
  29. package/skills/pre-execution-review/SKILL.md +1 -1
  30. package/skills/product-audit/SKILL.md +4 -1
  31. package/skills/product-audit/references/AUDIT_DIMENSIONS.md +34 -0
  32. package/skills/product-audit/references/AUDIT_PROCESS.md +5 -1
  33. package/skills/resolve-repository-state/SKILL.md +1 -1
  34. package/skills/review-a11y/SKILL.md +1 -1
  35. package/skills/review-brand/SKILL.md +1 -1
  36. package/skills/review-change/SKILL.md +18 -3
  37. package/skills/review-code/SKILL.md +28 -2
  38. package/skills/review-debt/SKILL.md +8 -2
  39. package/skills/review-design/SKILL.md +1 -1
  40. package/skills/review-implementation/SKILL.md +1 -1
  41. package/skills/review-implementation/references/CLASSIFY.md +25 -0
  42. package/skills/review-perf/SKILL.md +1 -1
  43. package/skills/review-security/SKILL.md +1 -1
  44. package/skills/review-seo/SKILL.md +1 -1
  45. package/skills/review-verify/SKILL.md +19 -2
  46. package/skills/triage-issue/SKILL.md +9 -1
  47. package/skills/triage-issue/references/LABELS.md +22 -0
  48. package/skills/unit-lane/SKILL.md +26 -7
  49. package/skills/unit-lane/references/DESIGN.md +55 -1
  50. package/skills/unit-lane/references/PLAN.md +29 -0
  51. package/skills/verification-contract/SKILL.md +9 -1
  52. package/skills/workflow-status/SKILL.md +1 -1
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: triage-issue
3
3
  user-invocable: true
4
- version: 2.12.0
4
+ version: 4.10.0
5
5
  argument-hint: <issue-number> [more issue numbers…] | <audit-id> F<k> [F<j>…] | --prioritize-now <unit> F<k> [F<j>…]
6
6
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
7
7
  license: MIT
@@ -60,6 +60,11 @@ first on purpose).
60
60
 
61
61
  ## Step 0 — Discover the project (always first)
62
62
 
63
+ **Backlog-sweep citation (S9 c, from #218).** Every newly opened issue must
64
+ cite its backlog-sweep `Checked:` line in the body — procedural, auditable
65
+ after the fact. When triaging a new issue on behalf of the user, the body
66
+ includes a `Checked: <what was searched>` line.
67
+
63
68
  Per the agent guide's **Workflow conventions** + **documentation map**, then read
64
69
  what THIS skill needs: the fix index (e.g. `docs/fix/README.md`) and fix SPEC
65
70
  template, and the roadmap. **Retrieval aid (optional, never authoritative):**
@@ -102,6 +107,9 @@ audit findings and fold ledger.
102
107
 
103
108
  ## Guardrails
104
109
 
110
+ - The all-stages no-assumption rule binds verification work — **ask-don't-infer**,
111
+ owner `skills/unit-lane/references/DESIGN.md` (`ask-dont-infer@1`): a trigger
112
+ the tree does not evidence is checked and asked about, never assumed.
105
113
  - Don't build deferred work just because asked to "look at" the issue — surface
106
114
  that the trigger is unmet and stop.
107
115
  - Keep issues, the fix index, and docs in sync with reality.
@@ -81,3 +81,25 @@ verdict — never a separate, silent step:
81
81
  A **fix-now** verdict is unchanged by this section — it gets no disposition
82
82
  label (it is tracked via the fix index + its route, and its high-severity
83
83
  case already gets the urgency label above).
84
+
85
+ ## Review-gate label vocabulary (human-owned)
86
+
87
+ Not a verdict this skill reaches: this label is a **human's hold**, applied when
88
+ an agent's plan, report or change set needs a look before more work builds on top
89
+ of it. Issues, unit docs and PRs are held equally.
90
+
91
+ | Label | Color | Meaning |
92
+ |---|---|---|
93
+ | `human-revision-needed` | `#FBCA04` | Hold — a human reviews before anything else is planned, implemented or merged. |
94
+
95
+ **Ownership is inverted here, and that inversion is the invariant.**
96
+ `triage-issue` neither applies nor clears it, because the label's whole value is
97
+ "a machine may not declare its own work reviewed". An agent **may** apply it (and
98
+ must then stop) with the same create-if-missing call as above:
99
+
100
+ 1. `gh label create human-revision-needed --color FBCA04 --description "<one-line meaning>"` — an "already exists" error is success.
101
+ 2. `gh issue edit <N> --add-label human-revision-needed` (or `gh pr edit <N> --add-label …`).
102
+
103
+ No skill and no agent ever removes it: `--remove-label human-revision-needed` is
104
+ a human's act only. A verdict comment never substitutes for the label — presence
105
+ is the signal, and the absence a human creates is what releases the hold.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: unit-lane
3
3
  user-invocable: true
4
- version: 2.5.1
4
+ version: 4.10.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
@@ -102,7 +102,8 @@ create it from the tree the unit belongs to:
102
102
  For `--fix`/`--from-issue`, read the tracked issue in the forge first and keep
103
103
  its number; the folder name carries it (`fix/<issue-number>-<topic>`). Fill
104
104
  objective, why, user outcome, and non-goals from the invocation (or the issue).
105
- Acceptance criteria are induced from user scenarios — **ask-don't-infer**; if the
105
+ Acceptance criteria are induced from user scenarios — **ask-don't-infer**
106
+ (owner: `references/DESIGN.md`, block `ask-dont-infer@1`); if the
106
107
  request is too vague, STOP and ask the user with concrete options. Open
107
108
  decisions that are not acceptance criteria run through the design step's
108
109
  **gap interview** — one batched form-turn with recommended options + why,
@@ -117,7 +118,25 @@ its stdout block **verbatim** into the unit doc's Evidence section header under
117
118
  a `## Triaged steps` heading. This block is authoritative. The model never
118
119
  re-derives, reorders, or invents steps — it executes only what the catalog says.
119
120
 
120
- ### 3. Execute triaged steps in order
121
+ ### 3. Forward closure + retirements (design/plan steps)
122
+
123
+ The two steps that own this are their reference files, not this conductor —
124
+ §4 below links both. The rule is duplicated here for nobody:
125
+
126
+ - the **design** step carries the three-direction closure (backward: the
127
+ constraints in force; sideways: callers and consumers of what changes;
128
+ forward: every promise coined, behind the **ask-don't-infer**
129
+ (owner: `references/DESIGN.md`, block `ask-dont-infer@1`) and
130
+ **document-or-don't-coin** gates) and the **retirements** the unit declares.
131
+ - the **plan** step turns every declared retirement into its own task carrying
132
+ the negative-capability pin, the sweep grep and the before/after reference
133
+ count.
134
+
135
+ This section states only that the two steps carry it. The text lives with the
136
+ step that executes it, so a model running `design` reads the rule instead of a
137
+ copy of it — and cannot read a stale copy.
138
+
139
+ ### 4. Execute triaged steps in order
121
140
 
122
141
  For each step the triage returned, follow its reference file. Judgment steps
123
142
  (research, design, plan, evidence, docs, review) run inline, **one step per
@@ -155,14 +174,14 @@ survives only as an explicit operator choice. When the last phase's turn
155
174
  closes, `execute-phase` resumes the lane and the remaining judgment steps
156
175
  (evidence, review, docs, release) run here.
157
176
 
158
- ### 4. Diff-size guard (after each implement step)
177
+ ### 5. Diff-size guard (after each implement step)
159
178
 
160
179
  Run `bun scripts/diff-guard.mjs --base <last-reviewed-ref> --unit <NN>`. Paste
161
180
  the output verbatim. On **BREACH**: stop, re-triage the unit, or record an
162
181
  exception. **Anti-gaming: NEVER shrink a diff by deleting comments, blank lines,
163
182
  docs or tests.** If the unit cannot fit the budget, record the exception and stop.
164
183
 
165
- ### 5. Update evidence and progress
184
+ ### 6. Update evidence and progress
166
185
 
167
186
  Before every commit:
168
187
 
@@ -171,7 +190,7 @@ Before every commit:
171
190
  - **Progress log**: `YYYY-MM-DD HH:MM — <what was done> → <commit sha> — next:
172
191
  <what is next>`
173
192
 
174
- ### 5b. Memory boundaries
193
+ ### 7. Memory boundaries
175
194
 
176
195
  Engram is the required memory substrate; a down layer never blocks a unit —
177
196
  follow [the memory protocol](references/MEMORY.md).
@@ -185,7 +204,7 @@ follow [the memory protocol](references/MEMORY.md).
185
204
  retry → `mem_get_observation` → the unit doc wins. A miss is keyword-bound,
186
205
  never proof nothing was saved; an unavailable mirror is marked pending.
187
206
 
188
- ### 6. Close the unit — the close-out ladder
207
+ ### 8. Close the unit — the close-out ladder
189
208
 
190
209
  When all triaged steps are done, in order:
191
210
 
@@ -48,7 +48,6 @@ repository has been asked.
48
48
  and cites the scenario or owner answer it came from.
49
49
  4. **Close boundaries**: entities and their roles, actors, accepted and rejected
50
50
  inputs (the expectation sweep), deferrals (→ `## Future`).
51
-
52
51
  Pass only if: ✓ the provenance search ran and its receipt is recorded ✓ every
53
52
  claim is a `sources.md` row ✓ every AC is induced from a user scenario.
54
53
 
@@ -77,6 +76,56 @@ Pass only if: ✓ every `INV-*` row carries a tier and a cost verdict ✓ every
77
76
  tier-0 row names the source that settled it ✓ no claim was researched or asked
78
77
  before the provenance tier ran.
79
78
 
79
+ ### Three-direction closure (S2, S6, S8)
80
+
81
+ The provenance tier answers *what exists*; closure answers *what this change
82
+ touches*, and each direction decides whether a question is left to ask.
83
+
84
+ **Backward — constraints in force.** A design system's tokens/components with
85
+ their `sources.md` evidence; with none, the precedent read from siblings.
86
+
87
+ **Sideways — siblings of the mechanism.** What it receives changes → its
88
+ callers. What it delivers changes → its consumers. Something is removed → what
89
+ still uses it, asked before breaking (the sweep `fold-findings` runs on a defect).
90
+
91
+ **Forward — promises coined.** Every name, field, endpoint or file is a
92
+ `sources.md` row and a node another party references, behind two gates:
93
+
94
+ - **ask-don't-infer** — an expectation in neither the tree nor the user's words
95
+ is a stage-3 question; a coined name with no owner answer is already a defect.
96
+ This is the design/plan case of the all-stages rule below —
97
+ `ask-dont-infer@1`, whose single normative owner is this file.
98
+ - **document-or-don't-coin** — a new contract lands with the consumer-facing doc
99
+ its consumer will look for (the promise registry renders into this step's
100
+ output and the PR).
101
+
102
+ **Retirements.** Every surface, token, pane, helper or contract this unit
103
+ **retires**, with its replacement or no-consumer evidence; an empty answer says
104
+ *why nothing can be removed*. Retirements are a design deliverable, not a
105
+ review-time discovery — the plan step turns each into a planned task.
106
+
107
+ ### Third-party before homemade (#340)
108
+
109
+ When the design reaches for code that solves a solved problem, a **widely
110
+ community-supported library is the preferred option** over writing our own
111
+ where a comparable option exists. Own code for a solved problem carries a
112
+ **recorded justification** in the design output — a `sources.md` row (or a
113
+ decision row) stating why no comparable community option fits. Owner-cited
114
+ precedent: the substrate-reuse approach of pi-extensible-workflows.
115
+
116
+ ### The all-stages no-assumption rule (`ask-dont-infer@1`, #340)
117
+
118
+ This block is the **single normative owner** of the no-assumption rule for
119
+ every stage — development, modification, deletion, planning, design, review,
120
+ audit. Stage skills reference this block; they **never restate** it — a
121
+ restatement is a defect (`scripts/residue-dimensions.test.mjs` counts them).
122
+
123
+ ```text
124
+ ask-dont-infer@1
125
+ stage | when the rule binds | what the stage does
126
+ any (development, modification, deletion, planning, design, review, audit) | an expectation is not evidenced by the tree, the docs, or a prior owner decision | understand the context of the question; research if useful — without leaking data, secrets or project details; propose options; the user decides. Research informs and proposes — it never answers on the user's behalf
127
+ ```
128
+
80
129
  ## Stage 3 — ask
81
130
 
82
131
  Batch the tier-2 claims from the orient stage. This stage reads the **orient
@@ -176,6 +225,9 @@ The unit doc's **Acceptance criteria** section, numbered and command-verified.
176
225
  - [ ] Entity closure: every entity mentioned has its role in the unit stated
177
226
  - [ ] Role closure: every actor/role that interacts with the unit is listed
178
227
  - [ ] Expectation sweep: user's accepted and rejected inputs are bounded
228
+ - [ ] The three-direction closure (§ Stage 2) ran: backward, sideways, forward — each with its evidence
229
+ - [ ] Retirements stated: each retired surface carries its replacement or no-consumer evidence, or the answer says why nothing can be removed
230
+ - [ ] Third-party before homemade (#340): a solved problem prefers a widely community-supported library; own code for a solved problem carries a recorded justification in the design output
179
231
  - [ ] Deferrals landed in `## Future`, not in scope
180
232
 
181
233
  ## Forbidden
@@ -192,5 +244,7 @@ The unit doc's **Acceptance criteria** section, numbered and command-verified.
192
244
  - Do not implement, spec, or task anything from `## Future`
193
245
  - Do not install a missing tool without explicit user consent
194
246
  - Do not build a separate DESIGN.md — one SPEC, all in the unit doc
247
+ - Do not coin a name, field or endpoint without an owner answer and a named place its consumer will read it
248
+ - Do not answer the retirement question with silence: “nothing can be removed” is a stated reason, not an omission
195
249
  - Do not pre-fill engineering content (phases, tests, architecture)
196
250
  - Do not stamp "designed" with an incomplete closure row
@@ -117,6 +117,31 @@ set, written from the planner's own discovery, and a file that is missing from
117
117
  it is never out of scope for the executor.
118
118
  <!-- tasks:end -->
119
119
 
120
+ <!-- retirements:start -->
121
+ Every retirement the design step declared (S8) becomes **its own task**: a
122
+ deliberate deletion gets the same rigor as a deliberate construction — task,
123
+ validator, evidence row — because an ad-hoc deletion skips evidence and a
124
+ planned one cannot. A replacement is a retirement: a task that supersedes an
125
+ existing part (a feature changed for another, a function/code path that does
126
+ the same or better) declares the superseded part retired, and its deletion
127
+ task follows the same three pieces (#340, replace-implies-delete). Three
128
+ pieces per retirement task:
129
+
130
+ - **the negative-capability pin** — the test proving the removed thing cannot
131
+ return (`grep -c '<removed name>' <scope>` → 0, or a suite that fails if the
132
+ surface reappears). This is the task's `(validator: …)`, never prose.
133
+ - **the sweep grep** — the pattern that found the remaining references, with its
134
+ scope, so a reviewer re-runs the same command.
135
+ - **the surviving-reference count** — before and after, so the deletion is
136
+ measured rather than asserted.
137
+
138
+ No declared retirements → write exactly
139
+ ``none — the design states why nothing can be removed``. The anti-gaming rule
140
+ (“never shrink a diff by deleting comments, blank lines, docs or tests”) gains
141
+ its complement: verified shrinkage is legitimate work, only unverified
142
+ shrinkage is suspect.
143
+ <!-- retirements:end -->
144
+
120
145
  <!-- sources:start -->
121
146
  `sources.md` — every `CLAIM-*` row with a source or an owner answer. A claim row
122
147
  whose source is empty, `—`, or `n/a` is a **defect**: find the source in the
@@ -167,6 +192,10 @@ name those files instead.
167
192
  - [ ] Every claim was swept against the candidate sources; each `contradicts` hit is resolved or asked
168
193
  - [ ] Every question asked was recorded in `decisions.md` with its resolution (or the questions pane says `none`)
169
194
  - [ ] Every AC maps to at least one task, and no task re-decides an AC
195
+ - [ ] Every retirement the design declared is its own task, carrying the negative-capability pin as its validator plus the sweep grep and the before/after reference count — or the plan states why nothing can be removed
196
+ - [ ] The plan obeys the all-stages no-assumption rule — **ask-don't-infer**, owner `skills/unit-lane/references/DESIGN.md` (`ask-dont-infer@1`); a claim no source settles is asked, never invented
197
+ - [ ] Reuse-first (#340): every task that adds functionality names the pre-existing parts it reuses (functions, scripts, skills, schemas, prose surfaces) — or records why reuse is not possible; a task that re-implements an existing part without saying why does not pass
198
+ - [ ] Replace-implies-delete (#340): every task that changes a feature for another, or adds a function/code path that supersedes an existing one, carries the superseded part's deletion as its own planned task with its evidence — and where no superseded part exists, nothing is deleted: the obligation exists when the case exists, never as a ritual
170
199
  - [ ] Tasks are ordered smallest first
171
200
  - [ ] Each task names its validator (a backticked command plus its expected outcome)
172
201
  - [ ] Final task is verification (proves the whole unit works); a unit that
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: verification-contract
3
3
  user-invocable: false
4
- version: 1.5.0
4
+ version: 4.10.0
5
5
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
6
6
  license: MIT
7
7
  description: >
@@ -43,6 +43,14 @@ canonical acceptance source. Criteria are numbered, each induced from a concrete
43
43
  user scenario, and command-verified where possible (label `read-verified` for
44
44
  prose-only checks). Unlabelled prose is invalid.
45
45
 
46
+ **Every criterion names its demonstrating command (S5).** A criterion that a
47
+ command can settle carries that command — ``<cmd> exits 0``, ``<cmd> matches
48
+ <N>`` — so a reviewer re-runs it instead of re-deriving the change, and `audit-pr`
49
+ can demand a demonstration for every AC. A criterion only a human can settle
50
+ keeps an explicit `manual:` label with the exact observation; a criterion with
51
+ neither fails closed at review (the `no command, no claim` admission rule
52
+ applied to the acceptance surface).
53
+
46
54
  **Validator stability.** A validator must never gate on a surface other workflow
47
55
  actors mutate — the branch diff as a whole, the session log, progress entries,
48
56
  review ledgers, or forge state — because any out-of-unit commit (a session-log
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: workflow-status
3
3
  user-invocable: true
4
- version: 3.9.4
4
+ version: 4.10.0
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]"