@gobing-ai/spur 0.3.48 → 0.3.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/config/config.example.yaml +52 -4
  3. package/config/workflows/pr-review.yaml +338 -0
  4. package/package.json +8 -8
  5. package/plugins/sp/README.md +9 -6
  6. package/plugins/sp/commands/{dev-featurechange.md → dev-feature-change.md} +7 -10
  7. package/plugins/sp/commands/dev-find-issue.md +24 -19
  8. package/plugins/sp/commands/dev-find-next.md +3 -3
  9. package/plugins/sp/commands/dev-gtd.md +11 -12
  10. package/plugins/sp/commands/dev-history-load.md +63 -0
  11. package/plugins/sp/commands/dev-pr-review.md +39 -0
  12. package/plugins/sp/plugin.json +1 -1
  13. package/plugins/sp/references/roles.md +25 -12
  14. package/plugins/sp/scripts/history-load.ts +400 -0
  15. package/plugins/sp/scripts/pr-reviewing.ts +867 -0
  16. package/plugins/sp/scripts/validate-commands.ts +33 -2
  17. package/plugins/sp/skills/code-implementation/SKILL.md +9 -1
  18. package/plugins/sp/skills/code-verification/SKILL.md +27 -28
  19. package/plugins/sp/skills/issue-finding/SKILL.md +6 -5
  20. package/plugins/sp/skills/issue-finding/references/session-formats.md +4 -2
  21. package/plugins/sp/skills/next-feature/SKILL.md +6 -6
  22. package/plugins/sp/skills/next-feature/references/handoff-routing.md +5 -5
  23. package/plugins/sp/skills/next-feature/references/signal-derivation.md +7 -2
  24. package/plugins/sp/skills/pr-reviewing/SKILL.md +285 -0
  25. package/plugins/sp/skills/spur-cli/references/features/hierarchy-mece.md +5 -5
  26. package/plugins/sp/skills/spur-cli/references/features.md +1 -1
  27. package/plugins/sp/skills/spur-dev/references/flag-glossary.md +14 -4
  28. package/schemas/spur-config.schema.json +20 -0
  29. package/spur.js +682 -222
