@gtrabanco/pi-agentic-workflow 0.15.2 → 0.16.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 (63) hide show
  1. package/README.md +49 -0
  2. package/dist/conductor/loop.js +23 -1
  3. package/dist/conductor/types.d.ts +6 -0
  4. package/dist/config/defaults.js +11 -0
  5. package/dist/config/merge.js +93 -1
  6. package/dist/config/profiles.d.ts +36 -0
  7. package/dist/config/profiles.js +102 -0
  8. package/dist/config/recommended.d.ts +14 -0
  9. package/dist/config/recommended.js +28 -0
  10. package/dist/config/schema.js +159 -3
  11. package/dist/config/types.d.ts +52 -0
  12. package/dist/config/types.js +10 -0
  13. package/dist/extension/conductor-command.d.ts +2 -5
  14. package/dist/extension/conductor-command.js +18 -6
  15. package/dist/extension/factory.d.ts +2 -0
  16. package/dist/extension/factory.js +10 -3
  17. package/dist/routing/dispatch.d.ts +9 -2
  18. package/dist/routing/dispatch.js +115 -46
  19. package/dist/routing/state.d.ts +26 -0
  20. package/dist/routing/state.js +67 -1
  21. package/dist/routing/types.d.ts +7 -0
  22. package/dist/settings/console.d.ts +7 -0
  23. package/dist/settings/console.js +214 -35
  24. package/dist/settings/view.d.ts +3 -1
  25. package/dist/settings/view.js +8 -1
  26. package/package.json +1 -1
  27. package/skills/audit-docs/SKILL.md +3 -3
  28. package/skills/audit-pr/SKILL.md +8 -8
  29. package/skills/audit-pr/references/01_MERGE_GATES.md +3 -3
  30. package/skills/audit-pr/references/02_CLOSURE_AND_SCOPE_GATES.md +4 -5
  31. package/skills/audit-pr/references/03_AUDIT_PROCESS.md +1 -1
  32. package/skills/audit-pr/references/04_VERDICT.md +3 -3
  33. package/skills/audit-pr/references/05_ROUTING_AND_GUARDRAILS.md +2 -2
  34. package/skills/discover-repository-state/SKILL.md +3 -4
  35. package/skills/execute-phase/SKILL.md +1 -1
  36. package/skills/execute-phase/references/DESCOPE.md +1 -1
  37. package/skills/fold-findings/SKILL.md +8 -8
  38. package/skills/fold-findings/references/FOLD_PROCESS.md +6 -5
  39. package/skills/orchestration-envelope/SKILL.md +4 -3
  40. package/skills/phase-contract/SKILL.md +3 -4
  41. package/skills/pre-execution-review/SKILL.md +10 -7
  42. package/skills/pre-execution-review/references/POLICY.md +17 -8
  43. package/skills/product-audit/SKILL.md +12 -13
  44. package/skills/product-audit/references/AUDIT_PROCESS.md +1 -1
  45. package/skills/resolve-repository-state/SKILL.md +2 -3
  46. package/skills/review-change/SKILL.md +3 -3
  47. package/skills/review-change/references/ADVERSARIAL_RECOMMENDATION.md +1 -1
  48. package/skills/review-change/references/ADVERSARIAL_SETUP.md +1 -1
  49. package/skills/review-change/references/OUTPUT_AND_GUARDRAILS.md +5 -5
  50. package/skills/review-change/references/PERSIST_AND_DECIDE.md +7 -6
  51. package/skills/review-implementation/SKILL.md +1 -1
  52. package/skills/review-implementation/references/CLASSIFY.md +13 -11
  53. package/skills/triage-issue/SKILL.md +11 -10
  54. package/skills/triage-issue/references/ISSUE_PROCESS.md +11 -10
  55. package/skills/triage-issue/references/LABELS.md +3 -3
  56. package/skills/triage-issue/references/REVIEW_FINDING_PROCESS.md +6 -6
  57. package/skills/unit-lane/SKILL.md +24 -9
  58. package/skills/workflow-status/SKILL.md +12 -13
  59. package/skills/workflow-status/references/CRASH_RECOVERY.md +6 -6
  60. package/skills/workflow-status/references/ENVELOPE_CORE.md +1 -4
  61. package/skills/workflow-status/references/ENVELOPE_FIELDS.md +7 -7
  62. package/skills/workflow-status/references/PRE_EXECUTION.md +5 -0
  63. package/skills/workflow-status/references/SENSOR_SIGNALS.md +1 -1
