pi-spine 1.5.0 → 1.6.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 (30) hide show
  1. package/bin/spine-batch.mjs +3 -2
  2. package/bin/spine.mjs +12 -0
  3. package/extensions/spine/slash-commands.ts +170 -1
  4. package/package.json +6 -3
  5. package/skills/spine-orchestrate-waves/SKILL.md +200 -0
  6. package/skills/spine-orchestrate-waves/references/outer-loop.md +165 -0
  7. package/skills/spine-release-operator/SKILL.md +341 -0
  8. package/skills/spine-release-operator/references/issue-intake-checklist.md +107 -0
  9. package/skills/spine-release-operator/references/issue-template.md +51 -0
  10. package/skills/spine-release-operator/references/release-manifest-template.md +76 -0
  11. package/skills/spine-release-operator/references/release-profiles.md +100 -0
  12. package/src/batch/batch-state-io.mjs +137 -0
  13. package/src/batch/contract-prelanded.mjs +116 -14
  14. package/src/batch/contract-verify.mjs +26 -2
  15. package/src/batch/diagnosis-alternatives.mjs +8 -0
  16. package/src/batch/diagnosis.mjs +28 -2
  17. package/src/batch/engine.mjs +10 -1
  18. package/src/batch/integrate-worktree.mjs +65 -15
  19. package/src/batch/lane-dirty-check.mjs +6 -1
  20. package/src/batch/lifecycle.mjs +10 -6
  21. package/src/batch/reconcile.mjs +254 -0
  22. package/src/batch/state.mjs +18 -1
  23. package/src/cli/batch-complete.mjs +16 -0
  24. package/src/cli/sync-base.mjs +354 -0
  25. package/src/config/defaults.mjs +8 -1
  26. package/src/config/spine-preflight-lib.mjs +146 -2
  27. package/src/doctor/agents-model-inherit.mjs +318 -0
  28. package/src/doctor/run-doctor-checks.mjs +14 -0
  29. package/templates/spine-config.json +4 -0
  30. package/templates/spine-worktree-setup-flutter.sh +44 -0