@@ -0,0 +1,285 @@
1
+ ---
2
+ name: pr-reviewing
3
+ description: "GitHub Codex PR-review workflow — prepare/reuse a PR, request `@codex review`, collect findings, and optionally validate/fix/re-review them. Backs /sp:dev-pr-review. Triggers: PR review, codex review, @codex review, review my PR, codex findings, dev-pr-review."
4
+ license: Apache-2.0
5
+ version: 1.0.0
6
+ metadata:
7
+ author: spur
8
+ platforms: "claude-code,codex,openclaw,opencode,antigravity,pi"
9
+ category: engineering-core
10
+ interactions:
11
+ - workflow
12
+ - review
13
+ pipeline_steps:
14
+ - preflight
15
+ - hygiene
16
+ - request
17
+ - wait
18
+ - collect
19
+ - triage
20
+ see_also:
21
+ - sp:code-verification
22
+ - sp:functional-review
23
+ - sp:spur-cli
24
+ - sp:spur-dev
25
+ ---
26
+
27
+ # sp:pr-reviewing — GitHub Codex PR Review
28
+
29
+ Backend for `/sp:dev-pr-review`. The invoking coding agent is the local orchestrator and
30
+ implementer; **GitHub Codex Code Review** is the independent reviewer. The point of the route is
31
+ that review effort happens on the PR, through Codex — not in the local session.
32
+
33
+ ## Architecture
34
+
35
+ ```text
36
+ /sp:dev-pr-review (thin command)
37
+ │ Skill(skill="sp:pr-reviewing", args=...)
38
+
39
+ sp:pr-reviewing (this skill — mode routing, triage, fix, rules)
40
+ │ deterministic spine, state order + guards:
41
+
42
+ .spur/workflows/pr-review.yaml ← workflow SSOT (seeded by spur init; project-tunable)
43
+ │ every state resolves with `superskill script path` and shells out to:
44
+
45
+ staged pr-reviewing.ts ← Bun entrypoint for the tested git/gh core
46
+ ```
47
+
48
+ - **State order and guards** are defined once, in the workflow YAML. Do not re-derive them in
49
+ prose; when the YAML and this file disagree, the YAML wins and this file gets fixed.
50
+ - **Deterministic work** (every git/gh call) goes through the script subcommands — never
51
+ hand-rolled `gh` invocations that drift from the tested core.
52
+ - **Model-bearing work** (finding triage, `fix` edits, `rules` authoring) is this skill's job and
53
+ never enters the workflow machine.
54
+ - The workflow YAML exposes only its declared spine modes (`full`, `submit`, and `rerun`). The
55
+ direct-mode routes below own `collect`, `fix`, `status`, and `rules`; keep those modes outside
56
+ the workflow `mode` variable.
57
+
58
+ ## Non-negotiable Codex routing
59
+
60
+ The external review MUST go through the GitHub pull request and an `@codex review` request.
61
+ Never substitute a local Codex review mechanism — no Codex CLI `/review`, no `codex review`, no
62
+ vendor-specific local review commands. If GitHub Codex Code Review is unavailable, stop and report
63
+ the setup/access problem; never silently fall back to a local review.
64
+
65
+ Never claim a request consumed a specific billing/quota bucket unless the platform exposes that
66
+ fact. The guarantee of this workflow is the route: GitHub Codex Code Review on the PR.
67
+
68
+ ## Modes and routing
69
+
70
+ Parse the first positional argument as the mode; default `full`.
71
+
72
+ | Mode | Route | Behavior |
73
+ | --- | --- | --- |
74
+ | `full` | Workflow YAML | Preflight → hygiene → precheck → push → ensure-pr → request (reviewed/in-flight HEAD dedupe) → wait → collect → report. No source edits. |
75
+ | `submit` | Workflow YAML | Run the spine through `request`; return pending for a new request (`--no-wait` has the same effect). If the exact current HEAD was already reviewed, collect that result instead of requesting a duplicate. |
76
+ | `rerun` | Workflow YAML | Run the spine and request a fresh review of the current pushed HEAD with `--force`. No source edits. |
77
+ | `collect` | Direct script | Do not start the workflow or request a review. Collect the current PR's result and composite status; a missing current-HEAD result is **pending**, never clean. |
78
+ | `fix` | Direct script + model work | Collect first, independently validate current-HEAD findings, fix legitimate issues, verify, make one focused commit, push, then force-request/review/collect the new HEAD. Do not pass `mode=fix` to the workflow. |
79
+ | `status` | Direct script | Read-only composite: repository, branch, local HEAD, PR/base, local changes, CI, and Codex state for the current PR HEAD. Do not start the workflow. |
80
+ | `rules` | Model work only | Create or improve the repo-root `AGENTS.md` section `## Code Review Rules`; do not invoke the workflow, request a review, commit, or push. |
81
+
82
+ ## Arguments
83
+
84
+ - `--base <branch>` — base for a newly created PR. Default: existing PR's base, else repo default.
85
+ - `--no-wait` — after a successful request, return pending instead of polling.
86
+ - `--agent <inline|auto|name>` — names **who performs model-bearing work**, per the
87
+ [inline-default execution-surface contract](../spur-dev/references/cross-cutting.md#inline-default-execution-surface).
88
+ Omit: the current agent is the default owner (eligible model stages may use one native subagent
89
+ under the shared contract). `inline` keeps all model work in the host session as the hard
90
+ zero-dispatch guarantee. `auto` resolves the command's declared role; a named executor pins that executor.
91
+ An alternate executor gets one `spur agent run --agent <value>` dispatch with the selector removed
92
+ from child args; that child owns model work. Current-agent selection stays inline.
93
+ Headless surfaces reject explicit `inline` with the shared stable error.
94
+ - `--agent` describes the model owner only; it is independent of the deterministic git/GitHub spine
95
+ and the workflow/direct route. Run the selected route in that resolved skill context. A separate
96
+ workflow subprocess belongs to the caller's execution surface or an objective trigger (for example,
97
+ a required durable run record), not to `--agent auto` or a name by itself.
98
+ - Remaining free text — extra review focus, appended to the Codex request without weakening
99
+ repository-defined rules (e.g. `security and authorization boundaries`, `migration safety`).
100
+
101
+ ## Safety rules
102
+
103
+ **Git history — never:** force-push (`--force`/`--force-with-lease`), destructive `git reset`,
104
+ `git clean`, rewriting published history, merging the PR, deleting branches, discarding unrelated
105
+ user changes.
106
+
107
+ **Local changes.** A GitHub PR only reviews pushed commits. If relevant changes are uncommitted:
108
+ inspect the tree, separate relevant from unrelated, never `git add .` blindly, and ask the user
109
+ before creating any commit outside `fix` mode. If safe separation is ambiguous, stop and explain.
110
+ In `fix` mode the user pre-authorized one focused fix commit for verified findings — still stop if
111
+ unrelated uncommitted changes make safe editing or committing ambiguous.
112
+
113
+ **Current-HEAD invariant.** Treat the PR's pushed `headRefOid` as the review identity. After every
114
+ preflight, push, commit, and request, record the returned HEAD and require `wait`, `collect`, and
115
+ the report to match that exact HEAD. A result for an older commit is stale; a result absent for the
116
+ current HEAD is pending, not clean. Reject uncorrelated issue/conversation comments rather than
117
+ using them to manufacture a current-HEAD result. In `fix` mode, discard the old result after the
118
+ fix commit and judge only the forced re-review for the new pushed HEAD.
119
+
120
+ **Reviewer authority.** Codex is an independent reviewer, not an authority. For every finding that
121
+ may lead to a code change: inspect the referenced code, verify reachability and intended behavior,
122
+ inspect callers/callees where needed, check existing tests, classify, reject false positives, fix
123
+ root causes rather than wording, prefer the smallest coherent patch, avoid drive-by refactors.
124
+
125
+ ## Workflow-backed spine (`full`, `submit`, `rerun`)
126
+
127
+ Run the workflow YAML's declared states in order. Every deterministic state invokes the
128
+ staged entrypoint below, supports `--json`, and must be parsed. Stop at the first red gate and
129
+ report its artifact. The canonical installed invocation is:
130
+
131
+ ```sh
132
+ bun "$(superskill script path sp pr-reviewing.ts)" <subcommand> [flags]
133
+ ```
134
+
135
+ Installed targets resolve the staged TypeScript source and execute it with Bun, matching the rest
136
+ of `plugins/sp/scripts`.
137
+
138
+ 1. **Preflight** — `<script> preflight --json`. Hard-fails on a
139
+ detached HEAD, missing `gh` auth, no GitHub remote, or a dirty tree. On a dirty tree, triage
140
+ with the user (commit/stash/exclude) before continuing — the workflow refuses to guess.
141
+ 2. **Hygiene** — `<script> hygiene --base "$base" --json`. `BLOCK` (secrets, `.env`, conflict markers,
142
+ private keys) stops the run — never submit a tainted diff. `WARN` (debug residue) rides along
143
+ into the report. This is a submission sanity check, not a second local review.
144
+ 3. **Precheck** — if the workflow YAML's `preReviewCmd` var is set, run it; a red check stops the
145
+ run (do not spend a review request on code that fails its own gate). When unset, report that
146
+ pre-review verification was not configured rather than inventing project commands.
147
+ 4. **Push** — `<script> push --json`. Normal push only; sets upstream when missing.
148
+ 5. **Ensure PR** — `<script> ensure-pr --base "$base" --json`. Reuses the branch's PR; creates with
149
+ `gh pr create --fill` only when absent. Never a duplicate PR.
150
+ 6. **Request** — `<script> request --focus "<focus>" --json` (`--force` in `rerun` mode). Dedupes when
151
+ Codex already reviewed the exact pushed HEAD (`ALREADY_REVIEWED` → skip to collect) or a marked
152
+ request by the current GitHub user is still in flight (`ALREADY_REQUESTED` → pending). The
153
+ request body is concise when the repo has `## Code Review Rules`, else carries the default
154
+ actionable-issues focus. Records PR, URL, HEAD, and request time.
155
+ 7. **Wait** (full/rerun unless `--no-wait`; submit stops before it) —
156
+ `<script> wait --since "$requestedAt" --head "$requestHead" --json`, using the request result so
157
+ a fast response is not missed, `rerun` cannot reuse the prior review, and a moved HEAD fails loud.
158
+ Polls every ~30s for up to
159
+ ~10 minutes across the current HEAD's PR review and inline comments. Uncorrelated conversation
160
+ comments are ignored. A current-HEAD clean review is a completed `CLEAN` outcome; findings are
161
+ `FOUND`; timeout or no current-HEAD result is **pending, not failed** — collect later.
162
+ 8. **Collect** — `<script> collect --since "$requestedAt" --head "$requestHead" --json`. Normalize
163
+ only the requested HEAD and request window; then invoke `status` with the same bounds for
164
+ PR/base/CI/local state. Never turn an absent, stale, or moved-HEAD result into `clean`.
165
+
166
+ ## Fix mode
167
+
168
+ Only in `fix` mode:
169
+
170
+ 1. **Collect before editing.** Invoke direct `collect --json` plus `status --json` and require a
171
+ completed result for the current pushed HEAD. If the result is pending, stale, or unavailable,
172
+ report it and stop without source edits. If it is explicitly clean, report no fixes and stop.
173
+ 2. **Validate each finding.** Open the referenced code; trace callers/callees; verify the problem
174
+ is reachable; check intended behavior and existing tests. Classify: `Confirmed`,
175
+ `Likely valid`, `Needs investigation`, `Likely false positive`. Never edit for a likely false
176
+ positive; investigate further before editing a `Needs investigation`.
177
+ 3. **Fix legitimate issues** with the smallest coherent change. Preserve existing interfaces
178
+ unless the defect requires otherwise; no unrelated refactoring; add or update tests when they
179
+ materially demonstrate the fix; follow repository conventions. Inspect `git diff` — the patch
180
+ must contain only intended review fixes.
181
+ 4. **Verify** with repository-defined targeted tests/type checks/linters. Never claim a check
182
+ passed unless it actually ran successfully.
183
+ 5. **Commit** one focused review-fix commit. The message describes the actual defect
184
+ (`fix: prevent duplicate transaction retry`), never `fix codex comments`. No unrelated files.
185
+ 6. **Push** normally to the existing PR branch (never force), record the new HEAD, and discard the
186
+ previous review identity.
187
+ 7. **Re-review:** invoke the staged `request --force`, then wait/collect as usual. The new review
188
+ must correspond to the new pushed HEAD — never present stale findings from the previous HEAD as
189
+ the new result. Include composite CI/status fields in the final report.
190
+
191
+ ## Rules mode
192
+
193
+ Only in `rules` mode. Inspect the architecture, existing instructions, and current root
194
+ `AGENTS.md`, then create or improve a section named exactly `## Code Review Rules`, preserving
195
+ unrelated content. Prefer repository-specific invariants over generic advice, using only categories
196
+ that matter to the project: data safety (atomic multi-step writes, idempotency, transaction
197
+ boundaries), security (server-side authorization, untrusted client identifiers, secrets in logs),
198
+ API compatibility (public contracts, CLI, serialized formats, event payloads, schema), concurrency
199
+ (races, stale writes, retry semantics), migration safety (backward-compatible rollout,
200
+ mixed-version operation), tests (which high-risk changes require regression coverage), and project
201
+ invariants a reviewer unfamiliar with the codebase could miss. Avoid generic advice (`write clean
202
+ code`) and anything lint/format already enforces mechanically. Keep it concise and actionable.
203
+ Show the diff, summarize the meaningful rules added, and do not commit or push.
204
+
205
+ ## Reporting
206
+
207
+ Findings report:
208
+
209
+ ```text
210
+ PR
211
+ #<number> <url>
212
+
213
+ HEAD
214
+ <short SHA>
215
+
216
+ Codex review
217
+ Clean | Findings | Pending | Unavailable
218
+
219
+ Findings
220
+
221
+ 1. [severity] path:line
222
+ Classification: Confirmed | Likely valid | Needs investigation | Likely false positive
223
+ Problem:
224
+ Why it matters:
225
+ Evidence:
226
+ Recommended next action:
227
+
228
+ CI
229
+ <status summary>
230
+ ```
231
+
232
+ Preserve filenames, line references, severity, and the important technical reasoning. Do not
233
+ inflate suggestions into confirmed bugs. If the review completed without actionable findings, say
234
+ so clearly.
235
+
236
+ `wait` and `collect` must distinguish an explicit current-HEAD clean result from pending, stale, or
237
+ unavailable data. `collect` and `fix` reports also include the composite PR/base/branch/HEAD/local/CI
238
+ status; an unavailable CI signal remains `unavailable`, never an inferred pass.
239
+
240
+ Always end with the compact summary:
241
+
242
+ ```text
243
+ PR: <number + URL | none>
244
+ Branch: <branch>
245
+ HEAD: <short SHA>
246
+ Base: <base>
247
+ CI: <status>
248
+ Codex: clean | findings | pending | not requested | unavailable
249
+ Findings: <count>
250
+ ```
251
+
252
+ `fix` mode appends: `Fixed: <n>`, `Rejected: <n>`, `New HEAD: <sha>`,
253
+ `Re-review: clean | findings | pending | unavailable`. If findings remain, state the recommended
254
+ next action.
255
+
256
+ `status` mode prints the same summary block and nothing else — no file edits, PR creation, pushes,
257
+ or review requests.
258
+
259
+ ## Failure handling
260
+
261
+ - **`gh` missing or unauthenticated** — stop and report; do not switch to browser automation.
262
+ - **GitHub Codex unavailable** (not enabled/authorized for the repo) — preserve the error, explain
263
+ the required repository/account setup, do not fall back to local Codex.
264
+ - **PR creation failure** — report the actual git/GitHub state; never rewrite history as a
265
+ workaround.
266
+ - **Review timeout** — return `pending`, not `failed`, unless GitHub explicitly reports a failure.
267
+ - **CI failure** — Codex review and CI are independent signals; always surface failing checks even
268
+ when Codex reports clean.
269
+
270
+ ## Platform notes
271
+
272
+ - The skill, command, workflow YAML, and script are platform-neutral; per-platform emission is
273
+ owned by superskill. On platforms without a Skill tool, read this file and follow the protocol
274
+ manually — the script subcommands are plain CLI invocations.
275
+ - Prerequisites on any platform: `git`, GitHub CLI (`gh`) authenticated, and GitHub Codex Code
276
+ Review enabled for the repository.
277
+
278
+ ## Additional Resources
279
+
280
+ - **Workflow SSOT:** `.spur/workflows/pr-review.yaml` (seeded by `spur init`; tune per project —
281
+ wait budget, `preReviewCmd`, dedupe policy)
282
+ - **Script source:** [scripts/pr-reviewing.ts](../../scripts/pr-reviewing.ts) — subcommand CLI
283
+ - **Tests:** [tests/pr-reviewing.test.ts](../../tests/pr-reviewing.test.ts) — stubbed git/gh suites
284
+ - **Related skills:** `sp:code-verification` (local SECUA review), `sp:functional-review`
285
+ (requirements traceability) — complements, never substitutes, the independent Codex review
@@ -4,7 +4,7 @@ description: >-
4
4
  Explicit rules for creating new feature nodes or extending existing ones —