@@ -15,11 +15,11 @@ after `/fold-findings` leaves rows unresolved.
15
15
  remains on the current unit. Route it to `/fold-findings` or an explicit
16
16
  `/execute-phase <unit> P<n>`.
17
17
  - A correction too large for the current fold is `replan-in-unit`. Run
18
- `node scripts/unit-route.mjs <unit>`; its `route: replan` line names the
19
- planner (`/plan-feature <unit>` for a feature, `/plan-fix <issue-number>`
20
- for a fix) and the fresh `/review-plan <unit>` that must pass before
21
- execution. The plan must append concrete `P<n>` phases to the unit's
22
- SPEC and preserve the finding's acceptance evidence.
18
+ `node scripts/unit-route.mjs <unit>`; its `route: replan` line prints the
19
+ planner command — `/unit-lane <unit>` for a feature, `/unit-lane --fix <n>`
20
+ for a fix — which re-runs the lane's `plan` step and appends concrete
21
+ `P<n>` phases to the unit's SPEC, preserving the finding's acceptance
22
+ evidence. The lane's `review` step gates execution.
23
23
  - A product, architecture, or acceptance decision that blocks safe work is
24
24
  `decision-required`. Ask the user; do not guess or weaken the finish line.
25
25
  - A finding disproved by current evidence is `disputed`. Preserve the row
@@ -35,7 +35,7 @@ Return exactly one block per finding:
35
35
  REVIEW FINDING <F-k> — <short title>
36
36
  Checked: <commands and evidence>
37
37
  VERDICT: fix-now | replan-in-unit | decision-required | disputed
38
- Action taken: <current-unit fold/phase | plan-feature | plan-fix | user decision>
38
+ Action taken: <current-unit fold/phase | unit-lane | user decision>
39
39
  ```
40
40
 
41
41
  Close with every finding ID mapped to its own command, joined with ` + `, and
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: unit-lane
3
3
  user-invocable: true
4
- version: 1.0.0
5
- argument-hint: <NN-slug | "<idea>"> [--retriage]
4
+ version: 1.1.0
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
8
8
  close in a single document. Triggers: "unit-lane", "run the lane",
@@ -36,8 +36,14 @@ done:
36
36
 
37
37
  - A known unit slug: `unit-lane <NN-slug>`
38
38
  - A raw idea (no slug yet): `unit-lane "<idea description>"`
39
+ - A tracked fix issue (no fix folder yet): `unit-lane --fix <issue-number>`
40
+ - A tracked roadmap feature issue (no feature folder yet): `unit-lane --from-issue <issue-number>`
39
41
  - Force re-triage: `unit-lane <NN-slug> --retriage`
40
42
 
43
+ Both `--fix <n>` and `--from-issue <n>` are the exact forms
44
+ `scripts/unit-route.mjs` prints for a tracked issue with no unit folder
45
+ (`route: plan-from-issue`) — never invent a different spelling.
46
+
41
47
  ## Step 0 — Discover the project
42
48
 
43
49
  Per the agent guide's **Workflow conventions** + **documentation map**, then read
@@ -48,11 +54,20 @@ exists, read its current `SPEC.md` to avoid overwriting.
48
54
 
49
55
  ### 1. Resolve or create the unit doc
50
56
 
51
- If the idea has no slug, assign the next number from `docs/features/ROADMAP.md`
52
- and create `docs/features/<NN>-<slug>/SPEC.md` from the template. Fill
53
- objective, why, user outcome, and non-goals from the invocation. Acceptance
54
- criteria are induced from user scenarios — **ask-don't-infer**; if the request
55
- is too vague, STOP and ask the user with concrete options. See
57
+ If the unit folder already exists, read its `SPEC.md` and continue. Otherwise
58
+ create it from the tree the unit belongs to:
59
+
60
+ | Invocation | Folder | Template | Index to register |
61
+ |---|---|---|---|
62
+ | `<NN-slug>` / `"<idea>"` | `docs/features/<NN>-<slug>/` | `docs/features/_TEMPLATE/SPEC.md` | `docs/features/ROADMAP.md` |
63
+ | `--fix <issue-number>` | `docs/fix/<issue-number>-<topic>/` | `docs/fix/_TEMPLATE/SPEC.md` | `docs/fix/README.md` |
64
+ | `--from-issue <issue-number>` | `docs/features/<NN>-<slug>/` | `docs/features/_TEMPLATE/SPEC.md` | `docs/features/ROADMAP.md` (row links `#<issue-number>`) |
65
+
66
+ For `--fix`/`--from-issue`, read the tracked issue in the forge first and keep
67
+ its number; the folder name carries it (`fix/<issue-number>-<topic>`). Fill
68
+ objective, why, user outcome, and non-goals from the invocation (or the issue).
69
+ Acceptance criteria are induced from user scenarios — **ask-don't-infer**; if the
70
+ request is too vague, STOP and ask the user with concrete options. See
56
71
  [the unit doc template](references/STEPS.md) for section order.
