pi-spine 2.27.0 → 2.28.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-batch.mjs +46 -4
- package/bin/spine-tasks.mjs +1 -0
- package/bin/spine-worker-runner.mjs +17 -3
- package/package.json +1 -1
- package/skills/create-spine-tasks/SKILL.md +60 -33
- package/skills/create-spine-tasks/references/authoring-evidence.md +58 -0
- package/skills/create-spine-tasks/references/contract-template.md +52 -7
- package/skills/create-spine-tasks/references/prompt-template.md +77 -8
- package/skills/spine-release-operator/SKILL.md +43 -52
- package/skills/spine-release-operator/references/issue-intake-checklist.md +3 -1
- package/skills/spine-release-operator/references/pi-async-orchestration.md +13 -9
- package/skills/spine-release-operator/references/post-integrate-regression-gate.md +8 -1
- package/skills/spine-release-operator/references/publish-recovery.md +62 -0
- package/src/batch/contract-task-start.mjs +23 -1
- package/src/batch/diagnosis-alternatives.mjs +16 -1
- package/src/batch/diagnosis-handoff-packet.mjs +18 -0
- package/src/batch/diagnosis-pending-lane.mjs +18 -0
- package/src/batch/diagnosis-review-infra.mjs +144 -0
- package/src/batch/diagnosis-suggested-command.mjs +9 -0
- package/src/batch/diagnosis.mjs +19 -20
- package/src/batch/engine-lanes/merge.mjs +0 -8
- package/src/batch/engine-lanes/quota-fallback-run.mjs +11 -0
- package/src/batch/engine-lanes/quota-fallback-state.mjs +155 -8
- package/src/batch/engine-lanes/review-code.mjs +20 -0
- package/src/batch/engine-lanes/review-final.mjs +10 -2
- package/src/batch/engine-lanes/review-poll.mjs +37 -1
- package/src/batch/engine-lanes/task-agent-profile.mjs +324 -0
- package/src/batch/engine-lanes.mjs +18 -18
- package/src/batch/gate-posture-approve.mjs +154 -15
- package/src/batch/integrate-path-delete.mjs +85 -0
- package/src/batch/integrate-worktree.mjs +20 -27
- package/src/batch/journal.mjs +5 -3
- package/src/batch/metrics-rollup.mjs +98 -4
- package/src/batch/metrics.mjs +134 -9
- package/src/batch/provider-quota.mjs +156 -7
- package/src/batch/quota-fallback.mjs +87 -6
- package/src/batch/reconcile-diagnosis.mjs +24 -77
- package/src/batch/resume-lane-reviews.mjs +11 -10
- package/src/batch/retry-profile.mjs +77 -0
- package/src/batch/retry.mjs +32 -1
- package/src/batch/review-artifacts.mjs +3 -2
- package/src/batch/review-level-effective.mjs +19 -0
- package/src/batch/review-spawn.mjs +12 -1
- package/src/batch/review-step-run.mjs +18 -2
- package/src/batch/review-step.mjs +1 -0
- package/src/batch/reviewer-provider-error.mjs +153 -0
- package/src/batch/worker-heartbeat.mjs +10 -2
- package/src/batch/worker-host.mjs +1 -1
- package/src/batch/worker-prompt.mjs +9 -7
- package/src/cli/deps.mjs +3 -2
- package/src/config/agent-model-resolve.mjs +144 -8
- package/src/config/cursor-rules/discover.mjs +38 -1
- package/src/config/model-family.mjs +60 -0
- package/src/config/preflight/discovery.mjs +1 -0
- package/src/config/settings-fields.mjs +11 -0
- package/src/config/spine-config-schema.mjs +87 -0
- package/src/doctor/agent-model-inherit.mjs +78 -1
- package/src/doctor/pi-extension-hooks.mjs +322 -0
- package/src/doctor/run-doctor-checks.mjs +18 -2
- package/src/metrics/quota-cli.mjs +16 -0
- package/src/metrics/quota-probes.mjs +228 -31
- package/src/metrics/quota-snapshot.mjs +21 -2
- package/src/planner/graph.mjs +7 -5
- package/src/planner/pending.mjs +2 -2
- package/src/planner/scope.mjs +3 -3
- package/src/tasks/packet/parse-prompt.mjs +47 -0
- package/src/tasks/packet/validate-prompt.mjs +167 -2
- package/src/tasks/validate-contract-warn.mjs +16 -0
- package/templates/agents/reviewer.md +3 -1
- package/templates/agents/worker.md +15 -19
- package/templates/spine-config.json +1 -1
package/bin/spine-batch.mjs
CHANGED
|
@@ -13,6 +13,7 @@ import { forceMergeWave, startBatch } from "../src/batch/engine.mjs";
|
|
|
13
13
|
import { parseBatchStartWaveFilter } from "../src/planner/wave-scope.mjs";
|
|
14
14
|
import { pauseBatch } from "../src/batch/pause.mjs";
|
|
15
15
|
import { resumeBatch } from "../src/batch/resume.mjs";
|
|
16
|
+
import { clearQuotaFallbackByOperator } from "../src/batch/engine-lanes/quota-fallback-state.mjs";
|
|
16
17
|
import { retryTask, skipTask } from "../src/batch/retry.mjs";
|
|
17
18
|
import { retryTaskRow, skipTaskRow, parseMatrixRowRef } from "../src/batch/retry-row.mjs";
|
|
18
19
|
import { reconcileBatch } from "../src/batch/reconcile.mjs";
|
|
@@ -32,6 +33,7 @@ const BATCH_FLAG_VALUE_TAKERS = new Set([
|
|
|
32
33
|
"--batch",
|
|
33
34
|
"--reason",
|
|
34
35
|
"--lane",
|
|
36
|
+
"--profile",
|
|
35
37
|
]);
|
|
36
38
|
|
|
37
39
|
/**
|
|
@@ -39,8 +41,11 @@ const BATCH_FLAG_VALUE_TAKERS = new Set([
|
|
|
39
41
|
*/
|
|
40
42
|
export function printBatchHelp() {
|
|
41
43
|
return (
|
|
42
|
-
"Usage: spine batch start <scope>|pause|resume|retry <taskId|[rowId]
|
|
44
|
+
"Usage: spine batch start <scope>|pause|resume|retry <taskId|[rowId]> [--profile NAME] [--no-escalate]|skip <taskId|[rowId]>|force-merge [--wave N]|salvage|quota-fallback clear|abort|dismiss|complete [--batch ID] [--lane N] [--integrate] [--yes] [--reason TEXT] [--hard] [--force] [--force-superseded] [--attached] [--dry-run] [--wave N] [--through-wave N] [--skip-preflight] [--detect-manual-merge] [--json]\n" +
|
|
43
45
|
" Row identity: retry/skip 'SP-X[rowId]' targets one matrix row; plain SP-X targets the whole task.\n" +
|
|
46
|
+
" retry --profile NAME Retry on another agents.profiles entry (content/contract failures only; quota/infra failures use agents.quotaFallbackProfile)\n" +
|
|
47
|
+
" retry --no-escalate Skip agents.escalatePolicy for this retry\n" +
|
|
48
|
+
" quota-fallback clear Delete the active quota fallback hop so workers return to the primary profile (paused/failed batches only)\n" +
|
|
44
49
|
" abort --dry-run Preview abort (reason/archive target); does not archive, journal, or clear live batch\n"
|
|
45
50
|
);
|
|
46
51
|
}
|
|
@@ -67,6 +72,7 @@ export function isBatchHelpRequest(args) {
|
|
|
67
72
|
"skip",
|
|
68
73
|
"force-merge",
|
|
69
74
|
"salvage",
|
|
75
|
+
"quota-fallback",
|
|
70
76
|
].includes(token),
|
|
71
77
|
);
|
|
72
78
|
if (subcommand && args.includes("help")) {
|
|
@@ -169,6 +175,12 @@ export function parseBatchArgs(args) {
|
|
|
169
175
|
laneNumber = Number(args[laneIdx + 1]);
|
|
170
176
|
}
|
|
171
177
|
|
|
178
|
+
let profile = null;
|
|
179
|
+
const profileIdx = args.indexOf("--profile");
|
|
180
|
+
if (profileIdx >= 0 && args[profileIdx + 1] && !args[profileIdx + 1].startsWith("--")) {
|
|
181
|
+
profile = args[profileIdx + 1];
|
|
182
|
+
}
|
|
183
|
+
|
|
172
184
|
const subcommand =
|
|
173
185
|
args.find(
|
|
174
186
|
(t) =>
|
|
@@ -181,7 +193,8 @@ export function parseBatchArgs(args) {
|
|
|
181
193
|
t === "retry" ||
|
|
182
194
|
t === "skip" ||
|
|
183
195
|
t === "force-merge" ||
|
|
184
|
-
t === "salvage"
|
|
196
|
+
t === "salvage" ||
|
|
197
|
+
t === "quota-fallback",
|
|
185
198
|
) ?? null;
|
|
186
199
|
|
|
187
200
|
let waveFilter = null;
|
|
@@ -218,6 +231,9 @@ export function parseBatchArgs(args) {
|
|
|
218
231
|
forceSuperseded,
|
|
219
232
|
integrate,
|
|
220
233
|
yes,
|
|
234
|
+
profile,
|
|
235
|
+
profileFlag: flags.has("--profile"),
|
|
236
|
+
noEscalate: flags.has("--no-escalate"),
|
|
221
237
|
batchId,
|
|
222
238
|
reason,
|
|
223
239
|
waveIndex,
|
|
@@ -351,13 +367,27 @@ export async function runSpineBatch(options) {
|
|
|
351
367
|
if (!parsed.taskId) {
|
|
352
368
|
return {
|
|
353
369
|
exitCode: 1,
|
|
354
|
-
output: "Usage: spine batch retry <taskId> | <taskId>[rowId] [--json]\n",
|
|
370
|
+
output: "Usage: spine batch retry <taskId> [--profile <name>] [--no-escalate] | <taskId>[rowId] [--json]\n",
|
|
355
371
|
};
|
|
356
372
|
}
|
|
373
|
+
if (parsed.profileFlag && !parsed.profile) {
|
|
374
|
+
return { exitCode: 1, output: "Usage: spine batch retry <taskId> --profile <name>\n" };
|
|
375
|
+
}
|
|
357
376
|
const rowRef = parseMatrixRowRef(parsed.taskId);
|
|
377
|
+
if (rowRef && parsed.profileFlag) {
|
|
378
|
+
return {
|
|
379
|
+
exitCode: 1,
|
|
380
|
+
output: "--profile applies to whole-task retry; retry the task (SP-X) instead of a matrix row.\n",
|
|
381
|
+
};
|
|
382
|
+
}
|
|
358
383
|
const result = rowRef
|
|
359
384
|
? retryTaskRow({ projectRoot, taskId: rowRef.taskId, rowId: rowRef.rowId })
|
|
360
|
-
: retryTask({
|
|
385
|
+
: retryTask({
|
|
386
|
+
projectRoot,
|
|
387
|
+
taskId: parsed.taskId,
|
|
388
|
+
profile: parsed.profile,
|
|
389
|
+
noEscalate: parsed.noEscalate,
|
|
390
|
+
});
|
|
361
391
|
if (parsed.json) {
|
|
362
392
|
return {
|
|
363
393
|
exitCode: result.exitCode ?? (result.ok ? 0 : 1),
|
|
@@ -383,6 +413,18 @@ export async function runSpineBatch(options) {
|
|
|
383
413
|
};
|
|
384
414
|
}
|
|
385
415
|
|
|
416
|
+
if (parsed.subcommand === "quota-fallback") {
|
|
417
|
+
if (parsed.scope !== "clear") {
|
|
418
|
+
return { exitCode: 1, output: "Usage: spine batch quota-fallback clear [--json]\n" };
|
|
419
|
+
}
|
|
420
|
+
const result = clearQuotaFallbackByOperator({ projectRoot });
|
|
421
|
+
return {
|
|
422
|
+
exitCode: result.exitCode ?? (result.ok ? 0 : 1),
|
|
423
|
+
output: parsed.json ? `${JSON.stringify(result, null, 2)}\n` : result.output,
|
|
424
|
+
result,
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
386
428
|
if (parsed.subcommand === "skip") {
|
|
387
429
|
if (!parsed.taskId) {
|
|
388
430
|
return {
|
package/bin/spine-tasks.mjs
CHANGED
|
@@ -217,6 +217,7 @@ export async function runSpineTasksValidate({
|
|
|
217
217
|
|
|
218
218
|
const packet = loadTaskPacket(discoveredTask.folderPath, {
|
|
219
219
|
contract: config.contract,
|
|
220
|
+
agents: config.agents,
|
|
220
221
|
});
|
|
221
222
|
const failure = collectPromptValidationFailure(packet, taskId);
|
|
222
223
|
/** @type {string[]} */
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
isPiExtensionConflictOutput,
|
|
43
43
|
shouldWorkerUsePiNoExtensions,
|
|
44
44
|
} from "../src/doctor/pi-extension-conflict.mjs";
|
|
45
|
-
import { parseContract, parsePrompt } from "../src/tasks/packet/parse-prompt.mjs";
|
|
45
|
+
import { PROMPT_THINKING_LEVELS, parseContract, parsePrompt } from "../src/tasks/packet/parse-prompt.mjs";
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Actionable hint when pi worker spawn fails on duplicate extension tool registration.
|
|
@@ -66,13 +66,26 @@ function buildReviewJournal() {
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* Append worker model/thinking flags from spine-config (mirrors reviewer spawn in review.mjs).
|
|
69
|
+
* `SPINE_WORKER_THINKING_OVERRIDE` (per-task `**Thinking:**`, SP-835 / #340) wins over
|
|
70
|
+
* `agents.worker.thinking`; invalid values warn on stderr and are ignored.
|
|
69
71
|
*
|
|
70
72
|
* @param {string[]} piArgs
|
|
71
73
|
* @param {object} [config]
|
|
74
|
+
* @param {Record<string, string|undefined>} [env] Defaults to `process.env`.
|
|
72
75
|
*/
|
|
73
|
-
export function appendWorkerAgentModelArgs(piArgs, config = {}) {
|
|
76
|
+
export function appendWorkerAgentModelArgs(piArgs, config = {}, env = process.env) {
|
|
74
77
|
const workerModel = config?.agents?.worker?.model;
|
|
75
|
-
|
|
78
|
+
let workerThinking = config?.agents?.worker?.thinking;
|
|
79
|
+
const thinkingOverride = env?.SPINE_WORKER_THINKING_OVERRIDE?.trim();
|
|
80
|
+
if (thinkingOverride) {
|
|
81
|
+
if (PROMPT_THINKING_LEVELS.includes(thinkingOverride)) {
|
|
82
|
+
workerThinking = thinkingOverride;
|
|
83
|
+
} else {
|
|
84
|
+
console.error(
|
|
85
|
+
`SPINE_WORKER_THINKING_OVERRIDE="${thinkingOverride}" ignored (expected ${PROMPT_THINKING_LEVELS.join("|")})`,
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
76
89
|
if (workerModel && workerModel !== "inherit") {
|
|
77
90
|
piArgs.push("--model", workerModel);
|
|
78
91
|
}
|
|
@@ -126,6 +139,7 @@ export async function buildWorkerPiArgs({
|
|
|
126
139
|
taskIdHint: taskIdFromFolder(taskFolder),
|
|
127
140
|
reviewLevel: readReviewLevel(taskFolder),
|
|
128
141
|
includePromptInclude: false,
|
|
142
|
+
includeAgentInclude: false,
|
|
129
143
|
config: spineConfig,
|
|
130
144
|
projectRoot,
|
|
131
145
|
taskFileScope,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-spine-tasks
|
|
3
|
-
version: 1.
|
|
3
|
+
version: 1.2.0
|
|
4
4
|
description: Decomposes PRDs and feature briefs into spine task packets (PROMPT.md, STATUS.md) under spine-tasks/ for autonomous execution via spine batch. Use when asked to "create a spine task", "decompose a PRD", "stage tasks for spine", "write PROMPT.md for spine", "create SP-* tasks", or queue work for spine workers.
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -195,17 +195,10 @@ Run **after Step A.5 — Clarify** and **before Step B — Slice**. Authoring-on
|
|
|
195
195
|
| **Scope** | One deliverable per task; disjoint **File Scope** when tasks can run in parallel. |
|
|
196
196
|
| **IDs** | Use `Next Task ID` from CONTEXT.md; increment after each new task. Greenfield spine projects typically use `SP-###`; Taskplane migrants may keep `TP-###`. |
|
|
197
197
|
| **Waves** | Order via `## Dependencies` and `{tasksRoot}/dependencies.json`. |
|
|
198
|
-
| **
|
|
198
|
+
| **Type** | Pick `execute` / matrix / `llm` per [Step 2a](#step-2a-choose-task-type) before writing steps. Deterministic work never needs an LLM worker. |
|
|
199
|
+
| **Review** | Score complexity (below). Level 1 is the code default; Level 0 for execute and docs-only; Level 2 only for security, data-model, or hot shared modules. |
|
|
199
200
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
| Superseded | Split into |
|
|
203
|
-
|------------|------------|
|
|
204
|
-
| SP-419 | SP-466, SP-467 |
|
|
205
|
-
| SP-428 | SP-468, SP-469 |
|
|
206
|
-
| SP-430 | SP-470, SP-471 |
|
|
207
|
-
| SP-436 | SP-474, SP-475 |
|
|
208
|
-
| SP-461 | SP-478, SP-479 |
|
|
201
|
+
Split evidence (Phase 55: five composite tasks, each split into exactly two children) lives in [references/authoring-evidence.md](references/authoring-evidence.md#two-deliverable-split-phase-55).
|
|
209
202
|
|
|
210
203
|
### Step C.5: Analyze (optional — LLM structural review after slice)
|
|
211
204
|
|
|
@@ -285,10 +278,29 @@ If `CONTEXT.md` is missing (pre-init legacy repo), ask the user to run `spine in
|
|
|
285
278
|
Quick reference (full rubric in [Complexity Assessment](#complexity-assessment)):
|
|
286
279
|
|
|
287
280
|
- Score each dimension 0–2: Blast radius, Pattern novelty, Security, Reversibility
|
|
288
|
-
- Sum → Level: 0–1→L0, 2–
|
|
281
|
+
- Sum → Level: 0–1→L0, 2–5→L1, 6–8→L2; **Security = 2 or Reversibility = 2 → L2** regardless of sum
|
|
289
282
|
- Size: S (<2h), M (2–4h), L (4–8h), XL (8h+ → must split)
|
|
290
283
|
|
|
291
|
-
**
|
|
284
|
+
**Code tasks default to Level 1** (plan + final review). Level 0 is for `Type: execute` tasks, docs-only tasks, and trivial config knobs. Level 2 adds a code review spawn per task — reserve it for security, data-model, or hot shared-module changes ([evidence](references/authoring-evidence.md#review-level-recalibration-token-cost-audit-oct-2026)).
|
|
285
|
+
|
|
286
|
+
### Step 2a: Choose task type
|
|
287
|
+
|
|
288
|
+
Every LLM worker turn costs tokens; a shell command does not. Decide the task type **before** writing steps:
|
|
289
|
+
|
|
290
|
+
| Work | Type | Why |
|
|
291
|
+
|------|------|-----|
|
|
292
|
+
| Deterministic script with a known command (generator, smoke run, evidence collection, deploy, mechanical validation) | `**Type:** execute` | Engine runs Contract `runCommand` in the lane worktree; no LLM worker, no turns spent waiting on output |
|
|
293
|
+
| Same command across N targets (regions, fixtures, models, files) | `**Type:** execute` + `## Matrix` | One packet fans out into rows; `matrixMaxParallel` throttles; failed rows retry alone (`spine batch retry 'SP-X[rowId]'`) |
|
|
294
|
+
| Design, refactor, judgment across files, writing tests | `**Type:** llm` (default) | Needs reasoning and STATUS checkpointing |
|
|
295
|
+
| Script needs to be **written** and then **run** for a long time | Split: `llm` task authors the script → `execute` task (dep edge) runs it | The LLM never supervises a long-running command (the background-and-exit failure in [#276](https://github.com/beettlle/pi-spine/issues/276)) |
|
|
296
|
+
|
|
297
|
+
Execute-task rules:
|
|
298
|
+
|
|
299
|
+
- Set **Review Level 0** — nothing for a reviewer to judge. Until [#336](https://github.com/beettlle/pi-spine/issues/336) lands, Level ≥ 1 still spawns plan and final reviewers on execute tasks.
|
|
300
|
+
- Provide `runCommand` **and** a cheap `testCommand` proof (`test -f out/report.json`). Without `runCommand`, the engine runs `testCommand` as the job and again at contract verify — the expensive command runs twice.
|
|
301
|
+
- Required sections and a `### Step N: Testing & Verification` step are still validated; keep steps short (the engine does not execute them).
|
|
302
|
+
- Contract commands refuse `$`, backticks, `;`, `|`, `||`, and lone `&`; wrap complex logic in a script (`sh scripts/run-row.sh`).
|
|
303
|
+
- Syntax and row semantics: [operator-runbook §2.4–2.5](../../docs/adoption/operator-runbook.md#24-matrix-tasks-parametric-sub-lanes); template: [prompt-template.md](references/prompt-template.md#execute-task-variant).
|
|
292
304
|
|
|
293
305
|
### Step 3: Create task folder
|
|
294
306
|
|
|
@@ -307,8 +319,8 @@ Use [references/prompt-template.md](references/prompt-template.md). Spine-specif
|
|
|
307
319
|
- **Environment** — include `npm run typecheck && SPINE_WORKER_STUB=1 npm test` when that is the project test command
|
|
308
320
|
- **Git Commit Convention** — `feat(SP-###): …` at step boundaries
|
|
309
321
|
- **Worker tools** — when Review Level > 0, steps must note `spine_review_step` after each step
|
|
310
|
-
- **Testing step (required for all tasks)** — every packet MUST include `### Step N: Testing & Verification` inside `## Steps`, placed **before** `## Completion Criteria`. This applies to **docs-only Review Level 0 tasks** as well — omitting the step causes `prompt_parse_failed` at batch launch (SP-075). Docs-only tasks
|
|
311
|
-
- **Coverage gate** — when
|
|
322
|
+
- **Testing step (required for all tasks)** — every packet MUST include `### Step N: Testing & Verification` inside `## Steps`, placed **before** `## Completion Criteria`. This applies to **docs-only Review Level 0 tasks** as well — omitting the step causes `prompt_parse_failed` at batch launch (SP-075). Docs-only tasks run **scoped** tests: `rg -l '<changed doc path or anchor>' tests/` and run only the hits (none → note "no tests reference this doc"); post-integrate `release:check` owns the full suite. Use `--test-reporter=dot` on `node --test` commands so passing tests do not flood the worker context. **Code tasks:** Contract `testCommand` must prefix project lint/analyze (`npm run lint &&` for pi-spine).
|
|
323
|
+
- **Coverage gate** — when a **Size L** task changes application code (or the Contract sets `minLineCoverage`), add a coverage verification checkbox in the Testing step using `testing.testWithCoverage` (≥77% line coverage policy). S/M tasks rely on post-integrate `release:check` for coverage.
|
|
312
324
|
- **Contract (required for new SP-\* tasks)** — add `## Contract` after `## File Scope` using [references/contract-template.md](references/contract-template.md). Include `testCommand` for code tasks; use `` `true` `` for docs-only S tasks. When `testCommand` is `` `true` `` (docs-only), **always** include `fileScopeMustChange` listing at least one documentation deliverable path — without it, workers can pass contract by creating only `.DONE` (SP-214 batch `20260612T204048`, SP-457 batch `20260703T022335`). When using `fileScopeMustNotChange`, follow parallel-only semantics and never ban `spine-tasks/**` (see contract template and [File Scope and parallel batches](#file-scope-and-parallel-batches)). Legacy `TP-*` packets may omit Contract when `contract.legacyTaskIdPrefixes` includes `TP-`.
|
|
313
325
|
- **Completion** — worker creates `{task-folder}/.DONE`; batch engine may auto-commit remaining work
|
|
314
326
|
- **Documentation Requirements ↔ File Scope ([#144](https://github.com/beettlle/pi-spine/issues/144))** — every path under **Must Update** in `## Documentation Requirements` **must** also appear in `## File Scope`. Advisory docs belong in **Check If Affected**, not Must Update. Example: if Must Update lists `docs/adoption/operator-runbook.md`, add that path to File Scope alongside code paths — otherwise workers must choose between scope and documentation obligations (SP-435, SP-451).
|
|
@@ -343,12 +355,12 @@ In pi: `/spine-plan pending` then `/spine SP-042` (single-task) or `spine batch
|
|
|
343
355
|
|
|
344
356
|
### Review Levels
|
|
345
357
|
|
|
346
|
-
| Level | Label |
|
|
347
|
-
|
|
348
|
-
| 0 | None |
|
|
349
|
-
| 1 | Plan Only | Plan
|
|
350
|
-
| 2 | Plan + Code | Plan + code
|
|
351
|
-
| 3 | Full |
|
|
358
|
+
| Level | Label | Engine reviews after `.DONE` (real pi) | Use for |
|
|
359
|
+
|-------|-------|----------------------------------------|---------|
|
|
360
|
+
| 0 | None | None | `Type: execute`, docs-only, trivial config |
|
|
361
|
+
| 1 | Plan Only | Plan + final | **Default for code tasks** |
|
|
362
|
+
| 2 | Plan + Code | Plan + code + final | Security, data-model / migration, hot shared modules (`engine*.mjs`, `parse-prompt.mjs`, reconcile, worktree) |
|
|
363
|
+
| 3 | Full | Same as Level 2 (`isReviewTypeRequired` treats 3 like 2) | Do not assign — no extra review type exists |
|
|
352
364
|
|
|
353
365
|
**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).
|
|
354
366
|
|
|
@@ -365,7 +377,7 @@ When Review Level ≥ 1 (v1.3), workers also run a **final** review (`--type fin
|
|
|
365
377
|
| **Security** | No auth/data | Touches auth | Modifies auth/encryption |
|
|
366
378
|
| **Reversibility** | Easy revert | Needs migration | Data model change |
|
|
367
379
|
|
|
368
|
-
Score 0–1 → Level 0 · 2–
|
|
380
|
+
Score 0–1 → Level 0 · 2–5 → Level 1 · 6–8 → Level 2 · Security = 2 or Reversibility = 2 → Level 2. `Type: execute` → Level 0 regardless of score.
|
|
369
381
|
|
|
370
382
|
### Per-step override and checkpoint markers
|
|
371
383
|
|
|
@@ -390,14 +402,7 @@ Individual steps can override the task-level review:
|
|
|
390
402
|
| **XL** | 8+ hours | **Must split** — never ship a single PROMPT with Size XL (validator rejects) |
|
|
391
403
|
| **L** | 4–8 hours | **Prefer split** into 2–3 M tasks; if kept, set Size L and expect longer stall budget (SP-088) |
|
|
392
404
|
|
|
393
|
-
**Rule of thumb:** More than **4** implementation steps → split. More than **8** file-scope paths → narrow or split.
|
|
394
|
-
|
|
395
|
-
**Example (incident-driven):** Eight Phase-13 tasks in one batch (`SP-064`…`SP-085`) caused parallel pi stalls. Prefer:
|
|
396
|
-
|
|
397
|
-
| Instead of | Use |
|
|
398
|
-
|------------|-----|
|
|
399
|
-
| One batch with 8 M tasks | Wave A: 4 tasks → land → Wave B: 4 tasks |
|
|
400
|
-
| One L task “refactor engine + resume + tests” | SP-074 engine scope, SP-076 resume DRY, SP-078 tests (deps) |
|
|
405
|
+
**Rule of thumb:** More than **4** implementation steps → split. More than **8** file-scope paths → narrow or split. Prefer waves of ≤4 M tasks; 8-task waves stalled pi workers ([evidence](references/authoring-evidence.md#mega-wave-stalls-phase-13--phase-15)).
|
|
401
406
|
|
|
402
407
|
---
|
|
403
408
|
|
|
@@ -518,7 +523,24 @@ Never ban `spine-tasks/**` — workers must update `STATUS.md` and create `.DONE
|
|
|
518
523
|
| Review Level 0, Size S, no code deliverable | Size S/M patch with an existing targeted test |
|
|
519
524
|
| Contract proof is doc mtime, not test output | Contract must prove code behavior |
|
|
520
525
|
|
|
521
|
-
Docs-only tasks still include `### Step N: Testing & Verification` (full suite
|
|
526
|
+
Docs-only tasks still include `### Step N: Testing & Verification` — run the tests that reference the changed docs (`rg -l '<doc path>' tests/`), not the full suite; post-integrate `release:check` covers the rest. Contract `` `true` `` only means final verify does not re-run tests. See [contract-template decision table](references/contract-template.md#docs-only-vs-scoped-node---test).
|
|
527
|
+
|
|
528
|
+
---
|
|
529
|
+
|
|
530
|
+
## Cost-aware authoring
|
|
531
|
+
|
|
532
|
+
Packet shape decides most of a batch's token spend. Each choice below removes LLM turns or reviewer spawns without weakening the merge gate (post-integrate `release:check` still runs the full suite and coverage on `main`).
|
|
533
|
+
|
|
534
|
+
| Lever | Cheaper choice | Cost avoided |
|
|
535
|
+
|-------|----------------|--------------|
|
|
536
|
+
| Task type | `Type: execute` (+ `## Matrix`) for deterministic commands ([Step 2a](#step-2a-choose-task-type)) | Entire LLM worker session; worker turns spent waiting on long command output |
|
|
537
|
+
| Review Level | 1 for code, 0 for execute/docs ([Review Levels](#review-levels)) | Code-review spawn per task (Level 2); plan + final spawns (Level 0) |
|
|
538
|
+
| Testing step | Scoped `node --test --test-reporter=dot <files>`; docs-only runs only `rg -l` hits | Full-suite runs per task; passing-test output in worker context |
|
|
539
|
+
| File Scope | Concrete paths, not directories | Glob-matched rule packs injected on every worker turn |
|
|
540
|
+
| Context to Read First | Only docs the task needs | Re-reading large docs each iteration |
|
|
541
|
+
| Size | S/M with ≤4 steps | Iteration count; stall retries |
|
|
542
|
+
|
|
543
|
+
**Measure before and after:** `spine metrics show --batch <id>` (or `--last 5`, `--json`) reports outcome, duration, and attempts per task. Token and cost columns stay empty until [#338](https://github.com/beettlle/pi-spine/issues/338) populates them — compare duration and retry counts until then. Background data: [references/authoring-evidence.md](references/authoring-evidence.md).
|
|
522
544
|
|
|
523
545
|
---
|
|
524
546
|
|
|
@@ -545,7 +567,10 @@ Before reporting launch commands:
|
|
|
545
567
|
- [ ] Authoring mode chosen (lean default; full when ambiguity, L/XL epic, or security surface)
|
|
546
568
|
- [ ] `Next Task ID` read from CONTEXT.md and incremented
|
|
547
569
|
- [ ] Folder at `{tasksRoot}/{PREFIX-###-slug}/`
|
|
548
|
-
- [ ] Complexity scored; review level assigned (0–
|
|
570
|
+
- [ ] Complexity scored; review level assigned (0–2; Level 1 for code unless security/data-model/hot module)
|
|
571
|
+
- [ ] Task type chosen ([Step 2a](#step-2a-choose-task-type)): deterministic commands are `Type: execute` (+ `## Matrix` for N targets), not LLM steps
|
|
572
|
+
- [ ] `Type: execute` tasks: Review Level 0, `runCommand` set, cheap `testCommand` proof (no double run of the job)
|
|
573
|
+
- [ ] No LLM step waits on a long-running command — split authoring (`llm`) from running (`execute`) ([#276](https://github.com/beettlle/pi-spine/issues/276))
|
|
549
574
|
- [ ] Size S/M/L — split if XL
|
|
550
575
|
- [ ] PROMPT.md from template: Mission, Dependencies, Context, File Scope, Contract (SP-\*), Steps, Do NOT, Git Commit Convention, Amendments
|
|
551
576
|
- [ ] Mission uses `Closes #N` or `Partial #N` on first line when tracking GitHub issues ([#147](https://github.com/beettlle/pi-spine/issues/147))
|
|
@@ -562,6 +587,7 @@ Before reporting launch commands:
|
|
|
562
587
|
- [ ] When parallelism is intended: `spine plan` shows `N lanes in parallel` for that wave — or document why overlapping scopes / real deps forced serial collapse ([#193](https://github.com/beettlle/pi-spine/issues/193))
|
|
563
588
|
- [ ] No false deps: edges only for real data dependencies; preference-order edges that force size-1 waves are rejected ([#193](https://github.com/beettlle/pi-spine/issues/193))
|
|
564
589
|
- [ ] `### Step N: Testing & Verification` present inside `## Steps` before `## Completion Criteria` (required even for docs-only Review Level 0)
|
|
590
|
+
- [ ] Testing step is scoped: `node --test --test-reporter=dot <files>` for code; `rg -l` hits only for docs-only — no full-suite run in S/M packets
|
|
565
591
|
- [ ] STATUS.md with matching steps (hydration markers where needed)
|
|
566
592
|
- [ ] `dependencies.json` updated when task has deps
|
|
567
593
|
- [ ] CONTEXT.md phase table updated for PRD decompositions
|
|
@@ -590,7 +616,7 @@ Hydration commits (STATUS.md expansions) may happen mid-step for crash recovery.
|
|
|
590
616
|
- **Lint in code-task contracts** — prefix `testCommand` with project lint/analyze (`npm run lint &&` for pi-spine). Contract verify runs the authored command in-lane; without lint, ESLint failures surface only at operator post-integrate `release:check` (post-mortem v2.15.0 F-C). Docs-only (`testCommand: true`) stays exempt.
|
|
591
617
|
- **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)).
|
|
592
618
|
- **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.
|
|
593
|
-
- **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.
|
|
619
|
+
- **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. The step runs the Contract `testCommand` (scoped); for **Size L code deliverables**, also include `testing.testWithCoverage` and a **≥77% line coverage** checkbox (see prompt template). Docs-only and S/M tasks omit the coverage checkbox — post-integrate `release:check` runs the full suite and coverage once per wave.
|
|
594
620
|
- **Documentation in every task** — "Must Update" / "Check If Affected" prevent doc drift.
|
|
595
621
|
- **Concrete deliverables** — name files to create/modify; avoid shortcuttable vague steps.
|
|
596
622
|
- **False deps defeat parallelism** — edge only when B needs A's output; independent work gets disjoint File Scope and no edge. Verify intended parallel waves with `spine plan` (`N lanes in parallel`) before handoff ([#193](https://github.com/beettlle/pi-spine/issues/193)).
|
|
@@ -606,6 +632,7 @@ Hydration commits (STATUS.md expansions) may happen mid-step for crash recovery.
|
|
|
606
632
|
- [references/clarify-template.md](references/clarify-template.md) — Step A.5 `clarify.md` schema (spec-kit `/speckit.clarify` equivalent)
|
|
607
633
|
- [references/requirements-checklist-template.md](references/requirements-checklist-template.md) — Step A.6 `checklist.md` schema (spec-kit `/speckit.checklist` equivalent)
|
|
608
634
|
- [references/context-template.md](references/context-template.md) — `{tasksRoot}/CONTEXT.md` scaffold
|
|
635
|
+
- [references/authoring-evidence.md](references/authoring-evidence.md) — incident and measurement data behind sizing, review-level, and testing rules
|
|
609
636
|
- [docs/PRD.md](../../docs/PRD.md) — task format spec (§13)
|
|
610
637
|
- [docs/adoption/bootstrap-checklist.md](../../docs/adoption/bootstrap-checklist.md) — greenfield setup
|
|
611
638
|
- [docs/adoption/operator-runbook.md](../../docs/adoption/operator-runbook.md) — execution policy
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Authoring evidence (create-spine-tasks)
|
|
2
|
+
|
|
3
|
+
Incident and measurement data behind the rules in [SKILL.md](../SKILL.md). Read this when a rule seems arbitrary or an operator asks "why"; authors applying the rules do not need it.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Two-deliverable split (Phase 55)
|
|
8
|
+
|
|
9
|
+
Every superseded composite task split into exactly two children because it bundled independent deliverables:
|
|
10
|
+
|
|
11
|
+
| Superseded | Split into |
|
|
12
|
+
|------------|------------|
|
|
13
|
+
| SP-419 | SP-466, SP-467 |
|
|
14
|
+
| SP-428 | SP-468, SP-469 |
|
|
15
|
+
| SP-430 | SP-470, SP-471 |
|
|
16
|
+
| SP-436 | SP-474, SP-475 |
|
|
17
|
+
| SP-461 | SP-478, SP-479 |
|
|
18
|
+
|
|
19
|
+
## Mega-wave stalls (Phase 13 / Phase 15)
|
|
20
|
+
|
|
21
|
+
Eight Phase-13 tasks in one batch (`SP-064`…`SP-085`) caused parallel pi stalls; 8-task waves stalled again in Phase 15 (SP-086–088). Prefer:
|
|
22
|
+
|
|
23
|
+
| Instead of | Use |
|
|
24
|
+
|------------|-----|
|
|
25
|
+
| One batch with 8 M tasks | Wave A: 4 tasks → land → Wave B: 4 tasks |
|
|
26
|
+
| One L task "refactor engine + resume + tests" | SP-074 engine scope, SP-076 resume DRY, SP-078 tests (deps) |
|
|
27
|
+
|
|
28
|
+
## Review Level recalibration (token-cost audit, Oct 2026)
|
|
29
|
+
|
|
30
|
+
Measured on this repository (`main` @ `c6891504`, v2.27.0) — basis for "Level 1 is the code default" ([#326](https://github.com/beettlle/pi-spine/issues/326), [#342](https://github.com/beettlle/pi-spine/issues/342)):
|
|
31
|
+
|
|
32
|
+
| Measure | Value |
|
|
33
|
+
|---------|-------|
|
|
34
|
+
| Engine reviews started, Sep–Oct 2026 | 114 plan · 44 code · 66 final |
|
|
35
|
+
| Journaled verdicts (all retained lane journals) | 140 APPROVE · 96 PASS · **0 REVISE** |
|
|
36
|
+
| `.reviews/` artifacts ever written that say REVISE | 8 of 844 (newest SP-474, 2026-07-05) |
|
|
37
|
+
| Tasks failed by reviewer infrastructure, Sep–Oct | 12 (timeouts, malformed function calls, 400s) |
|
|
38
|
+
| Wall time, failed vs completed attempts | 15.1 h vs 19.9 h |
|
|
39
|
+
|
|
40
|
+
Each review level adds reviewer spawns per task (Level 1: plan + final; Level 2+: plan + code + final). With approval near 100%, the extra spawns cost tokens and add failure surface without catching defects. Level 2 remains right for security, data-model, and hot shared-module changes, where a single missed defect is expensive.
|
|
41
|
+
|
|
42
|
+
## Execute and matrix adoption
|
|
43
|
+
|
|
44
|
+
As of v2.27.0, **0** real `Type: execute` or `## Matrix` packets had shipped on this repository — every deterministic step (generators, smoke runs, evidence collection) ran inside an LLM worker. Execute and matrix tasks run the Contract command with no LLM worker; see [Step 2a](../SKILL.md#step-2a-choose-task-type).
|
|
45
|
+
|
|
46
|
+
## Full-suite cost
|
|
47
|
+
|
|
48
|
+
| Measure | Value |
|
|
49
|
+
|---------|-------|
|
|
50
|
+
| Full suite size | 2,877 tests |
|
|
51
|
+
| Coverage run (`coverage-run.tap.log`) | ~176 s |
|
|
52
|
+
| Gate evidence `test-output.txt` | 243 KB |
|
|
53
|
+
|
|
54
|
+
Post-integrate `npm run release:check` already runs the full suite on `main` after every wave. A docs-only or S/M packet that reruns the full suite in its Testing step pays this cost a second time per task ([#341](https://github.com/beettlle/pi-spine/issues/341)).
|
|
55
|
+
|
|
56
|
+
## Usage fields
|
|
57
|
+
|
|
58
|
+
`spine metrics show` has token and cost columns from [#208](https://github.com/beettlle/pi-spine/issues/208), but 0 of 500 records carry usage until [#338](https://github.com/beettlle/pi-spine/issues/338) lands (workers and reviewers run pi in text mode). Use duration, attempt count, and failure class as cost proxies until then.
|
|
@@ -15,7 +15,7 @@ Normative schema: [PRD v2.0 implementation handoff §4](../../docs/PRD-v2.0-impl
|
|
|
15
15
|
|
|
16
16
|
| Field | Value |
|
|
17
17
|
|-------|-------|
|
|
18
|
-
| testCommand | `npm run lint && npm run typecheck && SPINE_WORKER_STUB=1 node --experimental-strip-types --test tests/batch/final-verdict.test.mjs` |
|
|
18
|
+
| testCommand | `npm run lint && npm run typecheck && SPINE_WORKER_STUB=1 node --experimental-strip-types --test --test-reporter=dot tests/batch/final-verdict.test.mjs` |
|
|
19
19
|
| fileScopeMustChange | `src/batch/review.mjs`, `bin/spine-tasks.mjs` |
|
|
20
20
|
| fileScopeMustNotChange | `src/planner/**` |
|
|
21
21
|
| minLineCoverage | 77 |
|
|
@@ -39,10 +39,12 @@ Avoid `` `bin/a.mjs,bin/b.mjs` `` — `tasks validate` warns (or errors in requi
|
|
|
39
39
|
| `testCommand` | **Required** for code tasks (Review Level ≥ 1, Size M/L, or implementation steps) | Shell command in backticks; max 500 chars; no newlines. **Code tasks:** prefix with project lint/analyze (`npm run lint &&` for pi-spine; `flutter analyze` scoped for Flutter). Contract verify executes this command at final review — lint runs in-lane when authored here. Post-integrate `release:check` remains the whole-repo backstop (full suite + coverage). Use `` `true` `` for docs-only S tasks with no code changes. When `` `true` ``, **always** pair with `fileScopeMustChange` (see below). |
|
|
40
40
|
| `fileScopeMustChange` | When you need proof specific paths were touched; **required** when `testCommand` is `` `true` `` | Comma-separated paths/globs relative to repo root; **one backtick per path** (not `` `a.mjs,b.mjs` ``). Trailing `/` means directory prefix match (e.g. `src/domain/types/` matches any file under that directory). For docs-only tasks, list at least one documentation deliverable path — without it, workers can pass contract by creating only `.DONE` (SP-214 batch `20260612T204048`, SP-457 batch `20260703T022335`). |
|
|
41
41
|
| `fileScopeMustNotChange` | When **parallel lanes** must not collide on product paths (see semantics below) | Comma-separated paths/globs relative to repo root; **one backtick per path** |
|
|
42
|
-
| `minLineCoverage` |
|
|
42
|
+
| `minLineCoverage` | Size L tasks that change application code (S/M rely on post-integrate `release:check` coverage) | Integer 0–100 (pi-spine policy: **77**) |
|
|
43
43
|
| `artifactsMustExist` | When deliverables must exist on disk | Comma-separated file paths; **one backtick per path** |
|
|
44
44
|
| `stallTimeoutMinutes` | Long external jobs (operator matrix, CI arms) exceeding global/size stall budget | Positive integer minutes; engine uses `max(global, size floor, contract)` |
|
|
45
45
|
| `extendGraceOnFileScope` | STATUS-only progress during long external work | `true` or `false`; when `true`, file-scope mtime extends stall grace for this task |
|
|
46
|
+
| `runCommand` | `Type: execute` tasks — the job the engine runs instead of an LLM worker | Shell command in backticks; same 500-char and metacharacter rules as `testCommand` (no `$`, backticks, `;`, `\|`, `\|\|`, lone `&`; `&&` allowed). Wrap complex logic in a script. When absent, execute tasks fall back to `testCommand`, which then runs **twice** (as the job and again at contract verify). |
|
|
47
|
+
| `matrixMaxParallel` | `## Matrix` tasks that must not take every lane | Positive integer; effective row concurrency is `min(matrixMaxParallel, lanes.maxParallel)` |
|
|
46
48
|
|
|
47
49
|
Unknown field names produce **warnings** at validate time (not errors). Duplicate rows are errors.
|
|
48
50
|
|
|
@@ -101,17 +103,17 @@ Symptom in journal: `testCommand` passes but `fileScopeMustNotChange` fails with
|
|
|
101
103
|
|
|
102
104
|
| Field | Value |
|
|
103
105
|
|-------|-------|
|
|
104
|
-
| testCommand | `npm run lint && npm run typecheck && SPINE_WORKER_STUB=1 node --experimental-strip-types --test tests/tasks/validate-cli.test.mjs` |
|
|
106
|
+
| testCommand | `npm run lint && npm run typecheck && SPINE_WORKER_STUB=1 node --experimental-strip-types --test --test-reporter=dot tests/tasks/validate-cli.test.mjs` |
|
|
105
107
|
```
|
|
106
108
|
|
|
107
|
-
###
|
|
109
|
+
### L task with coverage gate
|
|
108
110
|
|
|
109
111
|
```markdown
|
|
110
112
|
## Contract
|
|
111
113
|
|
|
112
114
|
| Field | Value |
|
|
113
115
|
|-------|-------|
|
|
114
|
-
| testCommand | `npm run lint && npm run typecheck && SPINE_WORKER_STUB=1 node --experimental-strip-types --test tests/tasks/validate-prompt.test.mjs` |
|
|
116
|
+
| testCommand | `npm run lint && npm run typecheck && SPINE_WORKER_STUB=1 node --experimental-strip-types --test --test-reporter=dot tests/tasks/validate-prompt.test.mjs` |
|
|
115
117
|
| fileScopeMustChange | `src/tasks/packet/validate-prompt.mjs` |
|
|
116
118
|
| minLineCoverage | 77 |
|
|
117
119
|
```
|
|
@@ -162,7 +164,7 @@ Use docs-only when the worker's only product deliverable is documentation. Use s
|
|
|
162
164
|
|
|
163
165
|
| Field | Value |
|
|
164
166
|
|-------|-------|
|
|
165
|
-
| testCommand | `npm run lint && npm run typecheck && SPINE_WORKER_STUB=1 node --experimental-strip-types --test tests/batch/final-verdict.test.mjs` |
|
|
167
|
+
| testCommand | `npm run lint && npm run typecheck && SPINE_WORKER_STUB=1 node --experimental-strip-types --test --test-reporter=dot tests/batch/final-verdict.test.mjs` |
|
|
166
168
|
| fileScopeMustChange | `src/batch/review.mjs` |
|
|
167
169
|
| fileScopeMustNotChange | `src/planner/**`, `src/batch/journal.mjs` |
|
|
168
170
|
| artifactsMustExist | `tests/batch/final-verdict.test.mjs` |
|
|
@@ -177,7 +179,7 @@ Use when a task runs a multi-hour external matrix or CI arm with little in-repo
|
|
|
177
179
|
|
|
178
180
|
| Field | Value |
|
|
179
181
|
|-------|-------|
|
|
180
|
-
| testCommand | `npm run lint && npm run typecheck && SPINE_WORKER_STUB=1 node --experimental-strip-types --test tests/batch/status-classification-align.test.mjs` |
|
|
182
|
+
| testCommand | `npm run lint && npm run typecheck && SPINE_WORKER_STUB=1 node --experimental-strip-types --test --test-reporter=dot tests/batch/status-classification-align.test.mjs` |
|
|
181
183
|
| stallTimeoutMinutes | 240 |
|
|
182
184
|
| extendGraceOnFileScope | true |
|
|
183
185
|
| fileScopeMustChange | `spine-tasks/SP-029-*/STATUS.md` |
|
|
@@ -185,6 +187,48 @@ Use when a task runs a multi-hour external matrix or CI arm with little in-repo
|
|
|
185
187
|
|
|
186
188
|
Recommended: **240** minutes for jobs expected to run 2+ hours. Size S floor (90m) and global default (120m) are additive floors; contract value wins when higher.
|
|
187
189
|
|
|
190
|
+
When the long job is a **known command**, prefer an execute task (below) — an LLM worker supervising a multi-hour command burns turns waiting for output and can background the command and exit without `.DONE` ([#276](https://github.com/beettlle/pi-spine/issues/276)).
|
|
191
|
+
|
|
192
|
+
### Execute task (no LLM worker)
|
|
193
|
+
|
|
194
|
+
`**Type:** execute` in the PROMPT header; Review Level 0. The engine runs `runCommand`; `testCommand` is a cheap proof re-run at contract verify.
|
|
195
|
+
|
|
196
|
+
```markdown
|
|
197
|
+
## Contract
|
|
198
|
+
|
|
199
|
+
| Field | Value |
|
|
200
|
+
|-------|-------|
|
|
201
|
+
| runCommand | `sh scripts/collect-evidence.sh` |
|
|
202
|
+
| testCommand | `test -f out/evidence.json` |
|
|
203
|
+
| fileScopeMustChange | `out/evidence.json` |
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Anti-pattern:** only `testCommand` set to the expensive job (`` `sh scripts/collect-evidence.sh` ``) — the engine runs it as the job **and** again at verify.
|
|
207
|
+
|
|
208
|
+
### Execute matrix task
|
|
209
|
+
|
|
210
|
+
Add a `## Matrix` table to the PROMPT; `{matrix.<column>}` placeholders are substituted per row. Write row-distinct outputs so row branches merge cleanly. `matrixMaxParallel` caps concurrent rows (`min(matrixMaxParallel, lanes.maxParallel)`).
|
|
211
|
+
|
|
212
|
+
```markdown
|
|
213
|
+
## Matrix
|
|
214
|
+
|
|
215
|
+
| run_id | target |
|
|
216
|
+
|--------|--------|
|
|
217
|
+
| east | us-east-1 |
|
|
218
|
+
| west | us-west-2 |
|
|
219
|
+
|
|
220
|
+
## Contract
|
|
221
|
+
|
|
222
|
+
| Field | Value |
|
|
223
|
+
|-------|-------|
|
|
224
|
+
| runCommand | `sh scripts/smoke.sh {matrix.target} out/{matrix.run_id}.json` |
|
|
225
|
+
| testCommand | `test -f out/{matrix.run_id}.json` |
|
|
226
|
+
| fileScopeMustChange | `out/{matrix.run_id}.json` |
|
|
227
|
+
| matrixMaxParallel | 2 |
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Rows also receive `SPINE_MATRIX_TASK_INDEX` (and Slurm/Kubernetes aliases); contract commands refuse `$`, so read them inside the script. Retry one failed row with `spine batch retry 'SP-X[rowId]'`. Full row semantics: [operator-runbook §2.4](../../../docs/adoption/operator-runbook.md#24-matrix-tasks-parametric-sub-lanes).
|
|
231
|
+
|
|
188
232
|
---
|
|
189
233
|
|
|
190
234
|
## Cross-model authoring (worker ≠ reviewer)
|
|
@@ -222,6 +266,7 @@ Reviewers spawn as **fresh sessions** with no memory of the worker session (FR-R
|
|
|
222
266
|
| Task type | Recommended `testCommand` |
|
|
223
267
|
|-----------|---------------------------|
|
|
224
268
|
| Docs-only, no code changes | `` `true` `` **and** `fileScopeMustChange` with at least one deliverable doc path |
|
|
269
|
+
| `Type: execute` (deterministic job) | `runCommand` = the job; `testCommand` = cheap artifact proof (`` `test -f out/x.json` ``) |
|
|
225
270
|
| Single module, targeted tests exist (Size S/M) | `` `npm run lint && npm run typecheck && node --test tests/feature.test.mjs` `` or `` `flutter analyze && flutter test test/unit/services/foo_test.dart` `` |
|
|
226
271
|
| **Shared-module behavior change** (diagnosis, reconcile, parse-prompt, worktree, doctor) | `` `npm run lint &&` `` then chain **all** related `tests/**/*.test.mjs` from `rg` for old strings — not only the new test file (see below) |
|
|
227
272
|
| Full-suite safe in lane worktree (Size L) | `` `npm run lint && npm run typecheck && SPINE_WORKER_STUB=1 npm test` `` |
|