@gtrabanco/pi-agentic-workflow 0.21.0 → 0.24.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.21.0",
3
+ "version": "0.24.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: execute-phase
3
3
  user-invocable: true
4
- version: 5.1.0
4
+ version: 6.0.0
5
5
  argument-hint: <NN-slug> [P<k>|step] [--max-attempts N] [--force]
6
6
  allowed-tools: [Bash, Read, Edit, Write, MultiEdit]
7
7
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
@@ -34,6 +34,9 @@ Tick every box before ending the turn; an unchecked box means the turn is not
34
34
  done:
35
35
 
36
36
  ```
37
+ ✓ Required user inputs were answered concretely (not defaulted). Nothing here
38
+ is inferred: a gap runs `node scripts/needs-input.mjs <unit-dir>` and the
39
+ `open-questions@1` block is pasted, then the run stops.
37
40
  ✓ Triage verified — unit doc Evidence section header matches
38
41
  `bun scripts/unit-route.mjs --triage <slug>` output block (PREFLIGHT.md)
39
42
  ✓ Unit doc read and step selected (explicit P<k> or first unfinished)
@@ -54,6 +57,25 @@ done:
54
57
  - To execute all remaining steps: `<NN-slug>` with no step argument.
55
58
  - To repair a failed step: `<NN-slug> P<k>` (retry the same step).
56
59
 
60
+ ## Inputs — artifacts, never questions
61
+
62
+ This skill **never interviews**. It reads its inputs — the unit doc's `Tasks`,
63
+ `unit-route.mjs --triage`'s block, the route's tier — and a missing or ambiguous
64
+ one is a **gap**, resolved in one fixed order and never by inference:
65
+ **(0) provenance** (search the repo's own docs and record where) →
66
+ **(1) research** (2–3 concrete options with trade-offs; asking for more research
67
+ is a legitimate answer) → **(2) halt**: run `node scripts/needs-input.mjs
68
+ <unit-dir>`, paste the `open-questions@1` block verbatim, stop. Interactive the
69
+ block is the pause point, unattended it is a hard fail. Grammar and exit codes:
70
+ `orchestration-envelope`'s `references/TURN_CONTRACT.md` §Open questions.
71
+
72
+ Bare `<NN-slug>` runs **all remaining steps** — the phase is not an input. File
73
+ targets are the unit doc's nested `Relevant files:` metadata plus the
74
+ path-protection checkpoint. `--max-attempts N` defaults to 3; `--force` skips the
75
+ *stop* on the dependency and phase-lint gates (never the check — `PREFLIGHT.md`
76
+ records the override in the Progress log) and has **no bypass** on the
77
+ path-protection checkpoint.
78
+
57
79
  ## Step 0 — Discover the project
58
80
 
59
81
  Per the agent guide's **Workflow conventions** + **documentation map**, read the
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: fold-findings
3
3
  user-invocable: true
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  argument-hint: [finding-id …]
6
6
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
7
7
  license: MIT
@@ -144,8 +144,16 @@ table: [`FOLD_PROCESS.md`](references/FOLD_PROCESS.md) §Batch classification.
144
144
  Scope is the ledger (or explicit ID subset); unlisted discoveries are proposals
145
145
  for user triage. Batch only when one root-cause correction, validator set and
146
146
  rollback boundary own the rows: one commit/push, individual ticks/lines. Split
147
- otherwise. Do not widen beyond a finding's file/line/axis unless its root cause
148
- requires it; explain that in the commit. Artifact language follows user
147
+ otherwise.
148
+
149
+ **The fix covers the change and everything that depends on it.** When what a
150
+ piece receives changes, find its callers; when what it delivers changes, find
151
+ its consumers; when something is removed, check what still uses it and ask
152
+ before breaking it. A surviving mention of what changed — a comment, a prose
153
+ claim, a declared validator, a manifest narration, a sibling surface stating
154
+ the same thing — is part of this same fold, never a finding for the next
155
+ cycle. The fold ends when nothing still asserts what is no longer true; state
156
+ in the commit which surfaces the correction swept. Artifact language follows user
149
157
  instruction > project docs language > English; conversation language never decides.
150
158
 
151
159
  ## Portability (agents other than Claude Code)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: init-workspace
3
3
  user-invocable: true
4
- version: 3.3.0
4
+ version: 4.0.2
5
5
  argument-hint: <target-dir>
6
6
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
7
7
  license: MIT
@@ -21,6 +21,10 @@ raw placeholders.
21
21
  ## Turn contract — verify before ending the turn
22
22
 
23
23
  ```