@@ -0,0 +1,341 @@
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. 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. Release manifest written and operator-approved
30
+ 2. All **release-scoped** tasks `.DONE` and integrated on `main`
31
+ 3. `spine preflight` green; local test/coverage gates pass
32
+ 4. Operator explicitly approved publish; version bumped and tag pushed (if approved)
33
+ 5. Final report with composition table, issues closed/deferred, verification output
34
+
35
+ ## Hard rules
36
+
37
+ - **Never** hand-edit `.spine/batch-state.json` or `.spine/runtime/**`
38
+ - **Never** implement product code in task folders while a batch owns that scope
39
+ - **Never** claim batch/test/publish success without CLI output
40
+ - **Never** run `npm version` or `git push --tags` without explicit operator approval
41
+ - **Always** parse target version / bump type **before** task selection (Phase 2)
42
+ - **Always** prioritize documentation issues over enhancements
43
+ - **Always** run `spine gate approve` before `spine integrate`
44
+ - **Always** run `npm install` on `main` after successful integrate
45
+ - **Do not** execute tasks outside the approved manifest scope
46
+
47
+ ---
48
+
49
+ ## Phase 0 — Baseline and target version
50
+
51
+ ```bash
52
+ cd <repo-root> # pi-spine root
53
+ spine --version
54
+ spine doctor
55
+ node -p "require('./package.json').version"
56
+ git status
57
+ git branch --show-current # must be main
58
+ ```
59
+
60
+ **Parse invocation** for target version or bump type:
61
+
62
+ | Input | Action |
63
+ |-------|--------|
64
+ | "release for v1.5.1" | Profile = `patch`, target = `1.5.1` |
65
+ | "release for v1.6.0" | Profile = `minor`, target = `1.6.0` |
66
+ | "patch release" | Profile = `patch`, compute next patch from `package.json` |
67
+ | "minor release" | Profile = `minor`, compute next minor |
68
+ | No version given | **Ask operator** for target version or bump type |
69
+
70
+ Read [references/release-profiles.md](references/release-profiles.md) for profile budgets.
71
+
72
+ If not on `main`, stop. If git is dirty, commit or stash hygiene fixes before release work.
73
+
74
+ ---
75
+
76
+ ## Phase 1 — Intake inventory
77
+
78
+ Follow [references/issue-intake-checklist.md](references/issue-intake-checklist.md).
79
+
80
+ **GitHub issues:**
81
+
82
+ ```bash
83
+ gh issue list --repo beettlle/pi-spine --state open --limit 100 \
84
+ --json number,title,labels,body
85
+ gh issue list --repo beettlle/pi-spine --state open --label documentation --json number,title,labels
86
+ gh issue list --repo beettlle/pi-spine --state open --label bug --json number,title,labels
87
+ ```
88
+
89
+ **Pending tasks:**
90
+
91
+ ```bash
92
+ spine plan pending
93
+ spine tasks validate pending
94
+ spine tasks analyze pending
95
+ ```
96
+
97
+ **Map issues to tasks:**
98
+
99
+ ```bash
100
+ rg 'Closes:|Partial:' spine-tasks/*/PROMPT.md
101
+ ```
102
+
103
+ Read `spine-tasks/CONTEXT.md` for `Next Task ID`.
104
+
105
+ **Output:** intake table (issue #, labels, mapped SP-* or gap, bucket, profile fit).
106
+
107
+ ---
108
+
109
+ ## Phase 2 — Compose release manifest
110
+
111
+ Write manifest to:
112
+
113
+ ```
114
+ spine-tasks/_authoring/release-v{TARGET}/manifest.md
115
+ ```
116
+
117
+ Use [references/release-manifest-template.md](references/release-manifest-template.md).
118
+
119
+ ### Selection order (strict)
120
+
121
+ 1. **Documentation first** — all feasible doc items before feature work
122
+ 2. **Bug fixes** — target 3–5 with user impact
123
+ 3. **Enhancements** — per profile (0 for patch, 1–2 for minor)
124
+ 4. **Defer** everything else with one-line rationale
125
+
126
+ ### Apply profile budgets
127
+
128
+ | Profile | Docs | Bugs | Enh | Total cap |
129
+ |---------|------|------|-----|-----------|
130
+ | **patch** | 1–2 small | 3–5 | **0** | 5–8 tasks, S only |
131
+ | **minor** | 2–4 | 3–5 | 1–2 | 10–15 tasks, S/M |
132
+ | **major** | migration + pass | 3–5 critical | multiple | operator-defined |
133
+
134
+ Fill composition audit table. **Do not proceed** on `FAIL` without operator override.
135
+
136
+ ### Operator gate
137
+
138
+ Present manifest summary:
139
+
140
+ - Target version and profile
141
+ - Selected SP-* / issues by bucket
142
+ - Deferred count
143
+ - Profile audit status
144
+
145
+ Require explicit **"approve release scope"** before Phase 3.
146
+
147
+ ---
148
+
149
+ ## Phase 3 — Author gaps and audit packets
150
+
151
+ ### 3.1 Author new tasks (gaps only)
152
+
153
+ For issues in manifest without SP-*:
154
+
155
+ - Follow **`create-spine-tasks`** (lean mode default)
156
+ - Mission: `Closes: #NNN` (or `Partial:` when scoped)
157
+ - Size S/M; ≤4 impl steps; Contract + Testing step
158
+ - Update `dependencies.json`, `CONTEXT.md`, increment `Next Task ID`
159
+
160
+ ### 3.2 Audit release-scoped packets
161
+
162
+ For every task in manifest scope:
163
+
164
+ | Size | Action |
165
+ |------|--------|
166
+ | **S** | Keep if ≤4 impl steps |
167
+ | **M** | OK if disjoint file scope; warn in patch profile |
168
+ | **L/XL** | **Split** before inclusion |
169
+
170
+ **Decompose** when:
171
+ - More than 4 implementation steps
172
+ - Multiple unrelated file areas
173
+ - Same hot file in parallel tasks (serialize via `dependencies.json`)
174
+ - M/L in patch profile
175
+
176
+ **Contract hygiene:**
177
+ - [ ] No trailing `/` in contract paths
178
+ - [ ] No parenthetical paths
179
+ - [ ] Doc paths in File Scope match Documentation Requirements (#144)
180
+ - [ ] `dependencies.json` matches PROMPT `## Dependencies`
181
+ - [ ] Same-wave tasks have disjoint `fileScopeMustChange`
182
+
183
+ ```bash
184
+ spine tasks validate <release-scope>
185
+ spine tasks analyze <release-scope>
186
+ spine plan <release-scope>
187
+ ```
188
+
189
+ ### 3.3 Commit packet changes
190
+
191
+ ```bash
192
+ git add spine-tasks/
193
+ git commit -m "chore(spine): release v{TARGET} task packets"
194
+ ```
195
+
196
+ ---
197
+
198
+ ## Phase 4 — Execute release scope
199
+
200
+ **Scope:** manifest tasks only — build a comma-separated release scope ID list.
201
+
202
+ ```bash
203
+ spine preflight
204
+ spine run sequence <release-scope> --dry-run
205
+ ```
206
+
207
+ For each wave `N` until all release-scoped tasks are `.DONE`:
208
+
209
+ ### 4.1 Start
210
+
211
+ ```bash
212
+ spine batch start <release-scope> --wave N --attached
213
+ ```
214
+
215
+ ### 4.2 Monitor
216
+
217
+ ```bash
218
+ spine status --diagnose
219
+ # or block:
220
+ spine wait --until completed,failed,needs_integrate,needs_retry,aborted --timeout 2h
221
+ ```
222
+
223
+ **Do not** start wave N+1 until wave N is integrated on `main`.
224
+
225
+ Wave sizing: prefer ≤4 M-sized tasks per wave; serialize hot shared files.
226
+
227
+ ### 4.3 Land loop
228
+
229
+ When diagnosis is `needs_integrate` or gate is open:
230
+
231
+ ```bash
232
+ spine gate status
233
+ spine gate approve
234
+ spine integrate
235
+ npm install
236
+ spine batch complete
237
+ ```
238
+
239
+ Verify: `git status` clean, `.DONE` count increased.
240
+
241
+ ### 4.4 Recovery
242
+
243
+ Always: `spine status --diagnose`
244
+
245
+ | Diagnosis | Action |
246
+ |-----------|--------|
247
+ | `running` | Wait; `spine watch` |
248
+ | `paused` | `spine batch resume` |
249
+ | `needs_retry` | Fix packet; `spine batch retry <taskId>` |
250
+ | `worker_orphaned` | abort → dismiss → prune worktree → retry |
251
+ | `needs_integrate` | Land loop |
252
+ | `state_drift` | `spine batch retry <taskId>` (pause first if task still `running`); then `spine batch resume --attached --force` |
253
+ | `failed` / `aborted` | Inspect journal; fix packet; dismiss; retry |
254
+ | Contract fail | Fix PROMPT on main, commit, abort, dismiss, retry |
255
+
256
+ **File upstream issues** for repeat engine faults — see [references/issue-template.md](references/issue-template.md).
257
+
258
+ ---
259
+
260
+ ## Phase 5 — Pre-publish verification (STOP)
261
+
262
+ ```bash
263
+ spine plan <release-scope> # should show 0 pending for scope
264
+ spine preflight
265
+ npm run release:check # typecheck → lint → tests → coverage (CI parity)
266
+ git status
267
+ ```
268
+
269
+ Present checklist from `docs/release/npm-publish.md`:
270
+
271
+ - [ ] All release-scoped tasks done
272
+ - [ ] Preflight green
273
+ - [ ] `npm run release:check` green (includes lint; ≥77% coverage)
274
+ - [ ] Clean git tree
275
+ - [ ] Bump type matches profile: patch | minor | major
276
+
277
+ **Human gate (required):** **STOP HERE.** Do not bump or push until operator explicitly approves publish and confirms bump type.
278
+
279
+ ---
280
+
281
+ ## Phase 6 — Publish (after approval only)
282
+
283
+ Only after operator says "approve publish" / "bump and push":
284
+
285
+ ```bash
286
+ npm version patch # or minor / major — must match Phase 2 profile
287
+ git push && git push --tags
288
+ ```
289
+
290
+ Monitor CI:
291
+
292
+ ```bash
293
+ gh run list --workflow release.yml --limit 3
294
+ ```
295
+
296
+ Post-publish smoke per `docs/release/npm-publish.md`:
297
+
298
+ ```bash
299
+ npm install -g pi-spine@<version>
300
+ spine version
301
+ spine doctor
302
+ ```
303
+
304
+ Update `spine-tasks/CONTEXT.md` release note (version + date).
305
+
306
+ Close GitHub issues where tasks had `Closes: #NNN` and work shipped.
307
+
308
+ ---
309
+
310
+ ## Final report (required)
311
+
312
+ 1. **Release manifest** — path, target version, profile, composition table
313
+ 2. **Tasks completed** — SP-IDs, waves, issues closed
314
+ 3. **Deferred backlog** — count and top items for next release
315
+ 4. **Authoring changes** — new SP-* created, splits/fixes in Phase 3
316
+ 5. **Issues filed** — pi-spine GitHub links or "none"
317
+ 6. **Recovery actions** — aborts, retries, contract fixes
318
+ 7. **Verification** — paste `spine preflight` tail, test/coverage output
319
+ 8. **Publish** — version bumped (Y/N), tag pushed (Y/N), workflow URL, or "awaiting operator approval"
320
+
321
+ ---
322
+
323
+ ## Repo-specific notes (pi-spine)
324
+
325
+ | Item | Value |
326
+ |------|-------|
327
+ | Tasks root | `spine-tasks/` |
328
+ | Issues repo | `beettlle/pi-spine` |
329
+ | Pre-publish gate | `npm run release:check` (typecheck → lint → tests → coverage; CI parity) |
330
+ | Publish | Tag-triggered `.github/workflows/release.yml` |
331
+ | Pending backlog | Run `spine plan pending` — release executes **subset only** |
332
+
333
+ ## Short prompt (resume mid-release)
334
+
335
+ ```text
336
+ Resume spine release v{TARGET}: check manifest at spine-tasks/_authoring/release-v{TARGET}/manifest.md →
337
+ verify remaining scope → preflight → for each wave: batch start --attached → diagnose →
338
+ gate approve → integrate → npm install → batch complete →
339
+ when scope done: tests + preflight → STOP for publish approval.
340
+ Post final report with composition table.
341
+ ```
@@ -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)
@@ -0,0 +1,76 @@
1
+ # Release manifest — v{TARGET_VERSION}
2
+
3
+ **Created:** {YYYY-MM-DD}
4
+ **Current version:** {from package.json}
5
+ **Target version:** v{TARGET_VERSION}
6
+ **Bump type:** patch | minor | major
7
+ **Profile:** patch | minor | major
8
+ **Operator approved scope:** no | yes ({date})
9
+
10
+ ---
11
+
12
+ ## Composition audit
13
+
14
+ | Bucket | Selected | Profile limit | Status |
15
+ |--------|----------|---------------|--------|
16
+ | Documentation | {n} | {profile limit} | PASS / WARN |
17
+ | Bug fixes | {n} | 3–5 | PASS / WARN |
18
+ | Enhancements | {n} | {profile limit} | PASS / WARN |
19
+ | **Total tasks** | {n} | {profile cap} | PASS / WARN |
20
+
21
+ **Profile audit:** PASS | PASS with operator override | FAIL (do not proceed)
22
+
23
+ ---
24
+
25
+ ## Selected tasks
26
+
27
+ | SP-ID | Issue | Bucket | Size | Title | Notes |
28
+ |-------|-------|--------|------|-------|-------|
29
+ | SP-### | #NNN | doc / bug / enh | S/M | … | Closes / Partial |
30
+
31
+ **Release scope ID:** comma-separated SP-IDs for `spine plan` / `spine batch start` (e.g. `SP-483,SP-460,SP-438`)
32
+
33
+ ---
34
+
35
+ ## Gaps requiring new packets
36
+
37
+ | Issue | Bucket | Proposed SP-ID | Author with |
38
+ |-------|--------|----------------|-------------|
39
+ | #90 | doc | SP-### | create-spine-tasks (lean) |
40
+
41
+ ---
42
+
43
+ ## Wave plan snapshot
44
+
45
+ ```text
46
+ (paste output of: spine plan <release-scope>)
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Deferred backlog
52
+
53
+ | Item | Type | Rationale |
54
+ |------|------|-----------|
55
+ | SP-### / #NNN | enh | Exceeds patch profile; defer to v1.6.0 |
56
+ | #117 | epic | v2.3 module split — out of minor scope |
57
+
58
+ ---
59
+
60
+ ## Risks and blockers
61
+
62
+ - {e.g. 7 M-sized tasks in full pending plan — release scope excludes them}
63
+ - {e.g. #156 release CI gate — separate enhancement}
64
+
65
+ ---
66
+
67
+ ## Publish checklist (Phase 5–6)
68
+
69
+ - [ ] All release-scoped tasks `.DONE` on `main`
70
+ - [ ] `spine preflight` green
71
+ - [ ] `npm run release:check` green (typecheck, lint, tests, coverage — CI parity)
72
+ - [ ] `git status` clean
73
+ - [ ] Operator approved publish bump type: patch | minor | major
74
+ - [ ] `npm version <bump>` + `git push && git push --tags`
75
+ - [ ] `release.yml` succeeded
76
+ - [ ] Post-publish smoke per `docs/release/npm-publish.md`
@@ -0,0 +1,100 @@
1
+ # Release profiles (semver-driven scope)
2
+
3
+ Use at **Phase 2** after parsing the operator's target version. Compare `package.json` version to the target to derive bump type.
4
+
5
+ ## Derive bump type
6
+
7
+ | Current → Target | Bump type | Profile |
8
+ |------------------|-----------|---------|
9
+ | `1.5.0` → `1.5.1` | **patch** | `patch` |
10
+ | `1.5.0` → `1.6.0` | **minor** | `minor` |
11
+ | `1.5.0` → `2.0.0` | **major** | `major` |
12
+
13
+ If the operator says only `patch` / `minor` / `major` without a version, compute the next version from `package.json` and record both in the manifest.
14
+
15
+ ## Invocation parsing
16
+
17
+ | Operator says | Profile |
18
+ |---------------|---------|
19
+ | "release for v1.5.1", "patch release", "hotfix release" | `patch` |
20
+ | "release for v1.6.0", "minor release", "feature release" | `minor` |
21
+ | "release for v2.0.0", "major release", "breaking release" | `major` |
22
+ | "run a spine release cycle" (no version) | **Ask** operator for target version or bump type |
23
+
24
+ ## Profile budgets
25
+
26
+ ### Patch (`patch`)
27
+
28
+ Stability and correctness focus. Smallest release window.
29
+
30
+ | Bucket | Target | Hard limits |
31
+ |--------|--------|-------------|
32
+ | Documentation | 1–2 small fixes/clarifications | No new feature docs; defer large doc epics |
33
+ | Bug fixes | 3–5 | Primary focus; prefer S-sized |
34
+ | Enhancements | **0** | Defer all; warn if operator insists without override |
35
+ | Total tasks | **5–8** | Warn if >8 without override |
36
+ | Max waves | 1–2 | Prefer single wave when possible |
37
+ | Task sizes | **S only** | Split any M/L before inclusion |
38
+
39
+ **Defer by default:** all enhancements, M/L tasks, epics, roadmap items, skill authoring clusters unless trivial typo fixes.
40
+
41
+ ### Minor (`minor`)
42
+
43
+ Balance new capability with stability.
44
+
45
+ | Bucket | Target | Hard limits |
46
+ |--------|--------|-------------|
47
+ | Documentation | 2–4 | Include docs for the chosen enhancement |
48
+ | Bug fixes | 3–5 | Same as patch |
49
+ | Enhancements | **1–2** | At most one M if split into safe waves |
50
+ | Total tasks | **10–15** | Warn if >15 without override |
51
+ | Max waves | 2–4 | ≤4 M-sized tasks per wave |
52
+ | Task sizes | S/M | Split L/XL before inclusion |
53
+
54
+ **Defer by default:** epics (#117 v2.3 module split), multi-enhancement batches, tasks requiring >4 waves.
55
+
56
+ ### Major (`major`)
57
+
58
+ Breaking changes and large migrations. Operator-defined epic scope.
59
+
60
+ | Bucket | Target | Hard limits |
61
+ |--------|--------|-------------|
62
+ | Documentation | Migration guides + comprehensive pass | Required for breaking changes |
63
+ | Bug fixes | 3–5 critical | Prioritize regressions blocking migration |
64
+ | Enhancements | Multiple allowed | Breaking API changes OK with migration path |
65
+ | Total tasks | Operator-defined | Manifest must list explicit epic boundaries |
66
+ | Max waves | Planned in manifest | Expect multi-cycle execution |
67
+
68
+ **Require:** explicit operator approval of epic scope before Phase 3. Do not auto-select major scope from backlog alone.
69
+
70
+ ## Selection order (all profiles)
71
+
72
+ Apply in this order; stop when profile budget is full:
73
+
74
+ 1. **Documentation** — `label:documentation`, `skill:create-spine-tasks` doc issues, pending docs-only SP-* tasks
75
+ 2. **Bug fixes** — open `label:bug` with user impact; prefer already-tasked or quick S
76
+ 3. **Enhancements** — only if profile allows; one user-visible improvement per minor release
77
+
78
+ ## Profile audit (must pass before Phase 3)
79
+
80
+ Fill the composition audit table in the manifest. Fail or warn when:
81
+
82
+ | Check | Patch | Minor | Major |
83
+ |-------|-------|-------|-------|
84
+ | Enhancement count | >0 without override | >2 without override | — |
85
+ | Bug count | <3 or >5 without override | <3 or >5 without override | <3 without override |
86
+ | Total tasks | >8 without override | >15 without override | — |
87
+ | M/L tasks in patch | any without override | — | — |
88
+ | Doc paths in File Scope | required for doc tasks (#144) | required | required |
89
+
90
+ Record `Profile audit: PASS` or `PASS with operator override` before proceeding.
91
+
92
+ ## Version ↔ publish alignment
93
+
94
+ The bump type chosen in Phase 2 must match `npm version` in Phase 6:
95
+
96
+ - `patch` profile → `npm version patch`
97
+ - `minor` profile → `npm version minor`
98
+ - `major` profile → `npm version major`
99
+
100
+ If the operator changes bump type at publish gate, update the manifest and confirm scope still fits the new profile.