5
5
  MECE roots, cautious root creation, reparent vs merge, depth limits.
6
6
  Consumed by spur feature authoring, /sp:dev-plan, /sp:dev-idea, and
7
- /sp:dev-featurechange.
7
+ /sp:dev-feature-change.
8
8
  see_also:
9
9
  - spur-cli
10
10
  - feature-verbs
@@ -15,7 +15,7 @@ see_also:
15
15
  # Feature hierarchy: MECE roots and extension rules
16
16
 
17
17
  This is the **normative checklist** before `spur feature create` or any restructure
18
- (`/sp:dev-featurechange`, `spur feature move`). CLI enforces ID shape (DD-14) and
18
+ (`/sp:dev-feature-change`, `spur feature move`). CLI enforces ID shape (DD-14) and
19
19
  ≤9 children; **judgment** here keeps the tree neat for humans and agents.
20
20
 
21
21
  ## Goals of a good tree
@@ -86,7 +86,7 @@ If any check fails → **child of best parent** or **task under existing feature
86
86
  | **Create child** | New deliverable under clear parent | `spur feature create "…" --parent <id>` |
87
87
  | **Reparent / move** | Node lives under wrong parent; Goal still valid | `spur feature move <id> --parent <new>` (cascade rename) |
88
88
  | **Rename-only** | Goal OK; title misleading | Prefer `update --field name` if supported, or document + move only if ID depth must change |