57
72
 
58
73
  ### 2. Triage — read the catalog, never re-derive
@@ -119,8 +134,8 @@ unit doc's status, and print the closing block.
119
134
 
120
135
  ## Relationship to other skills
121
136
 
122
- `unit-lane` absorbs the fixed-pipeline skills (design-feature, plan-feature,
123
- review-spec, review-plan) into catalog steps. The review pack axes
137
+ `unit-lane` absorbed the retired fixed-pipeline skills (design-feature,
138
+ plan-feature, review-spec, review-plan) into catalog steps. The review pack axes
124
139
  (`review-implementation`, `review-code`, `review-security`, `review-perf`,
125
140
  `review-a11y`, `review-debt`) compose the review step; `triage-issue` feeds
126
141
  issues into the lane; `workflow-status` computes the next lane invocation.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: workflow-status
3
3
  user-invocable: true
4
- version: 3.9.0
4
+ version: 3.9.1
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]"
@@ -30,15 +30,14 @@ report — it never assembles the envelope by hand.
30
30
  stdout, never assembled by the model
31
31
  ✓ Nothing was edited, committed, pushed, or created — read-only, always
32
32
  ✓ `next.recommended` is non-bare (carries the unit's slug/NN, never a bare
33
- `/plan-feature`) AND the script computed it from the unit's resolved status
34
- **and** its current pre-execution evidence: `idea`/undesigned →
35
- `/design-feature <slug>`; `defined` → `/plan-feature <slug>` only on a current
36
- `SPEC-REVIEW-PASS`, else `/review-spec <slug>`; `planned`/`in-progress` → `/execute-phase <NN>` only on a
37
- current `PLAN-REVIEW-PASS`, else `/review-plan <NN>` (step 6a)
33
+ `/unit-lane`) AND the script computed it from the unit's resolved status:
34
+ `idea`/`defined` → `/unit-lane <slug>` (or `/unit-lane --fix <n>` for a fix);
35
+ `planned`/`in-progress` → `/execute-phase <NN>` (its triage block is the
36
+ authority; no separate plan-receipt currency check, step 6a)
38
37
  ✓ `detail.crash_recovery` carries a verdict from the decision table and the
39
38
  envelope `state` matches it (CLEAN→OK, RESUMABLE→CONTINUE,
40
39
  AMBIGUOUS→NEEDS_INPUT)
41
- ✓ Every `detail.design_candidates[].next` begins with `/design-feature `
40
+ ✓ Every `detail.design_candidates[].next` begins with `/unit-lane `
42
41
  ✓ Every degraded dimension is named in `detail.degradations` as
43
42
  `unavailable-<source>-<cause>` — and, when `--last-envelope` was supplied, the
44
43
  no-progress guard's `workflow_observations` note is present (never a silently
@@ -99,11 +98,11 @@ the JSON contract.
99
98
 
100
99
  ## Relationship to other skills
101
100
 