24
+ ✓ Required user inputs were answered concretely (not defaulted). Consent for
25
+ every install, hook, and overwrite is explicit; a consent gap runs the
26
+ three-tier dispatch and stops with the dispatcher's `open-questions@1` block
27
+ — against a scratch unit folder when no unit exists yet (§Consent).
24
28
  ✓ The adapted scaffold and repository-state ledger are written (or the merge/abort decision was asked) and remaining placeholders are listed
25
29
  ✓ Nothing was installed or overwritten without an explicit yes
26
30
  ✓ Artifact language: explicit user instruction > the project's declared docs language > English. The CONVERSATION language never decides — a Spanish prompt still produces English PRs/issues/commits/SPECs unless one of the first two says otherwise
@@ -38,6 +42,21 @@ first on purpose).
38
42
  - Prefer this over a static `npx degit gtrabanco/agentic-workflow/template` when you
39
43
  want the gate commands, architecture, and doc domains filled in by interview.
40
44
 
45
+ ## Consent — mandatory, never defaulted
46
+
47
+ Installing a tool, wiring a hook, or overwriting an existing file each need an
48
+ explicit yes; context never supplies one, and an ambiguous repository state
49
+ (partially scaffolding) is not a route to guess. A consent gap is an open
50
+ question: **(0) provenance** (search the repo's own docs and record where) →
51
+ **(1) research** (concrete options) → **(2) halt**: run `node
52
+ scripts/needs-input.mjs <unit-dir>`, paste the `open-questions@1` block verbatim,
53
+ stop with the questions carried in it. The dispatcher needs a unit folder, and
54
+ consent gaps usually precede any unit — so the run first writes a scratch one
55
+ (`SPEC.md` + `decisions.md` in a `mktemp` directory, deleted after the paste)
56
+ and runs the dispatcher against that. Grammar and exit codes:
57
+ `orchestration-envelope`'s `references/TURN_CONTRACT.md` §Open questions.
58
+ `[target-dir]` is optional — absent means the current directory, recorded.
59
+
41
60
  ## Step 0 — Discover the project (always first)
42
61
 
43
62
  Inspect the target dir (`[target-dir]`, default cwd) before touching anything:
@@ -133,7 +152,7 @@ loads exactly upgrade and skips bootstrap plus portability.
133
152
 
134
153
  The adaptive lane (feature 61) replaces the fixed pipeline with a single-unit-
135
154
  document model. Every NEW unit produces one `SPEC.md` under
136
- `docs/features/<NN>-<slug>/` with 13 sections: Objective, Why, User outcome,
155
+ `docs/features/<NN>-<slug>/` with 14 sections: Objective, Why, User outcome, Impact,
137
156
  Acceptance criteria, Non-goals, Future cost, Applicable tests, Known pre-existing
138
157
  issues, Tasks, Evidence, Progress log, Next, References.
139
158
 
@@ -22,7 +22,7 @@
22
22
  that the scaffold failed. If retained, add its documentation-map row and
23
23
  name the project's explicit architectural-decision authority.
24
24
  7. **Propagate the unit doc template.** Ensure
25
- `docs/features/_TEMPLATE/SPEC.md` exists with all 13 mandatory sections.
25
+ `docs/features/_TEMPLATE/SPEC.md` exists with all 14 sections sections.
26
26
  This is the template used when creating new unit documents.
27
27
  8. **Provision the Serena project config.** Load
28
28
  [SERENA](SERENA.md), ask consent, then: (a) append the `.gitignore`
@@ -36,11 +36,11 @@ lacks**. Nine ordered steps:
36
36
  4. **Propose the adaptive lane conventions (feature 61 P11).** For pre-lane
37
37
  installs (before the fixed pipeline was retired), propose these missing
38
38
  blocks additively — **never clobber existing content**:
39
- - The **unit document conventions** section in AGENTS.md (the 13-section
39
+ - The **unit document conventions** section in AGENTS.md (the 14-section
40
40
  SPEC.md, triage-driven step selection, diff-size guard, evidence rows,
41
41
  dated progress log, closed commit format `type(scope): description`).
42
42
  - The **unit doc template** under `docs/features/_TEMPLATE/SPEC.md` if
43
- absent — the same 13-section template used by new units.
43
+ absent — the same 14-section template used by new units.
44
44
  - The **lane workflow doc** under `docs/workflow/` if absent: `FEATURE_WORKFLOW.md`
45
45
  (unit doc → triage → catalog steps → evidence → review → release),
46
46
  `ISSUE_WORKFLOW.md` (issues route through triage to the lane).
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: orchestration-envelope
3
3
  user-invocable: false
4
- version: 2.2.1
4
+ version: 2.3.0
5
5
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
6
6
  license: MIT
7
7
  description: >
@@ -85,6 +85,50 @@ next | suggested
85
85
  next | continuation
86
86
  ```
87
87
 
88
+ ## Open questions (the needs-input halt)
89
+
90
+ An input a step cannot resolve is never inferred: the step stops and hands the
91
+ questions back. The block below is that hand-off — printed by
92
+ `scripts/needs-input.mjs`, never hand-authored — so a weaker model copies it
93
+ instead of paraphrasing the questions away. Interactive, the block is the pause
94
+ point and the run waits for a user decision; unattended, it is a hard fail
95
+ carrying the same block.
96
+
97
+ ```text
98
+ open-questions@1
99
+ # produced-by: scripts/needs-input.mjs <unit-dir> [--json]
100
+ # input: <unit-dir>/SPEC.md + <unit-dir>/decisions.md (the ledger's own grammar is
101
+ # published by the template agent guide, template/AGENTS.md)
102
+ # machine: continuation-refusal-type (schema-export:CONTINUATION_REFUSALS)
103
+ # exit: 0 well-formed artifact (pending questions or none) | 1 fail-closed | 2 usage error
104
+ header: open-questions@1
105
+ fields: Unit: <unit-folder-name>
106
+ Open questions: <count>
107
+ - <question-id> · <route> · <the question>
108
+ Blocks: <why nothing proceeds without it>
109
+ Searched: <where the repository was searched: path:line, greps, prior units>
110
+ Options:
111
+ - <one researched option with its trade-off>
112
+ Pending: none (only when the count is 0)
113
+ Route back: <design | unit-lane> · … | none
114
+ Continuation: no-decision-available | none
115
+ Decision: open | none
116
+ fail-block: NEEDS-INPUT FAIL — needs-input@1
117
+ Unit: <unit-folder-name>
118
+ Reason: <missing-unit-doc | malformed-ledger-header | malformed-entry |
119
+ missing-search-receipt | missing-options | unknown-route |
120
+ unknown-question | invalid-authority | duplicate-id>
121
+ Where: <path[:line]>
122
+ Continuation: no-decision-available
123
+ route: design | unit-lane
124
+ ```
125
+
126
+ `route` is the stage that owns the fact and therefore receives it back —
127
+ `design` for scope/architecture questions, `unit-lane` for plan-owned facts.
128
+ Execution never interviews: it halts with the questions. `Continuation` reuses
129
+ the schema's existing `no-decision-available` (`decisionAvailable === false`),
130
+ so the halt needs no new envelope field.
131
+
88
132
  ## Path-protection checkpoint (feature 60)
89
133
 
90
134
  The Tier 1 path gate is versioned so the checkpoint invocation, the closed
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: unit-lane
3
3
  user-invocable: true
4
- version: 1.5.0
4
+ version: 2.0.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
@@ -21,6 +21,10 @@ Tick every box before ending the turn; an unchecked box means the turn is not
21
21
  done:
22
22
 
23
23
  ```
24
+ ✓ Required user inputs were answered concretely (not defaulted). Nothing here
25
+ is inferred: a gap re-enters provenance → research, and a gap surviving both
26
+ runs `node scripts/needs-input.mjs <unit-dir>` and stops with the
27
+ `open-questions@1` block routed back to the owning stage.
24
28
  ✓ Triage ran (bun scripts/unit-route.mjs --triage <slug>) and its block pasted
25
29
  verbatim into the unit doc's Evidence section as the authoritative step list
26
30
  ✓ Unit doc exists at docs/features/<NN>-<slug>/SPEC.md (created from template
@@ -44,6 +48,26 @@ Both `--fix <n>` and `--from-issue <n>` are the exact forms
44
48
  `scripts/unit-route.mjs` prints for a tracked issue with no unit folder
45
49
  (`route: plan-from-issue`) — never invent a different spelling.
46
50
 
51
+ ## Inputs — never inferred, never defaulted
52
+
53
+ The unit identifier, a mode's issue number, the unit kind, and the
54
+ objective/why/user-outcome the SPEC carries are **never inferred**: no silent
55
+ `feature` default, no acceptance criterion invented from a vague request. A gap
56
+ is resolved in one fixed order — **(0) provenance** (search the repo's own docs
57
+ and append an `open-question` row to the unit's `decisions.md` recording where)
58
+ → **(1) research** (2–3 concrete options with trade-offs; asking for more
59
+ research is a legitimate answer) → **(2) halt**: run `node
60
+ scripts/needs-input.mjs <unit-dir>`, paste the `open-questions@1` block verbatim,
61
+ stop. The block routes each question back to the stage that owns the fact —
62
+ `design` for scope/architecture, `unit-lane` for plan-owned facts. Grammar and
63
+ exit codes: `orchestration-envelope`'s `references/TURN_CONTRACT.md` §Open
64
+ questions.
65
+
66
+ The conversation lives in the unit folder's `decisions.md` (append-only
67
+ `open-questions@1`; its two entry types are published in the template agent
68
+ guide's question protocol). A resumed session re-reads the pending rows and
69
+ continues from the first one still open — never re-asks them.
70
+
47
71
  ## Step 0 — Discover the project
48
72
 
49
73
  Per the agent guide's **Workflow conventions** + **documentation map**, then read
@@ -1,5 +1,16 @@
1
1
  # Design step
2
2
 
3
+ ## Needs-input guard
4
+
5
+ A blank or vague scope or acceptance-criteria input is a gap, not a licence to
6
+ infer. The order is fixed: search the repository's own docs first and append an
7
+ `open-question` row to the unit folder's `decisions.md` recording where; research
8
+ an external gap into 2–3 concrete options. A gap surviving both runs
9
+ `node scripts/needs-input.mjs <unit-dir>`, pastes the `open-questions@1` block
10
+ and stops — route `design` for scope/architecture questions. "Decide for me" is
11
+ a legitimate answer: the lane chooses and records the choice with its reason.
12
+ Cheap-to-change defaults are recorded as assumptions, never silent.
13
+
3
14
  ## Purpose
4
15
 
5
16
  Run the gap interview, induce acceptance criteria from user scenarios, and
@@ -1,5 +1,16 @@
1
1
  # Research step
2
2
 
3
+ ## Needs-input guard
4
+
5
+ **Unit objective and scope** are the input to this step, and the lane authors
6
+ them, not the user. A blank or missing objective/scope is therefore a **document
7
+ defect**: stop and repair the SPEC (`/unit-lane <unit>` — its §1 writes the
8
+ objective/why/user-outcome) or re-triage. Never infer unit scope, and never
9
+ turn a doc defect into a question the user cannot answer. A gap that survives
10
+ the repair runs `node scripts/needs-input.mjs <unit-dir>`, pastes the
11
+ `open-questions@1` block and stops, routed to `design` or `unit-lane` by the
12
+ owning stage.
13
+
3
14
  ## Purpose
4
15
 
5
16
  Establish what is known and what is uncertain about the unit's domain before