pi-spine 1.5.0 → 1.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.
Files changed (57) hide show
  1. package/bin/spine-batch.mjs +3 -2
  2. package/bin/spine-wait.mjs +12 -0
  3. package/bin/spine.mjs +12 -0
  4. package/extensions/spine/slash-commands.ts +170 -1
  5. package/package.json +7 -4
  6. package/skills/spine-orchestrate-waves/SKILL.md +200 -0
  7. package/skills/spine-orchestrate-waves/references/outer-loop.md +165 -0
  8. package/skills/spine-release-operator/SKILL.md +371 -0
  9. package/skills/spine-release-operator/references/issue-intake-checklist.md +107 -0
  10. package/skills/spine-release-operator/references/issue-template.md +51 -0
  11. package/skills/spine-release-operator/references/release-manifest-template.md +76 -0
  12. package/skills/spine-release-operator/references/release-profiles.md +100 -0
  13. package/src/batch/attached-runner.mjs +18 -7
  14. package/src/batch/batch-state-io.mjs +137 -0
  15. package/src/batch/contract-prelanded.mjs +116 -14
  16. package/src/batch/contract-task-start.mjs +12 -7
  17. package/src/batch/contract-verify.mjs +51 -3
  18. package/src/batch/detached-spawn.mjs +78 -0
  19. package/src/batch/detached-start.mjs +25 -71
  20. package/src/batch/diagnosis-alternatives.mjs +8 -0
  21. package/src/batch/diagnosis.mjs +53 -4
  22. package/src/batch/engine.mjs +10 -1
  23. package/src/batch/evidence.mjs +30 -250
  24. package/src/batch/gate-evidence-collect.mjs +172 -0
  25. package/src/batch/gate-evidence-read.mjs +145 -0
  26. package/src/batch/gate.mjs +28 -38
  27. package/src/batch/integrate-worktree.mjs +65 -15
  28. package/src/batch/lane-dirty-check.mjs +108 -1
  29. package/src/batch/lifecycle.mjs +16 -11
  30. package/src/batch/post-merge-limbo.mjs +1 -1
  31. package/src/batch/postmortem.mjs +1 -2
  32. package/src/batch/reconcile.mjs +255 -1
  33. package/src/batch/resume-common.mjs +7 -1
  34. package/src/batch/resume-multi-validate.mjs +25 -101
  35. package/src/batch/resume-validation.mjs +120 -0
  36. package/src/batch/sequence.mjs +11 -2
  37. package/src/batch/state.mjs +18 -1
  38. package/src/batch/supervisor-spawn.mjs +379 -0
  39. package/src/cli/batch-complete.mjs +16 -0
  40. package/src/cli/spine-wait.mjs +114 -0
  41. package/src/cli/sync-base.mjs +354 -0
  42. package/src/cli/wait.mjs +7 -43
  43. package/src/config/defaults.mjs +11 -1
  44. package/src/config/settings-fields.mjs +23 -0
  45. package/src/config/spine-config-load.mjs +6 -0
  46. package/src/config/spine-config-schema.mjs +121 -0
  47. package/src/config/spine-init-constants.mjs +19 -1
  48. package/src/config/spine-preflight-lib.mjs +146 -2
  49. package/src/config/worktree-setup-hook.mjs +221 -0
  50. package/src/doctor/agent-models.mjs +1 -0
  51. package/src/doctor/agents-model-inherit.mjs +318 -0
  52. package/src/doctor/run-doctor-checks.mjs +28 -0
  53. package/src/doctor/supervisor.mjs +66 -0
  54. package/src/doctor/worktree-health.mjs +1 -1
  55. package/templates/agents/supervisor.md +27 -18
  56. package/templates/spine-config.json +20 -1
  57. package/templates/spine-worktree-setup-flutter.sh +44 -0
