@gtrabanco/pi-agentic-workflow 0.18.4 → 0.18.5

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.18.4",
3
+ "version": "0.18.5",
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,20 +1,22 @@
1
1
  ---
2
2
  name: phase-contract
3
3
  user-invocable: false
4
- version: 1.0.6
4
+ version: 1.1.0
5
5
  author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
6
6
  license: MIT
7
7
  description: >
8
- Internal contract: the single owner of the eight phase-lint rules, the fixed
9
- PASS/BLOCKED result, and the normalized phase fingerprint. Consumed by
10
- `execute-phase` and the lane's `plan` step. Not a menu entry.
8
+ Internal contract: the single owner of the eight phase-lint rules, the two
9
+ accepted phase grammars, the fixed PASS/BLOCKED result, and the normalized
10
+ phase fingerprint. Consumed by `execute-phase` and the lane's `plan` step.
11
+ Not a menu entry.
11
12
  ---
12
13
 
13
14
  # Phase Contract (internal)
14
15
 
15
16
  The one authoritative owner of phase shape for this workflow. Planners lint
16
17
  every phase they emit against the eight rules below; `execute-phase` re-checks
17
- the same rules before any edit. Nothing else may define what a valid phase is.
18
+ the same rules before any edit. Nothing else may define what a valid phase is —
19
+ including which grammar a phase is written in.
18
20
 
19
21
  ## When to use
20
22
 
@@ -62,18 +64,75 @@ The exemption is scoped to those two boxes: boxes 1, 2, 4, 5, 6 and 8 stay armed
62
64
  executed phase, and for an unemitted phase every box stays armed, so pre-ticking
63
65
  a phase to dodge a check is a defect, never a pass.
64
66
 
67
+ ## The two grammars (fix #272)
68
+
69
+ One contract, two shapes. `scripts/phase-lint.mjs` mechanizes exactly this
70
+ split and never carries a second copy of the semantics:
71
+
72
+ | grammar | where | shape |
73
+ |---|---|---|
74
+ | **plan** | a plan file, or any `##/###/#### P<n> — <Title>` heading | heading + `Layer: <enum>` + `- [ ]` tasks + `Done-when:` |
75
+ | **unit doc** | the unit doc's `## Tasks` section | one `P<n> — <task> (validator: <command> <outcome>)` bullet per phase, wrapped lines joining the bullet, plus an optional nested `- Relevant files: <path, path…>` line |
76
+
77
+ Precedence is fail-closed and one-way: **if a document carries any plan-style
78
+ phase heading, the plan grammar governs it**; only when it carries none does
79
+ the unit-doc grammar apply; a document with no phase in either answers
80
+ `BLOCKED: no-phases`. A `P<n>` bullet outside `## Tasks` (a progress-log line,
81
+ for instance) is prose, never a phase.
82
+
83
+ ### Mapping the eight boxes to a bullet phase
84
+
85
+ A bullet has no separate title line and declares no layer, so two boxes have no
86
+ input and are **skipped** (not "passed"); the rest run unchanged over the
87
+ bullet's joined text:
88
+
89
+ | box | unit-doc status |
90
+ |---|---|
91
+ | 1 title names one deliverable | **n/a** — there is no title line; the bullet is the task, and box 4 carries atomicity |
92
+ | 2 one declared layer | **n/a** — a unit doc declares no layer (layers belong to plans) |
93
+ | 3 ≥ 1 task, ≤ 8 tasks | applies — a bullet is exactly one task; a repeated `P<n>` number FAILs as `duplicate unit-doc phase P<n>` |
94
+ | 4 one deliverable | applies — same arrow-chain, >3-case and created-file checks |
95
+ | 5 zero decision words | applies, unchanged |
96
+ | 6 no conditional scope mutation | applies, unchanged |
97
+ | 7 no external/manual gates | applies with the **final-bullet exemption**: the last bullet is the unit doc's verification/close-out line, so `manual` / `ask the user` / `gh pr` are allowed there only |
98
+ | 8 machine-checkable done-when | applies — the bullet's `(validator: …)` span **is** the done-when: it must carry a backticked command *and* an expected outcome; a bullet without the span FAILs as `bullet carries no \`(validator: …)\`` |
99
+
100
+ ### The `Relevant files:` sub-section is metadata
101
+
102
+ A nested `- Relevant files: <path, path…>` line under a bullet declares that
103
+ phase's read set (the lane's plan step writes it from its own discovery). It is
104
+ **never** a task: it does not count toward box 3, never feeds a box-2 target and
105
+ is scanned by no rule. Every entry must be a path or a glob; an empty list, an
106
+ empty entry or a token that is neither fails the phase closed under its own
107
+ `relevant-files:` finding id — a malformed read set is reported, never dropped.
108
+ **Never-authority (same rule as every selector):** a file that is *not* listed
109
+ is never out of scope — an executor may always add one, logging it in the unit
110
+ doc's Progress log.
111
+
65
112
  ## Result — fixed PASS/BLOCKED output
