pi-spine 2.0.0 → 2.1.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-cleanup.mjs +89 -0
- package/bin/spine-doctor.mjs +8 -0
- package/bin/spine.mjs +13 -0
- package/package.json +4 -1
- package/skills/create-spine-tasks/SKILL.md +28 -0
- package/skills/create-spine-tasks/references/contract-template.md +11 -0
- package/skills/create-spine-tasks/references/prompt-template.md +7 -1
- package/skills/spine-autonomous-operator/SKILL.md +19 -3
- package/skills/spine-autonomous-operator/references/agent-shell-batch-policy.md +18 -0
- package/skills/spine-orchestrate-waves/SKILL.md +9 -2
- package/skills/spine-orchestrate-waves/references/outer-loop.md +24 -2
- package/skills/spine-release-operator/SKILL.md +25 -2
- package/skills/spine-release-operator/references/post-integrate-regression-gate.md +96 -0
- package/skills/spine-release-operator/references/release-manifest-template.md +7 -3
- package/src/batch/abort.mjs +10 -14
- package/src/batch/diagnosis-merge-failure.mjs +66 -0
- package/src/batch/diagnosis-parent-exit.mjs +125 -0
- package/src/batch/diagnosis.mjs +26 -73
- package/src/batch/lane-dirty-check.mjs +10 -0
- package/src/batch/lifecycle.mjs +1 -18
- package/src/batch/reconcile.mjs +11 -0
- package/src/batch/review.mjs +20 -0
- package/src/batch/worktree.mjs +130 -1
- package/src/config/preflight/git-batch.mjs +14 -3
- package/src/doctor/duplicate-install.mjs +148 -0
- package/src/doctor/pi-cli-resolution.mjs +222 -0
- package/src/doctor/run-doctor-checks.mjs +4 -0
- package/src/doctor/stale-worktrees.mjs +1 -1
- package/src/tasks/packet/parse-prompt.mjs +29 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `spine cleanup worktrees` — prune stale batch dirs and dangling git worktree refs (#169).
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { pruneStaleWorktrees, scanStaleWorktrees } from "../src/batch/worktree.mjs";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @param {object} params
|
|
9
|
+
* @param {string} params.projectRoot
|
|
10
|
+
* @param {string[]} params.args
|
|
11
|
+
*/
|
|
12
|
+
export function runSpineCleanup({ projectRoot, args }) {
|
|
13
|
+
const subcommand = args[0];
|
|
14
|
+
if (subcommand !== "worktrees") {
|
|
15
|
+
return {
|
|
16
|
+
exitCode: 1,
|
|
17
|
+
output:
|
|
18
|
+
"Usage: spine cleanup worktrees [--dry-run] [--yes] [--json]\n" +
|
|
19
|
+
" --dry-run List stale batch dirs and dangling worktree refs (default without --yes)\n" +
|
|
20
|
+
" --yes Remove empty batch shells and run git worktree prune\n" +
|
|
21
|
+
" --json Emit machine-readable output\n",
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const dryRun = args.includes("--dry-run") || !args.includes("--yes");
|
|
26
|
+
const json = args.includes("--json");
|
|
27
|
+
|
|
28
|
+
if (dryRun) {
|
|
29
|
+
const scan = scanStaleWorktrees(projectRoot);
|
|
30
|
+
if (json) {
|
|
31
|
+
return {
|
|
32
|
+
exitCode: 0,
|
|
33
|
+
output: `${JSON.stringify({ action: "dry-run", ...scan }, null, 2)}\n`,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const lines = [];
|
|
38
|
+
if (scan.batchIds.length === 0) {
|
|
39
|
+
lines.push("No stale spine batch worktree dirs found.");
|
|
40
|
+
} else {
|
|
41
|
+
lines.push(`Stale batch dirs (${scan.batchIds.length}):`);
|
|
42
|
+
for (const batchId of scan.batchIds) {
|
|
43
|
+
const suffix = scan.emptyShells.includes(batchId) ? " (empty shell)" : "";
|
|
44
|
+
lines.push(` .worktrees/spine-${batchId}${suffix}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (scan.danglingWorktrees.length > 0) {
|
|
49
|
+
lines.push(`Dangling worktree refs (${scan.danglingWorktrees.length}):`);
|
|
50
|
+
for (const entry of scan.danglingWorktrees) {
|
|
51
|
+
lines.push(` ${entry}`);
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
lines.push("No dangling worktree refs to prune.");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
lines.push("Run with --yes to remove empty shells and git worktree prune.");
|
|
58
|
+
return { exitCode: 0, output: `${lines.join("\n")}\n` };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const result = pruneStaleWorktrees(projectRoot, { dryRun: false });
|
|
62
|
+
if (json) {
|
|
63
|
+
return {
|
|
64
|
+
exitCode: 0,
|
|
65
|
+
output: `${JSON.stringify({ action: "prune", ...result }, null, 2)}\n`,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const lines = [];
|
|
70
|
+
if (result.removedShells.length === 0) {
|
|
71
|
+
lines.push("No empty batch shells removed.");
|
|
72
|
+
} else {
|
|
73
|
+
lines.push(`Removed empty batch shells (${result.removedShells.length}):`);
|
|
74
|
+
for (const batchId of result.removedShells) {
|
|
75
|
+
lines.push(` .worktrees/spine-${batchId}/`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (result.prunedWorktrees.length === 0) {
|
|
80
|
+
lines.push("git worktree prune: nothing to prune.");
|
|
81
|
+
} else {
|
|
82
|
+
lines.push(`git worktree prune (${result.prunedWorktrees.length}):`);
|
|
83
|
+
for (const entry of result.prunedWorktrees) {
|
|
84
|
+
lines.push(` ${entry}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return { exitCode: 0, output: `${lines.join("\n")}\n` };
|
|
89
|
+
}
|
package/bin/spine-doctor.mjs
CHANGED
|
@@ -15,6 +15,14 @@ export {
|
|
|
15
15
|
buildAttachedOrphanRiskDoctorCheck,
|
|
16
16
|
detectAttachedOrphanRiskPatterns,
|
|
17
17
|
} from "../src/doctor/attached-orphan-risk.mjs";
|
|
18
|
+
export {
|
|
19
|
+
buildDuplicateInstallDoctorCheck,
|
|
20
|
+
detectDuplicatePiSpineInstall,
|
|
21
|
+
} from "../src/doctor/duplicate-install.mjs";
|
|
22
|
+
export {
|
|
23
|
+
buildPiCliResolutionDoctorCheck,
|
|
24
|
+
resolveAuthoritativePiCliPath,
|
|
25
|
+
} from "../src/doctor/pi-cli-resolution.mjs";
|
|
18
26
|
export { buildTestingEvidenceDoctorChecks, runDoctorChecks } from "../src/doctor/run-doctor-checks.mjs";
|
|
19
27
|
|
|
20
28
|
export function cmdDoctor() {
|
package/bin/spine.mjs
CHANGED
|
@@ -95,6 +95,13 @@ async function cmdSyncBase(args) {
|
|
|
95
95
|
if (result.exitCode !== 0) process.exit(result.exitCode);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
async function cmdCleanup(args) {
|
|
99
|
+
const { runSpineCleanup } = await import("./spine-cleanup.mjs");
|
|
100
|
+
const result = runSpineCleanup({ projectRoot: process.cwd(), args });
|
|
101
|
+
process.stdout.write(result.output ?? "");
|
|
102
|
+
if (result.exitCode !== 0) process.exit(result.exitCode);
|
|
103
|
+
}
|
|
104
|
+
|
|
98
105
|
async function cmdVerify(args) {
|
|
99
106
|
const { runSpineVerify } = await import("./spine-cli/verify.mjs");
|
|
100
107
|
const result = runSpineVerify({ projectRoot: process.cwd(), args });
|
|
@@ -267,6 +274,7 @@ ${c.bold}Commands:${c.reset}
|
|
|
267
274
|
${c.cyan}report progress${c.reset} Emit task.step_completed to batch journal (FR-WORK-09)
|
|
268
275
|
${c.cyan}gate${c.reset} Inspect or resolve integrate gate (FR-GATE)
|
|
269
276
|
${c.cyan}integrate${c.reset} Merge orch branch into base (FR-INT-01)
|
|
277
|
+
${c.cyan}cleanup${c.reset} Prune stale worktree dirs and dangling refs
|
|
270
278
|
${c.cyan}sync-base${c.reset} Sync human checkout after isolated integrate (FR-WT-08)
|
|
271
279
|
${c.cyan}verify${c.reset} Phase exit verification checklists
|
|
272
280
|
${c.cyan}journal${c.reset} Replay orchestration journal timeline
|
|
@@ -326,6 +334,8 @@ ${c.bold}Examples:${c.reset}
|
|
|
326
334
|
spine gate [approve|reject|status] # integrate gate FSM
|
|
327
335
|
spine integrate [--dry-run] [--force-integrate] # merge orch branch into main
|
|
328
336
|
spine sync-base [--dry-run] [--json] # sync checkout after isolated land
|
|
337
|
+
spine cleanup worktrees --dry-run # list stale batch dirs / dangling refs
|
|
338
|
+
spine cleanup worktrees --yes # remove empty shells + git worktree prune
|
|
329
339
|
spine journal replay --batch 20260601T120000 # audit timeline for a batch
|
|
330
340
|
spine state validate # validate active batch-state.json
|
|
331
341
|
spine next # suggested next command (dry-run)
|
|
@@ -427,6 +437,9 @@ if (isCliEntrypoint(import.meta.url)) {
|
|
|
427
437
|
case "integrate":
|
|
428
438
|
await handleIntegrate(args);
|
|
429
439
|
break;
|
|
440
|
+
case "cleanup":
|
|
441
|
+
await cmdCleanup(args);
|
|
442
|
+
break;
|
|
430
443
|
case "sync-base":
|
|
431
444
|
await cmdSyncBase(args);
|
|
432
445
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-spine",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Orchestration spine for long-running pi development",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -32,12 +32,15 @@
|
|
|
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
|
+
"verify:reconcile-fixtures": "node scripts/verify-reconcile-test-fixtures.mjs",
|
|
36
|
+
"pretest": "npm run verify:reconcile-fixtures",
|
|
35
37
|
"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
38
|
"test:batch": "SPINE_SUPPRESS_JOURNAL_ATTACH=1 node --experimental-strip-types --test tests/batch/*.test.mjs",
|
|
37
39
|
"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
40
|
"test:coverage": "node scripts/run-coverage.mjs --report-only",
|
|
39
41
|
"coverage:check": "node scripts/run-coverage.mjs",
|
|
40
42
|
"release:check": "npm run typecheck && npm run lint && SPINE_WORKER_STUB=1 npm test && npm run coverage:check",
|
|
43
|
+
"preversion": "npm run release:check",
|
|
41
44
|
"prepublishOnly": "npm run release:check"
|
|
42
45
|
},
|
|
43
46
|
"repository": {
|
|
@@ -188,6 +188,7 @@ Run **after Step A.5 — Clarify** and **before Step B — Slice**. Authoring-on
|
|
|
188
188
|
|------|----------|
|
|
189
189
|
| **Size** | Target **M** (2–4 h). **L** → split when possible. **XL** → **must** split into multiple S/M tasks with dependencies. |
|
|
190
190
|
| **Steps** | Max **4** implementation steps per task (exclude Testing & Verification / Documentation & Delivery). More steps → split. |
|
|
191
|
+
| **Step numbering** | Number steps sequentially starting at 0 with **no duplicates** (`### Step N:`). `spine tasks validate` rejects duplicate step numbers (see issue #148 / SP-435). |
|
|
191
192
|
| **Two-deliverable test** | If your Steps can be grouped into two clusters with no data dependency between them, split into separate tasks even if the step count is ≤4. The #1 sizing mistake is bundling two independent deliverables in one M task. |
|
|
192
193
|
| **Parallel waves** | Prefer **≤4** M-sized tasks per wave; 8-task mega-waves stall pi workers (see Phase 15 / SP-086–088). |
|
|
193
194
|
| **Scope** | One deliverable per task; disjoint **File Scope** when tasks can run in parallel. |
|
|
@@ -337,6 +338,8 @@ In pi: `/spine-plan pending` then `/spine SP-042` (single-task) or `spine batch
|
|
|
337
338
|
| 2 | Plan + Code | Plan + code review at step boundaries |
|
|
338
339
|
| 3 | Full | Plan + code + test review |
|
|
339
340
|
|
|
341
|
+
**Environment compatibility ([#150](https://github.com/beettlle/pi-spine/issues/150)):** Review Level **2+** requires cross-model reviewer support in the execution environment. If running `SPINE_WORKER_STUB=1`, reviews are simulated — do not assign Level 2+ for tasks that need real cross-model review unless the operator has verified environment capability (preflight / batch config). Level 2+ in an unsupported environment can stall or kill lanes (e.g. SP-190 review spawn failure).
|
|
342
|
+
|
|
340
343
|
Workers call **`spine_review_step`** (Pi tool) or `spine review step --step N [--type plan|code]`.
|
|
341
344
|
|
|
342
345
|
When Review Level ≥ 1 (v1.3), workers also run a **final** review (`--type final`) before `.DONE`. Verdicts: `PASS`, `REVISE`, or `REPLAN` (scope wrong — operator edits PROMPT then retries). See [PRD v1.3](../docs/PRD-v1.3-upstream-execution-bridge.md) FR-UXB-04.
|
|
@@ -397,6 +400,14 @@ Individual steps can override the task-level review:
|
|
|
397
400
|
|
|
398
401
|
Populate "Context to Read First" from `referenceDocs` in spine config. Never list docs in `neverLoad`.
|
|
399
402
|
|
|
403
|
+
**Parent split (successor tasks — [#146](https://github.com/beettlle/pi-spine/issues/146)):** When this task is a child of a superseded parent (e.g. SP-419 split into SP-466 + SP-467), add a line in **Context to Read First**:
|
|
404
|
+
|
|
405
|
+
```markdown
|
|
406
|
+
- `Parent split: SP-### — [what was split out]`
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Example: SP-466 lists `Parent split: SP-419 — API schema types` so reviewers can trace decomposition history.
|
|
410
|
+
|
|
400
411
|
When authoring tasks for Cursor-based repos, **File Scope drives glob-matched worker rules** — include concrete paths (e.g. `src/**/*.mjs`, not only `src/`) so language packs activate. The same File Scope applies to **plan review** rule matching; code reviews match globs against changed diff paths instead. Preview worker selection with `spine rules select --task <id>`; preview reviewer selection with `spine rules select --role reviewer --review-type plan|code|final --task <id>`. See [docs/design/cursor-rules-discovery.md](../../docs/design/cursor-rules-discovery.md).
|
|
401
412
|
|
|
402
413
|
---
|
|
@@ -501,6 +512,16 @@ Docs-only tasks still include `### Step N: Testing & Verification` (full suite i
|
|
|
501
512
|
|
|
502
513
|
Do **not** generate Taskplane polyrepo **`#### Segment: <repoId>`** markers — pi-spine is monorepo-only (PRD §13.2). Split multi-repo work into separate tasks with dependencies instead.
|
|
503
514
|
|
|
515
|
+
## Do NOT (worker scope — include in every PROMPT)
|
|
516
|
+
|
|
517
|
+
Workers must **not** modify paths maintained by other processes ([#149](https://github.com/beettlle/pi-spine/issues/149)):
|
|
518
|
+
|
|
519
|
+
- `.spine/` — spine engine config, runtime, rules manifest
|
|
520
|
+
- `AGENTS.md`, `CLAUDE.md` — GitNexus / agent harness indexes
|
|
521
|
+
- `.gitnexus/` — code intelligence index
|
|
522
|
+
|
|
523
|
+
Include these in every packet's `## Do NOT` section. Workers editing these paths cause merge dirty-file failures (e.g. batch `20260703T051629`).
|
|
524
|
+
|
|
504
525
|
---
|
|
505
526
|
|
|
506
527
|
## Checklist (Definition of Ready)
|
|
@@ -513,10 +534,15 @@ Before reporting launch commands:
|
|
|
513
534
|
- [ ] Complexity scored; review level assigned (0–3)
|
|
514
535
|
- [ ] Size S/M/L — split if XL
|
|
515
536
|
- [ ] PROMPT.md from template: Mission, Dependencies, Context, File Scope, Contract (SP-\*), Steps, Do NOT, Git Commit Convention, Amendments
|
|
537
|
+
- [ ] Mission uses `Closes #N` or `Partial #N` on first line when tracking GitHub issues ([#147](https://github.com/beettlle/pi-spine/issues/147))
|
|
538
|
+
- [ ] Split-successor tasks include `Parent split: SP-###` in Context to Read First ([#146](https://github.com/beettlle/pi-spine/issues/146))
|
|
539
|
+
- [ ] `## Do NOT` bans `.spine/`, `AGENTS.md`, `CLAUDE.md`, `.gitnexus/` ([#149](https://github.com/beettlle/pi-spine/issues/149))
|
|
540
|
+
- [ ] Level 2+ only when operator environment supports cross-model review ([#150](https://github.com/beettlle/pi-spine/issues/150))
|
|
516
541
|
- [ ] If `testCommand` is `` `true` ``, `fileScopeMustChange` MUST list at least one deliverable path
|
|
517
542
|
- [ ] Every **Must Update** doc path also appears in `## File Scope` ([#144](https://github.com/beettlle/pi-spine/issues/144))
|
|
518
543
|
- [ ] Docs-only tasks: consider `fileScopeMustNotChange` on `src/**`, `bin/**` ([#142](https://github.com/beettlle/pi-spine/issues/142)); see [Docs-only contract pattern](#docs-only-contract-pattern-fr-sta-12)
|
|
519
544
|
- [ ] S/M patch Contract uses scoped `node --test` — not `npm test` or `npm test -- path` ([#141](https://github.com/beettlle/pi-spine/issues/141), SP-522)
|
|
545
|
+
- [ ] Shared-module behavior change: `rg` old strings in `tests/`; all hit files in `testCommand` or documented for post-integrate `release:check` ([post-integrate-regression-gate.md](../spine-release-operator/references/post-integrate-regression-gate.md))
|
|
520
546
|
- [ ] Plan waves ≤8 tasks when possible — `spine plan` warns when exceeded ([#143](https://github.com/beettlle/pi-spine/issues/143), SP-524)
|
|
521
547
|
- [ ] `### Step N: Testing & Verification` present inside `## Steps` before `## Completion Criteria` (required even for docs-only Review Level 0)
|
|
522
548
|
- [ ] STATUS.md with matching steps (hydration markers where needed)
|
|
@@ -542,7 +568,9 @@ Hydration commits (STATUS.md expansions) may happen mid-step for crash recovery.
|
|
|
542
568
|
## Key Principles
|
|
543
569
|
|
|
544
570
|
- **Self-contained PROMPT.md** — the worker has no memory of this conversation. Cross-model reviewers receive a **fresh spawn** (FR-REV-04) with only the review request, diff, and Contract — not `referenceDocs` or worker rules. Place acceptance criteria and spec references in PROMPT `## Mission`, `## Contract`, and step checkboxes.
|
|
571
|
+
- **Issue links in Mission ([#147](https://github.com/beettlle/pi-spine/issues/147))** — Use `Closes #N` when this task fully resolves the issue. Use `Partial #N` when this task is one of several addressing the issue. Place on the first line of `## Mission` (not `Closes: [#N]` or `GitHub: [#N]` variants).
|
|
545
572
|
- **Scoped `testCommand` for cross-model batches** — lane worktrees differ from dev checkouts; broad `flutter test` / `npm test` can fail in lanes even when targeted tests pass. See [cross-model authoring guidance](references/contract-template.md#cross-model-authoring-worker--reviewer) for the `testCommand` decision table.
|
|
573
|
+
- **Scoped contract ≠ full regression** — changing shared modules (diagnosis, reconcile, parse-prompt) can break tests outside the task's scoped `testCommand`. Authors must `rg` old strings in `tests/` and include related test files in Contract, or rely on operator post-integrate `release:check` on `main` ([post-integrate-regression-gate.md](../spine-release-operator/references/post-integrate-regression-gate.md)).
|
|
546
574
|
- **S/M patch tasks: no coverage gate in Contract** — do not chain `npm run coverage:check` or bare `npm test` in `## Contract` `testCommand` on Size S/M tasks; integrate gate owns full coverage at merge. Use scoped `node --test path/to.test.mjs` (SP-521 / [#141](https://github.com/beettlle/pi-spine/issues/141)). `spine tasks validate` warns when violated.
|
|
547
575
|
- **Testing step required (never omit)** — every task packet needs `### Step N: Testing & Verification` inside `## Steps`, before `## Completion Criteria`. **Do not skip this for docs-only or Review Level 0 tasks** — the worker rejects packets without a Testing step. Use `testing.test` from spine config; for **code deliverables**, also include `testing.testWithCoverage` and a **≥77% line coverage** checkbox (see prompt template). Docs-only tasks may omit the coverage checkbox.
|
|
548
576
|
- **Documentation in every task** — "Must Update" / "Check If Affected" prevent doc drift.
|
|
@@ -223,10 +223,21 @@ Reviewers spawn as **fresh sessions** with no memory of the worker session (FR-R
|
|
|
223
223
|
|-----------|---------------------------|
|
|
224
224
|
| Docs-only, no code changes | `` `true` `` **and** `fileScopeMustChange` with at least one deliverable doc path |
|
|
225
225
|
| Single module, targeted tests exist | `` `node --test tests/feature.test.mjs` `` or `` `flutter test test/unit/services/foo_test.dart` `` |
|
|
226
|
+
| **Shared-module behavior change** (diagnosis, reconcile, parse-prompt, worktree, doctor) | Chain **all** related `tests/**/*.test.mjs` from `rg` for old strings — not only the new test file (see below) |
|
|
226
227
|
| Full-suite safe in lane worktree | `` `npm run typecheck && SPINE_WORKER_STUB=1 npm test` `` |
|
|
227
228
|
| Coverage gate required (pi-spine ≥77%) | `` `npm run coverage:check` `` |
|
|
228
229
|
| Long external job (>2h) | Scoped command + `stallTimeoutMinutes` and `extendGraceOnFileScope` in Contract (see SP-314 example above) |
|
|
229
230
|
|
|
231
|
+
### Shared-module behavior changes
|
|
232
|
+
|
|
233
|
+
When `fileScopeMustChange` touches modules whose output is asserted across multiple test files (e.g. `src/batch/diagnosis*.mjs`, `src/batch/reconcile.mjs`, `src/tasks/packet/parse-prompt.mjs`, `src/batch/worktree.mjs`, `bin/spine-doctor.mjs`):
|
|
234
|
+
|
|
235
|
+
1. Before finalizing Contract, run `rg -l 'old headline|old error phrase' tests/` for strings being replaced.
|
|
236
|
+
2. Include **every** hit file in `testCommand` (chain with `&&`), or document why post-integrate `release:check` on `main` will cover them ([post-integrate-regression-gate.md](../../spine-release-operator/references/post-integrate-regression-gate.md)).
|
|
237
|
+
3. List discovered test files in the Testing step checkboxes.
|
|
238
|
+
|
|
239
|
+
**Anti-pattern:** New test file only in `testCommand` while older tests still assert previous behavior (SP-560 / `detached-start-orphan-timeout.test.mjs` vs `diagnosis-parent-exit.test.mjs`).
|
|
240
|
+
|
|
230
241
|
---
|
|
231
242
|
|
|
232
243
|
## Validate before plan
|
|
@@ -20,9 +20,13 @@ Review Level 0 is ONLY for trivial changes. Most M+ tasks need Level ≥1.
|
|
|
20
20
|
|
|
21
21
|
> **Real-pi batches (SP-195/SP-278):** Do **not** add per-step "Call `spine_review_step`" checkboxes for Review Level ≥ 1. The batch engine runs plan, code, and final reviews after worker `.DONE`. Stub batches (`SPINE_WORKER_STUB=1`) may still use in-worker stub plan review via the tool when a checkpoint marker requires it.
|
|
22
22
|
|
|
23
|
+
> **Environment ([#150](https://github.com/beettlle/pi-spine/issues/150)):** Review Level **2+** requires cross-model reviewer support. `SPINE_WORKER_STUB=1` simulates reviews only — verify operator environment before assigning Level 2+.
|
|
24
|
+
|
|
23
25
|
## Mission
|
|
24
26
|
|
|
25
|
-
[
|
|
27
|
+
> **Issue links ([#147](https://github.com/beettlle/pi-spine/issues/147)):** Use `Closes #N` when this task fully resolves the issue. Use `Partial #N` when this task is one of several addressing the issue. Place on the first line below (not `Closes: [#N]` or `GitHub: [#N]` variants).
|
|
28
|
+
|
|
29
|
+
[Closes #N | Partial #N] — [One paragraph: what you're building and why it matters]
|
|
26
30
|
|
|
27
31
|
## Dependencies
|
|
28
32
|
|
|
@@ -42,6 +46,7 @@ Review Level 0 is ONLY for trivial changes. Most M+ tasks need Level ≥1.
|
|
|
42
46
|
|
|
43
47
|
- `[path/to/CONTEXT.md]`
|
|
44
48
|
- `[path/to/specific-doc.md]` — [why needed]
|
|
49
|
+
- `Parent split: SP-### — [what was split out]` — **successor tasks only** ([#146](https://github.com/beettlle/pi-spine/issues/146)); omit when not a split child
|
|
45
50
|
|
|
46
51
|
## Environment
|
|
47
52
|
|
|
@@ -156,6 +161,7 @@ for this task MUST include the task ID for traceability:
|
|
|
156
161
|
- Modify framework/standards docs without explicit user approval
|
|
157
162
|
- Load docs not listed in "Context to Read First"
|
|
158
163
|
- Commit without the task ID prefix in the commit message
|
|
164
|
+
- Modify `.spine/`, `AGENTS.md`, `CLAUDE.md`, or `.gitnexus/` — maintained by spine engine / GitNexus ([#149](https://github.com/beettlle/pi-spine/issues/149))
|
|
159
165
|
|
|
160
166
|
---
|
|
161
167
|
|
|
@@ -29,6 +29,8 @@ Invoke explicitly: `/skill:spine-autonomous-operator`
|
|
|
29
29
|
- **Always** use `spine status --diagnose` for recovery; follow `suggestedCommand`
|
|
30
30
|
- **Always** run `spine gate approve` before `spine integrate`
|
|
31
31
|
- **Always** run `npm install` on `main` after successful integrate
|
|
32
|
+
- **Always** run post-integrate `npm run release:check` on `main` after each wave land loop before the next wave — see [post-integrate-regression-gate.md](../spine-release-operator/references/post-integrate-regression-gate.md)
|
|
33
|
+
- **Never** use `| tail` or `| head` alone to judge `release:check` pass/fail — verify exit code
|
|
32
34
|
- **Do not** use unattended `spine run sequence --auto-approve-gate --force` without monitoring
|
|
33
35
|
- **Do not** start a second batch while another batch is **running** on the same repo
|
|
34
36
|
- **Never** background `spine batch resume --attached` or `resume --attached --force` ([#163](https://github.com/beettlle/pi-spine/issues/163))
|
|
@@ -190,6 +192,19 @@ git add spine-tasks/*/.DONE 2>/dev/null; git commit -m "chore: track .DONE for w
|
|
|
190
192
|
|
|
191
193
|
Verify: `git status` clean, `.DONE` count increased.
|
|
192
194
|
|
|
195
|
+
### 3.3a Post-integrate regression gate (blocking)
|
|
196
|
+
|
|
197
|
+
After **every** land loop (including manual merge), on current `main`:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
npm run release:check 2>&1 | tee /tmp/pi-spine-post-integrate-wave-${N}.log
|
|
201
|
+
test "${PIPESTATUS[0]}" -eq 0
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Full reference: [post-integrate-regression-gate.md](../spine-release-operator/references/post-integrate-regression-gate.md).
|
|
205
|
+
|
|
206
|
+
**If non-zero:** fix on `main`, commit, re-run. Do **not** start wave N+1 until green.
|
|
207
|
+
|
|
193
208
|
### 3.4 Advance
|
|
194
209
|
|
|
195
210
|
Increment `N` and repeat.
|
|
@@ -245,11 +260,12 @@ See [references/issue-template.md](references/issue-template.md) for a full temp
|
|
|
245
260
|
spine plan pending
|
|
246
261
|
spine preflight
|
|
247
262
|
git status
|
|
248
|
-
npm run release:check
|
|
263
|
+
npm run release:check 2>&1 | tee /tmp/pi-spine-release-check.log
|
|
264
|
+
test "${PIPESTATUS[0]}" -eq 0
|
|
249
265
|
find spine-tasks -name '.DONE' | wc -l
|
|
250
266
|
```
|
|
251
267
|
|
|
252
|
-
In pi sessions, `MonitorCreate` for `npm run release:check` is allowed (see pi-async-orchestration).
|
|
268
|
+
In pi sessions, `MonitorCreate` for `npm run release:check` is allowed (see pi-async-orchestration). Verify exit 0 from full log — not `tail` alone.
|
|
253
269
|
|
|
254
270
|
## Final report (required)
|
|
255
271
|
|
|
@@ -273,7 +289,7 @@ In pi sessions, `MonitorCreate` for `npm run release:check` is allowed (see pi-a
|
|
|
273
289
|
```text
|
|
274
290
|
Run pending spine tasks: validate/analyze/plan → fix packets → preflight →
|
|
275
291
|
for each wave: MonitorCreate batch start (or foreground) → diagnose →
|
|
276
|
-
gate approve → integrate → npm install → batch complete.
|
|
292
|
+
gate approve → integrate → npm install → batch complete → post-integrate release:check (exit 0).
|
|
277
293
|
Resume --attached --force stays foreground. File pi-spine bugs on engine faults.
|
|
278
294
|
Done when 0 pending, preflight green, release:check passes. Post final report.
|
|
279
295
|
```
|
|
@@ -72,6 +72,24 @@ Follow `suggestedCommand` from `spine status --diagnose` when unsure.
|
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
|
|
75
|
+
## Post-integrate verification
|
|
76
|
+
|
|
77
|
+
After each wave land loop (`integrate` + `batch complete`), before the next wave or `git push`:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npm run release:check 2>&1 | tee /tmp/pi-spine-post-integrate-wave-${N}.log
|
|
81
|
+
test "${PIPESTATUS[0]}" -eq 0
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Full reference: [post-integrate-regression-gate.md](../../spine-release-operator/references/post-integrate-regression-gate.md).
|
|
85
|
+
|
|
86
|
+
| Do | Do not |
|
|
87
|
+
|----|--------|
|
|
88
|
+
| Verify `$?` or `${PIPESTATUS[0]}` after `release:check` | Use `\| tail` alone for pass/fail |
|
|
89
|
+
| Re-run after manual merge / conflict resolution | Assume scoped task `testCommand` covered full CI |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
75
93
|
## Preflight
|
|
76
94
|
|
|
77
95
|
```bash
|
|
@@ -23,6 +23,7 @@ Invoke explicitly: `/skill:spine-orchestrate-waves`, `/spine-orchestrate pending
|
|
|
23
23
|
| Curated release subset | `spine-release-operator` skill |
|
|
24
24
|
| Agent shell batch policy (detached vs attached) | [spine-autonomous-operator/references/agent-shell-batch-policy.md](../spine-autonomous-operator/references/agent-shell-batch-policy.md) |
|
|
25
25
|
| Pi async batch/verify (MonitorCreate) | [spine-release-operator/references/pi-async-orchestration.md](../spine-release-operator/references/pi-async-orchestration.md) |
|
|
26
|
+
| Post-integrate regression gate | [spine-release-operator/references/post-integrate-regression-gate.md](../spine-release-operator/references/post-integrate-regression-gate.md) |
|
|
26
27
|
| Canonical how-to prose | [references/outer-loop.md](references/outer-loop.md) (synced from `docs/adoption/agent-orchestrated-waves.md`) |
|
|
27
28
|
| Slash entry (`/spine-orchestrate`) | pi-spine extension — wave plan + outer loop checklist |
|
|
28
29
|
| Single-task suggested command | `/spine-next` inside land loop |
|
|
@@ -69,6 +70,7 @@ START
|
|
|
69
70
|
**Hard stops before next wave:**
|
|
70
71
|
|
|
71
72
|
- Land loop incomplete (`integrate` + `batch complete` + push when remote sync desired)
|
|
73
|
+
- Post-integrate `npm run release:check` not green on `main` — see [post-integrate-regression-gate.md](../spine-release-operator/references/post-integrate-regression-gate.md)
|
|
72
74
|
- Unresolved `failed`, `aborted`, or `needs_retry` on current wave
|
|
73
75
|
- Active `spine run sequence --attached` on same batch (state corruption risk)
|
|
74
76
|
|
|
@@ -106,7 +108,10 @@ spine gate status
|
|
|
106
108
|
|
|
107
109
|
spine gate approve # only after evidence checklist passes
|
|
108
110
|
spine integrate
|
|
111
|
+
npm install
|
|
109
112
|
spine batch complete
|
|
113
|
+
npm run release:check 2>&1 | tee /tmp/pi-spine-post-integrate-wave-${WAVE}.log
|
|
114
|
+
test "${PIPESTATUS[0]}" -eq 0 # blocking — see post-integrate-regression-gate.md
|
|
110
115
|
git push origin <baseBranch> # when remote sync desired
|
|
111
116
|
```
|
|
112
117
|
|
|
@@ -142,7 +147,7 @@ Inspect `.spine/runtime/<batchId>/evidence/`:
|
|
|
142
147
|
| `failed` | Inspect journal (`spine journal follow`); fix contract/env before retry |
|
|
143
148
|
| `needs_replan` | Read `{taskFolder}/.reviews/final-*.md`; edit PROMPT scope, then retry |
|
|
144
149
|
| `merge_blocked` | Resolve conflicts on orch branch or lane worktree; `spine batch resume --force` |
|
|
145
|
-
| `engine_orphaned` | Do **not** start a second attached engine; `spine batch retry <taskId>`
|
|
150
|
+
| `engine_orphaned` | Do **not** start a second attached engine; follow recovery recipe in [outer-loop.md](references/outer-loop.md#orphan-recovery-recipe) — `spine batch retry <taskId>` then `spine batch resume --force` (detached). Headline distinguishes parent shell exit from crash when journal has no `engine.crash` |
|
|
146
151
|
| `worker_orphaned` | `spine batch retry <taskId>` (reconciles orphan running → failed) |
|
|
147
152
|
| `worker_done_missing` | Read worker output log from headline; fix blocker, then `spine batch retry <taskId>` |
|
|
148
153
|
| `completed` | Run `spine batch complete` if not archived, then push |
|
|
@@ -155,12 +160,14 @@ Inspect `.spine/runtime/<batchId>/evidence/`:
|
|
|
155
160
|
| Anti-pattern | Correct approach |
|
|
156
161
|
|--------------|------------------|
|
|
157
162
|
| `spine batch start … --attached` from Cursor Agent or non-TTY shell | Detached start + `spine wait` / `spine status --diagnose` — see [agent-shell-batch-policy.md](../spine-autonomous-operator/references/agent-shell-batch-policy.md) |
|
|
163
|
+
| Cursor background shell + `--attached` (`block_until_ms` backgrounds tool shell) | Parent exits in ~15–120s; `engine_orphaned` misread as crash — detached start/resume + recovery recipe (retry → resume --force → diagnose) |
|
|
158
164
|
| `spine batch resume --attached` while `spine run sequence --attached` is active | One entry point; kill stale engines first (`spine status --diagnose`) |
|
|
159
165
|
| Approving gate without reading evidence | Always inspect evidence directory before `spine gate approve` |
|
|
160
166
|
| Expecting workers to call `spine_request_gate` for integrate | Agent drives gate approval from host shell |
|
|
161
167
|
| `--auto-approve-gate` with real pi workers | Per-wave agent loop with explicit gate approval |
|
|
162
|
-
| Starting next wave before land loop completes | Complete integrate + batch complete + push before next wave |
|
|
168
|
+
| Starting next wave before land loop completes | Complete integrate + batch complete + post-integrate release:check + push before next wave |
|
|
163
169
|
| Bare full-suite `testCommand` with large output | Scope `testCommand` to relevant test files |
|
|
170
|
+
| `release:check \| tail` for pass/fail | Verify exit code; use `tee` + `${PIPESTATUS[0]}` — see [post-integrate-regression-gate.md](../spine-release-operator/references/post-integrate-regression-gate.md) |
|
|
164
171
|
|
|
165
172
|
---
|
|
166
173
|
|
|
@@ -20,10 +20,24 @@ Run all pending tasks across multiple dependency waves without manual interventi
|
|
|
20
20
|
|
|
21
21
|
For agent-driven batches (Cursor Agent, pi MonitorCreate, CI), use **detached** start/resume — omit `--attached`. The engine survives parent shell exit; monitor with `spine status --diagnose` and `spine wait`.
|
|
22
22
|
|
|
23
|
+
**Automation rule:** External agents must use `spine batch start|resume --force` (detached) unless the agent process will **block until batch completion**. Never pass `--attached` from subprocesses that return before the batch finishes (Cursor tool shells, CI steps with timeouts, `block_until_ms` backgrounds).
|
|
24
|
+
|
|
23
25
|
Cursor Agent shells may background long commands after **~120 seconds**; an attached engine dies with the parent shell (`engine_orphaned`, exit 137). Run `spine doctor` and heed the `batch --attached orphan risk (#163)` warning.
|
|
24
26
|
|
|
25
27
|
Full policy: [agent-shell-batch-policy.md](../../spine-autonomous-operator/references/agent-shell-batch-policy.md). Use `--attached` only from a persistent interactive terminal kept in foreground for the full batch.
|
|
26
28
|
|
|
29
|
+
### Orphan recovery recipe
|
|
30
|
+
|
|
31
|
+
When diagnosis shows `engine_orphaned` or `worker_orphaned` after a short-lived shell:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
spine batch retry <taskId> # reconciles orphan running → failed
|
|
35
|
+
spine batch resume --force # detached — omit --attached
|
|
36
|
+
spine status --diagnose # confirm diagnosis: running
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Inspect `.spine/runtime/detached-engine.log` when the headline links it — absence of `engine.crash` in the journal usually means parent shell exit, not an engine defect ([#185](https://github.com/beettlle/pi-spine/issues/185)).
|
|
40
|
+
|
|
27
41
|
---
|
|
28
42
|
|
|
29
43
|
## Responsibility split
|
|
@@ -57,7 +71,10 @@ spine gate status
|
|
|
57
71
|
# Inspect .spine/runtime/<batchId>/evidence/
|
|
58
72
|
spine gate approve
|
|
59
73
|
spine integrate
|
|
74
|
+
npm install
|
|
60
75
|
spine batch complete
|
|
76
|
+
npm run release:check 2>&1 | tee /tmp/pi-spine-post-integrate-wave-${WAVE}.log
|
|
77
|
+
test "${PIPESTATUS[0]}" -eq 0 # blocking — see post-integrate-regression-gate.md
|
|
61
78
|
git push origin main
|
|
62
79
|
```
|
|
63
80
|
|
|
@@ -98,7 +115,7 @@ After `spine wait` returns or `spine status --diagnose` reports a non-running st
|
|
|
98
115
|
| `failed` | Inspect journal (`spine journal follow`); fix contract/env before retry |
|
|
99
116
|
| `needs_replan` | Read reviewer feedback in `{taskFolder}/.reviews/final-*.md`; edit PROMPT scope, then retry |
|
|
100
117
|
| `merge_blocked` | Resolve conflicts on orch branch or lane worktree; `spine batch resume --force` |
|
|
101
|
-
| `engine_orphaned` | Do **not** start a second attached engine; `spine batch retry <taskId>`
|
|
118
|
+
| `engine_orphaned` | Do **not** start a second attached engine; follow recovery recipe above — `spine batch retry <taskId>` then `spine batch resume --force` (detached). Headline distinguishes parent shell exit from crash when journal has no `engine.crash` |
|
|
102
119
|
| `worker_orphaned` | `spine batch retry <taskId>` (reconciles orphan running → failed) |
|
|
103
120
|
| `worker_done_missing` | Read worker output log from headline; fix blocker, then `spine batch retry <taskId>` |
|
|
104
121
|
| `completed` | Already landed — run `spine batch complete` if not archived, then push |
|
|
@@ -111,12 +128,14 @@ After `spine wait` returns or `spine status --diagnose` reports a non-running st
|
|
|
111
128
|
| Anti-pattern | Why it fails | Correct approach |
|
|
112
129
|
|--------------|-------------|------------------|
|
|
113
130
|
| `spine batch start … --attached` from Cursor Agent or non-TTY shell | Parent shell backgrounds (~120s) or exits; engine orphaned | Detached start + `spine wait` / `spine status --diagnose` |
|
|
131
|
+
| Cursor background shell + `--attached` (tool `block_until_ms` backgrounds) | Parent exits in ~15–120s; `engine_orphaned` misread as crash | Detached start/resume + recovery recipe (retry → resume --force → diagnose) |
|
|
114
132
|
| 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) |
|
|
115
133
|
| Approving gate without reading evidence | Merges untested or broken code to main | Always inspect `.spine/runtime/<batchId>/evidence/` before `spine gate approve` |
|
|
116
134
|
| 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 |
|
|
117
135
|
| 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 |
|
|
118
|
-
| Starting next wave before land loop completes | Base branch diverges from orch; downstream waves may conflict | Complete `integrate` + `batch complete` + push before next wave |
|
|
136
|
+
| Starting next wave before land loop completes | Base branch diverges from orch; downstream waves may conflict | Complete `integrate` + `batch complete` + post-integrate `release:check` + push before next wave |
|
|
119
137
|
| Bare full-suite `testCommand` with large output | Contract verify exceeds `maxBuffer` (10MB) and fails | Scope `testCommand` to relevant test files |
|
|
138
|
+
| `release:check \| tail` for pass/fail | `tail` exits 0 even when `release:check` failed | Verify exit code; use `tee` + `${PIPESTATUS[0]}` — [post-integrate-regression-gate.md](../../spine-release-operator/references/post-integrate-regression-gate.md) |
|
|
120
139
|
|
|
121
140
|
---
|
|
122
141
|
|
|
@@ -143,7 +162,10 @@ for ((WAVE=0; WAVE<WAVES; WAVE++)); do
|
|
|
143
162
|
spine gate status
|
|
144
163
|
spine gate approve
|
|
145
164
|
spine integrate
|
|
165
|
+
npm install
|
|
146
166
|
spine batch complete
|
|
167
|
+
npm run release:check 2>&1 | tee "/tmp/pi-spine-post-integrate-wave-${WAVE}.log"
|
|
168
|
+
test "${PIPESTATUS[0]}" -eq 0
|
|
147
169
|
git push origin main
|
|
148
170
|
else
|
|
149
171
|
echo "Wave $WAVE ended with diagnosis: $DIAG"
|
|
@@ -23,6 +23,7 @@ Invoke explicitly: `/skill:spine-release-operator` or "run a spine release cycle
|
|
|
23
23
|
| Semver scope budgets | [references/release-profiles.md](references/release-profiles.md) |
|
|
24
24
|
| Issue intake queries | [references/issue-intake-checklist.md](references/issue-intake-checklist.md) |
|
|
25
25
|
| Manifest format | [references/release-manifest-template.md](references/release-manifest-template.md) |
|
|
26
|
+
| Post-integrate regression gate | [references/post-integrate-regression-gate.md](references/post-integrate-regression-gate.md) |
|
|
26
27
|
| npm publish mechanics | `docs/release/npm-publish.md` |
|
|
27
28
|
| Upstream bug filing | [references/issue-template.md](references/issue-template.md) |
|
|
28
29
|
|
|
@@ -48,6 +49,9 @@ Invoke explicitly: `/skill:spine-release-operator` or "run a spine release cycle
|
|
|
48
49
|
- **Always** prioritize documentation issues over enhancements
|
|
49
50
|
- **Always** run `spine gate approve` before `spine integrate`
|
|
50
51
|
- **Always** run `npm install` on `main` after successful integrate
|
|
52
|
+
- **Always** run post-integrate `npm run release:check` on `main` after each wave land loop before starting the next wave or pushing — see [post-integrate-regression-gate.md](references/post-integrate-regression-gate.md)
|
|
53
|
+
- **Never** use `| tail` or `| head` alone to judge `release:check` pass/fail — verify exit code (`$?` or `${PIPESTATUS[0]}`)
|
|
54
|
+
- **Never** `git push origin main` during a release until post-integrate `release:check` exits 0 on current `HEAD`
|
|
51
55
|
- **Do not** execute tasks outside the approved manifest scope
|
|
52
56
|
- **Do not** start a second batch while another batch is **running** on this repo
|
|
53
57
|
- **Never** background `spine batch resume --attached` or `resume --attached --force` ([#163](https://github.com/beettlle/pi-spine/issues/163))
|
|
@@ -308,6 +312,21 @@ spine batch complete
|
|
|
308
312
|
|
|
309
313
|
Verify: `git status` clean, `.DONE` count increased.
|
|
310
314
|
|
|
315
|
+
### 4.3a Post-integrate regression gate (blocking)
|
|
316
|
+
|
|
317
|
+
After **every** land loop (including manual merge / conflict resolution), on current `main`:
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
npm run release:check 2>&1 | tee /tmp/pi-spine-post-integrate-wave-${N}.log
|
|
321
|
+
test "${PIPESTATUS[0]}" -eq 0
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Full reference: [post-integrate-regression-gate.md](references/post-integrate-regression-gate.md).
|
|
325
|
+
|
|
326
|
+
**If non-zero:** fix on `main`, commit, re-run gate. Do **not** start wave N+1, push, or proceed to Phase 5 until green.
|
|
327
|
+
|
|
328
|
+
**Do not** judge pass/fail from `tail` output — `tail` exits 0 even when `release:check` failed.
|
|
329
|
+
|
|
311
330
|
### 4.4 Recovery
|
|
312
331
|
|
|
313
332
|
Always: `spine status --diagnose`
|
|
@@ -335,14 +354,17 @@ spine preflight
|
|
|
335
354
|
git status
|
|
336
355
|
```
|
|
337
356
|
|
|
338
|
-
**pi async (preferred):** `MonitorCreate` with `npm run release:check 2>&1 | tee /tmp/pi-spine-release-check.log`, `timeout: 900000`, `onDone` to read log
|
|
357
|
+
**pi async (preferred):** `MonitorCreate` with `npm run release:check 2>&1 | tee /tmp/pi-spine-release-check.log`, `timeout: 900000`, `onDone` to read **full log** and verify exit 0 — not log tail alone.
|
|
339
358
|
|
|
340
359
|
**Foreground fallback:**
|
|
341
360
|
|
|
342
361
|
```bash
|
|
343
|
-
npm run release:check
|
|
362
|
+
npm run release:check 2>&1 | tee /tmp/pi-spine-release-check.log
|
|
363
|
+
test "${PIPESTATUS[0]}" -eq 0 # or: npm run release:check; echo $?
|
|
344
364
|
```
|
|
345
365
|
|
|
366
|
+
**Do not** use `npm run release:check 2>&1 | tail -20` for pass/fail — verify exit code explicitly.
|
|
367
|
+
|
|
346
368
|
### `release:check` gate (HARD STOP — blocking)
|
|
347
369
|
|
|
348
370
|
`npm run release:check` is **not advisory**. It is a **blocking gate** before any publish checklist or Phase 6.
|
|
@@ -461,6 +483,7 @@ check manifest at spine-tasks/_authoring/release-v{TARGET}/manifest.md →
|
|
|
461
483
|
spine status --diagnose (do not collide with running batch) →
|
|
462
484
|
preflight → for each wave: MonitorCreate batch start (or foreground) → onDone diagnose →
|
|
463
485
|
gate approve → integrate → npm install → batch complete →
|
|
486
|
+
post-integrate release:check (exit 0 required; no tail-only verification) →
|
|
464
487
|
MonitorCreate release:check → HARD STOP if non-zero (fix on main, re-run) → only if exit 0: verify ci.yml green on HEAD (gh run list/watch) → HARD STOP if not green → only then: STOP for publish approval.
|
|
465
488
|
resume --attached --force stays foreground. Post final report with composition table.
|
|
466
489
|
```
|