102
- - The **sensor** counterpart to `ship-roadmap`'s conductor: an external
103
- orchestrator calls `workflow-status` → routes on the envelope → invokes
104
- `plan-feature` / `execute-phase` / `review-change` / `audit-pr` /
105
- `triage-issue` directly, choosing the model per step — the same loop without
106
- the in-agent autopilot.
101
+ - The **sensor** counterpart to `advance`'s conductor: an external
102
+ orchestrator (or `advance` itself) calls `workflow-status` → routes on the
103
+ envelope → invokes `unit-lane` / `execute-phase` / `review-change` /
104
+ `audit-pr` / `triage-issue` directly, choosing the model per step — the same
105
+ loop without the in-agent autopilot.
107
106
  - Read-only sibling of `audit-docs` (which judges coherence and can fix) and
108
107
  `product-audit` (which judges health): this one only reports state.
109
108
  - Schema owner: `orchestration-envelope` (internal).
@@ -118,7 +117,7 @@ the JSON contract.
118
117
  `detail.crash_recovery` were read from the envelope, and the envelope `state`
119
118
  matches the crash-recovery verdict.
120
119
  - With `--last-envelope` supplied: the no-progress guard ran — a stalled
121
- `/plan-feature`/`/design-feature` hint surfaces as a `workflow_observations`
120
+ `/unit-lane` hint surfaces as a `workflow_observations`
122
121
  note, never a silent bland repeat, with no new write path introduced.
123
122
  - The human summary (unless `--json-only`) and the envelope are printed, envelope
124
123
  last.
@@ -23,12 +23,12 @@ section *classifies*; the resume command it recommends does the acting.
23
23
  caller's persisted envelope against the recomputed state and report the
24
24
  divergence in one line. The hint never overrides recomputed state.
25
25
  - ✓ **No-progress guard (optional, requires `--last-envelope`).** When the
26
- hint's `next.recommended` was `/plan-feature <slug>` or `/design-feature
27
- <slug>` for a given unit, and this run's own recomputed status for that
28
- **same unit** is still at the **same pre-advance status** the hint expected
29
- to move it off of (`defined` for a `/plan-feature` hint; `idea` for a
30
- `/design-feature` hint) — either the recommended command ran but its status
31
- write was dropped, or it never ran at all; this guard cannot distinguish the
26
+ hint's `next.recommended` was `/unit-lane <slug>` for a given unit, and this
27
+ run's own recomputed status for that **same unit** is still at the **same
28
+ pre-advance status** the hint expected to move it off of (`idea`/`defined` —
29
+ the lane's triage write lands when the unit doc is created) — either the
30
+ recommended command ran but its status write was dropped, or it never ran at
31
+ all; this guard cannot distinguish the
32
32
  two from the envelope alone, so the note names it as a **suspected** stall,
33
33
  not a confirmed dropped write. Emit a `workflow_observations` note (see
34
34
  `## Machine envelope` for the exact note shape). This is strictly additive:
@@ -108,15 +108,12 @@ the key's presence.
108
108
  |---|---|
109
109
  | `/discover-repository-state` | `strong` |
110
110
  | `/resolve-repository-state` | `strong` |
111
- | `/plan-feature` | `strong` |
112
- | `/design-feature` | `strong` |
111
+ | `/unit-lane` | `strong` |
113
112
  | `/review-change` | `strong` |
114
113
  | `/audit-pr` | `strong` |
115
114
  | `/triage-issue` | `strong` |
116
115
  | `/product-audit` | `strong` |
117
116
  | `/execute-phase` | `cheap` |
118
- | `/review-spec` | `strong` |
119
- | `/review-plan` | `strong` |
120
117
 
121
118
  `next.tier` is read off this map by matching the resolved `next.recommended`
122
119
  command's name (ignoring its arguments) — never guessed and never copied from
@@ -2,12 +2,12 @@
2
2
 
3
3
  **No-progress guard note (`workflow_observations`, requires `--last-envelope`,
4
4
  see the crash-recovery checklist above)** — when the hint's `next.recommended`
5
- targeted `/plan-feature <slug>` or `/design-feature <slug>` and this run still
5
+ targeted `/unit-lane <slug>` and this run still
6
6
  classifies that same unit at the same pre-advance status, append a note of the