66
113
 
67
114
  ```text
68
115
  Phase-lint: PASS (8/8)
69
116
  ```
70
117
 
118
+ A unit-doc bullet phase reports the boxes it actually runs:
119
+
120
+ ```text
121
+ P<n> Phase-lint: PASS (6/6) · fingerprint P<n>:unit-doc:<n-tasks>:<title-deliverable>
122
+ ```
123
+
71
124
  or, on the first failing box:
72
125
 
73
126
  ```text
74
127
  Phase-lint: BLOCKED — box <n>: <one-line reason>
75
128
  ```
76
129
 
130
+ A malformed `Relevant files:` sub-section reports under its own id:
131
+
132
+ ```text
133
+ P<n> relevant-files: <one-line reason>
134
+ ```
135
+
77
136
  A BLOCKED phase is re-cut or split; it is never emitted, committed, or executed
78
137
  as-is (no `--force` bypass exists for a non-atomic phase — that decision belongs
79
138
  to the user).
@@ -85,6 +144,10 @@ Each phase's fingerprint is a deterministic string over the phase's shape:
85
144
  exact phase version a plan committed to — templates and plans record
86
145
  `Phase-lint: PASS (8/8) · fingerprint <fingerprint>` so later re-lints and
87
146
  `execute-phase` can confirm nothing in the phase shape drifted since planning.
147
+ A unit-doc bullet phase has no layer, so its slot is the literal `unit-doc`
148
+ (`P<n>:unit-doc:<n-tasks>:<title-deliverable>`, title = the bullet text up to
149
+ its first `:`, with the `(validator: …)` span removed); both grammars hash the
150
+ same way, so a re-lint of either is comparable with its own earlier run.
88
151
 
89
152
  ## Guardrails
90
153
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: unit-lane
3
3
  user-invocable: true
4
- version: 1.1.0
4
+ version: 1.1.1
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
@@ -15,17 +15,27 @@ first. No future-phase work.
15
15
  Fill the unit doc's **Tasks** section:
16
16
 
17
17
  ```
18
- P1 — <task description> (validator: <what proves it works>)
19
- P2 — <task description> (validator: <what proves it works>)
18
+ P1 — <task description> (validator: <backticked command> <expected outcome>)
19
+ - Relevant files: <path, path…>
20
+ P2 — <task description> (validator: <backticked command> <expected outcome>)
20
21
  …
21
22
  Pn — last task is verification when the unit has behavior
22
23
  ```
23
24
 
25
+ Both phase grammars are accepted (owner: `phase-contract`): these bullets, or
26
+ full plan-style `## P<n> —` blocks when the unit doc already carries them —
27
+ `phase-lint` parses either and answers `no-phases` only when it finds neither.
28
+ A bullet's `(validator: …)` span is its machine-checkable done-when (a
29
+ backticked command **and** an expected outcome, e.g. `exits 0`), and the nested
30
+ `Relevant files:` line is **metadata, never a task** — it is that phase's read
31
+ set, written from the planner's own discovery, and a file that is missing from
32
+ it is never out of scope for the executor.
33
+
24
34
  ## Checklist (pass only if)
25
35
 
26
36
  - [ ] Every AC maps to at least one task
27
37
  - [ ] Tasks are ordered smallest first
28
- - [ ] Each task names its validator (command, output, or observation)
38
+ - [ ] Each task names its validator (a backticked command plus its expected outcome)
29
39
  - [ ] Final task is verification (proves the whole unit works)
30
40
  - [ ] No task reaches into a future-phase concern (docs, release, migrations)
31
41
  - [ ] Phases labeled P1, P2, … (never S1, Step 1)