89
- | **Merge (absorb)** | Two nodes share one Goal; bodies should be one | Prefer: move children under survivor → fold Scope/AC into survivor → cancel or archive source. **Not** a casual `move`. Use mapping + `/sp:dev-featurechange` when batching. |
89
+ | **Merge (absorb)** | Two nodes share one Goal; bodies should be one | Prefer: move children under survivor → fold Scope/AC into survivor → cancel or archive source. **Not** a casual `move`. Use mapping + `/sp:dev-feature-change` when batching. |
90
90
  | **Archive** | Capability retired | `cancelled` or leave `done`; do not delete history |
91
91
 
92
92
  ---
@@ -160,7 +160,7 @@ work under H.
160
160
  - [ ] Will attach tasks with `--feature <new-id>` (or parent if intentionally epic-only).
161
161
  - [ ] After create: `spur feature refresh` if INDEX must update; `spur feature check <id>`.
162
162
 
163
- ## Checklist: before restructure / `/sp:dev-featurechange`
163
+ ## Checklist: before restructure / `/sp:dev-feature-change`
164
164
 
165
165
  - [ ] Mapping file lists disposition per node (`keep` / `reparent-under` / `merge-into` / `rename-only` / `archive`).
166
166
  - [ ] False merges rejected (name overlap ≠ one Goal).