7
7
  exact shape:
8
- `"<slug> still 'defined' after the hint's /plan-feature <slug> recommendation — suspected dropped defined→planned write (see #51)"`
9
- (swap `defined`/`/plan-feature` for `idea`/`/design-feature` on the design
10
- side). The recommendation itself is unaffected — this only adds visibility.
8
+ `"<slug> still 'defined' after the hint's /unit-lane <slug> recommendation — triage not yet applied"`
9
+ (the note fires for a `defined` unit; the lane's triage write is what moves it
10
+ off `idea`/`defined`). The recommendation itself is unaffected — this only adds visibility.
11
11
 
12
12
  **Shape vs. current output — read this before trusting the example below.** The
13
13
  example is the envelope's **intended shape**, not everything the deterministic
@@ -33,10 +33,10 @@ absent-legacy` or `issues_born.n: 0`; the owning note is
33
33
  "dependencies": {"unmet": [], "build_order": []},
34
34
  "recommendations": {"product_audit": false, "reason": null},
35
35
  "needs_input": null,
36
- "next": {"recommended": "/review-change", "alternatives": ["/plan-feature 05"], "tier": "strong",
36
+ "next": {"recommended": "/review-change", "alternatives": ["/unit-lane 05"], "tier": "strong",
37
37
  "suggested": [{"command": "/review-change", "trigger": "accumulation: 420 changed lines since last-reviewed sha", "source_skill": "execute-phase"}]},
38
38
  "detail": {
39
- "design_candidates": [{"id": "08-billing-webhooks", "status": "idea", "next": "/design-feature 08-billing-webhooks"}],
39
+ "design_candidates": [{"id": "08-billing-webhooks", "status": "idea", "next": "/unit-lane 08-billing-webhooks"}],
40
40
  "pre_execution": [{"unit": "12-export-api", "unitDir": "docs/features/12-export-api", "stage": "lane", "label": "current", "verdict": "READY", "boundDigest": null, "observedDigest": null, "recommended": "/unit-lane 12-export-api", "reason": "unit-doc currency is checked per step by unit-lane/execute-phase"}],
41
41
  "features": [
42
42
  {"id": "07-csv-export", "status": "in-progress", "deps": ["01"], "deps_unmet": [],
@@ -87,7 +87,7 @@ fully in `features`/`fixes` — an `idea` unit appears ONLY in
87
87
  `design_candidates` (and `detail.features`), never in `startable_now`, since
88
88
  it has no deps-met check to pass (design precedes dependency startability).
89
89
  `05-auth` above illustrates `defined` (not yet `planned`): startable, next
90
- `/plan-feature`, phase fields null (no planning artifacts yet).
90
+ `/unit-lane`, phase fields null (no planning artifacts yet).
91
91
 
92
92
  ## The `--compact` projection
93
93
 
@@ -1,5 +1,10 @@
1
1
  ## Pre-execution receipt sensing (step 6a)
2
2
 
3
+ > **Legacy (feature 61 P8b):** the spec/plan pre-execution receipt stages are
4
+ > retired — the sensor now senses the unit doc's single triage block
5
+ > (`stage: lane`, see `ENVELOPE_FIELDS.md`). This reference is retained for
6
+ > units that still carry those receipts; the live sensing is the `lane` stage.
7
+
3
8
  Roadmap status says what exists; only a receipt bound to the current bytes says
4
9
  whether the unit may be executed. Sense it like every other signal — read the file,
5
10
  recompute the digest, never trust the prose sitting around the block.
@@ -145,5 +145,5 @@ mechanized.*
145
145
  `CRASH RECOVERY` sub-block to the report.
146
146
  18. **Report.** Print a short human summary (table: unit | status | deps unmet |
147
147
  PR | next gate) plus a **design candidates** line (`idea` units and their
148
- `/design-feature` next command) plus the `CRASH RECOVERY` sub-block, then
148
+ `/unit-lane` next command) plus the `CRASH RECOVERY` sub-block, then
149
149
  the envelope. With `--json-only`, envelope only.