@jaggerxtrm/specialists 3.18.1 → 3.18.3
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/config/mandatory-rules/code-quality-defaults.md +58 -1
- package/config/skills/setup-specialists/SKILL.md +1 -1
- package/config/skills/using-script-specialists/SKILL.md +5 -5
- package/config/skills/using-specialists/SKILL.md +1135 -879
- package/config/skills/using-specialists-auto/SKILL.md +21 -21
- package/config/specialists/chain-coordinator.specialist.json +63 -0
- package/config/specialists/reviewer.specialist.json +1 -1
- package/config/specialists/seconder.specialist.json +1 -1
- package/dist/asset-contract.json +8 -13
- package/dist/index.js +151 -28
- package/dist/lib.js +8 -0
- package/dist/types/cli/clean.d.ts.map +1 -1
- package/dist/types/cli/init.d.ts.map +1 -1
- package/dist/types/cli/view.d.ts.map +1 -1
- package/dist/types/specialist/control.d.ts.map +1 -1
- package/dist/types/specialist/loader.d.ts +12 -0
- package/dist/types/specialist/loader.d.ts.map +1 -1
- package/dist/types/specialist/process-health.d.ts +16 -1
- package/dist/types/specialist/process-health.d.ts.map +1 -1
- package/dist/types/specialist/supervisor.d.ts.map +1 -1
- package/docs/design/roadmap/chain-templates/README.md +1 -1
- package/docs/design/roadmap/chains-prompt-evals.md +3054 -0
- package/docs/design/roadmap/enhanced-prd.md +4282 -0
- package/docs/design/roadmap/specialists-roadmap.md +7 -7
- package/docs/design/xt-pi-role-pi-flag-passthrough.md +174 -0
- package/docs/skills.md +4 -13
- package/package.json +1 -1
- package/config/skills/using-specialists-v2/SKILL.md +0 -766
- package/config/skills/using-specialists-v3/SKILL.md +0 -1327
|
@@ -1,1327 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: using-specialists-v3
|
|
3
|
-
description: >
|
|
4
|
-
Canonical specialist orchestration skill. Use proactively for substantial work
|
|
5
|
-
that should be delegated, tracked, reviewed, fixed, tested, or merged through
|
|
6
|
-
specialists: code review, debugging, implementation, planning, doc sync,
|
|
7
|
-
security checks, multi-step chains, integration-phase reconciliation,
|
|
8
|
-
debugger-restitch on conflicting chains, pre-dispatch conflict-cluster
|
|
9
|
-
mapping, test-failure-map epics, and questions about specialist workflow.
|
|
10
|
-
version: 3.7
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# Using Specialists v3
|
|
14
|
-
|
|
15
|
-
You are the orchestrator. Turn user intent into a strong bead contract, choose right specialist from live registry, launch chain, monitor it, consume results, drive fixes, and publish through specialist merge path.
|
|
16
|
-
|
|
17
|
-
Keep skill practical. Core behavior belongs here; volatile detail stays in live commands.
|
|
18
|
-
|
|
19
|
-
> **MANDATORY — Run on skill load and before every new substantial task or epic:**
|
|
20
|
-
> ```bash
|
|
21
|
-
> specialists list --full
|
|
22
|
-
> ```
|
|
23
|
-
> Do not rely on remembered roles, models, or permissions. The registry is the source of truth.
|
|
24
|
-
> Run it again before dispatching any new chain or starting any epic — specialists change between sessions.
|
|
25
|
-
|
|
26
|
-
## Specialist File Locations
|
|
27
|
-
|
|
28
|
-
Specialists live in three layers. Know which layer you are reading or editing:
|
|
29
|
-
|
|
30
|
-
| Layer | Path | Purpose |
|
|
31
|
-
|-------|------|---------|
|
|
32
|
-
| Package (shipped) | `config/specialists/*.specialist.json` | Canonical role definitions; versioned with the repo |
|
|
33
|
-
| User override | `.specialists/user/*.specialist.json` | Per-project customizations; wins over package layer for same name |
|
|
34
|
-
| Default mirror | `.specialists/default/*.specialist.json` | Repo-managed mirror of package defaults; overrides package fallback |
|
|
35
|
-
|
|
36
|
-
The loader resolves in priority order: user → default-mirror → package. A same-name file in `.specialists/user/` fully replaces the package version for that specialist. When creating or editing a specialist, use `config/specialists/` for shipped roles and `.specialists/user/` for project-specific overrides. Never edit `.specialists/default/` by hand — it is managed by `update-specialists`.
|
|
37
|
-
|
|
38
|
-
`specialists list --full` shows the resolved set (which layer each specialist comes from) so you always know what will actually run.
|
|
39
|
-
|
|
40
|
-
### Editing Specialist Fields: `sp edit` Is Required
|
|
41
|
-
|
|
42
|
-
Direct JSON editing is error-prone and bypasses schema validation. Use `sp edit` for all field changes — it validates dot-paths, handles array append/remove, and writes to the correct layer.
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
# Read a field
|
|
46
|
-
sp edit executor --get specialist.execution.model
|
|
47
|
-
|
|
48
|
-
# Set a field (schema-validated)
|
|
49
|
-
sp edit executor specialist.execution.model <model-id>
|
|
50
|
-
|
|
51
|
-
# Set prompt.system or task_template from a file (required for multi-line content)
|
|
52
|
-
sp edit executor --set specialist.prompt.system _ --file ./my-system-prompt.txt
|
|
53
|
-
|
|
54
|
-
# Append or remove tags
|
|
55
|
-
sp edit executor --set specialist.metadata.tags review,security --append
|
|
56
|
-
sp edit executor --set specialist.metadata.tags old-tag --remove
|
|
57
|
-
|
|
58
|
-
# Apply a named preset (run sp edit --list-presets for current options)
|
|
59
|
-
sp edit executor --preset power
|
|
60
|
-
sp edit executor --preset cheap --dry-run # preview first
|
|
61
|
-
|
|
62
|
-
# Target a specific scope when name exists in multiple layers
|
|
63
|
-
sp edit executor --scope user --set specialist.execution.model <model-id>
|
|
64
|
-
|
|
65
|
-
# Bulk read across all specialists
|
|
66
|
-
sp edit --all --get specialist.execution.model
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**When `sp edit` is required vs. direct JSON edit:**
|
|
70
|
-
- Model, thinking level, timeout, tags, permission, description → always `sp edit`
|
|
71
|
-
- `prompt.system` or `task_template` longer than one line → `sp edit --file`
|
|
72
|
-
- Structural schema fields (execution flags, output_schema) → `sp edit` with dot-path
|
|
73
|
-
- Net-new specialist creation → `specialists-creator` skill, then `sp edit` for tuning
|
|
74
|
-
- Bulk cross-specialist reads → `sp edit --all --get <path>`
|
|
75
|
-
- Available presets → `sp edit --list-presets` (do not hardcode; varies by install)
|
|
76
|
-
|
|
77
|
-
## Orchestration Discipline (Paranoid Mode)
|
|
78
|
-
|
|
79
|
-
You are an orchestrator, not a hero. Move slowly enough to be correct.
|
|
80
|
-
|
|
81
|
-
- Run `specialists list --full` and `sp help` again at the start of every new substantial task. Do not skip because "you remember." Roles, models, and flags drift between sessions.
|
|
82
|
-
- Re-read the bead before dispatch. If you cannot defend each contract field out loud, the bead is not ready.
|
|
83
|
-
- Never dispatch a chain you cannot describe end-to-end (which specialist, which bead, which workspace, which merge target).
|
|
84
|
-
- Verify worktree and job state before and after each dispatch with `sp ps` and `git worktree list`. Drift is silent until merge.
|
|
85
|
-
- Treat reviewer `PARTIAL` and seconder `FINDINGS` as mandatory fix loops, not advisory noise.
|
|
86
|
-
- When unsure, prefer extra explorer/debugger passes over an over-eager executor. Wrong code merged is more expensive than slow research.
|
|
87
|
-
|
|
88
|
-
## Project-Specific Specialists
|
|
89
|
-
|
|
90
|
-
Users define their own specialists in `.specialists/user/*.specialist.json` to fit project shape (domain knowledge, language, framework, conventions). These override package defaults and may not match generic role descriptions.
|
|
91
|
-
|
|
92
|
-
- Always run `specialists list --full` to see the resolved set, including project-specific roles, before choosing.
|
|
93
|
-
- Read `sp help` and the specialist's description/tags to confirm fit. Do not assume a name maps to its package-default behavior — a `.specialists/user/` override may have a different prompt, model, or scope.
|
|
94
|
-
- Pick the project-specific specialist when its role matches the task shape. Do not fall back to a generic role just because it is more familiar.
|
|
95
|
-
- If the task does not match any project-specific role, use the package default and consider whether a new project-specific specialist would help (use `specialists-creator` skill).
|
|
96
|
-
|
|
97
|
-
## Mandatory Gates: Seconder, Obligations, Security (Iron-style)
|
|
98
|
-
|
|
99
|
-
For any substantive production diff, the chain shape is the canonical pipeline from [`docs/design/chain-templates.md` §2](../../../docs/design/chain-templates.md#2-the-canonical-pipeline):
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
writer (executor/debugger) → seconder → test-engineer → test-runner → security-auditor (if surface) → obligations-scanner → reviewer → Release Checklist
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Reviewer consumes final QA evidence together with Iron gates: test-engineer output, test-runner classification, smoke/E2E proof, telemetry/log assertions, obligations-scanner, and security-auditor when applicable.
|
|
106
|
-
|
|
107
|
-
`seconder`, `test-engineer`, `test-runner`, `obligations-scanner`, and `reviewer` are mandatory on production diffs (shipped via Opp 14 / `unitAI-sfwe1` + Opp 15 / `unitAI-4e194`). `security-auditor` is mandatory when the diff touches a sensitive surface. Reviewer follows canon §2.2 SCRUTINY as a chain-property, not reviewer input.
|
|
108
|
-
|
|
109
|
-
### Seconder Gate — `seconder`
|
|
110
|
-
|
|
111
|
-
Mandatory READ_ONLY scope/compliance + smell/type-safety/simplicity dual-verdict gate (canon §2.3). Every change gets one cheap second pair of eyes before QA and reviewer. If `overall_verdict` is FAIL or UNCLEAR where not allowed, route back to writer.
|
|
112
|
-
|
|
113
|
-
- Skip permitted ONLY for: test-only diffs (entirely under `test/`, `tests/`, `__tests__/`, `*.spec.*`, `*.test.*`, `*.fixture.*`) or new-file-only diffs (no modifications to existing symbols).
|
|
114
|
-
- Any other skip = escalation event. Small diffs hide the worst regressions.
|
|
115
|
-
|
|
116
|
-
### Obligations Gate — `obligations-scanner`
|
|
117
|
-
|
|
118
|
-
Mandatory READ_ONLY marker scan. Catches new TODO/FIXME/HACK/XXX/TEMP/WIP/NOTE(release) in production code that would otherwise leak unaccounted. Cheap (<30s, gpt-5.4-mini, bare).
|
|
119
|
-
|
|
120
|
-
- Accepts structured `// TODO(<bead-id>): reason` markers if the linked bead exists and is in current bead's NON_GOALS.
|
|
121
|
-
- Rejects unstructured markers in production code → reviewer issues PARTIAL "obligation: must resolve or accept".
|
|
122
|
-
- Markers under test/fixture/mock/e2e/docs paths are noted but never block.
|
|
123
|
-
|
|
124
|
-
The scanner produces JSON; the reviewer consumes its output directly via job feed.
|
|
125
|
-
|
|
126
|
-
### Security Gate — `security-auditor`
|
|
127
|
-
|
|
128
|
-
Mandatory when diff touches: auth, secrets, input handling (user/network/file), dependency lockfiles, agent/MCP/config surfaces, token-storage paths, migrations, permissions/hooks. Scan-only; recommendations only; executor applies fixes.
|
|
129
|
-
|
|
130
|
-
- Never skip on sensitive-surface diff "because the diff looks small."
|
|
131
|
-
- Auto-triggered by reviewer's SCRUTINY auto-escalation table when surface patterns match.
|
|
132
|
-
|
|
133
|
-
### Dispatch mechanics for all three gates
|
|
134
|
-
|
|
135
|
-
All run with their own bead and `--job <exec-job>` so they enter the executor workspace.
|
|
136
|
-
|
|
137
|
-
Routing across chain phases:
|
|
138
|
-
|
|
139
|
-
- **Per-chain dispatch**: gates run on the chain's job in canon order: seconder → test-engineer → test-runner → security-auditor (if surface) → obligations-scanner → reviewer. Seconder FAIL/UNCLEAR routes back to writer; test-runner misclassifications route to test-engineer or writer per canon §2.5.
|
|
140
|
-
- **Debugger-restitch**: same gate order on the debugger's job AFTER the restitch turn, BEFORE reviewer.
|
|
141
|
-
- **E2E smoke phase**: cross-cutting security-auditor on cumulative integrated diff if any landed chain touched a sensitive surface.
|
|
142
|
-
- **Reviewer rebuttal**: seconder OK and security-auditor "no findings" are legitimate evidence in reviewer rebuttals (cite the advisory job id).
|
|
143
|
-
|
|
144
|
-
## Monitoring Long-Running Jobs: Sleep Timers Are Mandatory
|
|
145
|
-
|
|
146
|
-
Specialists run async. You will lose the chain if you do not actively monitor it.
|
|
147
|
-
|
|
148
|
-
**Required pattern after every dispatch:**
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
sp run <role> --bead <id> --background ... # dispatch
|
|
152
|
-
sleep 10 && sp ps # confirm started
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
Then cycle sleeps based on average completion time per role, checking `sp ps` each cycle:
|
|
156
|
-
|
|
157
|
-
| Role | Typical duration | Initial sleep cycle |
|
|
158
|
-
|------|------------------|---------------------|
|
|
159
|
-
| sync-docs, changelog-keeper | 60–180s | `sleep 60` then `sleep 60` |
|
|
160
|
-
| seconder, security-auditor | 60–180s | `sleep 60` then `sleep 60` |
|
|
161
|
-
| reviewer | 90–240s | `sleep 90` then `sleep 60` |
|
|
162
|
-
| explorer, debugger, planner, overthinker | 120–300s | `sleep 120` then `sleep 90` |
|
|
163
|
-
| executor | 180–600s+ | `sleep 180` then `sleep 120` |
|
|
164
|
-
| test-runner | varies with suite | start at `sleep 120`, adjust |
|
|
165
|
-
|
|
166
|
-
Rules:
|
|
167
|
-
- After dispatch, **always** `sleep 10 && sp ps` first to confirm the job is `running`, not stuck in `queued` or already `failed`.
|
|
168
|
-
- Then sleep again per the table; check `sp ps` each cycle.
|
|
169
|
-
- Do not poll faster than every 30s after the initial check — it wastes context.
|
|
170
|
-
- When status flips to `completed`, run `sp result <job-id>` immediately to consume output before context grows.
|
|
171
|
-
- If a job exceeds 2× its typical duration without completing, inspect with `sp feed <job-id>` before assuming hang.
|
|
172
|
-
|
|
173
|
-
You are not "done" until every dispatched job is `completed` or `failed` and consumed.
|
|
174
|
-
|
|
175
|
-
## Worktree Cleanup After Merge
|
|
176
|
-
|
|
177
|
-
Merge is now manual (see `Merge And Publication` below). You own cleanup after every merge.
|
|
178
|
-
|
|
179
|
-
After every merge, verify:
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
git worktree list # any orphaned worktrees from this session?
|
|
183
|
-
sp ps # any leftover jobs?
|
|
184
|
-
git worktree prune # drop stale worktree metadata
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
Always remove the merged feature/epic worktree explicitly:
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
git worktree remove <path>
|
|
191
|
-
git branch -d <merged-branch> # only after confirming merged into target
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
`sp ps` must have no active jobs and no unresolved terminal problems before session close. If it only shows old terminal history that you have intentionally acknowledged, run `sp clean --ps --dry-run` and then `sp clean --ps` to soft-hide those rows from the default dashboard. This does not delete SQLite history or change job status; use `sp ps --include-cleaned` or `sp ps --all` for audit visibility. Stale worktrees and stale jobs both block future dispatches.
|
|
195
|
-
|
|
196
|
-
## When To Delegate
|
|
197
|
-
|
|
198
|
-
Use specialists for substantial work: codebase exploration, debugging, implementation, review, test execution, planning, documentation sync, security/config audit, release publication, and multi-chain epics.
|
|
199
|
-
|
|
200
|
-
Do small deterministic edits directly when scope is already obvious and delegation would add ceremony. Do not self-investigate or self-implement a substantial task just because you can read files faster; audit trail and specialist review are part of workflow.
|
|
201
|
-
|
|
202
|
-
## Non-Negotiable Rules
|
|
203
|
-
|
|
204
|
-
1. `--bead` is prompt for tracked work.
|
|
205
|
-
2. Do not dispatch until bead is usable task contract.
|
|
206
|
-
3. Never use `--prompt` to supplement tracked work. Update bead instead.
|
|
207
|
-
4. Choose by task shape, not habit. Check `specialists list --full` when roles may have changed.
|
|
208
|
-
5. Explorer/debugger answer uncertainty before executor writes code.
|
|
209
|
-
6. Executor starts only when scope, constraints, and validation are clear.
|
|
210
|
-
7. Reviewer uses its own bead and executor workspace via `--job <exec-job>`.
|
|
211
|
-
8. Keep executor/debugger jobs alive through review so they can be resumed.
|
|
212
|
-
9. Merge specialist-owned work via the documented manual git workflow (Cherry-Pick Playbook / FF / `git merge --no-ff`). Do NOT use `sp merge` or `sp epic merge` — both are known broken and awaiting a separate rework epic. The skill does not document their usage; if you find them in `sp help` output, ignore.
|
|
213
|
-
10. Specialists must not perform destructive or irreversible operations.
|
|
214
|
-
11. Treat tests as evidence: classify failures as in-scope, pre-existing, or infrastructure before starting fix loop.
|
|
215
|
-
12. Drive routine stages autonomously once task is clear. Escalate only for human judgment, destructive actions, repeated crashes, or reviewer `FAIL`.
|
|
216
|
-
13. The orchestrator NEVER edits code directly. Conflict resolution, even mechanical, goes through a debugger or executor specialist. Manual conflict resolution always escalates to the operator. (Exception: epics that explicitly restructure the specialists themselves — bootstrapping via the specialists they restructure is circular. Such epics are operator-authorized manual-orchestrator-direct work and must say so up-front.)
|
|
217
|
-
14. Before dispatching any chain whose work depends on prior chain output, verify git state per the Git State Precondition section: `git status` clean, HEAD contains prior chain commits, no orphaned worktrees. Stale-base dispatch produces guaranteed debugger-restitch loops downstream.
|
|
218
|
-
15. Never dispatch a specialist against a bead tagged `contract:draft` (`bd state <id> contract` returns `draft` or nothing). Promote it first — see Draft Beads And The Promotion Gate. A draft is a sanctioned capture format, not a shortcut around bead quality.
|
|
219
|
-
|
|
220
|
-
## Escalation Matrix
|
|
221
|
-
|
|
222
|
-
| Action | Default | Always escalate to operator |
|
|
223
|
-
|---|---|---|
|
|
224
|
-
| Code edit | Specialist only | (never orchestrator-direct) |
|
|
225
|
-
| Cherry-pick onto integration branch | Auto if non-overlapping | Conflict requiring manual edits |
|
|
226
|
-
| Manual conflict resolution | Never | Always |
|
|
227
|
-
| Force push | Never | Always |
|
|
228
|
-
| Branch delete | Never | Always |
|
|
229
|
-
| Stash pop where conflict expected | Auto | Stash conflict that destroys session-start state |
|
|
230
|
-
| `bd dolt fsck --revive-journal-with-data-loss` | Never | Always — explicit data-loss warning |
|
|
231
|
-
| `sp merge` / `sp epic merge` | Never (prohibited per rule #9; both known broken) | Always — if you reach for these, stop and use manual git workflow |
|
|
232
|
-
| Skip `seconder` (mandatory seconder) on production diff | Auto-skip only on test-only or new-file-only diffs | Always escalate on any other skip — seconder OK is reviewer pre-condition |
|
|
233
|
-
| Skip `obligations-scanner` on production diff | Auto-skip only on test-only or new-file-only diffs | Always escalate on any other skip |
|
|
234
|
-
| Skip `security-auditor` on diff touching auth/secrets/input/agent-config/lockfiles/migrations | Never | Always — sensitive-surface diffs always get the pass |
|
|
235
|
-
| Manual merge with conflicts | Never auto-resolve | Always escalate to operator (rule #13) |
|
|
236
|
-
| Dispatch chain on stale base (HEAD lacks prior chain commit) | Never | Always — fix base first per Git State Precondition |
|
|
237
|
-
| `sp stop <job>` | Auto when job is done/stale | Never on actively-running unless context blown |
|
|
238
|
-
| `git push origin <branch>` | Auto for chain branches | Force-push or delete-remote always |
|
|
239
|
-
| `npm publish` | Never | Always |
|
|
240
|
-
| Dependency bump | Auto for security-patch bumps | Major/minor bumps escalate |
|
|
241
|
-
| Config file schema-changing edit | Never | Always |
|
|
242
|
-
| Dispatch against `contract:draft` bead | Never (rule #15) | Always — promote first: explore + rewrite full 7-section contract + `bd set-state <id> contract=ready --reason "..."` |
|
|
243
|
-
|
|
244
|
-
## Live Registry And Help
|
|
245
|
-
|
|
246
|
-
Use live registry for role details, permissions, current models, and skills:
|
|
247
|
-
|
|
248
|
-
```bash
|
|
249
|
-
specialists list --full
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
Use help for command flags and subcommands:
|
|
253
|
-
|
|
254
|
-
```bash
|
|
255
|
-
sp help
|
|
256
|
-
sp run --help
|
|
257
|
-
sp ps --help
|
|
258
|
-
sp feed --help
|
|
259
|
-
sp result --help
|
|
260
|
-
sp resume --help
|
|
261
|
-
sp steer --help
|
|
262
|
-
sp stop --help
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
Do not rely on stale remembered flags when help is available. (Omitted: `sp finalize`, `sp merge`, `sp epic` — see rule #9. They exist in the binary but the skill prohibits their use.)
|
|
266
|
-
|
|
267
|
-
## Writing Bead Contracts Well
|
|
268
|
-
|
|
269
|
-
Bead quality controls specialist quality. A title-only bead produces wandering output because specialist has no contract to optimize against. Write contract before dispatch. Tighten vague scope before launch.
|
|
270
|
-
|
|
271
|
-
Bad bead:
|
|
272
|
-
|
|
273
|
-
```text
|
|
274
|
-
TITLE: Fix bug
|
|
275
|
-
PROBLEM: Something is broken.
|
|
276
|
-
SUCCESS: It works.
|
|
277
|
-
SCOPE: src/
|
|
278
|
-
NON_GOALS: N/A
|
|
279
|
-
CONSTRAINTS: Be careful.
|
|
280
|
-
VALIDATION: Tests pass.
|
|
281
|
-
OUTPUT: Done.
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
Good bead:
|
|
285
|
-
|
|
286
|
-
```text
|
|
287
|
-
TITLE: Fix feed cursor regression in sp result
|
|
288
|
-
PROBLEM: specialists feed follow skips events after restart because cursor tracks count, not last seq.
|
|
289
|
-
SUCCESS: feed follow resumes from last seen seq; result still reads terminal output.
|
|
290
|
-
SCOPE: src/cli/feed.ts, src/cli/result.ts, tests/unit/cli/feed.test.ts
|
|
291
|
-
NON_GOALS: No new runtime format, no DB schema change, no unrelated poll changes.
|
|
292
|
-
CONSTRAINTS: Preserve existing job IDs, keep backwards-compatible CLI output, avoid file-based fallback drift.
|
|
293
|
-
VALIDATION: Add regression test for restart resume; run targeted CLI tests.
|
|
294
|
-
OUTPUT: Changed files, test evidence, residual risks.
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
Fix three bad smells fast:
|
|
298
|
-
|
|
299
|
-
- Title-only bead. Add problem, scope, validation, output.
|
|
300
|
-
- Vague SCOPE like `src/`. Name files, symbols, or bounded docs.
|
|
301
|
-
- Missing VALIDATION. Say what proves done, not just that work is “finished.”
|
|
302
|
-
|
|
303
|
-
What differs: orchestrator writes contract before dispatch, so specialist does less guessing and more useful work.
|
|
304
|
-
|
|
305
|
-
## Draft Beads And The Promotion Gate
|
|
306
|
-
|
|
307
|
-
Full 7-section contracts are expensive to write for an idea you won't touch for weeks. Demanding that rigor for every captured thought is exactly what produces the other failure mode: skipping the bead entirely, or writing a one-liner. There is a third, sanctioned option — but it is a capture format, not an escape hatch.
|
|
308
|
-
|
|
309
|
-
**Draft state.** Tag a bead `contract:draft` at creation:
|
|
310
|
-
|
|
311
|
-
```bash
|
|
312
|
-
bd create --title "..." --labels contract:draft --type task --priority 3 \
|
|
313
|
-
--description "PROBLEM: <2+ real sentences — why this matters, not a title restated>
|
|
314
|
-
SCOPE: <rough guess — 'somewhere in src/auth/, needs investigation' is fine>
|
|
315
|
-
SUCCESS: TBD — needs exploration
|
|
316
|
-
NON_GOALS: TBD — needs exploration
|
|
317
|
-
CONSTRAINTS: TBD — needs exploration
|
|
318
|
-
VALIDATION: TBD — needs exploration
|
|
319
|
-
OUTPUT: TBD — needs exploration"
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
**No one-liners, ever — draft or not.** A draft still requires a real PROBLEM (why this exists, in prose) and a rough SCOPE. Every other section must be present and say `TBD — needs exploration` explicitly. A bare title, or a description that just restates the title, is never a valid bead — draft state lowers the bar on *completeness*, not on *honesty about what's missing*.
|
|
323
|
-
|
|
324
|
-
**The promotion gate (rule #15).** No specialist may be dispatched against a `contract:draft` bead. Before dispatch, the orchestrator must:
|
|
325
|
-
|
|
326
|
-
1. Re-read the bead (`bd show <id>`).
|
|
327
|
-
2. Actually explore — the same Phase 2 evidence-gathering the `planning` skill requires before writing a real contract (`gitnexus_query`/`gitnexus_context`/`gitnexus_impact`, or Serena symbol reads).
|
|
328
|
-
3. Rewrite the bead in place to the full 7-section contract (`bd update <id> --description "..."`), replacing every `TBD` with real content grounded in what was just found.
|
|
329
|
-
4. Flip the state: `bd set-state <id> contract=ready --reason "Explored via <what>; rewrote to full contract"`.
|
|
330
|
-
|
|
331
|
-
Check before any dispatch: `bd state <id> contract` — if it returns `draft` or nothing, stop and promote. This is a hard refuse (Escalation Matrix), not a warning — a stale draft wastes a full specialist turn on a contract the executor will have to guess at, which is the exact failure this rule exists to prevent.
|
|
332
|
-
|
|
333
|
-
**Current enforcement is a bridge.** This is orchestrator-discipline-enforced today, not yet a hard `sp run` pre-dispatch check — see `specialists-roadmap.md` §5.3 for the planned real enforcement (same class as the existing C1 cwd-mismatch hard-refuse). Follow the rule anyway; do not treat the absence of a hook as license to dispatch against a draft.
|
|
334
|
-
|
|
335
|
-
What differs: orchestrator has a sanctioned way to capture backlog ideas cheaply without either over-scoping them immediately or letting them decay into unusable one-liners.
|
|
336
|
-
|
|
337
|
-
## Bead Title Convention (canonical)
|
|
338
|
-
|
|
339
|
-
Every bead dispatched to a specialist gets a title in the form:
|
|
340
|
-
|
|
341
|
-
```text
|
|
342
|
-
<specialist-role>: <concise task description>
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
Examples: `explorer: map auth refresh path`, `executor: implement token refresh retry`, `reviewer: verify token refresh retry`, `seconder: sanity check token retry diff`, `security-auditor: scan token retry diff`, `test-runner: refresh <epic> failure map`.
|
|
346
|
-
|
|
347
|
-
Why: `bd list`, `bd ready`, `bd query`, and `sp ps` all show titles inline — a role-prefixed title makes the board scannable at a glance (which role owns which open work) without opening each bead. It also disambiguates same-named chains dispatched to different roles against the same parent (e.g. a `seconder:` and a `security-auditor:` bead both `validates`-linked to the same `executor:` bead).
|
|
348
|
-
|
|
349
|
-
Rules:
|
|
350
|
-
|
|
351
|
-
- Prefix with the exact specialist name from `specialists list --full` (`explorer`, `debugger`, `executor`, `reviewer`, `seconder`, `security-auditor`, `test-runner`, `test-engineer`, `obligations-scanner`, `planner`, `overthinker`, `researcher`, `sync-docs`, `changelog-keeper`, `specialists-creator`), not a role synonym.
|
|
352
|
-
- Root task/epic beads that are not themselves dispatched to a single specialist (the umbrella bead a chain is built under) are exempt — keep those descriptive without a role prefix, e.g. `Epic: auth refresh hardening`, `Fix token refresh retry`.
|
|
353
|
-
- Combine with the nesting default above: a role-prefixed title on a `--parent`-nested bead gives both a scannable title and a scannable ID (`bd-x.2` = `seconder: ...`).
|
|
354
|
-
|
|
355
|
-
What differs: orchestrator can `bd list`/`sp ps` and immediately tell which role owns which open work, instead of opening each bead to find out.
|
|
356
|
-
|
|
357
|
-
## SCRUTINY taxonomy (Iron-style)
|
|
358
|
-
|
|
359
|
-
`SCRUTINY` is a chain-property from canon §2.2, not reviewer input and not a quality tier. Every substantive bead must declare it at creation. It modulates chain structure only; quality stays invariant. New beads without it are invalid unless read-only / none-chain work.
|
|
360
|
-
|
|
361
|
-
```
|
|
362
|
-
SCRUTINY: none | low | medium | high | critical
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
| Level | Chain-structure modulation | When to use |
|
|
366
|
-
|---|---|---|
|
|
367
|
-
| `none` | Read-only / design chains only. No production-diff pipeline. | planning, premortem, research-only, triage, doc-sync, memory-hygiene |
|
|
368
|
-
| `low` | Minimal production diff. Keep pipeline light. | tiny isolated fixes |
|
|
369
|
-
| `medium` | Default production-diff chain. | most implementation beads |
|
|
370
|
-
| `high` | Heavier review / evidence floor. | cross-cutting, boundary, public API, persistence, orchestration |
|
|
371
|
-
| `critical` | Max structural gating. | auth, money, irreversible state, security-sensitive work |
|
|
372
|
-
|
|
373
|
-
Floor rule: author sets the minimum; dispatcher/reviewer can raise it on sensitive surfaces per canon §2.4, never lower it.
|
|
374
|
-
|
|
375
|
-
Cross-ref: [`docs/design/chain-templates.md` §2.2](../../../docs/design/chain-templates.md#22-scrutiny-is-a-chain-property--it-modulates-structure-not-quality), [`§2.3`](../../../docs/design/chain-templates.md#23-roles-in-the-canonical-pipeline), [`§2.5`](../../../docs/design/chain-templates.md#25-the-behavioral-validation-contract), [`§2.6`](../../../docs/design/chain-templates.md#26-the-release-checklist), roadmap Opp 15.
|
|
376
|
-
|
|
377
|
-
## Git State Precondition (before any chain dispatch)
|
|
378
|
-
|
|
379
|
-
Specialist worktrees fork from the current HEAD of the orchestrator's branch at dispatch time. If prior chain edits aren't merged in yet, the new chain works on a stale base, will conflict at integration, and debugger-restitch becomes mandatory. The fix is upstream: don't dispatch until prior work has landed.
|
|
380
|
-
|
|
381
|
-
Required pre-flight before dispatching any chain that depends on prior chain output:
|
|
382
|
-
|
|
383
|
-
```bash
|
|
384
|
-
# 1. Working tree clean — no uncommitted edits to inherit or lose
|
|
385
|
-
git status # MUST report "working tree clean"
|
|
386
|
-
|
|
387
|
-
# 2. HEAD contains prior chain's work
|
|
388
|
-
git log -1 --oneline # confirm latest commit
|
|
389
|
-
git log main..HEAD --oneline # confirm prior chain branch merged in
|
|
390
|
-
|
|
391
|
-
# 3. No orphaned worktrees from prior chains
|
|
392
|
-
git worktree list # all prior chain worktrees should be removed
|
|
393
|
-
git worktree prune # drop stale metadata
|
|
394
|
-
|
|
395
|
-
# 4. If on an integration branch
|
|
396
|
-
git log integration/<date>..HEAD # MUST be empty (in sync with integration target)
|
|
397
|
-
```
|
|
398
|
-
|
|
399
|
-
Decision rule: if any of the four checks fail, finish the merge/commit/cleanup first. Do not dispatch. A specialist forked from a stale base produces conflict work that costs more turns than the time saved by dispatching early.
|
|
400
|
-
|
|
401
|
-
Strictness by scenario:
|
|
402
|
-
|
|
403
|
-
| Scenario | Strictness |
|
|
404
|
-
|---|---|
|
|
405
|
-
| Sequential chains where child.B depends on child.A's edits | **Strict.** child.A merged before child.B dispatch. |
|
|
406
|
-
| Parallel chains in same epic with disjoint file scopes | Relaxed. Each dispatches off the shared base; integration reconciles. |
|
|
407
|
-
| Chain after orchestrator-direct edit (rule #13 exception epics) | **Strict.** Orchestrator commits + pushes their direct edits before dispatching any dependent chain. |
|
|
408
|
-
| Standalone chain (no upstream dependency) | Relaxed. Just `git status` clean. |
|
|
409
|
-
|
|
410
|
-
## Dependency Linking And Relationship Vocabulary
|
|
411
|
-
|
|
412
|
-
Link beads with correct edge shape. The edge tells orchestrator what blocks execution, what only preserves context, which bead verifies another, and which issue has been replaced. Do not overload `blocks` for follow-ups, root-cause links, verification pairs, duplicates, or restitch replacements.
|
|
413
|
-
|
|
414
|
-
Core commands:
|
|
415
|
-
|
|
416
|
-
- `bd dep add <issue> <depends-on>`: issue depends on depends-on; depends-on blocks issue. Default type is `blocks`. Use only for hard sequencing. [source: bd dep add --help]
|
|
417
|
-
- `bd dep <blocker> --blocks <blocked>`: reverse phrasing of the same hard sequencing edge. [source: bd dep --help]
|
|
418
|
-
- `bd dep add <issue> <other> --type <type>`: store a typed relationship. Supported types: `blocks`, `tracks`, `related`, `parent-child`, `discovered-from`, `until`, `caused-by`, `validates`, `relates-to`, `supersedes`. [source: bd dep add --help]
|
|
419
|
-
- `bd dep relate <a> <b>` / `bd dep unrelate <a> <b>`: bidirectional non-blocking `relates_to` link. Use for context, not order. [source: bd dep --help]
|
|
420
|
-
- `bd create --parent <bead-id>`: hierarchical child edge; auto-names child `<parent>.1`, `<parent>.2`, … and nests recursively — a child's own child becomes `<parent>.1.1`. `<bead-id>` can be an epic, a plain task, or an already-nested child; bd does not restrict `--parent` by issue type (`bd create --help` describes it generically as "Parent issue ID for hierarchical child"). [source: bd create --help]
|
|
421
|
-
- `bd create --deps discovered-from:<id>` or `bd dep add <new> <source> --type discovered-from`: follow-up work discovered from a source bead.
|
|
422
|
-
- `bd duplicate <new> --of <canonical>`: close duplicate issue and point at canonical. Use when two beads describe the same required work.
|
|
423
|
-
- `bd duplicates` / `bd find-duplicates --status open --method ai --json`: find exact or semantic duplicates before dispatching parallel chains.
|
|
424
|
-
- `bd supersede <old> --with <new>` or `bd dep add <new> <old> --type supersedes`: mark a replacement when a better-scoped fix bead replaces an obsolete/abandoned one.
|
|
425
|
-
- `bd dep cycles`, `bd dep tree <id>`, and `bd graph <id>`: sanity-check the execution graph before merge/publication.
|
|
426
|
-
|
|
427
|
-
**Default to nesting, not loose beads.** When a chain is dispatched to service an existing bead — a top-level task, an epic, or an already-nested child like `bd-x.1` — create the new bead with `bd create --parent <that-bead>` so it inherits the next sequential child ID (`bd-x.1`, or `bd-x.1.1` if the parent is itself a child). This applies uniformly, not only under epics — the common failure mode is orchestrators treating `--parent` as epic-only and defaulting every explorer/executor/reviewer/seconder/security bead spawned mid-chain to a loose top-level bead linked solely by a typed dep. `--parent` (hierarchy/ID) and a typed `bd dep add ... --type <blocks|validates|discovered-from>` edge (semantic relationship) are independent flags — combine both when the relationship needs naming beyond parentage. Only skip `--parent` when the new bead is a genuine standalone sibling concern, not work done on behalf of the bead it services.
|
|
428
|
-
|
|
429
|
-
Relationship vocabulary for specialist chains:
|
|
430
|
-
|
|
431
|
-
| Relationship | Reach for it when | Example command |
|
|
432
|
-
| --- | --- | --- |
|
|
433
|
-
| `blocks` | Hard must-happen-before sequencing: planner before executor, implementation before reviewer, restitch before publish. | `bd dep add <impl> <plan> --type blocks` |
|
|
434
|
-
| `tracks` | A local bead mirrors upstream or cross-project work whose status matters but is not owned here. | `bd dep add <local> external:xtrm-tools:<capability> --type tracks` |
|
|
435
|
-
| `related` | Loose topical association when no direction or scheduling effect is intended. Prefer `bd dep relate` for bidirectional relation. | `bd dep add <a> <b> --type related` |
|
|
436
|
-
| `parent-child` | Any bead spawns tracked child work — epic owning chains, a task spawning its explorer/executor/reviewer, or an already-nested child spawning its own sub-chain. Prefer `bd create --parent <bead>` (not only `<epic>`) so IDs nest and parentage stays canonical instead of drifting into loose top-level beads. | `bd create --parent <bead-id> --title "executor: Impl auth retry" ...` |
|
|
437
|
-
| `discovered-from` | Reviewer, debugger, explorer, or test-runner surfaces new follow-up work from a run. | `bd dep add <follow-up> <reviewer-bead> --type discovered-from` |
|
|
438
|
-
| `until` | Time-bounded or event-bounded precondition that blocks only until a stated condition lands. | `bd dep add <chain> <precondition> --type until` |
|
|
439
|
-
| `caused-by` | Failure bead points to the root-cause bead/cluster that explains it. Makes test-failure-map epics navigable. | `bd dep add <failing-test> <root-cause> --type caused-by` |
|
|
440
|
-
| `validates` | Reviewer, test-runner, seconder, or security-auditor bead verifies an implementation/debugger bead. | `bd dep add <review> <impl> --type validates` |
|
|
441
|
-
| `relates-to` | Bidirectional context edge for conflict clusters, sibling designs, or rebuttal patterns. Prefer dedicated relate command. | `bd dep relate <chain-a> <chain-b>` |
|
|
442
|
-
| `supersedes` | New fix/design/restitch bead replaces an older bead that should no longer be executed or merged. Prefer `bd supersede`. | `bd supersede <old> --with <new>` |
|
|
443
|
-
|
|
444
|
-
Worked high-value patterns:
|
|
445
|
-
|
|
446
|
-
```bash
|
|
447
|
-
# Reviewer discovers a separate follow-up during review. Do not block the impl.
|
|
448
|
-
bd create --title "Follow up: tighten retry metrics" --type task --priority 3 --description "..."
|
|
449
|
-
bd dep add <follow-up> <review> --type discovered-from
|
|
450
|
-
|
|
451
|
-
# Test-failure-map root cause: many failures point at one underlying issue.
|
|
452
|
-
bd create --title "Root cause: stale fixture factory" --type bug --priority 2 --description "..."
|
|
453
|
-
bd dep add <failing-test-bead> <root-cause> --type caused-by
|
|
454
|
-
|
|
455
|
-
# Verification bead validates implementation. This is not a hard prerequisite edge.
|
|
456
|
-
bd dep add <test-runner-bead> <impl> --type validates
|
|
457
|
-
bd dep add <reviewer-bead> <impl> --type validates
|
|
458
|
-
|
|
459
|
-
# Replacement bead supersedes an abandoned or wrongly scoped implementation.
|
|
460
|
-
bd create --title "Restitch auth retry onto integration state" --type task --priority 2 --description "..."
|
|
461
|
-
bd supersede <old-impl> --with <restitch>
|
|
462
|
-
|
|
463
|
-
# Before merging an epic or integration branch, prove the graph is sane.
|
|
464
|
-
bd dep cycles
|
|
465
|
-
bd graph <epic> --compact
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
Use each form for a different reason:
|
|
469
|
-
|
|
470
|
-
- `blocks` / `--blocks` for must-happen-before dependency only.
|
|
471
|
-
- `validates` for review, test, sanity, and security evidence.
|
|
472
|
-
- `discovered-from` for spawned follow-up beads.
|
|
473
|
-
- `caused-by` for failure-to-root-cause attribution.
|
|
474
|
-
- `relates-to` / `bd dep relate` for soft linkage with no schedule effect.
|
|
475
|
-
- `parent-child` / `--parent` for hierarchy and child naming — use for any bead spawned to do work on behalf of another bead, not only epic ownership. Nests recursively: a chain dispatched from an already-nested child (e.g. `bd-x.1`) becomes `bd-x.1.1`, not a new loose top-level bead.
|
|
476
|
-
- `supersedes` / `bd supersede` for replacement work; `duplicate` for same-work issues.
|
|
477
|
-
|
|
478
|
-
Cross-repo consistency: keep this vocabulary aligned with the xtrm-tools triaging skill and sibling triage bead `xtrm-drkk`; both should use the same relationship names when rewiring issue graphs.
|
|
479
|
-
|
|
480
|
-
What differs: orchestrator chooses edge type deliberately, so graph stays correct for chain execution, epic publish, duplicate cleanup, root-cause navigation, verification evidence, and follow-up traceability.
|
|
481
|
-
|
|
482
|
-
## Bead Contract By Bead Type
|
|
483
|
-
|
|
484
|
-
Use shape that fits specialist.
|
|
485
|
-
|
|
486
|
-
> **SCRUTINY field is universal.** Every substantive bead should carry `SCRUTINY: none|low|medium|high|critical` at creation. It is a chain-property, not reviewer behavior; it controls chain structure and gate strictness per the SCRUTINY taxonomy section and canon §2.2. Reviewer may auto-escalate but never lower it. Canon refs: §2.2, §2.3, §2.5, §2.6.
|
|
487
|
-
|
|
488
|
-
Task/epic bead:
|
|
489
|
-
|
|
490
|
-
```text
|
|
491
|
-
PROBLEM: User-facing or project-facing objective.
|
|
492
|
-
SUCCESS: End-state across all child beads.
|
|
493
|
-
SCRUTINY: none|low|medium|high|critical # required at creation; chain-property, not reviewer input
|
|
494
|
-
SCOPE: Area of project affected.
|
|
495
|
-
REFERENCES: Optional files, skills, or docs specialist reads only if work needs them.
|
|
496
|
-
NON_GOALS: Boundaries for entire effort.
|
|
497
|
-
CONSTRAINTS: Sequencing, compatibility, branch/merge rules.
|
|
498
|
-
VALIDATION: Final checks before close.
|
|
499
|
-
OUTPUT: What orchestrator reports back.
|
|
500
|
-
```
|
|
501
|
-
|
|
502
|
-
`SCOPE` is always loaded as context. `REFERENCES` is progressive disclosure: name what exists, but do not force load unless task needs it. Use this when a file would bloat payload today, like citing a huge skill file in scope and dragging in all lines before specialist even knows it must read them.
|
|
503
|
-
|
|
504
|
-
Example:
|
|
505
|
-
|
|
506
|
-
```text
|
|
507
|
-
SCOPE: config/skills/using-specialists-v3/SKILL.md, docs/specialists/handoff-schema.md
|
|
508
|
-
REFERENCES: config/skills/prompt-improving/SKILL.md (xml_core conventions), sibling beads per-turn-handoff-schema and bead-id-verbatim once landed
|
|
509
|
-
```
|
|
510
|
-
|
|
511
|
-
Explorer bead:
|
|
512
|
-
|
|
513
|
-
```text
|
|
514
|
-
PROBLEM: What is unknown.
|
|
515
|
-
SUCCESS: Questions answered with evidence.
|
|
516
|
-
SCOPE: Code areas, docs, commands, or symbols to inspect.
|
|
517
|
-
NON_GOALS: No implementation, no broad audit outside scope.
|
|
518
|
-
CONSTRAINTS: READ_ONLY, cite files/symbols/flows.
|
|
519
|
-
VALIDATION: Findings cite evidence.
|
|
520
|
-
OUTPUT: Findings, risks, recommended implementation track, stop condition.
|
|
521
|
-
```
|
|
522
|
-
|
|
523
|
-
Debugger bead:
|
|
524
|
-
|
|
525
|
-
```text
|
|
526
|
-
PROBLEM: Symptom, regression, or failing test.
|
|
527
|
-
SUCCESS: Root cause plus minimal fix path.
|
|
528
|
-
SCOPE: Logs, reproduction, code paths, and related tests.
|
|
529
|
-
NON_GOALS: No broad refactor.
|
|
530
|
-
CONSTRAINTS: Preserve behavior outside fault line.
|
|
531
|
-
VALIDATION: Repro steps and diagnosis.
|
|
532
|
-
OUTPUT: Root cause, fix options, confidence, remaining unknowns.
|
|
533
|
-
```
|
|
534
|
-
|
|
535
|
-
Executor bead:
|
|
536
|
-
|
|
537
|
-
```text
|
|
538
|
-
PROBLEM: Exact behavior or artifact to change.
|
|
539
|
-
SUCCESS: Observable acceptance criteria.
|
|
540
|
-
SCRUTINY: none|low|medium|high|critical # required at creation; chain-property, not reviewer input
|
|
541
|
-
SCOPE: Target files/symbols; include do-not-touch boundaries.
|
|
542
|
-
NON_GOALS: Related improvements explicitly excluded. (Include any accepted in-code obligation markers tracked in follow-up beads.)
|
|
543
|
-
CONSTRAINTS: API compatibility, style, migrations, safety.
|
|
544
|
-
VALIDATION: Lint/typecheck/tests or manual checks.
|
|
545
|
-
OUTPUT: Changed files, verification, residual risks.
|
|
546
|
-
```
|
|
547
|
-
|
|
548
|
-
Reviewer bead:
|
|
549
|
-
|
|
550
|
-
```text
|
|
551
|
-
PROBLEM: Verify executor output against requirements.
|
|
552
|
-
SUCCESS: PASS only if requirements + validation + Release Checklist satisfied.
|
|
553
|
-
SCRUTINY: none|low|medium|high|critical # required at creation; chain-property, not reviewer input
|
|
554
|
-
SCOPE: Executor job, diff, task bead, acceptance criteria.
|
|
555
|
-
NON_GOALS: Do not rewrite unless explicitly asked.
|
|
556
|
-
CONSTRAINTS: Code-review mindset; findings first; emit Release Checklist.
|
|
557
|
-
VALIDATION: Run or inspect required checks; consume obligations-scanner output.
|
|
558
|
-
OUTPUT: PASS/PARTIAL/FAIL with file/line findings + Release Checklist block.
|
|
559
|
-
```
|
|
560
|
-
|
|
561
|
-
Test bead:
|
|
562
|
-
|
|
563
|
-
```text
|
|
564
|
-
PROBLEM: Validate one or more implementation chains.
|
|
565
|
-
SUCCESS: Relevant tests/checks pass or failures are diagnosed.
|
|
566
|
-
SCOPE: Commands and implementation beads covered.
|
|
567
|
-
NON_GOALS: No broad unrelated suite expansion unless requested.
|
|
568
|
-
CONSTRAINTS: Avoid destructive cleanup; report flaky/infra failures separately.
|
|
569
|
-
VALIDATION: Command output and failure interpretation.
|
|
570
|
-
OUTPUT: Pass/fail summary, failing tests, likely owner.
|
|
571
|
-
```
|
|
572
|
-
|
|
573
|
-
Sync-docs bead:
|
|
574
|
-
|
|
575
|
-
```text
|
|
576
|
-
PROBLEM: Exactly one doc drifted from source truth.
|
|
577
|
-
SUCCESS: One doc updated and drift checked clean.
|
|
578
|
-
SCOPE: One doc only.
|
|
579
|
-
NON_GOALS: No source-code rewrite.
|
|
580
|
-
CONSTRAINTS: Keep doc and source aligned.
|
|
581
|
-
VALIDATION: Drift scan or bounded source cross-check.
|
|
582
|
-
OUTPUT: Updated doc, drift evidence, remaining doc gaps.
|
|
583
|
-
```
|
|
584
|
-
|
|
585
|
-
What differs: orchestrator gives each specialist a contract shape that matches job, so role stays narrow and reviewable.
|
|
586
|
-
|
|
587
|
-
For evidence-heavy or multi-item beads, let `SCOPE`, `CONSTRAINTS`, and `EXAMPLES` carry opt-in XML tags. Follow prompt-improving `xml_core` style: wrap only the subpart that needs structure, not whole bead. Example: a debugger bead can put stack trace lines in `<evidence>` and do-not-touch items in `<constraints>`, so specialist can scan facts fast without turning every field into markup.
|
|
588
|
-
|
|
589
|
-
## Choosing The Specialist
|
|
590
|
-
|
|
591
|
-
Run `specialists list` if you need live registry. Choose by task, not habit.
|
|
592
|
-
|
|
593
|
-
| Need | Specialist | Use when |
|
|
594
|
-
| --- | --- | --- |
|
|
595
|
-
| Architecture/code mapping | `explorer` | Need evidence and scoped implementation track |
|
|
596
|
-
| Root-cause analysis | `debugger` | Symptom, stack trace, failing test, or regression |
|
|
597
|
-
| Planning/decomposition | `planner` | Need beads, dependencies, file scopes, sequencing |
|
|
598
|
-
| Design/tradeoffs | `overthinker` | Approach is risky, ambiguous, or needs critique |
|
|
599
|
-
| Implementation | `executor` | Contract is clear enough to write code or docs |
|
|
600
|
-
| Compliance/code review | `reviewer` | Executor/debugger produced changes that need final PASS/PARTIAL/FAIL |
|
|
601
|
-
| Seconder gate (mandatory) | `seconder` | Production diff — fused scope/compliance + quality gate; reviewer pre-condition |
|
|
602
|
-
| Obligations gate (mandatory) | `obligations-scanner` | Production diff — scans for unstructured TODO/FIXME/HACK/XXX/TEMP/WIP/NOTE(release) markers |
|
|
603
|
-
| Security/dependency audit | `security-auditor` | Diff touches auth/secrets/input/lockfiles/migrations/agent-config |
|
|
604
|
-
| Test execution | `test-runner` | Need suites run and failures interpreted |
|
|
605
|
-
| Docs audit/sync | `sync-docs` | Docs may be stale or need targeted synchronization |
|
|
606
|
-
| External/live research | `researcher` | Any library/API/framework/CLI question — dispatch BEFORE answering from training data |
|
|
607
|
-
| Specialist config | `specialists-creator` | Creating or changing specialist JSON/config |
|
|
608
|
-
| Release publication | `changelog-keeper` | New tag is being cut |
|
|
609
|
-
|
|
610
|
-
Selection rules:
|
|
611
|
-
|
|
612
|
-
- Explorer is READ_ONLY and should answer specific questions.
|
|
613
|
-
- Debugger beats explorer for failures because it traces causes and remediation.
|
|
614
|
-
- Planner shapes epic/task graph before executor starts.
|
|
615
|
-
- Overthinker defends risky design before code locks in. It is CoT specialist by design, so thinking-heavy turns and `<thinking>` tags fit there.
|
|
616
|
-
- Reviewer already uses structured evidence/gap matrices, which is CoT in disguise; keep that structure, do not add freeform `<thinking>` blocks.
|
|
617
|
-
- Executor, debugger, changelog-keeper, sync-docs, and test-runner should not carry mandatory `<thinking>` blocks. That bloats output without payoff and hides the real contract.
|
|
618
|
-
- Executor does not own full test validation; use reviewer/test-runner for that phase.
|
|
619
|
-
- Sync-docs is for audit/sync; executor is for heavy doc rewrites.
|
|
620
|
-
- Researcher is for current external info, not repo archaeology. **Dispatch BEFORE answering any library/API/framework/CLI question from training data** — your knowledge is stale by months and APIs drift silently. The cost is one CLI call; the alternative is shipping wrong API usage.
|
|
621
|
-
- Specialists-creator should precede specialist config/schema edits.
|
|
622
|
-
- `parallel-review` is deprecated — old design that doesn't fit current sp shape. Do not reach for it. Use `overthinker` for independent second opinion or queue a second `reviewer` turn manually if needed.
|
|
623
|
-
|
|
624
|
-
## Bug Diagnosis Chain
|
|
625
|
-
|
|
626
|
-
For symptoms, errors, regressions, flakes, or failing tests where cause is unknown, start with diagnosis — not implementation. Do not dispatch executor while cause is unknown; executor is for clear implementation scope only.
|
|
627
|
-
|
|
628
|
-
Default chain:
|
|
629
|
-
|
|
630
|
-
1. **test-runner** or **debugger** establishes a fast deterministic feedback loop. If no loop can be built, debugger reports the blocker — do not patch in the dark.
|
|
631
|
-
2. **debugger** reproduces the symptom, writes 3–5 falsifiable hypotheses, and tests one variable at a time. Any temporary instrumentation must be tagged `[DEBUG-<id>]` and removed before completion.
|
|
632
|
-
3. **debugger** applies the minimal root-cause fix on the fault line and verifies via targeted lint/typecheck plus the focused repro.
|
|
633
|
-
4. **test-runner** reruns the original repro/regression command (full-suite validation is its job, not debugger's).
|
|
634
|
-
5. **seconder** runs if the fix smells brittle, overcomplicated, or type-risky. **security-auditor** runs if the fix touches auth/session/secrets/input handling, dependency logic, or agent/MCP/hook config.
|
|
635
|
-
6. **reviewer** gates the final diff against the bead contract.
|
|
636
|
-
7. If no correct regression-test seam exists, route the architecture/testability finding to **overthinker** or **planner** — do not force a brittle test just to close the loop.
|
|
637
|
-
|
|
638
|
-
Explorer is useful before diagnosis only when no concrete symptom exists and architecture is unknown. For real bugs with a symptom, use debugger.
|
|
639
|
-
|
|
640
|
-
## Seconder
|
|
641
|
-
|
|
642
|
-
The mandatory post-writer gate (canon §2.3): one READ_ONLY dual-verdict pass over the writer's diff that checks **scope/compliance** (does the diff satisfy the bead contract sections?) and **implementation quality** (complexity, duplication, type safety, brittle async/error handling) together, before test-engineer and reviewer.
|
|
643
|
-
|
|
644
|
-
Bead shape:
|
|
645
|
-
|
|
646
|
-
```text
|
|
647
|
-
PROBLEM: Verify the writer diff satisfies the bead contract and is implementation-sound before expensive QA.
|
|
648
|
-
SUCCESS: Dual-verdict isolates any scope or quality issue, or confirms the diff is clean.
|
|
649
|
-
SCOPE: Writer diff, risky files, and any nearby helpers.
|
|
650
|
-
NON_GOALS: No edits, no broad refactor, no release blessing, no security audit, no broad reviewer phase-2.
|
|
651
|
-
CONSTRAINTS: READ_ONLY, keep feedback cheap, cite exact sections/lines/symbols.
|
|
652
|
-
VALIDATION: scope_verdict + quality_verdict + overall_verdict with concrete findings.
|
|
653
|
-
OUTPUT: JSON dual-verdict (scope_verdict / scope_findings / quality_verdict / quality_findings / overall_verdict).
|
|
654
|
-
```
|
|
655
|
-
|
|
656
|
-
The chain reducer reads `overall_verdict`: PASS advances to test-engineer; FAIL routes back to the writer. Hand findings back with `sp resume <exec-job> "Seconder overall_verdict=FAIL — scope: ...; quality: ..."`.
|
|
657
|
-
|
|
658
|
-
A seconder PASS is the upstream scope gate for the reviewer; it is not itself a reviewer PASS.
|
|
659
|
-
|
|
660
|
-
What differs: orchestrator uses seconder as cheap smell screen, not as merge gate.
|
|
661
|
-
|
|
662
|
-
## Security-auditor
|
|
663
|
-
|
|
664
|
-
Use security-auditor when diff touches auth, secrets, input handling, dependency logic, or agent/config surfaces. Keep it advisory and scan-only.
|
|
665
|
-
|
|
666
|
-
Bead shape:
|
|
667
|
-
|
|
668
|
-
```text
|
|
669
|
-
PROBLEM: Diff may open auth, secrets, input, dependency, or agent-config risk.
|
|
670
|
-
SUCCESS: Findings isolate real security concern or confirm no obvious issue.
|
|
671
|
-
SCOPE: Executor diff, touched configs, and security-relevant paths.
|
|
672
|
-
NON_GOALS: No edits, no package updates, no destructive scans, no live exploit tests.
|
|
673
|
-
CONSTRAINTS: LOW permissions, scan-only, recommendations only.
|
|
674
|
-
VALIDATION: Findings cite risk surface and why it matters.
|
|
675
|
-
OUTPUT: Recommendations for executor to apply in a separate bead.
|
|
676
|
-
```
|
|
677
|
-
|
|
678
|
-
Use `sp resume <exec-job> "Security findings: ..."` or `sp resume <exec-job> "Security scan clean; continue to reviewer."`.
|
|
679
|
-
|
|
680
|
-
No findings is not reviewer PASS. Executor still applies fixes if any, then reviewer decides publish.
|
|
681
|
-
|
|
682
|
-
What differs: orchestrator uses security-auditor to surface risk early, not to bless merge.
|
|
683
|
-
|
|
684
|
-
## Dependency Graph Shapes
|
|
685
|
-
|
|
686
|
-
Draw graph before dispatch.
|
|
687
|
-
|
|
688
|
-
Simple chain:
|
|
689
|
-
|
|
690
|
-
```text
|
|
691
|
-
task -> explore -> impl -> review
|
|
692
|
-
```
|
|
693
|
-
|
|
694
|
-
Fix loop:
|
|
695
|
-
|
|
696
|
-
```text
|
|
697
|
-
debug -> exec -> seconder? -> security-auditor? -> reviewer
|
|
698
|
-
^ |
|
|
699
|
-
|------ resume PARTIAL --------------|
|
|
700
|
-
```
|
|
701
|
-
|
|
702
|
-
Epic:
|
|
703
|
-
|
|
704
|
-
```text
|
|
705
|
-
epic
|
|
706
|
-
├─ prep/planner
|
|
707
|
-
├─ impl-a
|
|
708
|
-
├─ impl-b
|
|
709
|
-
├─ test-batch
|
|
710
|
-
└─ merge/review chain(s)
|
|
711
|
-
```
|
|
712
|
-
|
|
713
|
-
What differs: orchestrator sees edge shape up front, so can pick sequential chain, fix loop, or multi-chain epic without graph drift.
|
|
714
|
-
|
|
715
|
-
## Pre-Dispatch: Conflict Cluster Identification
|
|
716
|
-
|
|
717
|
-
Before dispatching N parallel chains, build the file-overlap matrix:
|
|
718
|
-
|
|
719
|
-
| Chain | Touches | Overlap with |
|
|
720
|
-
|-------|---------|--------------|
|
|
721
|
-
| chain-A | src/cli/update.ts | chain-B, chain-C |
|
|
722
|
-
| chain-B | src/cli/update.ts, src/cli/install.ts | chain-A, chain-C, chain-D |
|
|
723
|
-
| chain-C | src/cli/update.ts, src/cli/install.ts, src/cli/doctor.ts | chain-A, chain-B |
|
|
724
|
-
|
|
725
|
-
For each cluster of overlapping chains, choose **one** of:
|
|
726
|
-
|
|
727
|
-
1. **Serial dispatch** — execute chains in dependency order, each waits for previous to land. Slowest but cleanest. Encode the order with `blocks`, not notes.
|
|
728
|
-
2. **Unified bead** — collapse all chains into one bead/executor pass. Larger reviewer scope but no merge conflicts. Mark obsolete split beads with `bd supersede <old> --with <unified>`.
|
|
729
|
-
3. **Parallel dispatch + debugger restitch at integration** — dispatch in parallel, plan for ~40% conflict rate (empirical), budget debugger-restitch passes during integration. Link overlapping siblings with `bd dep relate <chain-a> <chain-b>` so the future restitch has visible context without creating fake blockers.
|
|
730
|
-
|
|
731
|
-
Example graph rewiring:
|
|
732
|
-
|
|
733
|
-
```bash
|
|
734
|
-
# soft conflict-cluster context; does not change schedule
|
|
735
|
-
bd dep relate <chain-a> <chain-b>
|
|
736
|
-
|
|
737
|
-
# serializing because both chains edit src/cli/update.ts
|
|
738
|
-
bd dep add <chain-b> <chain-a> --type blocks
|
|
739
|
-
|
|
740
|
-
# replacing scattered duplicate/split beads with one unified implementation
|
|
741
|
-
bd supersede <old-chain-a> --with <unified-chain>
|
|
742
|
-
bd supersede <old-chain-b> --with <unified-chain>
|
|
743
|
-
```
|
|
744
|
-
|
|
745
|
-
Default heuristic: if 3+ chains touch the same file, **serial-dispatch them**. Conflict-resolution time at integration usually exceeds the time saved by parallel dispatch. Run `bd find-duplicates --status open --method ai --json` before launching a large wave; merge or supersede duplicate work before specialists spend tokens on it.
|
|
746
|
-
|
|
747
|
-
## Pre-Epic: Test-Failure-Map Pattern
|
|
748
|
-
|
|
749
|
-
Use when:
|
|
750
|
-
- A test suite shows ≥ ~5 failures and the operator says "fix all"
|
|
751
|
-
- The failures span multiple files / subsystems
|
|
752
|
-
- Root causes are not yet attributed per failure
|
|
753
|
-
|
|
754
|
-
### Step-by-step
|
|
755
|
-
|
|
756
|
-
1. **Run the suite once**, save the full log. Do not interpret yet.
|
|
757
|
-
2. **File one mapping bead** titled per the Bead Title Convention (e.g., `test-runner: refresh <epic> failure map`) with contract:
|
|
758
|
-
- `PROBLEM:` exact command + exit status + raw failure count.
|
|
759
|
-
- `SUCCESS:` cluster table grouping every failure by **likely shared root cause and file scope**, plus recommended fix-chain order.
|
|
760
|
-
- `SCOPE:` the log file path + bounded test files involved.
|
|
761
|
-
- `CONSTRAINTS:` READ_ONLY, no source/test edits, no fix attempts.
|
|
762
|
-
3. **Dispatch test-runner / explorer / debugger** for this bead READ_ONLY (or fill inline by reading the log).
|
|
763
|
-
4. **Build the cluster table**: cluster name | files (counts) | representative error | root-cause hypothesis | likely-owner area | targeted validation command. Save in bead notes.
|
|
764
|
-
5. **Wire root-cause relationships** so the graph is navigable:
|
|
765
|
-
```bash
|
|
766
|
-
bd dep add <failure-cluster-bead> <root-cause-bead> --type caused-by
|
|
767
|
-
bd dep add <test-runner-bead> <fix-bead> --type validates
|
|
768
|
-
```
|
|
769
|
-
Use `caused-by` for attribution, not `blocks`; use `validates` for the evidence-producing test bead.
|
|
770
|
-
6. **Plan fix chains** off the cluster table:
|
|
771
|
-
- One chain per cluster, file scopes disjoint where possible.
|
|
772
|
-
- Order by leverage (largest cluster first), then by simplicity.
|
|
773
|
-
- Debugger when root cause unclear; executor when bead constraint is concrete.
|
|
774
|
-
7. **Save the topology insight as `bd remember`** — patterns about where a codebase's test fragility concentrates are reusable.
|
|
775
|
-
|
|
776
|
-
### Why this beats dispatch-blind
|
|
777
|
-
|
|
778
|
-
When 34 failures collapsed under 5 clusters in one observed run, 56% of failures shared a single root cause. A blind parallel dispatch would have over-dispatched 19 fixes instead of 1. Net specialist spend ~3× higher without the mapping pass.
|
|
779
|
-
|
|
780
|
-
### Failure modes to watch for
|
|
781
|
-
|
|
782
|
-
- Clusters that look shared but aren't — same error string in unrelated tests may hide different root causes. Confirm via stack traces, not error text alone.
|
|
783
|
-
- One cluster's fix introduces another's regression — each chain's VALIDATION must span all known-failing areas with "no regressions in other clusters."
|
|
784
|
-
- Pre-existing failures vs new regressions — name pre-existing failures explicitly in each chain's NON_GOALS so reviewers don't FAIL on them.
|
|
785
|
-
|
|
786
|
-
## Canonical Single-Chain Flow
|
|
787
|
-
|
|
788
|
-
Use for one implementation branch.
|
|
789
|
-
|
|
790
|
-
```bash
|
|
791
|
-
# 1. Create or claim root task bead with complete contract
|
|
792
|
-
bd create --title "Fix token refresh retry" --type task --priority 2 --description "PROBLEM: login and refresh flow have a retry bug when transient token refresh fails before backoff clears stale state. SUCCESS: token refresh retries once, login survives transient failure, and terminal failure stays clear. SCOPE: src/auth/refresh.ts, src/cli/login.ts, tests/unit/auth/refresh.test.ts. NON_GOALS: no auth provider redesign, no storage migration, no UI changes. CONSTRAINTS: preserve token format, keep error text backward-compatible, avoid broad retry changes outside auth flow. VALIDATION: add regression test for fail-then-succeed path and run targeted auth tests. OUTPUT: changed files, test proof, residual risks."
|
|
793
|
-
bd update <task> --claim
|
|
794
|
-
|
|
795
|
-
# 2. Optional discovery when path is unknown — nested under task (bd-x.1) + typed edge for relationship semantics
|
|
796
|
-
bd create --parent <task> --title "explorer: map auth refresh path" --type task --priority 2 --description "PROBLEM: token refresh retry path is undocumented and likely drifts on failure handling. SUCCESS: evidence-backed plan names exact files, symbols, and risk. SCOPE: src/auth/refresh.ts, src/cli/login.ts, tests/unit/auth/*.test.ts. NON_GOALS: no implementation, no broad audit. CONSTRAINTS: READ_ONLY, cite files/symbols/flows, stay within live repo evidence. VALIDATION: findings cite code path and recommended sequence. OUTPUT: tracked discovery plan with stop condition."
|
|
797
|
-
bd dep add <explore> <task> --type discovered-from
|
|
798
|
-
specialists run explorer --bead <explore> --context-depth 3
|
|
799
|
-
specialists result <explore-job>
|
|
800
|
-
|
|
801
|
-
# 3. Implementation — nested under task (bd-x.2)
|
|
802
|
-
bd create --parent <task> --title "executor: implement token refresh retry" --type task --priority 2 --description "PROBLEM: login fails after transient token refresh error because retry path returns before backoff and clear error state. SUCCESS: retry waits once, preserves session on success, and surfaces final failure clearly. SCOPE: src/auth/refresh.ts, src/cli/login.ts, tests/unit/auth/refresh.test.ts. NON_GOALS: no auth redesign, no storage migration, no UI refresh. CONSTRAINTS: preserve existing token format, keep backward-compatible error text, avoid broad retry changes elsewhere. VALIDATION: add regression test for transient failure then success; run targeted auth tests. OUTPUT: changed files, test evidence, residual risks."
|
|
803
|
-
bd dep add <impl> <explore-or-task> --type blocks
|
|
804
|
-
specialists run executor --bead <impl> --context-depth 3
|
|
805
|
-
specialists result <exec-job>
|
|
806
|
-
|
|
807
|
-
# 4. Advisory passes when diff smells risky — nested under impl (bd-x.2.1, bd-x.2.2), since they service impl's diff specifically
|
|
808
|
-
bd create --parent <impl> --title "seconder: sanity check token retry diff" --type task --priority 2 --description "PROBLEM: auth retry diff has control-flow and state-handling smell that could hide bug. SUCCESS: findings identify concrete simplification or confirm clean shape. SCOPE: executor diff in auth refresh and login flow. NON_GOALS: no edits, no merge gate decision. CONSTRAINTS: READ_ONLY, keep feedback cheap, cite exact lines or symbols. VALIDATION: findings name concrete improvement or say OK. OUTPUT: FINDINGS with severity or OK with caveats."
|
|
809
|
-
bd dep add <sanity-bead> <impl> --type validates
|
|
810
|
-
specialists run seconder --bead <sanity-bead> --job <exec-job> --context-depth 3
|
|
811
|
-
|
|
812
|
-
bd create --parent <impl> --title "security-auditor: scan token retry diff" --type task --priority 2 --description "PROBLEM: auth refresh code touches secrets and session handling, so security regression is possible. SUCCESS: findings isolate real risk surface or confirm no obvious issue. SCOPE: executor diff in auth, token storage, and login path. NON_GOALS: no edits, no package updates, no destructive scans, no live exploit tests. CONSTRAINTS: LOW permissions, scan-only, recommendations only. VALIDATION: findings cite auth/secrets/input surface and why it matters. OUTPUT: recommendations for executor to apply in separate bead."
|
|
813
|
-
bd dep add <security-bead> <impl> --type validates
|
|
814
|
-
specialists run security-auditor --bead <security-bead> --job <exec-job> --context-depth 3
|
|
815
|
-
|
|
816
|
-
# 5. Final review — nested under impl (bd-x.2.3)
|
|
817
|
-
bd create --parent <impl> --title "reviewer: verify token refresh retry" --type task --priority 2 --description "PROBLEM: verify executor output against auth retry requirements. SUCCESS: PASS only if retry behavior, error handling, and tests satisfy contract. SCOPE: executor job, diff, acceptance criteria, and target auth files. NON_GOALS: do not rewrite unless explicitly asked. CONSTRAINTS: code-review mindset; findings first; verify security and sanity findings were handled. VALIDATION: inspect targeted checks and regression coverage. OUTPUT: PASS/PARTIAL/FAIL with file/line findings."
|
|
818
|
-
bd dep add <review> <impl> --type validates
|
|
819
|
-
specialists run reviewer --bead <review> --job <exec-job> --context-depth 3
|
|
820
|
-
specialists result <review-job>
|
|
821
|
-
|
|
822
|
-
# 6. Close any waiting keep-alive specialists explicitly
|
|
823
|
-
sp ps # confirm which jobs are still waiting
|
|
824
|
-
sp stop <waiting-job-id> # repeat per waiting job
|
|
825
|
-
|
|
826
|
-
# 7. Publish via manual git merge (rule #9 — sp merge is prohibited)
|
|
827
|
-
git checkout master
|
|
828
|
-
git pull --ff-only origin master
|
|
829
|
-
git merge --no-ff feature/<impl-bead>-<slug> -m "Merge <impl-bead>: <summary>"
|
|
830
|
-
git push origin master
|
|
831
|
-
git worktree remove <chain-worktree-path>
|
|
832
|
-
git branch -d feature/<impl-bead>-<slug>
|
|
833
|
-
bd close <task> --reason "Reviewer PASS; merged to master."
|
|
834
|
-
```
|
|
835
|
-
|
|
836
|
-
Edit-capable specialists with `--bead` auto-provision a clean git worktree. This does **not** provision ignored project dependency artifacts (`node_modules/`, `.venv/`, build caches). If validation tools are missing inside that worktree, have the specialist run the repo's standard bootstrap command (`make bootstrap`, `just setup`, `npm ci`, `uv sync`, etc.) or report that bootstrap is required; do not solve it by tracking dependency directories. `--worktree` is accepted for clarity but usually unnecessary. Use `--job <exec-job>` for reviewer/fix passes that must enter existing executor workspace.
|
|
837
|
-
|
|
838
|
-
What differs: orchestrator carries full bead contract inline, so downstream specialists inherit the actual job shape, not a title.
|
|
839
|
-
|
|
840
|
-
## Multi-Chain Epic Flow
|
|
841
|
-
|
|
842
|
-
Use epic when multiple implementation chains publish together.
|
|
843
|
-
|
|
844
|
-
```bash
|
|
845
|
-
# Epic bead
|
|
846
|
-
bd create --title "Epic: auth refresh hardening" --type epic --priority 2 --description "PROBLEM: login and refresh flow have retry drift, weak error surfacing, and unclear follow-up ownership. SUCCESS: epic closes with stable retry behavior, tests, docs, and clean publish. SCOPE: src/auth/*, src/cli/login.ts, tests/unit/auth/*, docs/auth-refresh.md. NON_GOALS: no auth provider swap, no storage migration, no unrelated session revamp. CONSTRAINTS: preserve token format, keep login compatible, sequence risky fixes before merge, use child beads for parallelizable slices. VALIDATION: targeted tests, seconder or security pass if risk appears, final reviewer PASS. OUTPUT: merged chain set with notes on remaining gaps."
|
|
847
|
-
|
|
848
|
-
# Planner bead — bd-epic.1
|
|
849
|
-
bd create --parent <epic> --title "planner: plan auth refresh split" --type task --priority 2 --description "PROBLEM: epic needs disjoint chains before executor starts. SUCCESS: child beads, dependency edges, and file ownership split are explicit. SCOPE: auth refresh epic area. NON_GOALS: no code changes. CONSTRAINTS: keep chains disjoint, identify security-sensitive slice, name review order. VALIDATION: plan names beads and edges. OUTPUT: parallel-ready plan with risk notes."
|
|
850
|
-
specialists run planner --bead <plan> --context-depth 3
|
|
851
|
-
|
|
852
|
-
# Parallel impl beads — bd-epic.2, bd-epic.3
|
|
853
|
-
bd create --parent <epic> --title "executor: impl auth retry" --type task --priority 2 --description "PROBLEM: transient refresh failure breaks login flow. SUCCESS: retry path succeeds after one transient failure and preserves session state. SCOPE: src/auth/refresh.ts, tests/unit/auth/refresh.test.ts. NON_GOALS: no UI changes, no storage migration, no unrelated retry framework edits. CONSTRAINTS: preserve error text, keep backoff bounded, avoid side effects outside auth flow. VALIDATION: regression test for fail-then-succeed path. OUTPUT: code diff, test proof, residual risk list."
|
|
854
|
-
bd create --parent <epic> --title "executor: impl login handoff" --type task --priority 2 --description "PROBLEM: login CLI does not surface refresh outcome clearly enough for operators. SUCCESS: login shows clear success/failure handoff and no stale token state. SCOPE: src/cli/login.ts, tests/unit/cli/login.test.ts. NON_GOALS: no auth protocol redesign. CONSTRAINTS: preserve CLI flags and error codes, keep output terse. VALIDATION: CLI regression test. OUTPUT: login diff and test evidence."
|
|
855
|
-
|
|
856
|
-
specialists run executor --bead <impl-a> --context-depth 3
|
|
857
|
-
specialists run executor --bead <impl-b> --context-depth 3
|
|
858
|
-
|
|
859
|
-
# Per-chain review — nested under each impl (bd-epic.2.1, bd-epic.3.1)
|
|
860
|
-
bd create --parent <impl-a> --title "reviewer: verify auth retry" --type task --priority 2 --description "..."
|
|
861
|
-
bd create --parent <impl-b> --title "reviewer: verify login handoff" --type task --priority 2 --description "..."
|
|
862
|
-
bd dep add <review-a> <impl-a> --type validates
|
|
863
|
-
bd dep add <review-b> <impl-b> --type validates
|
|
864
|
-
specialists run reviewer --bead <review-a> --job <exec-a-job> --context-depth 3
|
|
865
|
-
specialists run reviewer --bead <review-b> --job <exec-b-job> --context-depth 3
|
|
866
|
-
|
|
867
|
-
# Close waiting keep-alive specialists explicitly (per chain)
|
|
868
|
-
sp ps # see what's still waiting
|
|
869
|
-
sp stop <waiting-job-id> # repeat per waiting job in each chain
|
|
870
|
-
|
|
871
|
-
# Publish via Cherry-Pick Playbook (canonical multi-chain merge — see Integration Phase section)
|
|
872
|
-
bd dep cycles # stop if relationship rewiring introduced a cycle
|
|
873
|
-
git checkout -b integration/$(date +%Y%m%d)-$EPIC_TAG
|
|
874
|
-
# For each PASS chain in dependency order:
|
|
875
|
-
git merge --squash feature/<chain-bead>-<slug>
|
|
876
|
-
git restore --staged .beads .pi AGENTS.md CLAUDE.md # noise filter
|
|
877
|
-
git commit -m "<type>(<scope>): <summary> (<bead-id>)"
|
|
878
|
-
# Operator FF-merges integration → master when satisfied.
|
|
879
|
-
```
|
|
880
|
-
|
|
881
|
-
Use `--epic <id>` when job belongs to epic but bead is not direct child. Avoid parallel executors on same file; sequence them or consolidate work.
|
|
882
|
-
|
|
883
|
-
What differs: orchestrator splits graph first, then launches parallel work only when file scopes are provably disjoint.
|
|
884
|
-
|
|
885
|
-
## Review And Fix Loop
|
|
886
|
-
|
|
887
|
-
A chain stays alive until merged or abandoned.
|
|
888
|
-
|
|
889
|
-
```text
|
|
890
|
-
executor/debugger -> waiting
|
|
891
|
-
optional seconder/security-auditor -> advisory findings
|
|
892
|
-
reviewer -> PASS | PARTIAL | FAIL
|
|
893
|
-
```
|
|
894
|
-
|
|
895
|
-
- `PASS`: verify expected commit/diff + clean Release Checklist. Close any waiting keep-alive jobs explicitly with `sp stop <job-id>`. Then publish via manual git workflow (per-chain `git merge --no-ff` or Cherry-Pick Playbook for multi-chain epics).
|
|
896
|
-
- `PARTIAL`: resume same executor/debugger with exact findings, then re-review (`sp resume <reviewer-job>`).
|
|
897
|
-
- `FAIL`: stop and decide whether to replace chain, re-scope bead, or ask operator if judgment is required. If replacing a bad chain with a narrower one, use `bd supersede <failed-impl> --with <replacement>`; if reviewer discovered separate follow-up work, use `bd dep add <follow-up> <reviewer-bead> --type discovered-from`.
|
|
898
|
-
|
|
899
|
-
Prefer resume over new fix executor when original job is waiting and context is healthy:
|
|
900
|
-
|
|
901
|
-
```bash
|
|
902
|
-
sp resume <exec-job> "Reviewer PARTIAL. Fix only these findings: ..."
|
|
903
|
-
```
|
|
904
|
-
|
|
905
|
-
Do not treat job completion, seconder OK, security no-findings, or test-runner pass as equivalent to reviewer PASS.
|
|
906
|
-
|
|
907
|
-
What differs: orchestrator uses PASS/PARTIAL/FAIL as real control flow, not just status labels.
|
|
908
|
-
|
|
909
|
-
## Mini-Flows For Under-Promoted Specialists
|
|
910
|
-
|
|
911
|
-
Planner:
|
|
912
|
-
- Use when epic needs bead split, dependency graph, or file ownership before code starts.
|
|
913
|
-
- Bead shape: task/epic contract with clear success criteria, child beads, and edge plan.
|
|
914
|
-
- Chain position: first or pre-impl.
|
|
915
|
-
|
|
916
|
-
Debugger:
|
|
917
|
-
- Use when symptom exists and root cause is unclear.
|
|
918
|
-
- Bead shape: reproduction, logs, expected vs actual, scope to investigate.
|
|
919
|
-
- Chain position: before executor, or after a failing review when cause is unclear.
|
|
920
|
-
|
|
921
|
-
Overthinker:
|
|
922
|
-
- Use for risky design, cross-cutting tradeoffs, or premortem before lock-in.
|
|
923
|
-
- Bead shape: options, risks, constraint conflicts, decision asked for.
|
|
924
|
-
- Chain position: before planner/executor when design uncertainty is high.
|
|
925
|
-
|
|
926
|
-
Researcher:
|
|
927
|
-
- Dispatch **BEFORE** answering any library/API/framework/CLI question from training data. Training is months stale; APIs change; cheap CLI lookups (`ctx7`, `deepwiki`, `ghgrep`) replace the guess.
|
|
928
|
-
- Use for: API syntax checks, config options, version migrations, library-specific debugging, "how do others implement X", recent releases, public repo internals.
|
|
929
|
-
- Anti-pattern to break: "I think Library X works like Y…" → instead dispatch researcher with the exact question. The cost (~30s, `openai-codex/gpt-5.4-mini` via tool mode) is far less than shipping wrong API usage.
|
|
930
|
-
- Bead shape: source list (which libraries/repos), question set, required citations (library ID or `npx ctx7 docs /org/project "..."` output).
|
|
931
|
-
- Chain position: before executor when outside facts matter; alongside explorer when a question mixes local code with external behavior.
|
|
932
|
-
- Keep-alive: ask follow-ups in the same job rather than re-dispatching — researcher stays in waiting state after each turn.
|
|
933
|
-
|
|
934
|
-
Three modes — researcher picks automatically based on bead shape; you write the bead, not the mode:
|
|
935
|
-
|
|
936
|
-
- **Targeted lookup** (most common): "How do I configure X in library Y v1.2?" / "What does Z.method() return now?" / "Are foo and bar still the canonical replacements for baz?" → researcher resolves library ID via `ctx7 library`, then `ctx7 docs /org/project "<intent-rich query>"`. For repo-specific internals (e.g. "How does Vite handle X internally?"), `deepwiki ask <owner/repo> "..."`.
|
|
937
|
-
- **Discovery**: "How do production codebases handle X?" / "Find good examples of pattern Y" / "What does the ecosystem do for Z?" → `ghgrep "<literal pattern>" --lang <langs> --repo <maybe>`, scan results, drill into the best repos with `deepwiki toc` + `deepwiki ask`.
|
|
938
|
-
- **Media / discussion-recency** (rare): YouTube transcripts, social-media trends. Triggers on URLs or "what are people saying about X right now". Researcher loads `last30days` skill on-demand for this — don't fold its setup into the bead.
|
|
939
|
-
|
|
940
|
-
### Dispatch triggers — when the orchestrator should reach for researcher
|
|
941
|
-
|
|
942
|
-
Concrete agent thoughts that MUST be replaced with a researcher dispatch:
|
|
943
|
-
|
|
944
|
-
| Agent thought | Researcher bead |
|
|
945
|
-
|---|---|
|
|
946
|
-
| "I think `useEffect` cleanup works like…" | `ctx7 docs /facebook/react "useEffect cleanup with async operations"` |
|
|
947
|
-
| "Next.js app router middleware should be…" | `ctx7 docs /vercel/next.js "app router middleware patterns"` |
|
|
948
|
-
| "Let me check if `--target` is a valid flag for tool X" | `ctx7 docs /org/tool-x "--target flag"` or `tool-x --help` (orchestrator-side if it's installed) |
|
|
949
|
-
| "Production code probably handles X by…" | `ghgrep "<X-pattern>" --lang TypeScript --limit 5` then `deepwiki ask <best-repo> "<design question>"` |
|
|
950
|
-
| "Library Y added feature Z in v3 (I think)" | `ctx7 library <Y> "Z"` → `ctx7 docs /org/Y/<version> "Z"` to verify version + behavior |
|
|
951
|
-
| "Repo X's authentication architecture is…" | `deepwiki ask owner/X "How does the auth middleware work? What stores tokens? What controls expiry?"` |
|
|
952
|
-
| "Cross-library: do A and B compose like Z?" | `deepwiki ask repo-A repo-B "How do these interact for use-case Z?"` |
|
|
953
|
-
|
|
954
|
-
If you catch yourself making any of these claims without first dispatching researcher, you are about to ship stale information. Stop and dispatch.
|
|
955
|
-
|
|
956
|
-
### Cost framing
|
|
957
|
-
|
|
958
|
-
Researcher runs on `openai-codex/gpt-5.4-mini` via tool mode, keep-alive. Typical turn: 20-40s wall clock, ~$0.005-0.02 per call. The cost of shipping a wrong API call (debugger turn + executor fix + reviewer re-run, or worse, production regression) is orders of magnitude higher. Default to dispatch.
|
|
959
|
-
|
|
960
|
-
### What researcher does NOT do
|
|
961
|
-
|
|
962
|
-
- Local code mapping → use `explorer` (READ_ONLY, traces project code without external CLI cost).
|
|
963
|
-
- Bug root-cause when symptoms are local → use `debugger`.
|
|
964
|
-
- Reading internal docs already in this repo → use direct file read or `explorer`.
|
|
965
|
-
- Security audit of third-party packages → use `security-auditor`; researcher's job is the API surface, not the threat model.
|
|
966
|
-
|
|
967
|
-
Test-runner:
|
|
968
|
-
- Use when commands need to run and failures need classification, not fixes.
|
|
969
|
-
- Bead shape: exact command list, suites, and expected failure taxonomy.
|
|
970
|
-
- Chain position: after executor or between fix loops.
|
|
971
|
-
|
|
972
|
-
Sync-docs:
|
|
973
|
-
- Use when one doc drifts and must be synced to source truth.
|
|
974
|
-
- Bead shape: one-doc scope, source cross-check, drift checks.
|
|
975
|
-
- Chain position: parallel to code only when doc scope is isolated; otherwise after code settles.
|
|
976
|
-
|
|
977
|
-
What differs: orchestrator uses specialists beyond the common trio, so planning, diagnosis, research, tests, and docs do not collapse into executor work.
|
|
978
|
-
|
|
979
|
-
## Specialist Rebuttal As Routine
|
|
980
|
-
|
|
981
|
-
Several specialists default to over-cautious verdicts when an evidence gate looks unsatisfied. The orchestrator's job is to challenge that verdict with cited evidence, not to accept it. Common rebuttal-worthy patterns:
|
|
982
|
-
|
|
983
|
-
### Overthinker
|
|
984
|
-
|
|
985
|
-
- "Hold for operator decision" without specifying what decision is needed → push: "Cite file/line evidence for why this is a product decision rather than a mechanical resolution."
|
|
986
|
-
- "Close as superseded by X" without verification → push: "Read the current state of `<file>` and check whether feature Y from this bead is actually present." If verified, record it structurally with `bd supersede <old> --with <new>` instead of burying the replacement in notes.
|
|
987
|
-
- "Run separate small beads" or "run one big bead" without rationale → push: "Pick one and explain operationally — cost difference, conflict expectations, reviewer scope." If one big bead wins, mark replaced split beads with `bd supersede`; if the small beads remain parallel siblings, link overlap with `bd dep relate`, not `blocks`.
|
|
988
|
-
|
|
989
|
-
### Reviewer
|
|
990
|
-
|
|
991
|
-
- "PARTIAL — missing `gitnexus_impact` evidence" on a test-only diff → rebut: "Diff is entirely under `test/` (N files). `gitnexus_impact` analyzes runtime call graphs; test fixture mocks have no callers in the production graph. Bead's impact-gate constraint is conditional on modifying a runtime entrypoint, which did not happen here."
|
|
992
|
-
- "PARTIAL — missing `gitnexus_impact`" on a small LOW-blast-radius production diff where executor used `gitnexus_detect_changes` instead → rebut: cite the executor's `impact_report.highest_risk: LOW`, the LOC count, single helper / single consumer scope. The reviewer prompt accepts `gitnexus_impact` OR `$gitnexus_summary` OR `gitnexus_detect_changes` OR LOW `impact_report` as evidence.
|
|
993
|
-
- "FAIL — full suite shows N+1 fails" where one is a known concurrent-run flake → rebut: rerun the suspect test in isolation, paste clean output, resume reviewer with "Isolated rerun: P/P. Re-evaluate."
|
|
994
|
-
|
|
995
|
-
### General rule
|
|
996
|
-
|
|
997
|
-
Resume with explicit ammunition: file/line refs, exact rerun output, link to the bead memory documenting the rebuttal pattern. Don't argue from authority; argue from new evidence. **Findings from seconder / security-auditor are legitimate rebuttal evidence** — a clean seconder OK or a security-auditor "no findings" is concrete proof against a reviewer's "looks too complex" or "may have security risk" gate. Cite the advisory job id when rebutting on this axis.
|
|
998
|
-
|
|
999
|
-
**One rebuttal per reviewer is the limit.** Second FAIL after rebuttal means stop and report. After a successful rebuttal, save the rebuttal text to `bd remember "<key>"` so the next session inherits it.
|
|
1000
|
-
|
|
1001
|
-
## Monitoring And Steering
|
|
1002
|
-
|
|
1003
|
-
Use `sp ps` for state and `sp result` for completed turns.
|
|
1004
|
-
|
|
1005
|
-
```bash
|
|
1006
|
-
sp ps # active jobs + unresolved terminal problems
|
|
1007
|
-
sp ps --active # active jobs only
|
|
1008
|
-
sp ps --health # include detailed process tables
|
|
1009
|
-
sp ps --include-terminal # include uncleaned terminal history
|
|
1010
|
-
sp ps --include-cleaned # include rows hidden by sp clean --ps
|
|
1011
|
-
sp ps --all # full audit view, including cleaned/dead/history
|
|
1012
|
-
sp feed <job-id>
|
|
1013
|
-
sp result <job-id>
|
|
1014
|
-
```
|
|
1015
|
-
|
|
1016
|
-
Default `sp ps` is the actionable dashboard, not raw history. Error/cancelled terminal rows stay visible until an operator acknowledges them with `sp clean --ps`; cleaned rows remain in SQLite and are visible via `--include-cleaned`/`--all`.
|
|
1017
|
-
|
|
1018
|
-
If job is running, use `sp feed`. If it is waiting, use `sp result` and decide whether to resume, review, merge, or stop. Avoid tight polling; sleep based on task size, then check once.
|
|
1019
|
-
|
|
1020
|
-
Use `steer` for running jobs and `resume` for waiting jobs:
|
|
1021
|
-
|
|
1022
|
-
```bash
|
|
1023
|
-
sp steer <job-id> "Stop broad audit. Answer only the three bead questions."
|
|
1024
|
-
sp resume <job-id> "Continue with the next scoped fix. Do not refactor."
|
|
1025
|
-
```
|
|
1026
|
-
|
|
1027
|
-
Context usage is an action signal when available:
|
|
1028
|
-
|
|
1029
|
-
- 0-40%: healthy.
|
|
1030
|
-
- 40-65%: monitor.
|
|
1031
|
-
- 65-80%: steer toward conclusion.
|
|
1032
|
-
- Above 80%: finish, summarize, or replace job.
|
|
1033
|
-
|
|
1034
|
-
Raw token totals are not context percentages.
|
|
1035
|
-
|
|
1036
|
-
### Long autonomous runs — dual-mechanism monitoring
|
|
1037
|
-
|
|
1038
|
-
For sessions where the operator is offline (overnight, async windows), use both:
|
|
1039
|
-
|
|
1040
|
-
1. **Bash sleep timers per dispatch**, sized per role (see Monitoring Long-Running Jobs above). Bash sleep waits for an expected completion.
|
|
1041
|
-
2. **External cron loop** (Claude Code: `/loop 180s sp ps`) as a heartbeat at fixed cadence regardless of orchestrator's bash sleeps. Cron catches specialists that finished while the orchestrator was busy reading other results, and catches stalls.
|
|
1042
|
-
|
|
1043
|
-
The two complement: bash sleep waits for an expected completion; cron catches unexpected completions and stalls. Without the cron, the orchestrator can miss specialists that completed during a long bash poll cycle and waste turns re-polling.
|
|
1044
|
-
|
|
1045
|
-
## Bead Lifecycle And Parallel Commit Ordering
|
|
1046
|
-
|
|
1047
|
-
The bd commit-gate is **project-wide**, not per-worktree. While **any** bead in the project is `in_progress`, **no** worktree can commit. Practical consequences for parallel-chain epics:
|
|
1048
|
-
|
|
1049
|
-
- You CAN dispatch two executors in parallel — they work in separate worktrees, no commit-time collision.
|
|
1050
|
-
- But once executor A returns and executor B is still running, you CANNOT commit A's worktree until B's bead is closed (or vice versa).
|
|
1051
|
-
- Workflow: close the finished chain's executor bead FIRST (memory-ack + `bd close`), THEN commit that chain's worktree, THEN wait on the other chain.
|
|
1052
|
-
- This forces a serial-tail on the commit step. Plan for it: parallel-dispatch saves time on the *thinking* step, not the commit step.
|
|
1053
|
-
|
|
1054
|
-
If the commit-gate blocks unexpectedly mid-orchestration, `bd query "status=in_progress"` reveals which claim is holding it open.
|
|
1055
|
-
|
|
1056
|
-
### Memory-gate batch close
|
|
1057
|
-
|
|
1058
|
-
`bd close` is blocked until `memory-acked:<id>` exists. For batch-closing many orchestrator-internal beads (sanity beads, reviewer beads, decomposition trackers), use:
|
|
1059
|
-
|
|
1060
|
-
```bash
|
|
1061
|
-
for id in <impl> <sanity?> <review>; do
|
|
1062
|
-
bd kv set "memory-acked:$id" "saved:<chain-memory-key>" # OR "nothing novel: <reason>"
|
|
1063
|
-
done
|
|
1064
|
-
bd close <impl> <sanity?> <review> <parent> --reason "..."
|
|
1065
|
-
```
|
|
1066
|
-
|
|
1067
|
-
The chain memory key holds the actual durable insight (one per real fix). Sanity/review beads get "nothing novel" — the parent insight covers them.
|
|
1068
|
-
|
|
1069
|
-
## What Stays Out
|
|
1070
|
-
|
|
1071
|
-
- `memory-processor` — memory synthesis specialist; see `/documenting`.
|
|
1072
|
-
- `xt-merge`: deferred to xt-merge skill; this skill names specialist flow, not merge-wrapper internals.
|
|
1073
|
-
- Session-close reporting (report skeleton, CHANGELOG sync, push) — see `/session-close-report` skill; this skill mandates running it at session end but does not duplicate its content.
|
|
1074
|
-
- Release publication (version bump, build, tag, npm publish) — see `/releasing` skill.
|
|
1075
|
-
|
|
1076
|
-
## At Session End — Mandatory Handoff
|
|
1077
|
-
|
|
1078
|
-
Before declaring the session done:
|
|
1079
|
-
|
|
1080
|
-
1. Run the `/session-close-report` skill.
|
|
1081
|
-
2. Fill every `<!-- FILL -->` marker in the generated skeleton.
|
|
1082
|
-
3. Sync `CHANGELOG.md` for user-facing changes (the report skill drives this).
|
|
1083
|
-
4. Re-run cleanup checks: `sp ps`, `git worktree list`, `ps -ef` for stale serena/gitnexus, `tmux ls` for `sp-*`.
|
|
1084
|
-
5. Commit the report (and CHANGELOG if updated) before push.
|
|
1085
|
-
|
|
1086
|
-
A session that lands code but skips the close-report leaves the next agent cold-starting blind. That cost compounds across sessions.
|
|
1087
|
-
|
|
1088
|
-
## Adjacent xt commands
|
|
1089
|
-
|
|
1090
|
-
Source: latest xt report + `xt --help`; keep commands here, not full CLI surface.
|
|
1091
|
-
- `xt report` — session report input for release synthesis; see `/session-close-report`.
|
|
1092
|
-
- `xt end` — close worktree session: push, PR, merge, cleanup; see `/xt-end`.
|
|
1093
|
-
- `xt claude` — launch Claude in sandboxed worktree; see `/using-xtrm`.
|
|
1094
|
-
- `xt update` — refresh xtrm-managed files in one repo or many; see `/update-xt`.
|
|
1095
|
-
- `xt doctor` — diagnose xtrm drift in current project; see `/update-xt`.
|
|
1096
|
-
- `xt init` — bootstrap xtrm in project; see xtrm-tools docs.
|
|
1097
|
-
- `xt release prepare/publish` — legacy release path; canonical flow is `/releasing`.
|
|
1098
|
-
- `bd prime` — refresh beads workflow context; see `CLAUDE.md`.
|
|
1099
|
-
- `memory-processor` — memory synthesis specialist; see `/documenting`.
|
|
1100
|
-
- `xt-merge` — defer merge-queue internals to `/xt-merge`.
|
|
1101
|
-
|
|
1102
|
-
## Merge And Publication (manual git is canonical)
|
|
1103
|
-
|
|
1104
|
-
> **Rule #9:** `sp merge` and `sp epic merge` are prohibited — known broken, awaiting a separate rework epic. Even if `sp help` shows them, do not use. The Cherry-Pick Playbook below is the canonical merge path for specialist-owned work.
|
|
1105
|
-
|
|
1106
|
-
### Per-chain merge (standalone or one chain at a time inside an epic)
|
|
1107
|
-
|
|
1108
|
-
After reviewer PASS on a chain whose work lives in `feature/<bead-id>-<slug>` worktree:
|
|
1109
|
-
|
|
1110
|
-
```bash
|
|
1111
|
-
# 1. Verify reviewer PASS verdict was recorded (Release Checklist clean)
|
|
1112
|
-
bd show <bead-id> # check notes for the verdict
|
|
1113
|
-
|
|
1114
|
-
# 2. Verify the chain's gates passed:
|
|
1115
|
-
# seconder OK | obligations-scanner CLEAN | security-auditor clean (if surface)
|
|
1116
|
-
# Reviewer's Release Checklist block enumerates these.
|
|
1117
|
-
|
|
1118
|
-
# 3. Switch to target branch (master or integration/<date>) and FF or merge
|
|
1119
|
-
git checkout <target>
|
|
1120
|
-
git pull --ff-only origin <target>
|
|
1121
|
-
git merge --no-ff feature/<bead-id>-<slug> -m "Merge <bead-id>: <summary>"
|
|
1122
|
-
git push origin <target>
|
|
1123
|
-
|
|
1124
|
-
# 4. Cleanup the chain worktree + branch
|
|
1125
|
-
git worktree remove <chain-worktree-path>
|
|
1126
|
-
git branch -d feature/<bead-id>-<slug>
|
|
1127
|
-
git worktree prune
|
|
1128
|
-
```
|
|
1129
|
-
|
|
1130
|
-
Use `git update-ref` for FF-equivalent when checkout is blocked by transient working-tree state (e.g., bd auto-export churn on `.beads/issues.jsonl`):
|
|
1131
|
-
|
|
1132
|
-
```bash
|
|
1133
|
-
git merge-base --is-ancestor <target> feature/<bead-id>-<slug> && \
|
|
1134
|
-
git update-ref refs/heads/<target> feature/<bead-id>-<slug> && \
|
|
1135
|
-
git push origin <target>
|
|
1136
|
-
```
|
|
1137
|
-
|
|
1138
|
-
### Multi-chain epic merge
|
|
1139
|
-
|
|
1140
|
-
Use the Cherry-Pick Playbook (below). Each chain lands as one squash commit on an integration branch (visible to operator before main), then operator FF-merges integration → main when satisfied.
|
|
1141
|
-
|
|
1142
|
-
### Closing the keep-alive specialists
|
|
1143
|
-
|
|
1144
|
-
If reviewer/executor jobs are still `waiting` after PASS:
|
|
1145
|
-
|
|
1146
|
-
```bash
|
|
1147
|
-
sp stop <waiting-job-id> # explicit close per job; verify with sp ps before
|
|
1148
|
-
```
|
|
1149
|
-
|
|
1150
|
-
No automatic cascade-finalizer. Close each waiting job explicitly. (Yes, this is more ceremony than `sp finalize` provided — but `sp finalize` lived inside the broken sp merge path.)
|
|
1151
|
-
|
|
1152
|
-
### Rules
|
|
1153
|
-
|
|
1154
|
-
- Merge only after reviewer PASS + clean Release Checklist unless operator explicitly accepts a draft.
|
|
1155
|
-
- Always use `git merge --no-ff` for chain merges to keep the chain branch visible in history.
|
|
1156
|
-
- If merge reports a dirty worktree on the target branch, inspect what's dirty. Revert generated noise (e.g., `.beads/issues.jsonl` churn) only when clearly unrelated; otherwise ask the operator.
|
|
1157
|
-
- After merge, always remove the chain worktree + delete the branch + prune.
|
|
1158
|
-
- Stale-base failures: per Git State Precondition section, dispatch chains only when target branch HEAD contains all prior dependent chains' commits.
|
|
1159
|
-
|
|
1160
|
-
## Integration Phase — Cherry-Pick Playbook (canonical multi-chain merge)
|
|
1161
|
-
|
|
1162
|
-
The canonical path for landing multiple specialist chains. Operator gets visibility on an integration branch before the work hits main.
|
|
1163
|
-
|
|
1164
|
-
### Step-by-step
|
|
1165
|
-
|
|
1166
|
-
1. Stash uncommitted state on working branch: `git stash push -u -m "pre-integration"`.
|
|
1167
|
-
2. Create integration branch off the working branch: `git checkout -b integration/<date>-orchestrator`.
|
|
1168
|
-
3. For each non-overlapping chain (security/critical first, then test-baseline, then features):
|
|
1169
|
-
- `git merge --squash <chain-branch>`
|
|
1170
|
-
- Restore noise files (see "Chain noise filter checklist" below)
|
|
1171
|
-
- **Advisory passes** before commit: if the staged diff smells overcomplicated/duplicative/type-risky, dispatch `seconder --job <last-exec-job-of-chain>`; if it touches auth/secrets/input/agent-config, dispatch `security-auditor --job <last-exec-job-of-chain>`. Link those beads with `bd dep add <advisory-bead> <chain-bead> --type validates`. Apply findings or document why skipped.
|
|
1172
|
-
- `git commit -m "<type>(<scope>): <summary> (<bead-id>)"` — one squash commit per chain.
|
|
1173
|
-
4. For each overlapping chain, add `bd dep relate <overlap-a> <overlap-b>` if not already linked, then switch to the **debugger-restitch** pattern (next section).
|
|
1174
|
-
5. Before publication, run `bd dep cycles`; fix any accidental cycle before operator FF-merges integration → main.
|
|
1175
|
-
6. After all chains land, run E2E smoke phase (below) before declaring done.
|
|
1176
|
-
7. Operator FF-merges integration → main when satisfied.
|
|
1177
|
-
|
|
1178
|
-
### Chain noise filter checklist
|
|
1179
|
-
|
|
1180
|
-
For manual cherry-pick / squash flows, unstage these before committing (otherwise the chain commit will carry orchestrator-bookkeeping noise):
|
|
1181
|
-
|
|
1182
|
-
- `.pi/npm` — accidentally created by xt commands inside worktrees
|
|
1183
|
-
- `cli/pnpm-lock.yaml`, `cli/pnpm-workspace.yaml` — pnpm side-effects
|
|
1184
|
-
- `AGENTS.md`, `CLAUDE.md` — gitnexus stat-refresh hook noise
|
|
1185
|
-
- `.beads/issues.jsonl`, `.beads/interactions.jsonl` — bd state churn
|
|
1186
|
-
- `.specialists/executor-result.md` — transient specialist output
|
|
1187
|
-
|
|
1188
|
-
```bash
|
|
1189
|
-
git restore --staged .beads .pi AGENTS.md CLAUDE.md
|
|
1190
|
-
git checkout HEAD -- .beads AGENTS.md CLAUDE.md
|
|
1191
|
-
rm -f .pi/npm
|
|
1192
|
-
```
|
|
1193
|
-
|
|
1194
|
-
If a chain commits its own `.beads` symlink (older bd-in-worktree behavior), `rm -f .beads` then `git checkout HEAD -- .beads` to restore the real directory.
|
|
1195
|
-
|
|
1196
|
-
## Debugger-Restitch Pattern
|
|
1197
|
-
|
|
1198
|
-
When chain X conflicts with already-landed chain Y on shared files, raw `git cherry-pick` will revert Y's work. The debugger-restitch pattern preserves both, but only when the debugger gets an explicit "preserve already-landed work" contract.
|
|
1199
|
-
|
|
1200
|
-
1. **Reopen X**: `bd reopen <X> --reason="integration stitch onto post-Y state"`. If the old X chain is no longer publishable, create a restitch bead and mark replacement explicitly: `bd supersede <X> --with <X-restitch>`. Link X and Y with `bd dep relate <X-restitch> <Y>` for conflict context; use `caused-by` only when a concrete failure bead is attributable to Y's already-landed change.
|
|
1201
|
-
2. **Strengthen the bead contract** with these fields:
|
|
1202
|
-
- `## CRITICAL CONSTRAINTS:` heading at the top.
|
|
1203
|
-
- "Fork off `integration/<date>-orchestrator`. Verify with `git log integration/...$..HEAD` empty before any commits."
|
|
1204
|
-
- List the symbols/lines from Y that MUST be preserved verbatim (with file paths).
|
|
1205
|
-
- "ADD X's intent ON TOP" with a numbered list of the additions.
|
|
1206
|
-
- "Reference original `feature/<X>-executor` for symbol shapes only — do NOT cherry-pick or merge. Re-implement on integration's current state."
|
|
1207
|
-
- `## VALIDATION:` includes both Y's tests passing AND X's new tests passing.
|
|
1208
|
-
- `## OUTPUT:` mandates a 5-line code excerpt showing both Y and X features coexisting.
|
|
1209
|
-
3. **Dispatch debugger** with `--force-stale-base` if X is an epic child:
|
|
1210
|
-
```bash
|
|
1211
|
-
sp run debugger --bead <X> --force-stale-base --keep-alive --background
|
|
1212
|
-
```
|
|
1213
|
-
4. **Sanity check the result**: when debugger reports back:
|
|
1214
|
-
```bash
|
|
1215
|
-
git log integration/<date>..feature/<X>-debugger --oneline
|
|
1216
|
-
git diff integration/<date>...feature/<X>-debugger -- <key-files>
|
|
1217
|
-
```
|
|
1218
|
-
Confirm the debugger's diff is **additive** — no reverts of Y's lines.
|
|
1219
|
-
5. **Advisory passes**: before landing the restitch, dispatch `seconder --job <debugger-job>` if the restitch added control-flow complexity, and `security-auditor --job <debugger-job>` if it touched a sensitive surface. Link each advisory bead back with `bd dep add <advisory> <X-restitch-or-X> --type validates`. Restitched diffs are higher-risk than fresh executor diffs because the debugger had to thread around already-landed work.
|
|
1220
|
-
6. **Land via FF or cherry-pick the named commit** (NOT the checkpoint commit). Look for the commit with the proper `<type>(<scope>):` message; ignore `checkpoint(debugger):` commits above it.
|
|
1221
|
-
7. **Verify tests** before marking done.
|
|
1222
|
-
|
|
1223
|
-
### Failure mode to watch for
|
|
1224
|
-
|
|
1225
|
-
If the debugger forks off the OLD baseline (pre-Y) instead of integration, its commit will revert Y. Symptom: `git diff integration..feature/<X>-debugger -- <Y's-file>` shows DELETIONS of Y's symbols. Fix: resume the debugger with explicit "cd to a fresh worktree forked from `integration/<date>-orchestrator`" instruction. Re-verify with `git log integration..HEAD` empty. If the bad restitch became a tracked bead, supersede it with the corrected restitch bead so nobody merges the obsolete chain.
|
|
1226
|
-
|
|
1227
|
-
## E2E Smoke Phase
|
|
1228
|
-
|
|
1229
|
-
Run **every** npm script + entry point that any chain added or modified. The smoke phase is the only way to catch missed chains, false-positive CI gates, missing intermediate files, and runtime regressions invisible to unit tests.
|
|
1230
|
-
|
|
1231
|
-
### Procedure
|
|
1232
|
-
|
|
1233
|
-
```bash
|
|
1234
|
-
# Build sanity
|
|
1235
|
-
bun run build # or equivalent
|
|
1236
|
-
|
|
1237
|
-
# Test sanity — record PRE-baseline first
|
|
1238
|
-
git checkout <baseline-branch>
|
|
1239
|
-
bun test 2>&1 | tail -5 # record N failed / M passed
|
|
1240
|
-
|
|
1241
|
-
# Switch back and re-run
|
|
1242
|
-
git checkout integration/<date>-orchestrator
|
|
1243
|
-
bun test 2>&1 | tail -5 # MUST be ≥ baseline. Net regression is a stop-the-line.
|
|
1244
|
-
|
|
1245
|
-
# Run every check:* script the integration added
|
|
1246
|
-
for s in $(jq -r '.scripts | keys[] | select(startswith("check:"))' package.json); do
|
|
1247
|
-
echo "=== $s ==="
|
|
1248
|
-
npm run "$s" 2>&1 | tail -10
|
|
1249
|
-
done
|
|
1250
|
-
|
|
1251
|
-
# Targeted unit tests for chains touching the same files
|
|
1252
|
-
bunx vitest run <chain-test-files>
|
|
1253
|
-
```
|
|
1254
|
-
|
|
1255
|
-
For each smoke that fails, decide before continuing:
|
|
1256
|
-
- False positive (script flags itself) → file follow-up bead, document, continue
|
|
1257
|
-
- Missing dependency (vendor not run) → expected gate, document
|
|
1258
|
-
- Real regression → stop, dispatch debugger to fix, re-smoke
|
|
1259
|
-
|
|
1260
|
-
### Cross-cutting security-auditor pass
|
|
1261
|
-
|
|
1262
|
-
If any landed chain in this integration touched auth, secrets, input handling, dependency lockfiles, or agent/MCP/config surfaces, dispatch one `security-auditor` on the cumulative integration diff BEFORE declaring smoke done:
|
|
1263
|
-
|
|
1264
|
-
```bash
|
|
1265
|
-
git diff <baseline>..integration/<date>-orchestrator > /tmp/integration-diff.patch
|
|
1266
|
-
sp run security-auditor --bead <sec-bead> --context-depth 3 --background
|
|
1267
|
-
```
|
|
1268
|
-
|
|
1269
|
-
Per-chain security-auditor passes catch chain-local risks; this cross-cutting pass catches interaction risks that only appear once all chains coexist (e.g. one chain weakens an input validator that another newly relies on). Skipping this on a sensitive-surface integration is an escalation event.
|
|
1270
|
-
|
|
1271
|
-
Record all smoke results in the session-close-report under a `## Smoke test results` table (see `/session-close-report` skill).
|
|
1272
|
-
|
|
1273
|
-
## Failure Recovery
|
|
1274
|
-
|
|
1275
|
-
When something fails:
|
|
1276
|
-
|
|
1277
|
-
```bash
|
|
1278
|
-
sp ps <job-id>
|
|
1279
|
-
sp feed <job-id>
|
|
1280
|
-
sp result <job-id>
|
|
1281
|
-
sp doctor
|
|
1282
|
-
```
|
|
1283
|
-
|
|
1284
|
-
Then choose one action:
|
|
1285
|
-
|
|
1286
|
-
- Resume waiting executor/debugger with exact findings.
|
|
1287
|
-
- Re-run with better bead if contract was weak.
|
|
1288
|
-
- Re-scope bead if scope was wrong.
|
|
1289
|
-
- Escalate if human decision is needed.
|
|
1290
|
-
- Replace specialist only if failure mode repeats.
|
|
1291
|
-
|
|
1292
|
-
### Common failure patterns (and the canonical fix)
|
|
1293
|
-
|
|
1294
|
-
| Symptom | Cause | Fix |
|
|
1295
|
-
|---|---|---|
|
|
1296
|
-
| `git checkout <branch>` aborts with "would overwrite untracked/changes" mid-orchestration | bd auto-export keeps re-staging `.beads/issues.jsonl` after every bd op | Use `git update-ref refs/heads/<target> <source>` for FF-equivalent without checkout; or commit the .beads churn as a separate "chore(beads): export state" commit before switching |
|
|
1297
|
-
| Stale `.git/index.lock` blocks git commands | bd hooks or other tooling crashed mid-operation | Check no real git process is running (`ps -ef \| grep "git "`); if clear, `rm -f .git/index.lock` and retry |
|
|
1298
|
-
| `git add .beads/issues.jsonl` says "ignored by gitignore" but `git status` shows it modified | File is in `.git/info/exclude` but already tracked in the index | The staged change can still be committed directly (`git commit` without `git add`); don't fight the exclude |
|
|
1299
|
-
| Validation fails with `command not found`, `vitest: not found`, missing Python tools, or `ERR_MODULE_NOT_FOUND` in a fresh worktree | Normal git worktree behavior: ignored dependency dirs (`node_modules/`, `.venv/`) are not copied into new worktrees | Run the repo's standard bootstrap inside that worktree (`make bootstrap`, `just setup`, `npm ci`, `uv sync`, etc.) or report bootstrap-required. Do not track dependency artifacts. |
|
|
1300
|
-
| `sp ps` shows old terminal jobs after a session | Default dashboard keeps unresolved terminal problems visible until acknowledged | `sp clean --ps --dry-run`, then `sp clean --ps` to soft-hide from default ps; use `sp ps --include-cleaned`/`--all` for audit history |
|
|
1301
|
-
| Reviewer keeps returning PARTIAL on functional contracts already met | Reviewer demanding tool-event evidence — typically obsoleted after the gate relaxation, but if it persists check the executor's `gitnexus_detect_changes` ran and use the rebuttal pattern (see Specialist Rebuttal As Routine) | Rebut with cited evidence; second FAIL = escalate |
|
|
1302
|
-
| Multiple `sp run` background launches drop silently under shell parallelism | Known launch-ceremony race | Re-check `sp ps` after each dispatch and retry the missing one; serialize when reliability matters |
|
|
1303
|
-
| `sp run` returns `Warning: job started but ID not yet available` and nothing appears in `sp ps --bead <id>` after 30s | Dispatch was refused by epic guard or base-staleness check; stderr now surfaces the refusal reason (see `sp run --background` post-fix) | Read the surfaced reason; retry with `--force-stale-base` if intentional, or fix the bead/lineage |
|
|
1304
|
-
| `sp feed <job-id>` returns short tail with no tool events | Confirms DB-backed replay is active; if you see ≤10 lines on a real run, the DB is missing events for that job — verify with raw SQL on observability.db | If DB truly lacks events: re-run job; if DB has events but feed truncates: file bug bead — should not happen on current build |
|
|
1305
|
-
| bd "database not found" or per-project Dolt server respawn | bd has spawned a per-project Dolt instead of routing to the shared server | `ps aux \| grep "<repo>/.beads/dolt" \| awk '{print $2}' \| xargs -r kill -9`; ensure `.beads/config.yaml` contains `dolt.shared-server: true`; `bd ready` should now route to `~/.beads/shared-server/` |
|
|
1306
|
-
| Dolt journal corruption (`possible data loss detected at offset N`) | bd-internal | Operator-only — do NOT auto-recover. Stop bd writes, snapshot `~/.beads/shared-server/dolt`, run `dolt fsck` (read-only) first. Operator decides on `--revive-journal-with-data-loss` after reviewing the warning |
|
|
1307
|
-
|
|
1308
|
-
## What Orchestrator Does Differently Because Of This Skill
|
|
1309
|
-
|
|
1310
|
-
- Writes bead contract before dispatch.
|
|
1311
|
-
- Nests specialist-dispatch beads under the bead they service via `--parent`, regardless of whether that bead is an epic, a task, or already a nested child — never defaults to loose top-level beads.
|
|
1312
|
-
- Titles every specialist-dispatch bead `<specialist-role>: <task>` so `bd list`/`sp ps` are scannable by role at a glance.
|
|
1313
|
-
- Chooses edge type before creating chain.
|
|
1314
|
-
- Uses specialist role by job shape, not by habit.
|
|
1315
|
-
- Keeps fix loops alive with resume, not re-spawn.
|
|
1316
|
-
- Treats reviewer PASS as only publish gate.
|
|
1317
|
-
- Maps file-overlap surface BEFORE dispatching parallel waves.
|
|
1318
|
-
- Files one READ_ONLY test-failure-map bead before fix chains when ≥5 failures span subsystems.
|
|
1319
|
-
- Uses overthinker and reviewer as conversation, not one-shot oracles — rebuts with cited evidence once, then escalates.
|
|
1320
|
-
- Smokes every npm script and entry point before declaring integration done; runs cross-cutting security-auditor on cumulative diff when sensitive surfaces were touched.
|
|
1321
|
-
- Commits debugger-restitch results via FF or cherry-pick of the named commit, not the checkpoint commit above it.
|
|
1322
|
-
- Closes finished chain's bead BEFORE committing that worktree when other chains still in_progress (project-wide commit-gate).
|
|
1323
|
-
- Applies SCRUTINY field on every substantive bead; lets reviewer auto-escalate.
|
|
1324
|
-
- Verifies Git State Precondition before every dependent-chain dispatch.
|
|
1325
|
-
- Merges specialist work via manual git workflow (Cherry-Pick Playbook); never `sp merge` / `sp epic merge` (rule #9 — known broken).
|
|
1326
|
-
- Runs `/session-close-report` at session end and only then declares done.
|
|
1327
|
-
- Keeps memory-processor, xt-merge, session-close-report, and releasing out of this skill on purpose — each has its own.
|