@@ -177,6 +177,6 @@ work under H.
177
177
  | **This reference** | Agent/human judgment — MECE, root gate, merge vs reparent |
178
178
  | **`spur feature create/move/check`** | Deterministic DD-14, children limit, lifecycle |
179
179
  | **`/sp:dev-plan` / `/sp:dev-idea`** | Must run the decision procedure before allocate |
180
- | **`/sp:dev-featurechange`** | Batch restructure against a mapping; must not invent roots |
180
+ | **`/sp:dev-feature-change`** | Batch restructure against a mapping; must not invent roots |
181
181
 
182
182
  Agents authoring features **must load this file** (via `sp:spur-cli` features references) before creating a root or proposing merges.
@@ -64,7 +64,7 @@ subtree and **cascade-renames** every descendant; omit `--parent` to lift it to
64
64
  **Before create or restructure (judgment, not CLI):** load
65
65
  [features/hierarchy-mece.md](features/hierarchy-mece.md) — MECE sibling sets, **sparse cautious
66
66
  roots**, extend-vs-create decision procedure, merge vs reparent, depth/width limits. `/sp:dev-plan`,
67
- `/sp:dev-idea`, and `/sp:dev-featurechange` must follow that checklist so new work prefers an
67
+ `/sp:dev-idea`, and `/sp:dev-feature-change` must follow that checklist so new work prefers an
68
68
  existing parent over a new letter.