@@ -0,0 +1,165 @@
1
+ # How to orchestrate multi-wave spine batches with an external agent
2
+
3
+ > **Sync source:** `docs/adoption/agent-orchestrated-waves.md` (canonical). Update the doc first, then re-copy here when content changes.
4
+
5
+ Run all pending tasks across multiple dependency waves without manual intervention between each step. An **external agent** (pi, OpenCode, Cursor, CI script) drives the land loop between waves while spine owns batch execution, review, and integrate gates.
6
+
7
+ **Gate approval by the external agent is intentional** — spine workers return `not_supported` from `spine_request_gate` (FR-SHIP-13). The agent-as-operator model decouples wave scheduling from engine internals.
8
+
9
+ ---
10
+
11
+ ## Prerequisites
12
+
13
+ - pi-spine installed and configured ([bootstrap-checklist.md](../../../docs/adoption/bootstrap-checklist.md))
14
+ - Tasks decomposed into dependency waves (`spine plan pending` shows wave structure)
15
+ - Familiarity with the [land loop](../../../docs/adoption/operator-runbook.md#4-land-loop)
16
+
17
+ ---
18
+
19
+ ## Responsibility split
20
+
21
+ | Layer | Owns |
22
+ |-------|------|
23
+ | **Spine engine** | Batch start, lane provisioning, worker spawn, review, contract verify, lane→orch merge, gate evidence, journal |
24
+ | **External agent** | Wave selection, `spine wait`, evidence review, `gate approve`, integrate decision, retry/dismiss, conflict resolution |
25
+
26
+ The engine never auto-approves the integrate gate or pushes to remote — those decisions belong to the operator (human or agent).
27
+
28
+ ---
29
+
30
+ ## Per-wave land loop
31
+
32
+ Run this sequence once per wave from the consumer repo root:
33
+
34
+ ```bash
35
+ spine preflight
36
+ WAVE=0 # agent picks the next wave index from plan output
37
+
38
+ spine batch start pending --wave $WAVE --attached
39
+ spine wait --until completed,needs_integrate,failed,aborted,needs_retry --timeout 4h
40
+
41
+ spine status --diagnose
42
+ # Read headline + suggestedCommand
43
+
44
+ # Land loop (after reviewing evidence)
45
+ spine gate status
46
+ # Inspect .spine/runtime/<batchId>/evidence/
47
+ spine gate approve
48
+ spine integrate
49
+ spine batch complete
50
+ git push origin main
51
+ ```
52
+
53
+ Increment `$WAVE` and repeat until `spine plan pending` shows no remaining waves.
54
+
55
+ ---
56
+
57
+ ## Multi-wave strategy
58
+
59
+ **Preferred: agent repeats per wave.** Each iteration is an independent land loop. The agent reviews evidence, approves or rejects the gate, handles failures, then starts the next wave. This approach:
60
+
61
+ - Decouples from `--auto-approve-gate` (which is stub/CI only)
62
+ - Allows the agent to react to partial wave success
63
+ - Avoids sequence halt issues on merge-blocked waves
64
+
65
+ **Optional: sequence dry-run as script template.** Generate the command sequence without executing:
66
+
67
+ ```bash
68
+ spine run sequence pending --attached --dry-run
69
+ ```
70
+
71
+ The agent can execute each printed block manually with judgment between steps.
72
+
73
+ **Not recommended for real pi:** `spine run sequence pending --auto-approve-gate --force` bypasses evidence review and is restricted to stub/CI environments by safety gates.
74
+
75
+ ---
76
+
77
+ ## Diagnosis → agent action table
78
+
79
+ After `spine wait` returns or `spine status --diagnose` reports a non-running state:
80
+
81
+ | Diagnosis | Agent action |
82
+ |-----------|--------------|
83
+ | `needs_integrate` | Review evidence under `.spine/runtime/<batchId>/evidence/` → `spine gate approve` → `spine integrate` → `spine batch complete` → push |
84
+ | `needs_retry` | `spine batch retry <taskId>` then `spine batch resume --attached`; amend PROMPT contract if scope is wrong |
85
+ | `needs_retry` + `review_exhausted` | Inspect `.reviews/` feedback; fix implementation or packet scope, then retry |
86
+ | `needs_retry` + `contract_failed` | Edit `PROMPT.md` `testCommand` or file scope, then retry |
87
+ | `failed` | Inspect journal (`spine journal follow`); fix contract/env before retry |
88
+ | `needs_replan` | Read reviewer feedback in `{taskFolder}/.reviews/final-*.md`; edit PROMPT scope, then retry |
89
+ | `merge_blocked` | Resolve conflicts on orch branch or lane worktree; `spine batch resume --force` |
90
+ | `engine_orphaned` | Do **not** start a second attached engine; `spine batch retry <taskId>` or `spine batch resume --attached --force` after confirming dead PIDs |
91
+ | `worker_orphaned` | `spine batch retry <taskId>` (reconciles orphan running → failed) |
92
+ | `worker_done_missing` | Read worker output log from headline; fix blocker, then `spine batch retry <taskId>` |
93
+ | `completed` | Already landed — run `spine batch complete` if not archived, then push |
94
+
95
+ ---
96
+
97
+ ## Anti-patterns
98
+
99
+ | Anti-pattern | Why it fails | Correct approach |
100
+ |--------------|-------------|------------------|
101
+ | Running `spine batch resume --attached` while `spine run sequence --attached` is active | Two engines on the same batch causes state corruption | Use one entry point; kill stale engines first (`spine status --diagnose` to check PIDs) |
102
+ | Approving gate without reading evidence | Merges untested or broken code to main | Always inspect `.spine/runtime/<batchId>/evidence/` before `spine gate approve` |
103
+ | Expecting workers to call `spine_request_gate` for integrate | Workers always receive `not_supported` (FR-SHIP-13) | Agent drives gate approval from the host shell |
104
+ | Using `--auto-approve-gate` with real pi workers | Bypasses evidence review; safety gates block this for real pi | Use per-wave agent loop with explicit gate approval |
105
+ | Starting next wave before land loop completes | Base branch diverges from orch; downstream waves may conflict | Complete `integrate` + `batch complete` + push before next wave |
106
+ | Bare full-suite `testCommand` with large output | Contract verify exceeds `maxBuffer` (10MB) and fails | Scope `testCommand` to relevant test files |
107
+
108
+ ---
109
+
110
+ ## Example: full backlog orchestration
111
+
112
+ ```bash
113
+ #!/usr/bin/env bash
114
+ set -euo pipefail
115
+
116
+ spine preflight
117
+
118
+ WAVES=$(spine plan pending --json | jq '.waveCount')
119
+
120
+ for ((WAVE=0; WAVE<WAVES; WAVE++)); do
121
+ echo "=== Wave $WAVE ==="
122
+
123
+ spine batch start pending --wave "$WAVE" --attached
124
+ spine wait --until completed,needs_integrate,failed,aborted,needs_retry --timeout 4h
125
+
126
+ DIAG=$(spine status --json | jq -r '.diagnosis')
127
+
128
+ if [ "$DIAG" = "needs_integrate" ]; then
129
+ spine gate status
130
+ spine gate approve
131
+ spine integrate
132
+ spine batch complete
133
+ git push origin main
134
+ else
135
+ echo "Wave $WAVE ended with diagnosis: $DIAG"
136
+ echo "Run: spine status --diagnose"
137
+ exit 1
138
+ fi
139
+ done
140
+
141
+ echo "All waves complete."
142
+ ```
143
+
144
+ Adapt for agent sessions: replace the bash loop with agent tool calls (`spine status --json` → parse → branch on diagnosis).
145
+
146
+ ---
147
+
148
+ ## Related docs
149
+
150
+ | Doc | Relevance |
151
+ |-----|-----------|
152
+ | [operator-runbook.md §4](../../../docs/adoption/operator-runbook.md#4-land-loop) | Land loop copy-paste sequence |
153
+ | [bootstrap-checklist.md](../../../docs/adoption/bootstrap-checklist.md) | First batch setup |
154
+ | [upstream-execution-workflow.md](../../../docs/adoption/upstream-execution-workflow.md) | PRD → task packets → batch |
155
+ | [QUICK-REFERENCE.md](../../../docs/QUICK-REFERENCE.md) | Command reference |
156
+ | [spine-orchestrate-waves SKILL.md](../SKILL.md) | pi skill entry with decision tree |
157
+
158
+ ## Related issues
159
+
160
+ - [#90](https://github.com/beettlle/pi-spine/issues/90) — agent-orchestrated multi-wave outer loop
161
+ - [#79](https://github.com/beettlle/pi-spine/issues/79) — `--auto-approve-gate` flag (deprioritized; agent loop replaces need)
162
+ - [#82](https://github.com/beettlle/pi-spine/issues/82) — sequence stops on merge_blocked
163
+ - [#84](https://github.com/beettlle/pi-spine/issues/84) — PROMPT authoring for cross-model
164
+ - [#71](https://github.com/beettlle/pi-spine/issues/71) — built-in supervisor (future; agent outer loop bridges gap)
165
+ - [#54](https://github.com/beettlle/pi-spine/issues/54) — `spine run sequence` (complementary, not replacement)
@@ -0,0 +1,371 @@
1
+ ---
2
+ name: spine-release-operator
3
+ description: End-to-end pi-spine release operator. Intakes open GitHub issues and pending spine tasks, composes a semver-profiled release (docs priority, 3–5 bug fixes, ~1 enhancement for minor), authors and audits small self-contained task packets, executes wave-by-wave batches, verifies tests, and publishes after operator approval. Use when asked to run a spine release cycle, release vX.Y.Z, patch/minor/major release, or ship pi-spine to npm.
4
+ compatibility: Requires spine CLI, gh CLI, git, Node >= 22, gitnexus (pi-gitnexus extension or `gitnexus` on PATH). Run from pi-spine repo root on main.
5
+ ---
6
+
7
+ # Spine Release Operator
8
+
9
+ You are the **pi-spine release operator**. Drive a **curated release cycle** from intake through publish: select work by semver profile, author/audit task packets, execute batches, verify, and bump version — with **operator approval** before publish.
10
+
11
+ Invoke explicitly: `/skill:spine-release-operator` or "run a spine release cycle for v1.5.1".
12
+
13
+ **Not** for executing all pending tasks — use `spine-autonomous-operator` for that. This skill selects a **subset** fitting the release profile.
14
+
15
+ ## Skill boundaries
16
+
17
+ | Concern | Delegate to |
18
+ |---------|-------------|
19
+ | PROMPT/STATUS/Contract authoring | `create-spine-tasks` skill + templates |
20
+ | Batch land loop / recovery | Phases below (adapted from `spine-autonomous-operator`) |
21
+ | Semver scope budgets | [references/release-profiles.md](references/release-profiles.md) |
22
+ | Issue intake queries | [references/issue-intake-checklist.md](references/issue-intake-checklist.md) |
23
+ | Manifest format | [references/release-manifest-template.md](references/release-manifest-template.md) |
24
+ | npm publish mechanics | `docs/release/npm-publish.md` |
25
+ | Upstream bug filing | [references/issue-template.md](references/issue-template.md) |
26
+
27
+ ## Success criteria
28
+
29
+ 1. GitNexus index refreshed (`gitnexus status` up-to-date with HEAD)
30
+ 2. Release manifest written and operator-approved
31
+ 3. All **release-scoped** tasks `.DONE` and integrated on `main`
32
+ 4. `spine preflight` green; local test/coverage gates pass
33
+ 5. Operator explicitly approved publish; version bumped and tag pushed (if approved)
34
+ 6. Final report with composition table, issues closed/deferred, verification output
35
+
36
+ ## Hard rules
37
+
38
+ - **Never** hand-edit `.spine/batch-state.json` or `.spine/runtime/**`
39
+ - **Never** implement product code in task folders while a batch owns that scope
40
+ - **Never** claim batch/test/publish success without CLI output
41
+ - **Never** run `npm version` or `git push --tags` without explicit operator approval
42
+ - **Always** parse target version / bump type **before** task selection (Phase 2)
43
+ - **Always** prioritize documentation issues over enhancements
44
+ - **Always** run `spine gate approve` before `spine integrate`
45
+ - **Always** run `npm install` on `main` after successful integrate
46
+ - **Do not** execute tasks outside the approved manifest scope
47
+ - **Always** run `/gitnexus analyze` (Pre-work) before Phase 0 — do not start intake, authoring, or batches on a stale index
48
+
49
+ ---
50
+
51
+ ## Pre-work — GitNexus index
52
+
53
+ **First step on every release cycle.** Refresh the knowledge graph so GitNexus auto-augment, impact analysis, and symbol lookups reflect current `main` before intake, packet audit, or batch execution.
54
+
55
+ In pi:
56
+
57
+ ```
58
+ /gitnexus analyze
59
+ ```
60
+
61
+ Outside pi (same repo root):
62
+
63
+ ```bash
64
+ cd <repo-root>
65
+ gitnexus analyze
66
+ ```
67
+
68
+ Verify before continuing:
69
+
70
+ ```bash
71
+ gitnexus status # Status: up-to-date; indexed commit matches HEAD
72
+ ```
73
+
74
+ If analyze fails or status is not up-to-date, **stop** and report — do not proceed to Phase 0.
75
+
76
+ ---
77
+
78
+ ## Phase 0 — Baseline and target version
79
+
80
+ ```bash
81
+ cd <repo-root> # pi-spine root
82
+ spine --version
83
+ spine doctor
84
+ node -p "require('./package.json').version"
85
+ git status
86
+ git branch --show-current # must be main
87
+ ```
88
+
89
+ **Parse invocation** for target version or bump type:
90
+
91
+ | Input | Action |
92
+ |-------|--------|
93
+ | "release for v1.5.1" | Profile = `patch`, target = `1.5.1` |
94
+ | "release for v1.6.0" | Profile = `minor`, target = `1.6.0` |
95
+ | "patch release" | Profile = `patch`, compute next patch from `package.json` |
96
+ | "minor release" | Profile = `minor`, compute next minor |
97
+ | No version given | **Ask operator** for target version or bump type |
98
+
99
+ Read [references/release-profiles.md](references/release-profiles.md) for profile budgets.
100
+
101
+ If not on `main`, stop. If git is dirty, commit or stash hygiene fixes before release work.
102
+
103
+ ---
104
+
105
+ ## Phase 1 — Intake inventory
106
+
107
+ Follow [references/issue-intake-checklist.md](references/issue-intake-checklist.md).
108
+
109
+ **GitHub issues:**
110
+
111
+ ```bash
112
+ gh issue list --repo beettlle/pi-spine --state open --limit 100 \
113
+ --json number,title,labels,body
114
+ gh issue list --repo beettlle/pi-spine --state open --label documentation --json number,title,labels
115
+ gh issue list --repo beettlle/pi-spine --state open --label bug --json number,title,labels
116
+ ```
117
+
118
+ **Pending tasks:**
119
+
120
+ ```bash
121
+ spine plan pending
122
+ spine tasks validate pending
123
+ spine tasks analyze pending
124
+ ```
125
+
126
+ **Map issues to tasks:**
127
+
128
+ ```bash
129
+ rg 'Closes:|Partial:' spine-tasks/*/PROMPT.md
130
+ ```
131
+
132
+ Read `spine-tasks/CONTEXT.md` for `Next Task ID`.
133
+
134
+ **Output:** intake table (issue #, labels, mapped SP-* or gap, bucket, profile fit).
135
+
136
+ ---
137
+
138
+ ## Phase 2 — Compose release manifest
139
+
140
+ Write manifest to:
141
+
142
+ ```
143
+ spine-tasks/_authoring/release-v{TARGET}/manifest.md
144
+ ```
145
+
146
+ Use [references/release-manifest-template.md](references/release-manifest-template.md).
147
+
148
+ ### Selection order (strict)
149
+
150
+ 1. **Documentation first** — all feasible doc items before feature work
151
+ 2. **Bug fixes** — target 3–5 with user impact
152
+ 3. **Enhancements** — per profile (0 for patch, 1–2 for minor)
153
+ 4. **Defer** everything else with one-line rationale
154
+
155
+ ### Apply profile budgets
156
+
157
+ | Profile | Docs | Bugs | Enh | Total cap |
158
+ |---------|------|------|-----|-----------|
159
+ | **patch** | 1–2 small | 3–5 | **0** | 5–8 tasks, S only |
160
+ | **minor** | 2–4 | 3–5 | 1–2 | 10–15 tasks, S/M |
161
+ | **major** | migration + pass | 3–5 critical | multiple | operator-defined |
162
+
163
+ Fill composition audit table. **Do not proceed** on `FAIL` without operator override.
164
+
165
+ ### Operator gate
166
+
167
+ Present manifest summary:
168
+
169
+ - Target version and profile
170
+ - Selected SP-* / issues by bucket
171
+ - Deferred count
172
+ - Profile audit status
173
+
174
+ Require explicit **"approve release scope"** before Phase 3.
175
+
176
+ ---
177
+
178
+ ## Phase 3 — Author gaps and audit packets
179
+
180
+ ### 3.1 Author new tasks (gaps only)
181
+
182
+ For issues in manifest without SP-*:
183
+
184
+ - Follow **`create-spine-tasks`** (lean mode default)
185
+ - Mission: `Closes: #NNN` (or `Partial:` when scoped)
186
+ - Size S/M; ≤4 impl steps; Contract + Testing step
187
+ - Update `dependencies.json`, `CONTEXT.md`, increment `Next Task ID`
188
+
189
+ ### 3.2 Audit release-scoped packets
190
+
191
+ For every task in manifest scope:
192
+
193
+ | Size | Action |
194
+ |------|--------|
195
+ | **S** | Keep if ≤4 impl steps |
196
+ | **M** | OK if disjoint file scope; warn in patch profile |
197
+ | **L/XL** | **Split** before inclusion |
198
+
199
+ **Decompose** when:
200
+ - More than 4 implementation steps
201
+ - Multiple unrelated file areas
202
+ - Same hot file in parallel tasks (serialize via `dependencies.json`)
203
+ - M/L in patch profile
204
+
205
+ **Contract hygiene:**
206
+ - [ ] No trailing `/` in contract paths
207
+ - [ ] No parenthetical paths
208
+ - [ ] Doc paths in File Scope match Documentation Requirements (#144)
209
+ - [ ] `dependencies.json` matches PROMPT `## Dependencies`
210
+ - [ ] Same-wave tasks have disjoint `fileScopeMustChange`
211
+
212
+ ```bash
213
+ spine tasks validate <release-scope>
214
+ spine tasks analyze <release-scope>
215
+ spine plan <release-scope>
216
+ ```
217
+
218
+ ### 3.3 Commit packet changes
219
+
220
+ ```bash
221
+ git add spine-tasks/
222
+ git commit -m "chore(spine): release v{TARGET} task packets"
223
+ ```
224
+
225
+ ---
226
+
227
+ ## Phase 4 — Execute release scope
228
+
229
+ **Scope:** manifest tasks only — build a comma-separated release scope ID list.
230
+
231
+ ```bash
232
+ spine preflight
233
+ spine run sequence <release-scope> --dry-run
234
+ ```
235
+
236
+ For each wave `N` until all release-scoped tasks are `.DONE`:
237
+
238
+ ### 4.1 Start
239
+
240
+ ```bash
241
+ spine batch start <release-scope> --wave N --attached
242
+ ```
243
+
244
+ ### 4.2 Monitor
245
+
246
+ ```bash
247
+ spine status --diagnose
248
+ # or block:
249
+ spine wait --until completed,failed,needs_integrate,needs_retry,aborted --timeout 2h
250
+ ```
251
+
252
+ **Do not** start wave N+1 until wave N is integrated on `main`.
253
+
254
+ Wave sizing: prefer ≤4 M-sized tasks per wave; serialize hot shared files.
255
+
256
+ ### 4.3 Land loop
257
+
258
+ When diagnosis is `needs_integrate` or gate is open:
259
+
260
+ ```bash
261
+ spine gate status
262
+ spine gate approve
263
+ spine integrate
264
+ npm install
265
+ spine batch complete
266
+ ```
267
+
268
+ Verify: `git status` clean, `.DONE` count increased.
269
+
270
+ ### 4.4 Recovery
271
+
272
+ Always: `spine status --diagnose`
273
+
274
+ | Diagnosis | Action |
275
+ |-----------|--------|
276
+ | `running` | Wait; `spine watch` |
277
+ | `paused` | `spine batch resume` |
278
+ | `needs_retry` | Fix packet; `spine batch retry <taskId>` |
279
+ | `worker_orphaned` | abort → dismiss → prune worktree → retry |
280
+ | `needs_integrate` | Land loop |
281
+ | `state_drift` | `spine batch retry <taskId>` (pause first if task still `running`); then `spine batch resume --attached --force` |
282
+ | `failed` / `aborted` | Inspect journal; fix packet; dismiss; retry |
283
+ | Contract fail | Fix PROMPT on main, commit, abort, dismiss, retry |
284
+
285
+ **File upstream issues** for repeat engine faults — see [references/issue-template.md](references/issue-template.md).
286
+
287
+ ---
288
+
289
+ ## Phase 5 — Pre-publish verification (STOP)
290
+
291
+ ```bash
292
+ spine plan <release-scope> # should show 0 pending for scope
293
+ spine preflight
294
+ npm run release:check # typecheck → lint → tests → coverage (CI parity)
295
+ git status
296
+ ```
297
+
298
+ Present checklist from `docs/release/npm-publish.md`:
299
+
300
+ - [ ] All release-scoped tasks done
301
+ - [ ] Preflight green
302
+ - [ ] `npm run release:check` green (includes lint; ≥77% coverage)
303
+ - [ ] Clean git tree
304
+ - [ ] Bump type matches profile: patch | minor | major
305
+
306
+ **Human gate (required):** **STOP HERE.** Do not bump or push until operator explicitly approves publish and confirms bump type.
307
+
308
+ ---
309
+
310
+ ## Phase 6 — Publish (after approval only)
311
+
312
+ Only after operator says "approve publish" / "bump and push":
313
+
314
+ ```bash
315
+ npm version patch # or minor / major — must match Phase 2 profile
316
+ git push && git push --tags
317
+ ```
318
+
319
+ Monitor CI:
320
+
321
+ ```bash
322
+ gh run list --workflow release.yml --limit 3
323
+ ```
324
+
325
+ Post-publish smoke per `docs/release/npm-publish.md`:
326
+
327
+ ```bash
328
+ npm install -g pi-spine@<version>
329
+ spine version
330
+ spine doctor
331
+ ```
332
+
333
+ Update `spine-tasks/CONTEXT.md` release note (version + date).
334
+
335
+ Close GitHub issues where tasks had `Closes: #NNN` and work shipped.
336
+
337
+ ---
338
+
339
+ ## Final report (required)
340
+
341
+ 1. **Release manifest** — path, target version, profile, composition table
342
+ 2. **Tasks completed** — SP-IDs, waves, issues closed
343
+ 3. **Deferred backlog** — count and top items for next release
344
+ 4. **Authoring changes** — new SP-* created, splits/fixes in Phase 3
345
+ 5. **Issues filed** — pi-spine GitHub links or "none"
346
+ 6. **Recovery actions** — aborts, retries, contract fixes
347
+ 7. **Verification** — paste `spine preflight` tail, test/coverage output
348
+ 8. **Publish** — version bumped (Y/N), tag pushed (Y/N), workflow URL, or "awaiting operator approval"
349
+
350
+ ---
351
+
352
+ ## Repo-specific notes (pi-spine)
353
+
354
+ | Item | Value |
355
+ |------|-------|
356
+ | Tasks root | `spine-tasks/` |
357
+ | Issues repo | `beettlle/pi-spine` |
358
+ | Pre-publish gate | `npm run release:check` (typecheck → lint → tests → coverage; CI parity) |
359
+ | Publish | Tag-triggered `.github/workflows/release.yml` |
360
+ | Pending backlog | Run `spine plan pending` — release executes **subset only** |
361
+
362
+ ## Short prompt (resume mid-release)
363
+
364
+ ```text
365
+ Resume spine release v{TARGET}: /gitnexus analyze (or gitnexus analyze) → gitnexus status →
366
+ check manifest at spine-tasks/_authoring/release-v{TARGET}/manifest.md →
367
+ verify remaining scope → preflight → for each wave: batch start --attached → diagnose →
368
+ gate approve → integrate → npm install → batch complete →
369
+ when scope done: tests + preflight → STOP for publish approval.
370
+ Post final report with composition table.
371
+ ```
@@ -0,0 +1,107 @@
1
+ # Issue intake checklist
2
+
3
+ Run during **Phase 1** before composing the release manifest.
4
+
5
+ ## GitHub queries
6
+
7
+ Repo: `beettlle/pi-spine`
8
+
9
+ ```bash
10
+ gh issue list --repo beettlle/pi-spine --state open --limit 100 \
11
+ --json number,title,labels,body
12
+
13
+ gh issue list --repo beettlle/pi-spine --state open --label documentation \
14
+ --json number,title,labels
15
+
16
+ gh issue list --repo beettlle/pi-spine --state open --label bug \
17
+ --json number,title,labels
18
+
19
+ gh issue list --repo beettlle/pi-spine --state open --label enhancement \
20
+ --json number,title,labels
21
+ ```
22
+
23
+ ## Label taxonomy
24
+
25
+ | Label | Release bucket | Priority notes |
26
+ |-------|----------------|----------------|
27
+ | `documentation` | Documentation | Highest user value — address before enhancements |
28
+ | `bug` | Bug fix | Prefer user-impact, reproducible, already-tasked |
29
+ | `enhancement` | Enhancement | One per minor; zero per patch |
30
+ | `priority:P1` | Any | Prefer over P2/P3 when scope allows |
31
+ | `priority:P2` | Any | Normal |
32
+ | `priority:P3` | Any | Defer unless trivial S doc fix |
33
+ | `skill:create-spine-tasks` | Documentation (usually) | Skill/template updates; often docs-only packets |
34
+
35
+ ## Issue → task mapping
36
+
37
+ 1. Grep pending and done tasks for issue links:
38
+
39
+ ```bash
40
+ rg 'Closes:|Partial:' spine-tasks/*/PROMPT.md
41
+ ```
42
+
43
+ 2. Classify each open issue:
44
+
45
+ | State | Action |
46
+ |-------|--------|
47
+ | Mapped to pending SP-* | Candidate for manifest if fits profile |
48
+ | Mapped to `.DONE` SP-* | Closed by shipped work — exclude |
49
+ | No SP-* yet | **Gap** — author with `create-spine-tasks` in Phase 3 |
50
+ | Epic / `[Epic]` in title | Defer unless major profile with operator approval |
51
+
52
+ ## Documentation issue heuristics
53
+
54
+ Prefer for release inclusion when:
55
+
56
+ - `label:documentation` or title starts with `Docs:`
57
+ - `skill:create-spine-tasks` issues that are template/rule updates only
58
+ - Pending SP-* with docs-only File Scope (`fileScopeMustNotChange` on `src/`, `bin/`, `tests/`)
59
+ - `testCommand: true` or scoped doc verification
60
+
61
+ Ensure **Documentation Requirements paths appear in File Scope** (issue #144).
62
+
63
+ ## Bug issue heuristics
64
+
65
+ Prefer when:
66
+
67
+ - Repro steps in issue body or linked diagnosis
68
+ - Already has pending SP-* with `Closes: #NNN`
69
+ - S/M size, disjoint file scope from parallel neighbors
70
+ - User-visible failure (contract fail, integrate hang, dirty worktree)
71
+
72
+ Exclude when:
73
+
74
+ - Fixed on `main` but issue not closed
75
+ - Requires external repo reproduction without minimal repro
76
+ - Blocked by epic infrastructure not in this release
77
+
78
+ ## Enhancement issue heuristics
79
+
80
+ **Patch profile:** exclude all.
81
+
82
+ **Minor profile:** pick exactly one (two only with operator override):
83
+
84
+ - User-visible or operator-visible improvement
85
+ - S/M size; split L/XL first
86
+ - Disjoint `fileScopeMustChange` from bug tasks in same wave
87
+ - P1/P2 over P3
88
+
89
+ ## Pending task inventory
90
+
91
+ ```bash
92
+ spine plan pending
93
+ spine tasks validate pending
94
+ spine tasks analyze pending
95
+ spine deps pending
96
+ ```
97
+
98
+ Read `spine-tasks/CONTEXT.md` for `Next Task ID` and phase notes.
99
+
100
+ Cross-reference pending SP-* with open issues. The release executes **manifest scope only**, not all pending tasks.
101
+
102
+ ## Intake output table
103
+
104
+ | Issue # | Labels | Mapped SP-* | Bucket | Profile fit | Notes |
105
+ |---------|--------|-------------|--------|-------------|-------|
106
+ | #130 | bug | SP-483 | bug | patch ✓ | post-merge restore |
107
+ | #90 | documentation | — (gap) | doc | minor ✓ | needs new SP-* |
@@ -0,0 +1,51 @@
1
+ # pi-spine upstream issue template
2
+
3
+ Use when filing engine/orchestrator bugs at https://github.com/beettlle/pi-spine/issues during **Phase 4** recovery.
4
+
5
+ ## Environment
6
+
7
+ - pi-spine: `spine --version`
8
+ - pi: `pi --version`
9
+ - Node: `node --version`
10
+ - Repo: `pi-spine` @ `git rev-parse --short HEAD`
11
+
12
+ ## Commands run
13
+
14
+ ```text
15
+ (paste exact spine commands)
16
+ ```
17
+
18
+ ## Diagnosis
19
+
20
+ ```text
21
+ (paste output of: spine status --diagnose)
22
+ ```
23
+
24
+ ## Journal excerpt
25
+
26
+ ```bash
27
+ spine journal replay --batch <batchId>
28
+ ```
29
+
30
+ ```text
31
+ (paste last 20–40 lines relevant to failure)
32
+ ```
33
+
34
+ ## Expected vs actual
35
+
36
+ - **Expected:** ...
37
+ - **Actual:** ...
38
+
39
+ ## Minimal reproduction
40
+
41
+ Steps another operator can follow on the pi-spine repo or a consumer repo.
42
+
43
+ ## Related issues
44
+
45
+ Search first before filing. Common clusters:
46
+
47
+ - Contract verifier false positives (#105, #118)
48
+ - Integrate / post-merge sync (#130, #114)
49
+ - Dirty worktree / graphify-out (#113)
50
+ - Batch complete stale state (#94)
51
+ - Doctor / provider auth (#97)