@gobing-ai/spur 0.3.77 → 0.3.78
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/.claude-plugin/marketplace.json +1 -1
- package/package.json +9 -9
- package/plugins/sp/commands/dev-refineall.md +1 -0
- package/plugins/sp/commands/dev-run.md +1 -0
- package/plugins/sp/commands/dev-runall.md +1 -0
- package/plugins/sp/commands/dev-verifyall.md +1 -0
- package/plugins/sp/plugin.json +1 -1
- package/plugins/sp/scripts/batch-preflight.mjs +173 -2
- package/plugins/sp/scripts/batch-preflight.ts +257 -2
- package/plugins/sp/scripts/verify-answer-lint.ts +11 -6
- package/plugins/sp/skills/spur-dev/references/cross-cutting.md +33 -0
- package/plugins/sp/skills/spur-dev/references/execution-batch.md +17 -0
- package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +102 -13
- package/spur.js +1207 -538
|
@@ -446,6 +446,23 @@ isolated git worktree instead of the operator's working directory. This section
|
|
|
446
446
|
lifecycle for the sequential batch loop. Per-task worktrees and `--mode parallel` isolation stay out
|
|
447
447
|
of scope (task 0142 Slice A); `--worktree --mode parallel` is rejected.
|
|
448
448
|
|
|
449
|
+
**Startup ordering (task 0814 R3).** Resolve the selector/status filter and run the quick
|
|
450
|
+
command-aware readiness (the `quickReadiness` contract in `batch-preflight.ts`) **before** creating
|
|
451
|
+
or adopting the tree. The admission decision is what determines whether a tree should be cut at all;
|
|
452
|
+
all subsequent tools, agents, task/feature writes, and run artifacts use the confirmed execution
|
|
453
|
+
tree's cwd. A stale or empty selector, an unsupported mode, or an invalid target creates no tree and
|
|
454
|
+
no marker (WT-2/WT-7), and the required Git safety checks (WT-1) still precede creation.
|
|
455
|
+
|
|
456
|
+
> **Command wiring (task 0814 R3).** The four worktree-capable commands (`dev-run`, `dev-runall`,
|
|
457
|
+
> `dev-refineall`, `dev-verifyall`) each call `quickReadiness` with their operation (`run`/`refine`/
|
|
458
|
+
> `verify`), the resolved selector/status, and the filtered-set size **before** WT-1/WT-2. The
|
|
459
|
+
> admission outcome gates the tree: an invalid/empty selector, unsupported mode, or a target that
|
|
460
|
+
> quickReadiness marks `blocked`/`invalid` creates no tree and no marker (WT-2/WT-7); a
|
|
461
|
+
> `needs-refinement` refine batch is still work to do (the tree is created, the gaps are the work).
|
|
462
|
+
> The required Git safety checks (WT-1) still precede creation, and ownership/identity is confirmed
|
|
463
|
+
> before any tool, agent, corpus write, or run artifact. A later failure retains the tree with
|
|
464
|
+
> recovery information (WT-5).
|
|
465
|
+
|
|
449
466
|
**Single-task `dev-run` (batch of one).** `/sp:dev-run <wbs> --worktree [<name>]` runs this same
|
|
450
467
|
lifecycle with a one-task loop: WT-1…WT-6 apply unchanged, the marker's `command` is `dev-run` and
|
|
451
468
|
its `selector` is the `<wbs>` (so WT-6's command+selector fallback resolves the resume), and the
|
|
@@ -43,9 +43,19 @@ command, skill, script, or second workflow.
|
|
|
43
43
|
|
|
44
44
|
## Run setup
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
**Shared startup contract (task 0814 R1/R3/R4/R6/R7).** The order is load-bearing: publish a compact
|
|
47
|
+
**bootstrap checklist** immediately (host-preparation rows, never copied workflow states); run quick
|
|
48
|
+
deterministic readiness (admission, not an implementation certificate) before any isolation; when
|
|
49
|
+
`--worktree` is valid, create/adopt and switch to the execution tree; then publish the **workflow
|
|
50
|
+
inventory** (the CLI todo projection) — and only then read the full YAML for comprehensive/model work.
|
|
51
|
+
Comprehensive checks stay at their owning boundaries and run after the plan is visible and after
|
|
52
|
+
isolation when requested (R7); quick readiness and plan projection dispatch zero models and execute
|
|
53
|
+
zero workflow actions (R8). Use the stable label helpers
|
|
54
|
+
(`columnLabel` / `buildStepLabels` / `labelChild` in `packages/app/src/workflow/step-reporter.ts`) for
|
|
55
|
+
the human/native presentation layer — labels are display addresses only, never an execution key.
|
|
56
|
+
|
|
57
|
+
1. Resolve the command inputs, `--auto`, and any explicit `--vars` — **without reading the selected
|
|
58
|
+
YAML yet**. An explicit non-inline executor selection chooses the subprocess workflow path.
|
|
49
59
|
2. Allocate a collision-resistant inline run id (`uuidgen`, with a timestamp/pid fallback), create
|
|
50
60
|
`.spur/run/`, and use `.spur/run/<run-id>.log` as the run log.
|
|
51
61
|
3. **Authoritative run identity (task 0804 R1, fail-closed).** Persist the run row through the
|
|
@@ -64,18 +74,60 @@ command, skill, script, or second workflow.
|
|
|
64
74
|
and writes `.spur/run/<run-id>-inline-setup.json`. Seed `__runId` and `__definitionDigest`
|
|
65
75
|
from that file so proof capture and bound registration verify against the persisted identity.
|
|
66
76
|
A non-zero exit (missing row identity, changed definition, bundle-only install) stops the run —
|
|
67
|
-
never continue unbound and never fabricate a PASS.
|
|
77
|
+
never continue unbound and never fabricate a PASS. (The delegate persists the authoritative
|
|
78
|
+
RUN row only — the 0808 inline record is the registration-equivalent convention below, not a
|
|
79
|
+
setup-time artifact-ledger insert.)
|
|
80
|
+
|
|
81
|
+
**Frozen invocation identity (task 0809 R4).** The definition parsed and hashed at setup is
|
|
82
|
+
the definition for the ENTIRE run: keep one invocation-time parsed definition and never
|
|
83
|
+
re-resolve or reseed `__definitionDigest` at record because a workflow YAML changed. Two
|
|
84
|
+
digests serve different purposes: `proof.digest` is the freshly captured current-input
|
|
85
|
+
fingerprint; `proof.definitionDigest` identifies the workflow actually interpreted (the setup
|
|
86
|
+
identity). A source-only edit of a TRACKED workflow YAML before capture is part of current
|
|
87
|
+
input proof — the Git fingerprint covers tracked working-tree files, and ignored/external
|
|
88
|
+
workflow files are NOT part of it (their executed identity remains the setup digest).
|
|
89
|
+
Post-capture changes to fingerprinted inputs invalidate that proof and take the normal
|
|
90
|
+
certification loop — stale post-capture evidence is refused, never reconciled. If execution
|
|
91
|
+
must switch to a different definition, or the executed identity cannot be established: stop
|
|
92
|
+
before record, preserve the run log and evidence, and start a FRESH inline run with a fresh
|
|
93
|
+
run id and fresh gate/review/verify certification. Never mutate old run/proof identities,
|
|
94
|
+
manufacture a paused engine snapshot, or call `continuePaused` for a running inline row;
|
|
95
|
+
task text, Git attribution and `--auto` are not consent to stamp `resumeDefinitionDigest` —
|
|
96
|
+
explicit consent for actual paused engine runs stays owned by task 0784.
|
|
68
97
|
4. Resolve the host session id from `.spur/context/.session.json`, accepting the normalized hook key
|
|
69
98
|
`session` and the Codex key `session_id` (in that order). If neither is available, allocate
|
|
70
99
|
`host-session-<run-id>` and record that fallback in the log; provenance must never be blank or
|
|
71
100
|
guessed from an executor subprocess.
|
|
72
|
-
5.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
101
|
+
5. **Publish the bootstrap checklist (R1).** Render host-preparation rows into the host todo list
|
|
102
|
+
before any expensive check: `A, Quick readiness`, `B, Prepare Git`, `C, Publish workflow plan`,
|
|
103
|
+
`D, Comprehensive checking`. These are host preparation, never copied workflow states; they are
|
|
104
|
+
not silently reassigned to unrelated workflow states when the workflow view later appears.
|
|
105
|
+
6. **Quick deterministic readiness (R2), before isolation.** Evaluate `quickReadiness` from
|
|
106
|
+
`plugins/sp/scripts/batch-preflight.ts` with the operation, status, filtered-set size, the
|
|
107
|
+
matrix-selected required/present sections, and content-policy findings. Record the outcome
|
|
108
|
+
(runnable / needs-refinement / blocked / skipped / invalid) in the run log. Admission decision
|
|
109
|
+
only — no model, no full tests/lint, no live-data probe, no feature mutation, no corpus-wide
|
|
110
|
+
relational check.
|
|
111
|
+
7. **Isolation (R3), only when `--worktree` is valid.** After quick readiness and the required Git
|
|
112
|
+
safety checks succeed, create/adopt and `cd` into the execution tree; confirm absolute cwd,
|
|
113
|
+
branch, base SHA, and ownership. An invalid/empty target, unsupported mode, ambiguous ownership,
|
|
114
|
+
or stale target stops without creating a tree or discarding work. All subsequent tools, agents,
|
|
115
|
+
corpus writes, and run artifacts use the confirmed execution tree.
|
|
116
|
+
8. **Publish the workflow inventory (R4), BEFORE reading the YAML.** Resolve the selected workflow
|
|
117
|
+
through the same project/bundled resolver as execution and run
|
|
118
|
+
`spur workflow show <resolved-file> --no-logo --format todo --json`. Validate the projection with
|
|
119
|
+
`parseWorkflowInventory` and bind it to the run's persisted `__definitionDigest` with
|
|
120
|
+
`assertInventoryIdentity` — a drift or projection failure stops the run before any
|
|
121
|
+
comprehensive/model work, never executing with a misleading plan.
|
|
122
|
+
- **Layer 1** = that projection's `steps[]`: the declared state inventory in declaration order
|
|
123
|
+
with `initial` / `terminal` / `failure` / `pause` / `loopBack` / `conditional` markers. Mark
|
|
124
|
+
the active state. Never re-derive this list from the YAML.
|
|
125
|
+
9. **Read the selected YAML and overlay its `vars` defaults** with the invocation values. Compare the
|
|
126
|
+
resolved definition identity against the bound `__definitionDigest`; a mismatch is identity drift
|
|
127
|
+
and fails closed (step 8 already caught projection-side drift; this re-checks the same definition
|
|
128
|
+
the interpreter will execute).
|
|
77
129
|
- **Layer 2** = the active state's `onEnter` actions (`kind` + resolved `input`/`command`), from
|
|
78
|
-
the YAML
|
|
130
|
+
the YAML read here, shown only for the active state.
|
|
79
131
|
- **Refresh cadence** = stage boundaries only (when the current state changes after a transition),
|
|
80
132
|
never per action.
|
|
81
133
|
- **Transition reconciliation (task 0727)** = at every stage boundary the host must
|
|
@@ -84,9 +136,18 @@ command, skill, script, or second workflow.
|
|
|
84
136
|
whether the stage ran via native subagent, host-inline execution, or the post-dispatch host
|
|
85
137
|
fallback, so a run can never terminate with earlier stages stuck `in_progress` (task 0726
|
|
86
138
|
ended 0/11 with precheck and implement still open).
|
|
87
|
-
- **Source of truth** = the CLI projection for layer 1; the YAML
|
|
139
|
+
- **Source of truth** = the CLI projection for layer 1; the YAML read here for layer 2.
|
|
88
140
|
Never hand-copy or hand-derive the state list into the driver, a command, a skill, or a script.
|
|
89
|
-
|
|
141
|
+
- **Stable labels (task 0814 R5).** Top-level declaration indexes map to A, B, … Z, AA, AB …;
|
|
142
|
+
visible children restart numbering under their parent (A1, A2, B1 …). Labels never replace the
|
|
143
|
+
canonical step id, and are re-derived identically on retry/resume against the same definition.
|
|
144
|
+
- **Truthful progress (task 0814 R6).** Publish pending/active state before the visible item
|
|
145
|
+
starts, then update it immediately after the observed item completes and before the next item
|
|
146
|
+
starts. Keep completed, skipped, failed, blocked, paused, and unattempted outcomes distinct;
|
|
147
|
+
never mark skipped/conditional work completed merely to clear the UI. If the host has no
|
|
148
|
+
suitable native todo tool, or it fails, use an explicit Markdown fallback with the same labels
|
|
149
|
+
and truth — never a fabricated successful tool invocation.
|
|
150
|
+
10. For task execution only, record lifecycle provenance before entering the FSM:
|
|
90
151
|
|
|
91
152
|
```bash
|
|
92
153
|
spur task run-link <wbs> --source inline-full --run-id <run-id> --json
|
|
@@ -95,6 +156,28 @@ command, skill, script, or second workflow.
|
|
|
95
156
|
This is required for the normal `testing → done` provenance guard. Planning pipelines have no
|
|
96
157
|
task lifecycle link and skip this task-specific action.
|
|
97
158
|
|
|
159
|
+
## Comprehensive-check retention and evidence (R7/R8)
|
|
160
|
+
|
|
161
|
+
**R7 — comprehensive checks stay at their owning boundaries.** Quick readiness and plan projection are
|
|
162
|
+
admission and visibility, not a substitute for the owning gates. After the plan is visible and after
|
|
163
|
+
isolation when requested, retain the full task/feature integrity, size, evidence-channel,
|
|
164
|
+
provenance, capability, dependency, quality, review, and verification gates exactly where their
|
|
165
|
+
owners declare them. Prefer deterministic checks; invoke semantic model work only for an identified
|
|
166
|
+
unresolved requirement/design/evidence question and record its reason in the run log. Reuse a
|
|
167
|
+
cached observation only while its relevant inputs (task content, effective status, matrix, dependency
|
|
168
|
+
snapshot, cwd) remain unchanged; refresh after branch/tree changes, task writes, dependency
|
|
169
|
+
completion, or resume. Never run a shadow copy of a workflow precheck state in the host — if a
|
|
170
|
+
workflow defines a precheck state, its result updates that state, not a host-side duplicate.
|
|
171
|
+
|
|
172
|
+
**R8 — matched before/after evidence, no invented claims.** Record a timestamped event trace under
|
|
173
|
+
`.spur/run/<run-id>-event-trace.md` (render via `renderEventTrace` in
|
|
174
|
+
`packages/app/src/workflow/workflow-inventory.ts`) naming event ordering, time-to-first-visible
|
|
175
|
+
checklist, time-to-workflow-inventory, confirmed execution cwd, and CLI/process/model invocation
|
|
176
|
+
counts. Quick readiness and plan projection must dispatch zero models and execute zero workflow
|
|
177
|
+
actions — record that as observed. Record unavailable measurements as `unknown`; never present a
|
|
178
|
+
simulated run as a real verified outcome. Event order and provenance are evidence; wall-clock/token
|
|
179
|
+
savings are observations, never fabricated pass conditions.
|
|
180
|
+
|
|
98
181
|
## YAML interpreter
|
|
99
182
|
|
|
100
183
|
Start at `initialState`. For each current state, execute its `onEnter` actions in declaration order,
|
|
@@ -127,7 +210,13 @@ Action semantics come from the YAML and the workflow action contract:
|
|
|
127
210
|
line to `.spur/run/<run-id>.log` naming the equivalence (artifact kind, path, verdict, digest) and
|
|
128
211
|
proceeds to `spur task record`. A failed validation stops at the state and follows the failure
|
|
129
212
|
contract; the step is never silently skipped. Artifact-provenance consumers read that run-log
|
|
130
|
-
line on the inline path — there is no ledger row.
|
|
213
|
+
line on the inline path — there is no ledger row. The validation also includes **run/definition
|
|
214
|
+
identity agreement from authoritative evidence** (task 0809 R4): the verdict's `proof.runId` and
|
|
215
|
+
`proof.definitionDigest` must agree with the setup artifact `.spur/run/<run-id>-inline-setup.json`
|
|
216
|
+
and the persisted run row; if that identity is absent or conflicts, STOP — recreating a row is
|
|
217
|
+
not a diagnostic operation. The app-service bound-artifact fixture (which writes a real engine
|
|
218
|
+
ledger row) is service-level test evidence for this identity mechanics, not evidence that the
|
|
219
|
+
inline host writes a ledger.
|
|
131
220
|
|
|
132
221
|
**Native-subagent dispatch (R2 eligibility, evaluated before each action):**
|
|
133
222
|
|