pi-spine 1.6.0 → 1.8.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/bin/spine-wait.mjs +12 -0
- package/package.json +3 -3
- package/skills/spine-autonomous-operator/SKILL.md +264 -0
- package/skills/spine-autonomous-operator/references/issue-template.md +45 -0
- package/skills/spine-orchestrate-waves/SKILL.md +1 -0
- package/skills/spine-release-operator/SKILL.md +80 -14
- package/skills/spine-release-operator/references/pi-async-orchestration.md +88 -0
- package/skills/spine-release-operator/scripts/collect-release-intake.sh +71 -0
- package/src/batch/abort.mjs +1 -0
- package/src/batch/agent-session-worker.mjs +1 -0
- package/src/batch/attached-engine-handoff.mjs +1 -0
- package/src/batch/attached-runner.mjs +19 -7
- package/src/batch/contract-prelanded.mjs +1 -0
- package/src/batch/contract-task-start.mjs +13 -7
- package/src/batch/contract-verify.mjs +26 -1
- package/src/batch/detached-spawn.mjs +78 -0
- package/src/batch/detached-start.mjs +26 -71
- package/src/batch/diagnosis-launch-failure.mjs +1 -0
- package/src/batch/diagnosis-merge-failure.mjs +1 -0
- package/src/batch/diagnosis-retry-limbo.mjs +1 -0
- package/src/batch/diagnosis-tail-state.mjs +1 -0
- package/src/batch/diagnosis-task-done.mjs +1 -0
- package/src/batch/diagnosis-worker-done-missing.mjs +1 -0
- package/src/batch/diagnosis.mjs +26 -2
- package/src/batch/engine-lanes/commit.mjs +1 -0
- package/src/batch/engine-lanes/merge.mjs +1 -0
- package/src/batch/engine-lanes/queue.mjs +1 -0
- package/src/batch/engine-lanes/review.mjs +1 -0
- package/src/batch/engine-lanes.mjs +1 -0
- package/src/batch/engine-scope.mjs +1 -0
- package/src/batch/engine.mjs +19 -9
- package/src/batch/evidence.mjs +31 -250
- package/src/batch/gate-evidence-collect.mjs +173 -0
- package/src/batch/gate-evidence-read.mjs +146 -0
- package/src/batch/gate.mjs +29 -38
- package/src/batch/git-helpers.mjs +1 -1
- package/src/batch/heartbeat-git-debounce.mjs +83 -0
- package/src/batch/heartbeat.mjs +17 -20
- package/src/batch/integrate-worktree.mjs +1 -0
- package/src/batch/integrate.mjs +1 -0
- package/src/batch/journal-rebuild.mjs +1 -0
- package/src/batch/journal.mjs +2 -1
- package/src/batch/lane-commit.mjs +1 -0
- package/src/batch/lane-dirty-check.mjs +103 -0
- package/src/batch/lifecycle.mjs +7 -5
- package/src/batch/limbo-detect.mjs +1 -0
- package/src/batch/macro-phase.mjs +1 -0
- package/src/batch/merge/adoption-doc-merge.mjs +1 -0
- package/src/batch/merge/wave-merge-state.mjs +1 -0
- package/src/batch/metrics.mjs +1 -0
- package/src/batch/orphan-detect.mjs +1 -0
- package/src/batch/pause.mjs +1 -0
- package/src/batch/post-merge-limbo.mjs +2 -1
- package/src/batch/postmortem.mjs +2 -2
- package/src/batch/readers/spine-state.mjs +1 -0
- package/src/batch/readers/taskplane-state.mjs +1 -0
- package/src/batch/reconcile.mjs +85 -9
- package/src/batch/resume-common.mjs +8 -1
- package/src/batch/resume-engine.mjs +1 -0
- package/src/batch/resume-multi-lanes.mjs +1 -0
- package/src/batch/resume-multi-validate.mjs +26 -101
- package/src/batch/resume-multi.mjs +1 -0
- package/src/batch/resume-validation.mjs +121 -0
- package/src/batch/resume.mjs +1 -0
- package/src/batch/retry.mjs +1 -0
- package/src/batch/review-shared.mjs +1 -0
- package/src/batch/review-spawn.mjs +1 -0
- package/src/batch/review.mjs +1 -0
- package/src/batch/rules-manifest-drift.mjs +1 -0
- package/src/batch/salvage.mjs +1 -0
- package/src/batch/sequence.mjs +16 -4
- package/src/batch/state.mjs +1 -0
- package/src/batch/supervisor-spawn.mjs +380 -0
- package/src/batch/task-stall-budget.mjs +3 -4
- package/src/batch/worker-host.mjs +31 -25
- package/src/batch/worker-output.mjs +1 -0
- package/src/batch/worker-prompt.mjs +1 -0
- package/src/cli/journal-follow.mjs +1 -1
- package/src/cli/spine-wait.mjs +114 -0
- package/src/cli/wait.mjs +7 -43
- package/src/config/agent-model-resolve.mjs +1 -0
- package/src/config/contract.mjs +1 -0
- package/src/config/cursor-rules/discover.mjs +1 -0
- package/src/config/cursor-rules/match-globs.mjs +1 -0
- package/src/config/cursor-rules/parse-frontmatter.mjs +1 -0
- package/src/config/cursor-rules/profile.mjs +1 -0
- package/src/config/cursor-rules/select.mjs +1 -0
- package/src/config/defaults.mjs +4 -1
- package/src/config/env-overrides.mjs +1 -0
- package/src/config/pi-spine-root.mjs +1 -0
- package/src/config/preflight/discovery.mjs +333 -0
- package/src/config/preflight/git-batch.mjs +320 -0
- package/src/config/preflight/integrate-plan.mjs +460 -0
- package/src/config/reviewer-context.mjs +1 -0
- package/src/config/settings-fields.mjs +24 -0
- package/src/config/spine-config-load.mjs +6 -0
- package/src/config/spine-config-schema.mjs +122 -0
- package/src/config/spine-init-constants.mjs +20 -1
- package/src/config/spine-preflight-lib.mjs +54 -1013
- package/src/config/worker-backend.mjs +1 -0
- package/src/config/worker-context.mjs +1 -0
- package/src/config/worker-launch-script.mjs +1 -0
- package/src/config/worktree-setup-hook.mjs +222 -0
- package/src/dashboard/public/dashboard.js +6 -1
- package/src/dashboard/running-tail-state.mjs +1 -0
- package/src/dashboard/server.mjs +136 -16
- package/src/dashboard/snapshot-lanes.mjs +479 -0
- package/src/dashboard/snapshot-waves.mjs +272 -0
- package/src/dashboard/snapshot.mjs +41 -862
- package/src/doctor/agent-model-inherit.mjs +1 -0
- package/src/doctor/agent-models.mjs +2 -0
- package/src/doctor/coexistence.mjs +1 -0
- package/src/doctor/run-doctor-checks.mjs +15 -0
- package/src/doctor/stale-path.mjs +1 -0
- package/src/doctor/stall-config.mjs +1 -0
- package/src/doctor/suggest-max-parallel.mjs +1 -0
- package/src/doctor/supervisor.mjs +66 -0
- package/src/doctor/task-packet-size.mjs +3 -10
- package/src/doctor/worktree-health.mjs +2 -1
- package/src/planner/cycles.mjs +1 -0
- package/src/planner/file-scope.mjs +1 -0
- package/src/planner/format-plan.mjs +1 -0
- package/src/planner/graph.mjs +1 -0
- package/src/planner/scope.mjs +1 -0
- package/src/planner/wave-scope.mjs +1 -0
- package/src/planner/waves.mjs +1 -0
- package/src/tasks/packet/merge-deps.mjs +1 -0
- package/src/tasks/packet/parse-prompt.mjs +4 -3
- package/src/tasks/packet/parse-status.mjs +1 -0
- package/src/tasks/packet/size-line.mjs +12 -0
- package/src/tasks/packet/validate-contract.mjs +1 -0
- package/src/tasks/packet/validate-prompt.mjs +1 -0
- package/templates/agents/supervisor.md +27 -18
- package/templates/spine-config.json +16 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-export spine wait helpers from src (bin must not be imported by src/).
|
|
3
|
+
*/
|
|
4
|
+
export {
|
|
5
|
+
WAIT_UNTIL_PSEUDO_DIAGNOSES,
|
|
6
|
+
VALID_UNTIL_DIAGNOSES,
|
|
7
|
+
formatValidWaitUntilDiagnoses,
|
|
8
|
+
parseUntilDiagnoses,
|
|
9
|
+
deriveWaitPseudoDiagnoses,
|
|
10
|
+
diagnosisMatchesUntil,
|
|
11
|
+
reconciliationMatchesUntil,
|
|
12
|
+
} from "../src/cli/spine-wait.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-spine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Orchestration spine for long-running pi development",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"doctor": "node bin/spine.mjs doctor",
|
|
33
33
|
"lint": "eslint --max-warnings 0 src bin tests scripts",
|
|
34
34
|
"typecheck": "tsc --project tsconfig.json --noEmit && tsc --project tsconfig.batch.json --noEmit",
|
|
35
|
-
"test": "SPINE_SUPPRESS_JOURNAL_ATTACH=1 node --experimental-strip-types --test tests/*.test.mjs tests/cli/*.test.mjs tests/compat/*.test.mjs tests/tasks/*.test.mjs tests/config/*.test.mjs tests/config/cursor-rules/*.test.mjs tests/planner/*.test.mjs tests/batch/*.test.mjs tests/agents/*.test.mjs tests/adoption/*.test.mjs tests/dashboard/*.test.mjs tests/doctor/*.test.mjs tests/migrate/*.test.mjs tests/worker-tools/*.test.mjs tests/coverage/*.test.mjs tests/extensions/*.test.mjs",
|
|
35
|
+
"test": "SPINE_SUPPRESS_JOURNAL_ATTACH=1 node --experimental-strip-types --test tests/*.test.mjs tests/cli/*.test.mjs tests/compat/*.test.mjs tests/tasks/*.test.mjs tests/config/*.test.mjs tests/config/cursor-rules/*.test.mjs tests/planner/*.test.mjs tests/batch/*.test.mjs tests/agents/*.test.mjs tests/adoption/*.test.mjs tests/dashboard/*.test.mjs tests/doctor/*.test.mjs tests/init/*.test.mjs tests/migrate/*.test.mjs tests/worker-tools/*.test.mjs tests/coverage/*.test.mjs tests/extensions/*.test.mjs",
|
|
36
36
|
"test:batch": "SPINE_SUPPRESS_JOURNAL_ATTACH=1 node --experimental-strip-types --test tests/batch/*.test.mjs",
|
|
37
37
|
"test:core": "SPINE_SUPPRESS_JOURNAL_ATTACH=1 node --experimental-strip-types --test tests/*.test.mjs tests/cli/*.test.mjs tests/compat/*.test.mjs tests/tasks/*.test.mjs tests/config/*.test.mjs tests/config/cursor-rules/*.test.mjs tests/planner/*.test.mjs tests/agents/*.test.mjs tests/adoption/*.test.mjs tests/dashboard/*.test.mjs tests/doctor/*.test.mjs tests/migrate/*.test.mjs tests/worker-tools/*.test.mjs tests/coverage/*.test.mjs",
|
|
38
38
|
"test:coverage": "node scripts/run-coverage.mjs --report-only",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
72
|
+
"@earendil-works/pi-coding-agent": "^0.80.3",
|
|
73
73
|
"@types/node": "^22.19.18",
|
|
74
74
|
"eslint": "^9.28.0",
|
|
75
75
|
"globals": "^16.2.0",
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spine-autonomous-operator
|
|
3
|
+
description: Autonomous pi-spine batch operator for pending tasks. Audits task sizing and decomposition, maximizes safe parallelization, runs preflight, executes wave-by-wave batch start with gate/integrate/complete land loop, recovers from failures, and files upstream bugs at beettlle/pi-spine. Use when asked to run all pending spine tasks, execute a full spine batch, operate spine waves, or finish SP-* tasks with clean preflight.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
compatibility: Requires spine CLI, gh CLI (for issue filing), git, Node >= 22. Run from pi-spine repo root on main.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Spine Autonomous Operator
|
|
9
|
+
|
|
10
|
+
You are the **pi-spine batch operator** for this repository. Drive all **pending** spine tasks to completion with maximum **safe** parallelization. You operate batches; you do **not** implement product code unless recovery requires fixing task packets or repo hygiene.
|
|
11
|
+
|
|
12
|
+
For **curated semver releases** (subset scope, publish gates), use [`skills/spine-release-operator/SKILL.md`](../spine-release-operator/SKILL.md) instead.
|
|
13
|
+
|
|
14
|
+
Invoke explicitly: `/skill:spine-autonomous-operator`
|
|
15
|
+
|
|
16
|
+
## Success criteria
|
|
17
|
+
|
|
18
|
+
1. `spine plan pending` shows **0 pending tasks**
|
|
19
|
+
2. `spine preflight` passes with a **clean** git tree
|
|
20
|
+
3. All work is **integrated on `main`** (not stuck in worktrees)
|
|
21
|
+
4. Repeatable pi-spine **engine** faults have GitHub issues filed
|
|
22
|
+
5. Final report: waves completed, tasks done, issues filed, verification output
|
|
23
|
+
|
|
24
|
+
## Hard rules
|
|
25
|
+
|
|
26
|
+
- **Never** hand-edit `.spine/batch-state.json` or journal files under `.spine/runtime/`
|
|
27
|
+
- **Never** implement product code in task folders while a batch owns that scope
|
|
28
|
+
- **Never** claim batch/test success without CLI output
|
|
29
|
+
- **Always** use `spine status --diagnose` for recovery; follow `suggestedCommand`
|
|
30
|
+
- **Always** run `spine gate approve` before `spine integrate`
|
|
31
|
+
- **Always** run `npm install` on `main` after successful integrate
|
|
32
|
+
- **Do not** use unattended `spine run sequence --auto-approve-gate --force` without monitoring
|
|
33
|
+
- **Do not** start a second batch while another batch is **running** on the same repo
|
|
34
|
+
- **Never** background `spine batch resume --attached` or `resume --attached --force` ([#163](https://github.com/beettlle/pi-spine/issues/163))
|
|
35
|
+
|
|
36
|
+
## Phase 0 — Baseline
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
cd <repo-root>
|
|
40
|
+
spine --version
|
|
41
|
+
spine doctor
|
|
42
|
+
git status
|
|
43
|
+
git branch --show-current # must be main
|
|
44
|
+
spine status --diagnose # readonly — do not collide with active batch
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If not on `main`, stop and ask the operator. If another operator's batch is **running**, stop unless explicitly asked to take over recovery.
|
|
48
|
+
|
|
49
|
+
## Phase 1 — Audit pending tasks
|
|
50
|
+
|
|
51
|
+
### 1.1 Inventory
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
spine plan pending
|
|
55
|
+
spine tasks validate pending
|
|
56
|
+
spine tasks analyze pending
|
|
57
|
+
spine deps pending
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Read `spine-tasks/CONTEXT.md` for `Next Task ID` and phase notes.
|
|
61
|
+
|
|
62
|
+
### 1.2 Size audit
|
|
63
|
+
|
|
64
|
+
For each pending `spine-tasks/{SP-###-slug}/PROMPT.md`:
|
|
65
|
+
|
|
66
|
+
| Size | Target | Action if exceeded |
|
|
67
|
+
|------|--------|-------------------|
|
|
68
|
+
| **S** | <2h, ≤4 impl steps | Keep |
|
|
69
|
+
| **M** | 2–4h | OK if file scope disjoint from parallel neighbors |
|
|
70
|
+
| **L** | 4–8h | **Split** into multiple S/M tasks |
|
|
71
|
+
| **XL** | >8h or >4 steps | **Must split** |
|
|
72
|
+
|
|
73
|
+
**Decompose** when:
|
|
74
|
+
- More than 4 implementation steps (excluding Testing + Completion Criteria)
|
|
75
|
+
- Multiple unrelated file areas in one task
|
|
76
|
+
- Same hot file in parallel tasks (serialize via `dependencies.json`)
|
|
77
|
+
- M/L tasks share overlapping `fileScopeMustChange` in the same wave
|
|
78
|
+
|
|
79
|
+
### 1.3 Parallelization audit
|
|
80
|
+
|
|
81
|
+
- [ ] `dependencies.json` matches PROMPT `## Dependencies`
|
|
82
|
+
- [ ] Same-wave tasks have **disjoint** `fileScopeMustChange`
|
|
83
|
+
- [ ] Hot shared files are serial (e.g. `src/batch/heartbeat.mjs`, `bin/spine.mjs`)
|
|
84
|
+
- [ ] No directory paths with trailing `/` in contracts — use explicit files
|
|
85
|
+
- [ ] No parenthetical comments in contract paths (e.g. `file.ts (Step 2 only)`)
|
|
86
|
+
- [ ] Pre-landed code on `main` → point `fileScopeMustChange` at `spine-tasks/{task}/STATUS.md` + `## Amendments`
|
|
87
|
+
|
|
88
|
+
After changes:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
spine tasks validate pending
|
|
92
|
+
spine tasks analyze pending
|
|
93
|
+
spine plan pending
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 1.4 Commit packet changes
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
git add spine-tasks/ .spine/spine-config.json # only if changed
|
|
100
|
+
git commit -m "chore(spine): refine pending task packets for safe parallel execution"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Repo hygiene that breaks preflight:
|
|
104
|
+
- Add `coverage/`, `node_modules/`, `.pi/` to `.gitignore` if missing
|
|
105
|
+
- `git worktree prune` after abort
|
|
106
|
+
|
|
107
|
+
## Phase 2 — Preflight gate
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
spine preflight
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
All checks must pass (`git-clean`, `no-active-batch`, `tasks-validate`, `prelanded-file-scope`, `plan`). Fix, commit, re-run until green. **Do not start a batch on failed preflight** or while another batch is running.
|
|
114
|
+
|
|
115
|
+
## Phase 3 — Wave execution loop
|
|
116
|
+
|
|
117
|
+
Preview the plan:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
spine run sequence pending --dry-run
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
For each wave `N` until `spine plan pending` shows 0 tasks:
|
|
124
|
+
|
|
125
|
+
### 3.1 Start
|
|
126
|
+
|
|
127
|
+
**pi async (preferred in pi sessions)** — see [pi-async-orchestration.md](../spine-release-operator/references/pi-async-orchestration.md):
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
MonitorCreate:
|
|
131
|
+
command: spine batch start pending --wave N --attached
|
|
132
|
+
description: Pending wave N
|
|
133
|
+
timeout: 0
|
|
134
|
+
onDone: spine status --diagnose → land loop (§3.3) or recovery (§4)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Foreground fallback** (non-pi or after #163 orphan on MonitorCreate):
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
spine batch start pending --wave N --attached
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 3.2 Monitor
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
spine status --diagnose
|
|
147
|
+
# or block:
|
|
148
|
+
spine wait --until completed,failed,needs_integrate,needs_retry,aborted --timeout 2h
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Optional: `spine watch --once`, `spine dashboard`
|
|
152
|
+
|
|
153
|
+
### 3.2a Pi async watchdog (optional)
|
|
154
|
+
|
|
155
|
+
If MonitorCreate `onDone` did not fire but batch may still be running:
|
|
156
|
+
|
|
157
|
+
```text
|
|
158
|
+
LoopCreate: trigger "2m", readOnly true, maxFires 50
|
|
159
|
+
prompt: check spine status --diagnose; LoopDelete self on terminal diagnosis
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Do not** start the next wave until the current wave is fully landed on `main`.
|
|
163
|
+
|
|
164
|
+
### 3.3 Land loop
|
|
165
|
+
|
|
166
|
+
When diagnosis is `needs_integrate` or gate is open:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
spine gate status
|
|
170
|
+
spine gate approve
|
|
171
|
+
spine integrate
|
|
172
|
+
npm install
|
|
173
|
+
spine batch complete
|
|
174
|
+
git add spine-tasks/*/.DONE 2>/dev/null; git commit -m "chore: track .DONE for wave N" || true
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Verify: `git status` clean, `.DONE` count increased.
|
|
178
|
+
|
|
179
|
+
### 3.4 Advance
|
|
180
|
+
|
|
181
|
+
Increment `N` and repeat.
|
|
182
|
+
|
|
183
|
+
## Phase 4 — Recovery
|
|
184
|
+
|
|
185
|
+
Always: `spine status --diagnose`
|
|
186
|
+
|
|
187
|
+
| Diagnosis | Action |
|
|
188
|
+
|-----------|--------|
|
|
189
|
+
| `running` | Wait; `spine watch` or async watchdog |
|
|
190
|
+
| `paused` | `spine batch resume` (foreground if `--attached`) |
|
|
191
|
+
| `needs_retry` | Fix packet if needed; `spine batch retry <taskId>` |
|
|
192
|
+
| `worker_orphaned` | `abort` → `dismiss` → prune worktree → retry wave |
|
|
193
|
+
| `needs_integrate` | Land loop (gate → integrate → npm install → complete) |
|
|
194
|
+
| `state_drift` | `spine batch retry <taskId>`; then **`spine batch resume --attached --force` in foreground** |
|
|
195
|
+
| `failed` / `aborted` | Inspect journal; fix packet; dismiss; retry |
|
|
196
|
+
| Contract fail | Fix PROMPT on **main**, commit, abort, dismiss, prune, retry |
|
|
197
|
+
| Integrate hang | Manual `spine integrate` + `spine batch complete`; file upstream issue |
|
|
198
|
+
|
|
199
|
+
**After abort:**
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
spine batch abort --reason recovery
|
|
203
|
+
spine batch dismiss --reason recovery
|
|
204
|
+
rm -rf .worktrees/spine-* # if stale
|
|
205
|
+
git worktree prune
|
|
206
|
+
spine preflight
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Phase 5 — File upstream pi-spine issues
|
|
210
|
+
|
|
211
|
+
File at https://github.com/beettlle/pi-spine/issues when:
|
|
212
|
+
- Same diagnosis repeats after `suggestedCommand`
|
|
213
|
+
- Engine crash, orphan, gate bug, integrate hang, verifier false positive
|
|
214
|
+
|
|
215
|
+
**Not** for: misconfig, dirty git, bad packets, consumer code bugs.
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
spine issue draft --type bug --json
|
|
219
|
+
spine issue draft --type bug --create
|
|
220
|
+
# or:
|
|
221
|
+
gh issue create --repo beettlle/pi-spine --title "..." --body-file .spine/issue-draft.md
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Search existing issues first. Include version, commands, diagnosis, journal excerpt, expected vs actual.
|
|
225
|
+
|
|
226
|
+
See [references/issue-template.md](references/issue-template.md) for a full template.
|
|
227
|
+
|
|
228
|
+
## Phase 6 — Final verification
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
spine plan pending
|
|
232
|
+
spine preflight
|
|
233
|
+
git status
|
|
234
|
+
npm run release:check
|
|
235
|
+
find spine-tasks -name '.DONE' | wc -l
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
In pi sessions, `MonitorCreate` for `npm run release:check` is allowed (see pi-async-orchestration).
|
|
239
|
+
|
|
240
|
+
## Final report (required)
|
|
241
|
+
|
|
242
|
+
1. **Tasks completed** — SP-IDs and wave numbers
|
|
243
|
+
2. **Decomposition changes** — splits/fixes in Phase 1
|
|
244
|
+
3. **Issues filed** — pi-spine GitHub links or "none"
|
|
245
|
+
4. **Recovery actions** — aborts, retries, contract fixes
|
|
246
|
+
5. **Verification** — paste `spine preflight` tail and `spine plan pending`
|
|
247
|
+
6. **Remaining blockers** — if any
|
|
248
|
+
|
|
249
|
+
## Repo-specific notes (pi-spine)
|
|
250
|
+
|
|
251
|
+
- **Tasks root:** `spine-tasks/`
|
|
252
|
+
- **Config:** `.spine/spine-config.json`
|
|
253
|
+
- **Test gate:** `npm run release:check` (typecheck → lint → tests → coverage)
|
|
254
|
+
- **Known upstream issues:** #114 (integrate hang, fixed), #118 (trailing-slash contracts), #130 (`coverage/` restore), #163 (`engine_orphaned`)
|
|
255
|
+
|
|
256
|
+
## Short prompt (resume mid-batch)
|
|
257
|
+
|
|
258
|
+
```text
|
|
259
|
+
Run pending spine tasks: validate/analyze/plan → fix packets → preflight →
|
|
260
|
+
for each wave: MonitorCreate batch start (or foreground) → diagnose →
|
|
261
|
+
gate approve → integrate → npm install → batch complete.
|
|
262
|
+
Resume --attached --force stays foreground. File pi-spine bugs on engine faults.
|
|
263
|
+
Done when 0 pending, preflight green, release:check passes. Post final report.
|
|
264
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# pi-spine upstream issue template
|
|
2
|
+
|
|
3
|
+
Use when filing engine/orchestrator bugs at https://github.com/beettlle/pi-spine/issues
|
|
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 pi-spine or a consumer repo.
|
|
42
|
+
|
|
43
|
+
## Related issues
|
|
44
|
+
|
|
45
|
+
Search first: #114 integrate hang, #118 contract trailing-slash, #130 coverage restore, #163 engine_orphaned
|
|
@@ -21,6 +21,7 @@ Invoke explicitly: `/skill:spine-orchestrate-waves`, `/spine-orchestrate pending
|
|
|
21
21
|
|---------|-------------|
|
|
22
22
|
| Task packet authoring | `create-spine-tasks` skill |
|
|
23
23
|
| Curated release subset | `spine-release-operator` skill |
|
|
24
|
+
| Pi async batch/verify (MonitorCreate) | [spine-release-operator/references/pi-async-orchestration.md](../spine-release-operator/references/pi-async-orchestration.md) |
|
|
24
25
|
| Canonical how-to prose | [references/outer-loop.md](references/outer-loop.md) (synced from `docs/adoption/agent-orchestrated-waves.md`) |
|
|
25
26
|
| Slash entry (`/spine-orchestrate`) | pi-spine extension — wave plan + outer loop checklist |
|
|
26
27
|
| Single-task suggested command | `/spine-next` inside land loop |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: spine-release-operator
|
|
3
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. Run from pi-spine repo root on main.
|
|
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
5
|
---
|
|
6
6
|
|
|
7
7
|
# Spine Release Operator
|
|
@@ -17,7 +17,8 @@ Invoke explicitly: `/skill:spine-release-operator` or "run a spine release cycle
|
|
|
17
17
|
| Concern | Delegate to |
|
|
18
18
|
|---------|-------------|
|
|
19
19
|
| PROMPT/STATUS/Contract authoring | `create-spine-tasks` skill + templates |
|
|
20
|
-
| Batch land loop / recovery |
|
|
20
|
+
| Batch land loop / recovery | [`spine-autonomous-operator`](../spine-autonomous-operator/SKILL.md) Phase 3–4 + [pi-async-orchestration.md](references/pi-async-orchestration.md) |
|
|
21
|
+
| Wave evidence / diagnosis tree | [`spine-orchestrate-waves`](../spine-orchestrate-waves/SKILL.md) |
|
|
21
22
|
| Semver scope budgets | [references/release-profiles.md](references/release-profiles.md) |
|
|
22
23
|
| Issue intake queries | [references/issue-intake-checklist.md](references/issue-intake-checklist.md) |
|
|
23
24
|
| Manifest format | [references/release-manifest-template.md](references/release-manifest-template.md) |
|
|
@@ -26,11 +27,12 @@ Invoke explicitly: `/skill:spine-release-operator` or "run a spine release cycle
|
|
|
26
27
|
|
|
27
28
|
## Success criteria
|
|
28
29
|
|
|
29
|
-
1.
|
|
30
|
-
2.
|
|
31
|
-
3.
|
|
32
|
-
4.
|
|
33
|
-
5.
|
|
30
|
+
1. GitNexus index refreshed (`gitnexus status` up-to-date with HEAD)
|
|
31
|
+
2. Release manifest written and operator-approved
|
|
32
|
+
3. All **release-scoped** tasks `.DONE` and integrated on `main`
|
|
33
|
+
4. `spine preflight` green; local test/coverage gates pass
|
|
34
|
+
5. Operator explicitly approved publish; version bumped and tag pushed (if approved)
|
|
35
|
+
6. Final report with composition table, issues closed/deferred, verification output
|
|
34
36
|
|
|
35
37
|
## Hard rules
|
|
36
38
|
|
|
@@ -43,6 +45,36 @@ Invoke explicitly: `/skill:spine-release-operator` or "run a spine release cycle
|
|
|
43
45
|
- **Always** run `spine gate approve` before `spine integrate`
|
|
44
46
|
- **Always** run `npm install` on `main` after successful integrate
|
|
45
47
|
- **Do not** execute tasks outside the approved manifest scope
|
|
48
|
+
- **Do not** start a second batch while another batch is **running** on this repo
|
|
49
|
+
- **Never** background `spine batch resume --attached` or `resume --attached --force` ([#163](https://github.com/beettlle/pi-spine/issues/163))
|
|
50
|
+
- **Always** run `/gitnexus analyze` (Pre-work) before Phase 0 — do not start intake, authoring, or batches on a stale index
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Pre-work — GitNexus index
|
|
55
|
+
|
|
56
|
+
**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.
|
|
57
|
+
|
|
58
|
+
In pi:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
/gitnexus analyze
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Outside pi (same repo root):
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
cd <repo-root>
|
|
68
|
+
gitnexus analyze
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Verify before continuing:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
gitnexus status # Status: up-to-date; indexed commit matches HEAD
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
If analyze fails or status is not up-to-date, **stop** and report — do not proceed to Phase 0.
|
|
46
78
|
|
|
47
79
|
---
|
|
48
80
|
|
|
@@ -77,6 +109,13 @@ If not on `main`, stop. If git is dirty, commit or stash hygiene fixes before re
|
|
|
77
109
|
|
|
78
110
|
Follow [references/issue-intake-checklist.md](references/issue-intake-checklist.md).
|
|
79
111
|
|
|
112
|
+
Optional snapshot (readonly):
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
skills/spine-release-operator/scripts/collect-release-intake.sh {TARGET}
|
|
116
|
+
# optional: tee spine-tasks/_authoring/release-v{TARGET}/intake-snapshot-$(date -u +%Y%m%d).md
|
|
117
|
+
```
|
|
118
|
+
|
|
80
119
|
**GitHub issues:**
|
|
81
120
|
|
|
82
121
|
```bash
|
|
@@ -206,7 +245,21 @@ spine run sequence <release-scope> --dry-run
|
|
|
206
245
|
|
|
207
246
|
For each wave `N` until all release-scoped tasks are `.DONE`:
|
|
208
247
|
|
|
209
|
-
|
|
248
|
+
Check `spine status --diagnose` first — if a batch is already **running** for this release, do not start another; follow recovery or wait.
|
|
249
|
+
|
|
250
|
+
### 4.1 Start (pi async — preferred in pi sessions)
|
|
251
|
+
|
|
252
|
+
See [references/pi-async-orchestration.md](references/pi-async-orchestration.md):
|
|
253
|
+
|
|
254
|
+
```text
|
|
255
|
+
MonitorCreate:
|
|
256
|
+
command: spine batch start <release-scope> --wave N --attached
|
|
257
|
+
description: Release wave N
|
|
258
|
+
timeout: 0
|
|
259
|
+
onDone: spine status --diagnose → §4.3 land loop or §4.4 recovery
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**Foreground fallback** (non-pi, or after #163 orphan on MonitorCreate):
|
|
210
263
|
|
|
211
264
|
```bash
|
|
212
265
|
spine batch start <release-scope> --wave N --attached
|
|
@@ -220,6 +273,8 @@ spine status --diagnose
|
|
|
220
273
|
spine wait --until completed,failed,needs_integrate,needs_retry,aborted --timeout 2h
|
|
221
274
|
```
|
|
222
275
|
|
|
276
|
+
Optional pi watchdog: `LoopCreate` every 2m, `readOnly: true`, `maxFires: 50` — see pi-async-orchestration.
|
|
277
|
+
|
|
223
278
|
**Do not** start wave N+1 until wave N is integrated on `main`.
|
|
224
279
|
|
|
225
280
|
Wave sizing: prefer ≤4 M-sized tasks per wave; serialize hot shared files.
|
|
@@ -249,7 +304,7 @@ Always: `spine status --diagnose`
|
|
|
249
304
|
| `needs_retry` | Fix packet; `spine batch retry <taskId>` |
|
|
250
305
|
| `worker_orphaned` | abort → dismiss → prune worktree → retry |
|
|
251
306
|
| `needs_integrate` | Land loop |
|
|
252
|
-
| `state_drift` | `spine batch retry <taskId>` (pause first if task still `running`); then
|
|
307
|
+
| `state_drift` | `spine batch retry <taskId>` (pause first if task still `running`); then **`spine batch resume --attached --force` in foreground** (never MonitorCreate) |
|
|
253
308
|
| `failed` / `aborted` | Inspect journal; fix packet; dismiss; retry |
|
|
254
309
|
| Contract fail | Fix PROMPT on main, commit, abort, dismiss, retry |
|
|
255
310
|
|
|
@@ -262,10 +317,17 @@ Always: `spine status --diagnose`
|
|
|
262
317
|
```bash
|
|
263
318
|
spine plan <release-scope> # should show 0 pending for scope
|
|
264
319
|
spine preflight
|
|
265
|
-
npm run release:check # typecheck → lint → tests → coverage (CI parity)
|
|
266
320
|
git status
|
|
267
321
|
```
|
|
268
322
|
|
|
323
|
+
**pi async (preferred):** `MonitorCreate` with `npm run release:check 2>&1 | tee /tmp/pi-spine-release-check.log`, `timeout: 900000`, `onDone` to read log tail and present checklist.
|
|
324
|
+
|
|
325
|
+
**Foreground fallback:**
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
npm run release:check # typecheck → lint → tests → coverage (CI parity)
|
|
329
|
+
```
|
|
330
|
+
|
|
269
331
|
Present checklist from `docs/release/npm-publish.md`:
|
|
270
332
|
|
|
271
333
|
- [ ] All release-scoped tasks done
|
|
@@ -293,6 +355,8 @@ Monitor CI:
|
|
|
293
355
|
gh run list --workflow release.yml --limit 3
|
|
294
356
|
```
|
|
295
357
|
|
|
358
|
+
**pi async:** `MonitorCreate` with `gh run watch --exit-status <run-id>`, `timeout: 1800000`, `onDone` to report conclusion and run smoke tests if green.
|
|
359
|
+
|
|
296
360
|
Post-publish smoke per `docs/release/npm-publish.md`:
|
|
297
361
|
|
|
298
362
|
```bash
|
|
@@ -333,9 +397,11 @@ Close GitHub issues where tasks had `Closes: #NNN` and work shipped.
|
|
|
333
397
|
## Short prompt (resume mid-release)
|
|
334
398
|
|
|
335
399
|
```text
|
|
336
|
-
Resume spine release v{TARGET}:
|
|
337
|
-
|
|
400
|
+
Resume spine release v{TARGET}: /gitnexus analyze → gitnexus status →
|
|
401
|
+
check manifest at spine-tasks/_authoring/release-v{TARGET}/manifest.md →
|
|
402
|
+
spine status --diagnose (do not collide with running batch) →
|
|
403
|
+
preflight → for each wave: MonitorCreate batch start (or foreground) → onDone diagnose →
|
|
338
404
|
gate approve → integrate → npm install → batch complete →
|
|
339
|
-
|
|
340
|
-
Post final report with composition table.
|
|
405
|
+
MonitorCreate release:check → STOP for publish approval.
|
|
406
|
+
resume --attached --force stays foreground. Post final report with composition table.
|
|
341
407
|
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Pi async orchestration (MonitorCreate / LoopCreate)
|
|
2
|
+
|
|
3
|
+
Use in **pi sessions** when long-running shell work would waste the agent context window. The operator session stays free for intake, manifest edits, issue filing, and recovery planning while batches and verification run in the background.
|
|
4
|
+
|
|
5
|
+
**Fallback:** When pi bridge tools are unavailable (Cursor-only, no MonitorCreate), use blocking `spine wait` and foreground shell — see each skill's non-pi sections.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to use MonitorCreate (preferred)
|
|
10
|
+
|
|
11
|
+
`MonitorCreate` runs a shell command in the background and fires an `onDone` prompt when it exits. No polling loop required.
|
|
12
|
+
|
|
13
|
+
| Command | timeout | Notes |
|
|
14
|
+
|---------|---------|-------|
|
|
15
|
+
| `spine batch start <scope> --wave N --attached` | `0` (none) | Wave batch; see safety rules below |
|
|
16
|
+
| `npm run release:check 2>&1 \| tee /tmp/pi-spine-release-check.log` | `900000` (15m) | Default 5m is too short for full pi-spine suite |
|
|
17
|
+
| `gh run watch --exit-status <run-id>` | `1800000` (30m) | After tag push; resolve run-id from `gh run list` |
|
|
18
|
+
|
|
19
|
+
### onDone prompt template (batch)
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
Monitor for wave N completed. Run spine status --diagnose.
|
|
23
|
+
- needs_integrate: inspect .spine/runtime/<batchId>/evidence/ → gate approve → integrate → npm install → batch complete.
|
|
24
|
+
- needs_retry / failed / aborted: follow recovery table; do not start next wave.
|
|
25
|
+
- running: optional LoopCreate watchdog (below) or spine watch.
|
|
26
|
+
Paste diagnosis headline and exit evidence. Do not claim success without CLI output.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### onDone prompt template (release:check)
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
release:check monitor completed. Read tail of /tmp/pi-spine-release-check.log.
|
|
33
|
+
If exit 0: present pre-publish checklist from docs/release/npm-publish.md.
|
|
34
|
+
If non-zero: STOP; summarize first failing step; do not bump version.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## When to use LoopCreate (watchdog only)
|
|
40
|
+
|
|
41
|
+
Use when MonitorCreate's completion wake is insufficient or you need lightweight status polling without blocking the session.
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
LoopCreate:
|
|
45
|
+
trigger: "2m"
|
|
46
|
+
readOnly: true
|
|
47
|
+
maxFires: 50
|
|
48
|
+
prompt: |
|
|
49
|
+
Check spine status --diagnose for batch <batchId>.
|
|
50
|
+
If diagnosis is terminal (needs_integrate, failed, aborted, needs_retry): LoopDelete this loop and run onDone actions.
|
|
51
|
+
If still running: do nothing.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Prefer Monitor's built-in completion wake over LoopCreate when MonitorCreate was used for the same command.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## When NOT to async
|
|
59
|
+
|
|
60
|
+
| Action | Rule | Why |
|
|
61
|
+
|--------|------|-----|
|
|
62
|
+
| `spine batch resume --attached` | **Foreground shell only** | [#163](https://github.com/beettlle/pi-spine/issues/163) engine_orphaned |
|
|
63
|
+
| `spine batch resume --attached --force` | **Foreground shell only** | Same; release recovery discipline |
|
|
64
|
+
| `spine gate approve` | Agent must read evidence first | FR-SHIP-13; no auto-approve |
|
|
65
|
+
| Land loop during active recovery | Stay on current wave | Avoid parallel engines |
|
|
66
|
+
|
|
67
|
+
If `engine_orphaned` recurs after MonitorCreate on `batch start`, fall back to blocking `spine wait` for that wave and comment on #163.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Cleanup
|
|
72
|
+
|
|
73
|
+
Before starting the next wave or ending the release session:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
LoopList → LoopDelete any release watchdog loops
|
|
77
|
+
MonitorList → note completed monitors; MonitorStop any stale runners
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Do not interfere with active batches
|
|
83
|
+
|
|
84
|
+
Before authoring skill-driven commands:
|
|
85
|
+
|
|
86
|
+
1. Run `spine status --diagnose` (readonly).
|
|
87
|
+
2. If a batch is **running** for the current release, do not start a second batch or edit `.spine/runtime/**`.
|
|
88
|
+
3. Skill/doc updates on `main` are safe; batch execution is owned by the active operator session.
|