69
69
 
70
70
  ## Editing a feature: status, fields, and sections
@@ -204,13 +204,13 @@ Select an execution mode: `full|implement` on `dev-run` (full pipeline vs implem
204
204
  `briefing|structure|architecture|design|full` on `dev-reverse`. Mode selection is explicit and orthogonal
205
205
  to `--next`.
206
206
 
207
- ### `--task [<feature-id>]`seed a task from the current result
207
+ ### `--task <wbs>` — task work or task narrowing
208
208
 
209
209
  **Anchor:** `#flag-task`.
210
210
 
211
- Connect the current command's result to task work (`dev-brainstorm`, `dev-debug`, `dev-dogfood`,
212
- `dev-find-next`). The optional value and the effect are per-command — this flag is a family, not one
213
- behavior:
211
+ Connect the current command's result to task work, or narrow a history analysis to one task
212
+ (`dev-brainstorm`, `dev-debug`, `dev-dogfood`, `dev-find-next`, `dev-history-load`). The value and
213
+ the effect are per-command — this flag is a family, not one behavior:
214
214
 
215
215
  - `dev-brainstorm` `[<feature-id>]` — **creates** one task from the chosen approach, landing at
216
216
  `todo` ready for refine. Optional feature id scopes it.
@@ -221,6 +221,7 @@ behavior:
221
221
  id names the target instead of offering rank 1.
222
222
  - `dev-debug` `[<wbs>]` — **attaches** findings to an existing task. Optional WBS names it.
223
223
  - `dev-dogfood` (no value) — **records** run outcomes against the task under test.
224
+ - `dev-history-load` `<wbs>` — narrows the `analyze` step to that task's messages.
224
225
 
225
226
  ### `--since <ref>` — lower bound on a range
226
227
 
@@ -245,6 +246,15 @@ Remediation policy on verify-family commands (`dev-verify`, `dev-verifyall`):
245
246
  Upper bound on a range: a git ref on `dev-changelog` (defaults to `HEAD`), or an ISO date on
246
247
  `dev-find-issue` (defaults to now).
247
248
 
249
+ ### `--source <source>` — agent source to scope the operation
250
+
251
+ **Anchor:** `#flag-source`.
252
+
253
+ Scope the operation to one agent source (`dev-find-issue`, `dev-history-load`): one of
254
+ `pi|claude|codex|gemini|opencode|antigravity|openclaw|omp|grok|agy` (or `all`). On
255
+ `dev-history-load` the value is forwarded to **both** `spur history import` and
256
+ `spur history analyze`; on `dev-find-issue` it narrows the report scan to that source's sessions.
257
+
248
258
  ### `--status <s>` — filter by task status
249
259
 
250
260
  **Anchor:** `#flag-status`.
@@ -135,6 +135,26 @@
135
135
  }
136
136
  }
137
137
  },
138
+ "roles": {
139
+ "type": "object",
140
+ "description": "Per-role tier/stage overrides over DEFAULT_AGENT_ROLES (0572 / ADR-061). Keys are the closed role vocabulary (scribe, coder, reviewer, planner); a present field replaces the default for that role, an omitted field keeps it. Mirrors @gobing-ai/spur-config AgentRoleConfigSchema (Zod is SSOT).",
141
+ "additionalProperties": {
142
+ "type": "object",
143
+ "properties": {
144
+ "tier": {
145
+ "type": "string",
146
+ "enum": ["cheap", "standard", "capable-1", "capable-2", "capable-3"],
147
+ "description": "Replacement capability tier for the role. Must not sit below the highest min_tier among the role's folded stages (enforced at the CLI boundary)."
148
+ },
149
+ "stages": {
150
+ "type": "array",
151
+ "minItems": 1,
152
+ "items": { "type": "string", "minLength": 1 },
153
+ "description": "Replacement folded-stage list for the role. Ids must come from the canonical stage registry (validated at the CLI boundary). Omit the field to keep the default — an empty array is rejected."
154
+ }
155
+ }
156
+ }
157
+ },
138
158
  "team": {
139
159
  "type": "object",
140
160
  "description": "Declarative agent teams keyed by team id (the map key is the teamId). Each team materializes a roster of agent specs (feature M). Mirrors @gobing-ai/spur-config TeamConfigSchema (Zod is SSOT).",