@jaggerxtrm/specialists 3.17.0 → 3.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/README.md +268 -134
  2. package/config/mandatory-rules/executor-delivery.md +4 -0
  3. package/config/mandatory-rules/json-only-final-output.md +13 -0
  4. package/config/mandatory-rules/service-skills-diff-scan-mandatory.md +26 -0
  5. package/config/mandatory-rules/service-skills-gitnexus-triage.md +5 -0
  6. package/config/mandatory-rules/test-runner-execution-scope.md +4 -0
  7. package/config/skills/setup-specialists/SKILL.md +556 -0
  8. package/config/skills/specialists-creator/SKILL.md +132 -4
  9. package/config/skills/specialists-creator/scripts/audit-spec-uniformity.mjs +1 -1
  10. package/config/skills/using-specialists-v3/SKILL.md +80 -20
  11. package/config/specialists/bare.specialist.json +3 -3
  12. package/config/specialists/changelog-drafter.specialist.json +5 -4
  13. package/config/specialists/changelog-keeper.specialist.json +7 -6
  14. package/config/specialists/debugger.specialist.json +2 -2
  15. package/config/specialists/executor.specialist.json +2 -2
  16. package/config/specialists/explorer.specialist.json +4 -4
  17. package/config/specialists/memory-processor.specialist.json +3 -3
  18. package/config/specialists/node-coordinator.specialist.json +3 -3
  19. package/config/specialists/obligations-scanner.specialist.json +67 -17
  20. package/config/specialists/overthinker.specialist.json +3 -3
  21. package/config/specialists/planner.specialist.json +4 -4
  22. package/config/specialists/quant-methodologist.specialist.json +145 -0
  23. package/config/specialists/quant-researcher.specialist.json +144 -0
  24. package/config/specialists/researcher.specialist.json +5 -5
  25. package/config/specialists/reviewer.specialist.json +1 -1
  26. package/config/specialists/seconder.specialist.json +2 -2
  27. package/config/specialists/security-auditor.specialist.json +2 -2
  28. package/config/specialists/service-skills-sync.specialist.json +90 -75
  29. package/config/specialists/specialists-creator.specialist.json +4 -4
  30. package/config/specialists/sync-docs.specialist.json +4 -4
  31. package/config/specialists/test-engineer.specialist.json +3 -3
  32. package/config/specialists/test-runner.specialist.json +7 -7
  33. package/config/specialists/transcriber.specialist.json +3 -3
  34. package/config/specialists/xt-merge.specialist.json +4 -4
  35. package/dist/asset-contract.json +22 -3
  36. package/dist/index.js +28711 -18517
  37. package/dist/lib.js +10020 -6150
  38. package/dist/types/cli/console/components.d.ts +83 -0
  39. package/dist/types/cli/console/components.d.ts.map +1 -0
  40. package/dist/types/cli/console/config-source.d.ts +58 -0
  41. package/dist/types/cli/console/config-source.d.ts.map +1 -0
  42. package/dist/types/cli/console/forensic.d.ts +11 -0
  43. package/dist/types/cli/console/forensic.d.ts.map +1 -0
  44. package/dist/types/cli/console/git.d.ts +28 -0
  45. package/dist/types/cli/console/git.d.ts.map +1 -0
  46. package/dist/types/cli/console/help.d.ts +2 -0
  47. package/dist/types/cli/console/help.d.ts.map +1 -0
  48. package/dist/types/cli/console/log.d.ts +13 -0
  49. package/dist/types/cli/console/log.d.ts.map +1 -0
  50. package/dist/types/cli/console/repo-config.d.ts +26 -0
  51. package/dist/types/cli/console/repo-config.d.ts.map +1 -0
  52. package/dist/types/cli/console/repo-discovery.d.ts +12 -0
  53. package/dist/types/cli/console/repo-discovery.d.ts.map +1 -0
  54. package/dist/types/cli/console/runtime.d.ts +12 -0
  55. package/dist/types/cli/console/runtime.d.ts.map +1 -0
  56. package/dist/types/cli/console/subscribe-prototype.d.ts +18 -0
  57. package/dist/types/cli/console/subscribe-prototype.d.ts.map +1 -0
  58. package/dist/types/cli/console/theme.d.ts +91 -0
  59. package/dist/types/cli/console/theme.d.ts.map +1 -0
  60. package/dist/types/cli/console/types.d.ts +231 -0
  61. package/dist/types/cli/console/types.d.ts.map +1 -0
  62. package/dist/types/cli/console/view-model.d.ts +252 -0
  63. package/dist/types/cli/console/view-model.d.ts.map +1 -0
  64. package/dist/types/cli/console.d.ts +2 -0
  65. package/dist/types/cli/console.d.ts.map +1 -0
  66. package/dist/types/cli/db.d.ts.map +1 -1
  67. package/dist/types/cli/doctor.d.ts.map +1 -1
  68. package/dist/types/cli/edit.d.ts.map +1 -1
  69. package/dist/types/cli/epic.d.ts.map +1 -1
  70. package/dist/types/cli/feed.d.ts.map +1 -1
  71. package/dist/types/cli/forensic.d.ts +2 -0
  72. package/dist/types/cli/forensic.d.ts.map +1 -0
  73. package/dist/types/cli/format-helpers.d.ts +4 -2
  74. package/dist/types/cli/format-helpers.d.ts.map +1 -1
  75. package/dist/types/cli/help.d.ts.map +1 -1
  76. package/dist/types/cli/init.d.ts +10 -0
  77. package/dist/types/cli/init.d.ts.map +1 -1
  78. package/dist/types/cli/list.d.ts.map +1 -1
  79. package/dist/types/cli/log.d.ts.map +1 -1
  80. package/dist/types/cli/merge.d.ts.map +1 -1
  81. package/dist/types/cli/metrics.d.ts +2 -0
  82. package/dist/types/cli/metrics.d.ts.map +1 -0
  83. package/dist/types/cli/ps.d.ts.map +1 -1
  84. package/dist/types/cli/result.d.ts.map +1 -1
  85. package/dist/types/cli/run.d.ts +20 -0
  86. package/dist/types/cli/run.d.ts.map +1 -1
  87. package/dist/types/cli/script.d.ts +3 -0
  88. package/dist/types/cli/script.d.ts.map +1 -1
  89. package/dist/types/cli/serve.d.ts.map +1 -1
  90. package/dist/types/cli/setup.d.ts +19 -1
  91. package/dist/types/cli/setup.d.ts.map +1 -1
  92. package/dist/types/cli/status.d.ts.map +1 -1
  93. package/dist/types/cli/version-check.d.ts +1 -0
  94. package/dist/types/cli/version-check.d.ts.map +1 -1
  95. package/dist/types/index.d.ts +1 -1
  96. package/dist/types/pi/session.d.ts +12 -1
  97. package/dist/types/pi/session.d.ts.map +1 -1
  98. package/dist/types/server.d.ts +15 -0
  99. package/dist/types/server.d.ts.map +1 -1
  100. package/dist/types/specialist/benchmarks.d.ts +37 -0
  101. package/dist/types/specialist/benchmarks.d.ts.map +1 -0
  102. package/dist/types/specialist/chain-identity.d.ts +7 -1
  103. package/dist/types/specialist/chain-identity.d.ts.map +1 -1
  104. package/dist/types/specialist/control.d.ts.map +1 -1
  105. package/dist/types/specialist/dead-job-audit.d.ts +20 -0
  106. package/dist/types/specialist/dead-job-audit.d.ts.map +1 -0
  107. package/dist/types/specialist/forensic-events.d.ts +138 -0
  108. package/dist/types/specialist/forensic-events.d.ts.map +1 -0
  109. package/dist/types/specialist/forensic-renderer.d.ts +34 -0
  110. package/dist/types/specialist/forensic-renderer.d.ts.map +1 -0
  111. package/dist/types/specialist/git-diff-evidence.d.ts +28 -0
  112. package/dist/types/specialist/git-diff-evidence.d.ts.map +1 -0
  113. package/dist/types/specialist/global-config.d.ts +389 -0
  114. package/dist/types/specialist/global-config.d.ts.map +1 -0
  115. package/dist/types/specialist/launch.d.ts +9 -0
  116. package/dist/types/specialist/launch.d.ts.map +1 -1
  117. package/dist/types/specialist/live-aggregates.d.ts +46 -0
  118. package/dist/types/specialist/live-aggregates.d.ts.map +1 -0
  119. package/dist/types/specialist/loader.d.ts +50 -1
  120. package/dist/types/specialist/loader.d.ts.map +1 -1
  121. package/dist/types/specialist/model-chain.d.ts +7 -0
  122. package/dist/types/specialist/model-chain.d.ts.map +1 -0
  123. package/dist/types/specialist/model-probes.d.ts +28 -0
  124. package/dist/types/specialist/model-probes.d.ts.map +1 -0
  125. package/dist/types/specialist/node-contract.d.ts +18 -18
  126. package/dist/types/specialist/node-supervisor.d.ts.map +1 -1
  127. package/dist/types/specialist/observability-db.d.ts +1 -1
  128. package/dist/types/specialist/observability-db.d.ts.map +1 -1
  129. package/dist/types/specialist/observability-sqlite.d.ts +101 -0
  130. package/dist/types/specialist/observability-sqlite.d.ts.map +1 -1
  131. package/dist/types/specialist/pr-drift-refresh.d.ts +17 -0
  132. package/dist/types/specialist/pr-drift-refresh.d.ts.map +1 -0
  133. package/dist/types/specialist/preset-resolver.d.ts +56 -0
  134. package/dist/types/specialist/preset-resolver.d.ts.map +1 -0
  135. package/dist/types/specialist/prometheus-projection.d.ts +25 -0
  136. package/dist/types/specialist/prometheus-projection.d.ts.map +1 -0
  137. package/dist/types/specialist/runner.d.ts +29 -1
  138. package/dist/types/specialist/runner.d.ts.map +1 -1
  139. package/dist/types/specialist/schema.d.ts +163 -54
  140. package/dist/types/specialist/schema.d.ts.map +1 -1
  141. package/dist/types/specialist/script-runner.d.ts +5 -1
  142. package/dist/types/specialist/script-runner.d.ts.map +1 -1
  143. package/dist/types/specialist/snapshot-diff.d.ts +8 -0
  144. package/dist/types/specialist/snapshot-diff.d.ts.map +1 -0
  145. package/dist/types/specialist/source-queue.d.ts +13 -0
  146. package/dist/types/specialist/source-queue.d.ts.map +1 -0
  147. package/dist/types/specialist/status-load.d.ts.map +1 -1
  148. package/dist/types/specialist/supervisor.d.ts +25 -1
  149. package/dist/types/specialist/supervisor.d.ts.map +1 -1
  150. package/dist/types/specialist/timeline-events.d.ts +70 -1
  151. package/dist/types/specialist/timeline-events.d.ts.map +1 -1
  152. package/dist/types/tools/specialist/resume_specialist.tool.d.ts +4 -4
  153. package/dist/types/tools/specialist/specialist_status.tool.d.ts +1 -1
  154. package/dist/types/tools/specialist/steer_specialist.tool.d.ts +4 -4
  155. package/dist/types/tools/specialist/use_specialist.tool.d.ts +16 -16
  156. package/docs/ARCHITECTURE.md +1176 -0
  157. package/docs/TODO.md +9 -0
  158. package/docs/architecture.md +11 -0
  159. package/docs/archive/2026-03-13-bd-decision-context-template-plan.md +96 -0
  160. package/docs/archive/AGENT-HANDOFF.md +351 -0
  161. package/docs/archive/PARITY-ANALYSIS.md +296 -0
  162. package/docs/archive/SPECIALISTS_REFACTOR.md.md +30 -0
  163. package/docs/archive/cc-programmatic.md +216 -0
  164. package/docs/archive/claude-agent-sdk.md +594 -0
  165. package/docs/archive/decision-specialist-directory.md +41 -0
  166. package/docs/archive/discoveries.md +148 -0
  167. package/docs/archive/executor-benchmark-protocol.md +198 -0
  168. package/docs/archive/future-features.md +66 -0
  169. package/docs/archive/gzrx-completion-critique.md +183 -0
  170. package/docs/archive/gzrx-research-notes.md +401 -0
  171. package/docs/archive/gzrx-tool-catalog.md +760 -0
  172. package/docs/archive/iron-review-hardening-qa-chain-substrate.md +322 -0
  173. package/docs/archive/iron-review-hardening.html +1004 -0
  174. package/docs/archive/issuetracking.md +312 -0
  175. package/docs/archive/qa-v3.0.2.md +220 -0
  176. package/docs/archive/restructure.md +231 -0
  177. package/docs/archive/script-specialists.md +1254 -0
  178. package/docs/archive/spec-v3.md +792 -0
  179. package/docs/archive/specialist-stats.md +127 -0
  180. package/docs/archive/specialists-friction-audit.md +1347 -0
  181. package/docs/archive/specialists-runtime-critique.md +170 -0
  182. package/docs/archive/specialists-service-evaluation.md +713 -0
  183. package/docs/archive/specialists-substrate-alignment.md +255 -0
  184. package/docs/archive/substrate-review.md +1288 -0
  185. package/docs/archive/test-writer-specialist.md +254 -0
  186. package/docs/archive/using-specialists-v3-improvements-2026-05-09.md +600 -0
  187. package/docs/archive/xtrm-specialists-analysis.md +314 -0
  188. package/docs/authoring.md +701 -0
  189. package/docs/background-jobs.md +203 -0
  190. package/docs/bare-specialists.md +83 -0
  191. package/docs/benchmarks/executor-benchmark-runner.md +66 -0
  192. package/docs/bootstrap.md +161 -0
  193. package/docs/cli-reference.md +1645 -0
  194. package/docs/deploying-alongside.md +155 -0
  195. package/docs/design/README.md +36 -0
  196. package/docs/design/darth-feedor-migration.md +290 -0
  197. package/docs/design/roadmap/README.md +32 -0
  198. package/docs/design/roadmap/chain-templates/README.md +146 -0
  199. package/docs/design/roadmap/chain-templates/code-quick.formula.json +27 -0
  200. package/docs/design/roadmap/chain-templates/code-standard.formula.json +126 -0
  201. package/docs/design/roadmap/chain-templates/code-with-advisors.formula.json +128 -0
  202. package/docs/design/roadmap/chain-templates/code-with-tests.formula.json +76 -0
  203. package/docs/design/roadmap/chain-templates/debug.formula.json +128 -0
  204. package/docs/design/roadmap/chain-templates/doc-sync.formula.json +28 -0
  205. package/docs/design/roadmap/chain-templates/memory-hygiene.formula.json +27 -0
  206. package/docs/design/roadmap/chain-templates/planning.formula.json +27 -0
  207. package/docs/design/roadmap/chain-templates/premortem.formula.json +26 -0
  208. package/docs/design/roadmap/chain-templates/release-prep.formula.json +36 -0
  209. package/docs/design/roadmap/chain-templates/research-only.formula.json +28 -0
  210. package/docs/design/roadmap/chain-templates/restitch.formula.json +125 -0
  211. package/docs/design/roadmap/chain-templates/security-deep.formula.json +161 -0
  212. package/docs/design/roadmap/chain-templates/test-only.formula.json +52 -0
  213. package/docs/design/roadmap/chain-templates/triage.formula.json +35 -0
  214. package/docs/design/roadmap/history/handoff-from-substrate-design.md +87 -0
  215. package/docs/design/roadmap/history/substrate-reconciliation.md +105 -0
  216. package/docs/design/roadmap/specialists-roadmap.md +1261 -0
  217. package/docs/design/sp-console-subscribe-via-materializer.md +231 -0
  218. package/docs/design/sp-console-tui-mock-v2.html +293 -0
  219. package/docs/design/sp-console-tui-mock.html +120 -0
  220. package/docs/design/sp-console-tui.md +340 -0
  221. package/docs/design/specialist-agentops-suite.md +323 -0
  222. package/docs/design/substrate/channels.md +14 -0
  223. package/docs/design/substrate/devops-platform-engineering-prd.md +446 -0
  224. package/docs/design/substrate/html-design-example.md +339 -0
  225. package/docs/design/xtrm-tiers-architecture.svg +132 -0
  226. package/docs/devops/dependency-verdict-materialization.md +46 -0
  227. package/docs/epic-readiness.md +75 -0
  228. package/docs/examples/mercury-atomic-summarizer.specialist.json +26 -0
  229. package/docs/examples/smoke-echo-text-expected-keys.specialist.json +25 -0
  230. package/docs/examples/smoke-echo.specialist.json +25 -0
  231. package/docs/features.md +1577 -0
  232. package/docs/hooks.md +81 -0
  233. package/docs/installation.md +142 -0
  234. package/docs/manifest.md +184 -0
  235. package/docs/mcp-servers.md +73 -0
  236. package/docs/mcp-tools.md +71 -0
  237. package/docs/nodes.md +231 -0
  238. package/docs/observability-metrics.md +152 -0
  239. package/docs/operator/sp-console-v2-walkthrough.md +410 -0
  240. package/docs/overrides-guide.md +306 -0
  241. package/docs/pi-rpc-boundary.md +118 -0
  242. package/docs/pi-session.md +195 -0
  243. package/docs/release.md +22 -0
  244. package/docs/skills.md +132 -0
  245. package/docs/specialists/handoff-schema.md +181 -0
  246. package/docs/specialists-catalog.md +99 -0
  247. package/docs/specialists-service-install.md +226 -0
  248. package/docs/specialists-service.md +363 -0
  249. package/docs/surface-ownership.md +138 -0
  250. package/docs/upgrade-notes/kan-90-global-user-config.md +114 -0
  251. package/docs/upgrade-notes/kan-91-expanded-overrides.md +261 -0
  252. package/docs/workflow.md +114 -0
  253. package/docs/worktree.md +71 -0
  254. package/docs/worktrees.md +309 -0
  255. package/package.json +7 -4
@@ -0,0 +1,600 @@
1
+ # Proposed improvements to `using-specialists-v3` skill
2
+
3
+ > **Status: DONE (2026-05-13)** — merged into `using-specialists-v3` SKILL.md v3.3 + `using-specialists-auto` SKILL.md v2.0 (commits `0b4487c0` + `0b1d8220`).
4
+ >
5
+ > - **~80% of Part C workarounds obsoleted by code fixes** earlier in session 2026-05-13a/b/c: `unitAI-lqsha` (reviewer injected-diff noise filter), `unitAI-pqe96` (sp merge .beads/+.xtrm/skills/active/ ignore), `unitAI-a6e60` (sp merge --target-branch), `unitAI-wq0mw` (dead-toolchain reaper), `unitAI-xbofm` (background-dispatch stderr surfacing), `unitAI-6fsxp` (reviewer blast-radius gate relaxation), `unitAI-889dv` (sp feed DB-backed full event replay — the root-cause fix for the reviewer false-PARTIAL pattern).
6
+ > - **Doctrine sections A0–A9 + Part B targeted edits merged into v3.3** with one exception (A9 session-close report — referenced via `/session-close-report` skill instead of duplicating the template, since session-close is its own skill).
7
+ > - **Auto-mode overlay (`using-specialists-auto`) trimmed to v2.0** to delegate shared content (sleep cadence, rebuttal pattern, escalation matrix, memory-gate batch close) to v3 — auto skill is now a minimal discipline overlay (~137 lines) instead of duplicating v3 content.
8
+ > - **Remaining residual** (filed but not yet shipped): one ~5-min `sp edit executor` patch to add a generic "don't edit generated files" CONSTRAINT to executor system prompt (proposal L588). Tracked as backlog.
9
+ > - **Two bd/Dolt-internal workarounds (Part C #6 and #7) retained as Failure Recovery patterns in v3.3** — these are bd-side and out of specialists' scope to fix.
10
+ >
11
+ > Kept below for historical reference. Do not action items from this doc directly; the canonical sources are now v3 SKILL.md v3.3 and auto SKILL.md v2.0.
12
+
13
+ ---
14
+
15
+ **Source:** lessons from the 2026-05-09 xtrm-tools full-auto orchestration session (~75 specialist dispatches, 22 chains landed, 6 friction beads filed), with a 2026-05-11 addendum from a follow-up cli-test-suite epic (11 dispatches across 5 disjoint clusters, 34→0 fails, captured in `.xtrm/reports/2026-05-11-1f573e2.md`). Addendum additions are tagged inline as **(2026-05-11)**.
16
+ **Target:** `specialists/config/skills/using-specialists-v3/SKILL.md` (current version: 3.2).
17
+ **Owner:** specialists repo.
18
+ **Bead:** xtrm-clzv (+ xtrm-wa45 for the 2026-05-11 addendum).
19
+
20
+ The skill is solid for **dispatch + chain + reviewer**. The gaps surfaced by this session live around **integration-phase reconciliation, post-merge smoke validation, conversation-style overthinker use, autonomous long-running orchestration, and explicit workarounds for known harness bugs that won't be fixed before the next release**. This document proposes additive sections + targeted edits.
21
+
22
+ ---
23
+
24
+ ## Part A — Net-new sections to add
25
+
26
+ ### A0. Advisory passes are part of every chain (REINFORCEMENT — 2026-05-12)
27
+
28
+ The current SKILL.md has a doctrine section "Security-Auditor and Code-Sanity Are Part of the Chain" (line ~95) saying both are not optional for substantive diffs. The integration patterns introduced below (A1 cherry-pick playbook, A2 debugger-restitch, A3 E2E smoke) and the escalation matrix (A4) must explicitly route through this doctrine — otherwise an agent following the new sections will skip advisory passes by omission. Observed reality 2026-05-09 → 2026-05-11: code-sanity is under-used; reviewers absorb its responsibilities and produce noisier PARTIAL verdicts.
29
+
30
+ **Add this section before "Canonical Single-Chain Flow" or fold into the existing "Security-Auditor and Code-Sanity Are Part of the Chain" section to strengthen it:**
31
+
32
+ ````markdown
33
+ ## Advisory Passes Are Part Of Every Chain
34
+
35
+ For any substantive diff, the chain shape is:
36
+
37
+ ```
38
+ executor → code-sanity (if smell) → security-auditor (if risk surface) → reviewer → merge
39
+ ```
40
+
41
+ Triggers:
42
+
43
+ - **code-sanity**: diff has control-flow complexity, duplication, type-risky changes, or unusual brittleness shape. Cheap. Output is advisory; executor applies findings or reviewer arbitrates.
44
+ - **security-auditor**: diff touches auth, secrets, input handling (user/network/file), dependency lockfiles, agent/MCP/config surfaces, or token-storage paths. Output is advisory; executor applies findings.
45
+
46
+ Routing patterns (cross-referenced from A1–A4, A6):
47
+
48
+ - Cherry-pick integration (A1): advisory passes run on the last executor job in each chain BEFORE the squash-commit step.
49
+ - Debugger-restitch (A2): advisory passes run on the debugger's job AFTER the restitch turn, BEFORE reviewer.
50
+ - E2E smoke (A3): security-auditor runs on the cumulative integrated diff if any landed chain touched a sensitive surface, BEFORE smoke completes.
51
+ - Reviewer rebuttal (A6): code-sanity / security-auditor findings count as legitimate evidence to support or rebut a reviewer verdict.
52
+
53
+ Skipping an advisory pass on a substantive diff is an escalation event (A4).
54
+
55
+ When the diff is purely additive (new files only, no existing-symbol modifications), advisory passes are optional — note the new-file scope explicitly in the chain's handoff. Test-only diffs that touch no production code path skip security-auditor by default but should still get code-sanity if the test logic is non-trivial.
56
+ ````
57
+
58
+ ### A1. Integration phase / cherry-pick playbook
59
+
60
+ The skill currently assumes `sp merge` and `sp epic merge` are the only publish path. In practice when chains forked from a non-`main` working branch (e.g. `fix/foo-baseline`), `sp merge` fails because it hardcodes `main` as the rebase target (filed as xtrm-nr05). The orchestrator falls back to manual cherry-pick + debugger restitch — a multi-step pattern that the skill should teach explicitly.
61
+
62
+ **Add this section after "Merge And Publication":**
63
+
64
+ ````markdown
65
+ ## Integration Phase — Cherry-Pick Playbook
66
+
67
+ Use this when:
68
+ - `sp merge` refuses (e.g., chains forked from a non-main working branch)
69
+ - The operator wants visibility before publish
70
+ - Multiple chains must land into a single integration branch before main
71
+
72
+ ### Step-by-step
73
+
74
+ 1. Stash uncommitted state on working branch: `git stash push -u -m "pre-integration"`.
75
+ 2. Create integration branch off the working branch: `git checkout -b integration/<date>-orchestrator`.
76
+ 3. For each non-overlapping chain (security/critical first, then test-baseline, then features):
77
+ - `git merge --squash <chain-branch>`
78
+ - Restore noise files (see "Chain noise filter checklist" below)
79
+ - **Advisory passes per A0** before commit: if the staged diff smells overcomplicated/duplicative/type-risky, dispatch `code-sanity --job <last-exec-job-of-chain>`; if it touches auth/secrets/input/agent-config, dispatch `security-auditor --job <last-exec-job-of-chain>`. Apply findings or document why skipped. Skipping on a substantive diff is an escalation event (A4).
80
+ - `git commit -m "<type>(<scope>): <summary> (<bead-id>)"` — one squash commit per chain
81
+ 4. For each overlapping chain, switch to the **debugger-restitch** pattern (see A2).
82
+ 5. After all chains land, run E2E smoke phase (see A3) before declaring done.
83
+ 6. Operator FF-merges integration → main when satisfied.
84
+
85
+ ### Chain noise filter checklist
86
+
87
+ Before committing each squashed chain, unstage:
88
+
89
+ - `.pi/npm` — accidentally created by xt commands inside worktrees
90
+ - `cli/pnpm-lock.yaml` and `cli/pnpm-workspace.yaml` — pnpm side-effects
91
+ - `AGENTS.md` and `CLAUDE.md` — gitnexus stat-refresh hook noise
92
+ - `.beads/issues.jsonl` and `.beads/interactions.jsonl` — bd state changes from your own bd close calls
93
+ - Any `.beads/*` symlink-vs-dir conflicts (worktree bd setup leaks)
94
+ - `.specialists/executor-result.md` — last specialist's transient output
95
+
96
+ ```bash
97
+ git restore --staged .beads .pi AGENTS.md CLAUDE.md
98
+ git checkout HEAD -- .beads AGENTS.md CLAUDE.md
99
+ rm -f .pi/npm
100
+ ```
101
+
102
+ 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.
103
+ ````
104
+
105
+ ### A2. Debugger-restitch pattern (NEW)
106
+
107
+ When a chain conflicts with already-landed work, raw `git cherry-pick` will revert the landed work. The debugger-restitch pattern preserves both — but only when the debugger is given an explicit "preserve already-landed work" contract. This pattern saved the 2026-05-09 session.
108
+
109
+ ````markdown
110
+ ## Debugger-Restitch Pattern
111
+
112
+ When chain X conflicts with already-landed chain Y on shared files:
113
+
114
+ 1. **Reopen X**: `bd reopen <X> --reason="integration stitch onto post-Y state"`.
115
+ 2. **Strengthen the bead contract** with these fields:
116
+ - `## CRITICAL CONSTRAINTS:` heading at the top
117
+ - "Fork off integration/<date>-orchestrator. Verify with `git log integration/...$..HEAD` empty before any commits."
118
+ - List the symbols/lines from Y that MUST be preserved verbatim (with file paths).
119
+ - "ADD X's intent ON TOP" with a numbered list of the additions.
120
+ - "Reference original feature/<X>-executor for symbol shapes only — do NOT cherry-pick or merge. Re-implement on integration's current state."
121
+ - `## VALIDATION:` includes both Y's tests passing AND X's new tests passing.
122
+ - `## OUTPUT:` mandates a 5-line code excerpt showing both Y and X features coexisting.
123
+ 3. **Dispatch debugger** with `--force-stale-base` if X is an epic child:
124
+ ```bash
125
+ sp run debugger --bead <X> --force-stale-base --keep-alive --background
126
+ ```
127
+ 4. **Sanity check the result**: when the debugger reports back, run:
128
+ ```bash
129
+ git log integration/<date>..feature/<X>-debugger --oneline
130
+ git diff integration/<date>...feature/<X>-debugger -- <key-files>
131
+ ```
132
+ Confirm the debugger's diff is **additive** — no reverts of Y's lines.
133
+ 5. **Advisory passes per A0**: before landing the restitch, dispatch `code-sanity --job <debugger-job>` if the restitch added control-flow complexity, and `security-auditor --job <debugger-job>` if the restitch touched a sensitive surface. Restitched diffs are higher-risk than fresh executor diffs because the debugger had to thread around already-landed work — they should never skip advisory passes.
134
+ 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.
135
+ 7. **Verify tests** before marking done.
136
+
137
+ ### Failure mode to watch for
138
+
139
+ 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.
140
+ ````
141
+
142
+ ### A3. E2E smoke phase before close (MANDATORY at end of integration)
143
+
144
+ This session discovered a missed chain (xtrm-qtq9) only via post-integration smoke testing. The skill should mandate this step.
145
+
146
+ ````markdown
147
+ ## E2E Smoke Phase (MANDATORY before declaring integration done)
148
+
149
+ After all chains land, run **every** npm script + entry point that any chain added or modified. The smoke phase is the only way to catch:
150
+
151
+ - Missed chains (you forgot to cherry-pick one)
152
+ - False-positive CI gates (script flags itself)
153
+ - Missing intermediate files (e.g., a verifier that needs a file the vendor script creates)
154
+ - Runtime regressions invisible to unit tests
155
+
156
+ ### Procedure
157
+
158
+ ```bash
159
+ # Build sanity
160
+ npm run build --workspace cli # or equivalent
161
+
162
+ # Test sanity — record PRE-baseline first
163
+ git checkout <baseline-branch>
164
+ npm test --workspace cli 2>&1 | tail -5 # record N failed / M passed
165
+
166
+ # Switch back and re-run
167
+ git checkout integration/<date>-orchestrator
168
+ npm test --workspace cli 2>&1 | tail -5 # MUST be ≥ baseline. Net regression is a stop-the-line.
169
+
170
+ # Run every check:* script the integration added
171
+ for s in $(jq -r '.scripts | keys[] | select(startswith("check:"))' package.json); do
172
+ echo "=== $s ==="
173
+ npm run "$s" 2>&1 | tail -10
174
+ done
175
+
176
+ # Targeted unit tests for chains touching the same files
177
+ npx vitest run <chain-test-files>
178
+ python3 -m pytest <chain-python-tests>
179
+ ```
180
+
181
+ For each smoke that fails, **decide before continuing**:
182
+ - False positive (script flags itself, etc.) → file follow-up bead, document, continue
183
+ - Missing dependency (vendor not run, etc.) → expected gate, document
184
+ - Real regression → stop, dispatch debugger to fix, re-smoke
185
+
186
+ ### Cross-cutting security-auditor pass (per A0)
187
+
188
+ 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:
189
+
190
+ ```bash
191
+ git diff <baseline>..integration/<date>-orchestrator > /tmp/integration-diff.patch
192
+ # file a sanity bead pointing at /tmp/integration-diff.patch + the touched-surface list
193
+ sp run security-auditor --bead <sec-bead> --context-depth 3 --background
194
+ ```
195
+
196
+ Per-chain security-auditor passes in A1/A2 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 chain newly relies on). Skipping this on a sensitive-surface integration is an escalation event (A4).
197
+
198
+ Record all smoke results in the session-close-report under a `## Smoke test results` table.
199
+ ````
200
+
201
+ ### A4. Operator escalation matrix
202
+
203
+ The skill talks about destructive operations but doesn't enumerate. Add a clear "what to escalate" table.
204
+
205
+ ````markdown
206
+ ## Operator Escalation Matrix
207
+
208
+ Action | Default | Always escalate to operator
209
+ ---|---|---
210
+ Code edit | Specialist only | (never orchestrator-direct)
211
+ Cherry-pick onto integration branch | Auto if non-overlapping | Conflict resolution that requires manual edits
212
+ Manual conflict resolution | Never | Always
213
+ Force push | Never | Always
214
+ Branch delete | Never | Always
215
+ Stash pop where conflict expected | Auto | Stash conflict that destroys session-start state
216
+ `bd dolt fsck --revive-journal-with-data-loss` | Never | Always — has explicit data-loss warning
217
+ `sp epic merge` | Auto if all children PASSed | Skip if any child reviewer-FAILed
218
+ Skip `code-sanity` on a substantive diff | Auto-skip only on test-only or new-file-only diffs | Always escalate before skipping on a multi-file production diff
219
+ Skip `security-auditor` on diff touching auth/secrets/input/agent-config | Never | Always — sensitive-surface diffs always get the pass per A0
220
+ `sp stop <job>` | Auto when job is done/stale | Never on actively-running unless context blown
221
+ `git push origin <branch>` | Auto for chain branches (read-only push) | Force-push or delete-remote always
222
+ `npm publish` | Never | Always
223
+ Dependency bump | Auto for patch-bumps in security work | Major/minor bumps escalate
224
+ Config file edit (.beads/config.yaml) | Auto for shared-server flag re-add | Schema-changing edits escalate
225
+ ````
226
+
227
+ ### A5. Conflict cluster identification (PRE-DISPATCH)
228
+
229
+ The orchestrator should map overlap surface BEFORE dispatching parallel waves, not discover conflicts at integration time. Add to "Dependency Linking" or as a new section.
230
+
231
+ ````markdown
232
+ ## Pre-Dispatch: Conflict Cluster Identification
233
+
234
+ Before dispatching N parallel chains, build the file-overlap matrix:
235
+
236
+ ```bash
237
+ # For each candidate chain, list what files it'll touch (from bead SCOPE)
238
+ # Then group by file overlap:
239
+ ```
240
+
241
+ | Chain | Touches | Overlap with |
242
+ |-------|---------|--------------|
243
+ | sm1t | cli/src/commands/update.ts | 42in, 19e5 |
244
+ | 42in | cli/src/commands/update.ts, install.ts, registry-scaffold.ts | sm1t, 19e5, u3t |
245
+ | 19e5 | cli/src/commands/update.ts, install.ts, doctor.ts | sm1t, 42in |
246
+
247
+ For each cluster of overlapping chains, choose **one** of:
248
+
249
+ 1. **Serial dispatch** — execute chains in dependency order, each waits for previous to land. Slowest but cleanest.
250
+ 2. **Unified bead** — collapse all chains into one bead/executor pass. Larger reviewer scope but no merge conflicts.
251
+ 3. **Parallel dispatch + debugger restitch at integration** — dispatch in parallel, plan for ~50% conflict rate, budget debugger-restitch passes during integration phase.
252
+
253
+ Empirical conflict rates from 2026-05-09:
254
+ - 8 of 20 chains conflicted on shared files (~40%)
255
+ - Each conflict cost ~1 debugger restitch (~5–10 min wall time)
256
+ - Net: serial order on the 3 worst clusters would have saved ~30 min vs parallel + restitch
257
+
258
+ Default heuristic: if 3+ chains touch the same file, **serial-dispatch them**.
259
+ ````
260
+
261
+ ### A5b. Pre-epic test-failure-map pattern **(2026-05-11)**
262
+
263
+ When a test suite has many failures and the operator wants them all fixed, do NOT dispatch parallel fix chains blind. Land one read-only mapping bead first.
264
+
265
+ ````markdown
266
+ ## Pre-Epic: Test-Failure-Map Pattern
267
+
268
+ Use when:
269
+ - A test suite shows ≥ ~5 failures and the operator says "fix all"
270
+ - The failures span multiple files / subsystems
271
+ - Root causes are not yet attributed per failure
272
+
273
+ ### Step-by-step
274
+
275
+ 1. **Run the suite once**, save the full log to `/tmp/<suite>-fails.log`. Do not interpret yet.
276
+ 2. **File one mapping bead** (e.g., `test-runner: refresh <epic> CLI failure map`) with this contract shape:
277
+ - `PROBLEM:` the exact command run, its exit status, the raw failure count.
278
+ - `SUCCESS:` cluster table grouping every failure by **likely shared root cause and file scope**, plus a recommended fix-chain order.
279
+ - `SCOPE:` the log file path + the bounded set of test files involved.
280
+ - `CONSTRAINTS:` READ_ONLY, no source/test edits, no fix attempts. The mapping bead's only job is to think.
281
+ 3. **Optionally dispatch test-runner / explorer / debugger** for this bead (READ_ONLY), OR fill the map inline by orchestrator reading the log.
282
+ 4. **Build the cluster table** with at minimum: cluster name | files (counts) | representative error | root-cause hypothesis | likely-owner area | targeted validation command. Save in bead notes.
283
+ 5. **Plan fix chains** off the cluster table:
284
+ - One chain per cluster, file scopes disjoint between chains where possible.
285
+ - Order by leverage (largest cluster first), then by simplicity.
286
+ - Decide debugger-or-executor per cluster: debugger when root cause unclear, executor when bead constraint is concrete.
287
+ 6. **Save the topology insight as a memory** (`bd remember`) — patterns about where this codebase's test fragility concentrates are reusable across future regressions.
288
+
289
+ ### Why this beats dispatch-blind
290
+
291
+ Empirically (2026-05-11 xtrm-tools, 34 fails → 5 clusters):
292
+ - 56 % of fails collapsed under ONE cluster's single root cause (`findRepoRoot` vs `findProjectRoot` in docs CLI). A blind parallel dispatch would have over-dispatched 19 fixes instead of 1.
293
+ - 30 % collapsed under another single shared harness drift. Same logic.
294
+ - The remaining 14 % were 3 small unrelated clusters — each got a tight focused bead.
295
+ - Total: 5 fix chains vs ~10 had we dispatched per file. Net specialist spend ~$0.50 vs ~$1.50+.
296
+
297
+ ### Failure modes to watch for
298
+
299
+ - **Clusters that look shared but aren't**: if the same error string appears in unrelated tests, the root causes may differ. Don't merge clusters by error text alone — confirm by reading the stack traces.
300
+ - **One cluster's fix introduces another's regression**: each cluster's bead must include "no regressions in other clusters" as VALIDATION, with the test command spanning all known-failing areas.
301
+ - **Pre-existing failures vs new regressions**: name pre-existing failures explicitly in each chain's NON_GOALS so reviewers don't FAIL on them.
302
+ ````
303
+
304
+ ### A6. Specialist rebuttal as routine (PATTERN UPDATE — generalized from overthinker 2026-05-09 / reviewer 2026-05-11)
305
+
306
+ Current skill mentions overthinker for "risky design, tradeoffs, premortem". The 2026-05-09 session showed a different pattern: **conversation**. Send overthinker to evaluate a strategy, then resume with pushback when its first answer feels too cautious. Got 3 retracted recommendations after challenge.
307
+
308
+ **Generalized 2026-05-11**: the same pattern works on **reviewer** too. 3 of 5 reviews this session returned PARTIAL on a non-applicable gate (gitnexus_impact on a test-only diff). One-line rebuttal flipped all 3 to PASS. Treat overcautious specialist verdicts as the first turn of a conversation, not a final decision.
309
+
310
+ ````markdown
311
+ ## Specialist Rebuttal as Routine
312
+
313
+ 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:
314
+
315
+ ### Overthinker
316
+ - "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."
317
+ - "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."
318
+ - "Run separate small beads" or "run one big bead" without rationale → push: "Pick one and explain operationally — cost difference, conflict expectations, reviewer scope."
319
+
320
+ ### Reviewer **(2026-05-11)**
321
+ - "PARTIAL — missing gitnexus_impact evidence" on a test-only diff → rebut: "gitnexus_impact analyzes runtime call graphs; test fixture mocks have no callers in the production graph; the bead's impact-gate constraint is conditional on modifying a runtime entrypoint, which did not happen here."
322
+ - "FAIL — full suite shows N+1 fails" where one of the fails is a known flake from concurrent runs → rebut: re-run the suspect test in isolation, paste the clean output, then resume reviewer with "The flake was from concurrent vitest runs during parallel review; isolated rerun: P/P. Re-evaluate."
323
+ - "FAIL — injected diff doesn't match claimed change" when the injected diff is a known-buggy reviewer context (xtrm-axwq) → rebut with cumulative-diff commands from the bead SCOPE (see B1).
324
+
325
+ ### General rule
326
+
327
+ Resume with explicit ammunition: file/line refs, exact rerun output, link to the bead memory that documents the rebuttal pattern. Don't argue from authority; argue from new evidence. **Findings from code-sanity / security-auditor are legitimate rebuttal evidence** — a clean code-sanity 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. After a successful rebuttal, save the rebuttal text as a `bd remember` so the next session inherits it.
328
+
329
+ When done, capture rebuttals in the session-close-report under the relevant specialist's "Problems" sub-table — they're durable handoff context and pattern-of-pattern fuel for future training.
330
+ ````
331
+
332
+ ### A7. Sleep timer + cron pattern for autonomous runs
333
+
334
+ For long autonomous runs (hours of orchestration without operator), the orchestrator must monitor specialists. Two complementary mechanisms emerged this session:
335
+
336
+ ````markdown
337
+ ## Long Autonomous Runs — Monitoring Pattern
338
+
339
+ For sessions where the operator is offline (overnight, async windows), use both:
340
+
341
+ 1. **Bash sleep timers per dispatch**, sized to specialist role expectations:
342
+ - sync-docs / changelog-keeper: `sleep 60`
343
+ - code-sanity / security-auditor: `sleep 60`
344
+ - reviewer: `sleep 90`
345
+ - explorer / debugger / planner / overthinker: `sleep 120` initial, `sleep 90` follow-up
346
+ - executor: `sleep 180` initial, `sleep 120` follow-up
347
+ - test-runner: `sleep 120` initial, scale with suite size
348
+ 2. **External cron loop** (Claude Code: `/loop 180s sp ps`) to refresh specialist state at fixed cadence regardless of orchestrator's bash sleeps. The cron acts as a heartbeat that catches specialists that finished while the orchestrator was busy reading other results.
349
+
350
+ The two complement: bash sleep waits for an expected completion; cron catches unexpected completions and stalls.
351
+
352
+ After every dispatch:
353
+ ```bash
354
+ sleep 10 && sp ps # confirm started, not stuck queued
355
+ sleep <role-typical-duration> && sp ps # check state
356
+ sp result <job-id> # consume immediately when done
357
+ ```
358
+
359
+ If a job exceeds 2× its typical duration, inspect with `sp feed <job-id>` before assuming hang.
360
+ ````
361
+
362
+ ### A8. Memory-gate batch-close workflow
363
+
364
+ Closing many beads at once requires per-id memory acks. The skill should document the loop pattern.
365
+
366
+ ````markdown
367
+ ## Batch-Close Workflow (Memory Gate Compliance)
368
+
369
+ `bd close` is blocked until `memory-acked:<id>` exists. For batch-closing many orchestrator-internal beads (sanity beads, reviewer beads, etc.), use:
370
+
371
+ ```bash
372
+ for id in xtrm-aaa xtrm-bbb xtrm-ccc; do
373
+ bd kv set "memory-acked:$id" "nothing novel — orchestrator-internal sanity/reviewer bead"
374
+ bd close $id --force --reason="chain complete"
375
+ done
376
+ ```
377
+
378
+ `--force` is safe here because the parent chain's bead has already captured the substantive insight. If the parent itself has novel insight, save via `bd remember "..."` BEFORE closing the parent (set `memory-acked:<parent>` to `saved:<key>`).
379
+
380
+ Common orchestrator-internal beads that don't need novel memory:
381
+ - Sanity beads (xtrm-aaaa) created to dispatch code-sanity on a parent
382
+ - Reviewer beads (xtrm-bbbb) created to dispatch reviewer on a parent
383
+ - Re-review beads after fix turns
384
+ - Decomposition tracker beads created by planners (memory captured in children)
385
+
386
+ ### Parallel-chain commit ordering **(2026-05-11)**
387
+
388
+ The bd commit-gate is **project-wide**, not per-worktree. While **any** bead in the project is `in_progress`, **no** worktree can commit. Practical consequence for parallel-chain epics:
389
+
390
+ - You CAN dispatch two executors in parallel — they work in separate worktrees, no commit-time collision.
391
+ - 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).
392
+ - 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.
393
+ - This forces a serial-tail on the commit step. Plan for it: parallel-dispatch saves time on the *thinking* step, not the commit step.
394
+
395
+ If the commit-gate blocks unexpectedly mid-orchestration, `bd query "status=in_progress"` reveals which claim is holding it open.
396
+ ````
397
+
398
+ ### A9. Session-close-report integration (MANDATORY at session end)
399
+
400
+ The skill currently doesn't reference the session-close-report skill. Add a closing reference.
401
+
402
+ ````markdown
403
+ ## At Session End — Mandatory Handoff
404
+
405
+ Before declaring the session done:
406
+
407
+ 1. Run `/session-close-report` (or the `session-close-report` skill).
408
+ 2. Fill every `<!-- FILL -->` marker in the generated skeleton. Don't leave them.
409
+ 3. Sync `CHANGELOG.md` for user-facing changes (see the report skill's Step 6).
410
+ 4. Re-run the cleanup checks (worktree list, sp ps, ps -ef for stale serena/gitnexus, tmux ls for sp-*).
411
+ 5. Commit the report (and CHANGELOG if updated) before push.
412
+
413
+ A session that lands code but skips the close-report leaves the next agent cold-starting blind. That cost compounds across sessions.
414
+ ````
415
+
416
+ ---
417
+
418
+ ## Part B — Targeted edits to existing sections
419
+
420
+ ### B1. "Monitoring And Steering"
421
+
422
+ **Add subsection: "Reviewer cumulative-diff workaround (until xtrm-axwq is fixed)"**
423
+
424
+ ```markdown
425
+ ### Reviewer cumulative-diff workaround
426
+
427
+ The reviewer's "injected diff context" frequently shows only the latest checkpoint commit (or AGENTS/CLAUDE refresh noise) instead of the cumulative branch diff. Until this is fixed upstream, EVERY reviewer dispatch should include explicit cumulative-diff commands in its bead's SCOPE field:
428
+
429
+ ```text
430
+ SCOPE: Cumulative diff in feature/<bead>-executor (job <id>). Use:
431
+ cd /path/to/.worktrees/<bead>/<bead>-executor
432
+ git log <fork-base>..HEAD --oneline
433
+ git diff <fork-base>...HEAD --stat
434
+ git diff <fork-base>...HEAD -- <key-files>
435
+ npm test ...
436
+ IGNORE injected docs-only diff. Issue PASS/PARTIAL/FAIL based on cumulative output.
437
+ ```
438
+
439
+ If the reviewer FAILs on first turn with "docs-only diff contradicts claimed", resume with the same cumulative-diff command. Most second-turn verdicts come back PASS.
440
+ ```
441
+
442
+ ### B2. "What Stays Out"
443
+
444
+ **Add:** mention `session-close-report` and `releasing` skills explicitly (orchestrator should know they exist and when to invoke them).
445
+
446
+ ### B3. "Hard Rules"
447
+
448
+ **Add rule 12:**
449
+
450
+ ```markdown
451
+ 12. The orchestrator NEVER edits code directly. Conflict resolution, even mechanical, goes through a debugger or executor specialist. Manual conflict resolution is the only escalation that must always go to the operator.
452
+ ```
453
+
454
+ ### B4. "Failure Recovery"
455
+
456
+ **Add to "When something fails":**
457
+
458
+ ```markdown
459
+ - If a chain's reviewer keeps FAILing on injected-diff, switch to cumulative-diff workaround (see B1).
460
+ - If `sp run` returns silently with `Warning: job started but ID not yet available`, check `sp ps --bead <id>` after 30s. If still empty, the dispatch was likely refused (epic guard, base-staleness). Retry with `--force-stale-base`. If still empty, run `sp run` in foreground to see the error message.
461
+ - If bd commands fail with `database "jaggers_agent_tools" not found`, the per-project Dolt has spawned. Kill it (`ps aux | grep "<repo>.beads/dolt" | awk '{print $2}' | xargs kill -9`), re-add `dolt.shared-server: true` to `.beads/config.yaml` (it sometimes gets stripped after branch switches), and retry. This is documented friction (xtrm-hhiu).
462
+ - If Dolt journal corrupts mid-session (`possible data loss detected at offset N`), DO NOT auto-recover. Operator-only. The `dolt fsck --revive-journal-with-data-loss` flag has explicit data-loss warning.
463
+ ```
464
+
465
+ ### B5. "What Orchestrator Does Differently Because Of This Skill"
466
+
467
+ **Add to the bullet list:**
468
+
469
+ - Maps file-overlap surface BEFORE dispatching parallel waves.
470
+ - Uses overthinker as a conversation, not a one-shot oracle.
471
+ - Smokes every npm script and entry point before declaring integration done.
472
+ - Files friction beads as encountered, not retrospectively at session end.
473
+ - Commits debugger-restitch results via FF or cherry-pick of the named commit, not the checkpoint commit above it.
474
+
475
+ ---
476
+
477
+ ## Part C — Active workarounds (until upstream fixes)
478
+
479
+ These belong in a new appendix `## Known Workarounds (filed for upstream fix)`:
480
+
481
+ ````markdown
482
+ ## Known Workarounds
483
+
484
+ Until the listed friction beads are fixed in their upstream repos, the orchestrator must apply these workarounds.
485
+
486
+ ### Reviewer injected-diff bug (xtrm-axwq)
487
+ **Workaround:** explicit `git diff <base>...HEAD` command in every reviewer bead SCOPE. See B1.
488
+
489
+ ### sp merge hardcoded to main (xtrm-nr05)
490
+ **Workaround:** manual cherry-pick + debugger-restitch pattern (A1+A2). Don't use `sp merge` for chains forked from non-main branches.
491
+
492
+ ### bd-in-worktree fails (xtrm-hhiu)
493
+ **Workaround:** orchestrator owns bead lifecycle from main repo. Specialists never run `bd close` from inside their worktree (their attempts will fail with `database not found`; that's expected and documented).
494
+
495
+ ### Chain noise pollution (xtrm-ombq)
496
+ **Workaround:** filter checklist at every cherry-pick (see A1 "Chain noise filter checklist"). Until idempotent AGENTS/CLAUDE generation lands (xtrm-i4uu/9xg2.*), every commit will pull in the gitnexus stat refresh — filter at squash time.
497
+
498
+ ### Epic guard refuses sub-bead dispatches (xtrm-5sz2)
499
+ **Workaround:** `--force-stale-base` flag for initial dispatches on epic children. Subsequent reviewer/sanity dispatches under the same chain may fail silently — retry with `--force-stale-base` again, or dispatch in foreground to see the refusal reason.
500
+
501
+ ### Per-project Dolt respawns after branch switch (related to xtrm-hhiu)
502
+ **Workaround:**
503
+ ```bash
504
+ ps aux | grep "<repo>/.beads/dolt" | grep -v grep | awk '{print $2}' | xargs -r kill -9
505
+ echo "" >> .beads/config.yaml
506
+ echo "dolt.shared-server: true" >> .beads/config.yaml
507
+ sleep 2
508
+ bd ready # should now route to ~/.beads/shared-server/
509
+ ```
510
+ Repeat as needed; the flag gets stripped on some bd auto-init paths.
511
+
512
+ ### Dolt journal corruption (xtrm-yb0u)
513
+ **Recovery:** operator-only. Stop further bd writes. Snapshot `~/.beads/shared-server/dolt`. Run `dolt fsck` (read-only) first to assess. Decide on `--revive-journal-with-data-loss` only after reviewing the warning.
514
+
515
+ ### Worktree `.beads/` directory-to-symlink swap pollutes checkpoint commits **(2026-05-11)** (xtrm-nsca)
516
+
517
+ `xt claude` / specialist worktree provisioning (per commit `63d2bb1` in xtrm-tools) replaces the tracked `.beads/` directory with a symlink to the parent repo's `.beads/`, so bd hooks inside the worktree resolve to the shared dolt server. Side effect: when the executor/debugger commits a checkpoint, git stages the directory→symlink change as **1.7k lines of phantom `.beads/` deletions** alongside the real fix, polluting the chain diff. Reviewer then either FAILs on out-of-scope deletions or sees a stale/limited diff and FAILs on missing source change.
518
+
519
+ **Bead-time prevention:** put this CONSTRAINT in every edit-capable specialist's bead:
520
+ > "When committing, do NOT include any `.beads/*` paths. Use `git add` with explicit source/test paths (NOT `git add -A` or `git add .`). If `git status` shows `.beads/*` deletions, ignore them — they are a known provisioning artifact."
521
+
522
+ This works when specialists follow it (~40 % did, 2026-05-11). When they don't, recover before reviewer:
523
+
524
+ **Per-chain recovery sequence** (run inside the executor/debugger worktree):
525
+
526
+ ```bash
527
+ git reset --mixed HEAD~1 # uncommit the polluted checkpoint
528
+ rm <worktree>/.beads # drop the provisioning symlink
529
+ git checkout HEAD -- .beads/ # restore .beads as a directory from HEAD
530
+ git restore --staged .beads/ # drop any newly-staged .beads/* paths
531
+ git checkout -- .beads/issues.jsonl # revert any bd auto-export churn
532
+ git add <source/test files only> # stage real changes explicitly
533
+ git commit -m "<conventional message> (<bead-id>)" # clean commit
534
+ ```
535
+
536
+ If bd auto-export re-stages `.beads/issues.jsonl` between `bd close` and `git commit`, `git reset HEAD~1 -- .beads/issues.jsonl && git checkout -- .beads/issues.jsonl && git commit --amend --no-edit` cleans it.
537
+
538
+ **Pre-merge cleanup:** `sp merge` refuses if the worktree (or main repo) has uncommitted `.beads/issues.jsonl`. Always:
539
+
540
+ ```bash
541
+ git -C <worktree> restore --staged .beads/issues.jsonl
542
+ git -C <worktree> checkout -- .beads/issues.jsonl
543
+ git -C <main-repo> restore --staged .beads/issues.jsonl
544
+ git -C <main-repo> stash push -m "pre-merge" -- .beads/issues.jsonl
545
+ sp merge <chain-root-bead>
546
+ ```
547
+
548
+ Filed for systemic fix at `xtrm-nsca` (xtrm-tools-side) — candidate solutions: write `.beads` to `.git/worktrees/<name>/info/exclude` during provisioning, `git update-index --skip-worktree` on `.beads/*`, or a chain-internal pathspec filter on checkpoint commits.
549
+
550
+ ### Reviewer reflexive PARTIAL on test-only diffs **(2026-05-11)**
551
+
552
+ The reviewer specialist (`gpt-5.3-codex thinking:low`) reflexively flags missing `gitnexus_impact` evidence even when the diff is entirely under `test/` or `tests/` paths. Three of five reviews this session PARTIAL'd on this gate. Durable rebuttal (works every time):
553
+
554
+ > "Re-evaluate. The diff is entirely under `<test-path>` (N files, M lines, no runtime symbol touched). `gitnexus_impact` analyzes runtime call graphs — test fixture mocks have no callers in the production graph. The bead's impact-gate constraint is conditional on modifying a runtime entrypoint, which did not happen here. Issue final verdict PASS."
555
+
556
+ Each rebuttal cost ~1 specialist turn (~$0.05). Bake a preempt into the bead CONSTRAINT:
557
+ > "`gitnexus_impact` requirement does NOT apply if the diff is entirely under `test/` or `tests/` paths. Reviewer should issue PASS without that evidence when the diff is test-only."
558
+
559
+ Reviewer then PASSes on the first turn.
560
+
561
+ ### `sp merge` refuses on dirty main worktree even when unrelated **(2026-05-11)**
562
+
563
+ `sp merge` validates main is clean before rebasing. Between every chain merge, bd auto-export re-touches `.beads/issues.jsonl` on the main repo (and the worktree). `sp merge` then refuses with "cannot rebase: You have unstaged changes" or "Your index contains uncommitted changes".
564
+
565
+ **Workaround**, run before every `sp merge`:
566
+
567
+ ```bash
568
+ git -C <main-repo> restore --staged .beads/issues.jsonl 2>/dev/null
569
+ git -C <main-repo> stash push -m "pre-merge" -- .beads/issues.jsonl 2>&1 | tail -1
570
+ git -C <worktree> restore --staged .beads/issues.jsonl 2>/dev/null
571
+ git -C <worktree> checkout -- .beads/issues.jsonl 2>/dev/null
572
+ sp merge <bead-id>
573
+ # after merge:
574
+ git -C <main-repo> stash drop 2>/dev/null
575
+ ```
576
+
577
+ For epic merges, repeat the cleanup BEFORE each `sp epic merge` even when the previous one succeeded — bd activity between merges re-dirties the tree.
578
+ ````
579
+
580
+ ---
581
+
582
+ ## Part D — Editing instructions
583
+
584
+ To apply this proposal:
585
+
586
+ 1. Read the current `specialists/config/skills/using-specialists-v3/SKILL.md` (734 lines, version 3.2).
587
+ 2. Add Part A sections in this order: A1 (after "Merge And Publication"), A2 (right after A1), A3 (right after A2), A4 (after "Hard Rules"), A5 (after "Dependency Graph Shapes"), A6 (in "Mini-Flows For Under-Promoted Specialists"), A7 (after "Monitoring And Steering"), A8 (in "What Stays Out" or as separate "Bead Lifecycle Workflow"), A9 (last section before "What Orchestrator Does Differently").
588
+ 3. Apply Part B targeted edits inline to existing sections.
589
+ 4. Append Part C as the final appendix.
590
+ 5. Bump version to `3.3` in frontmatter.
591
+ 6. Update SKILL.md description to mention "integration phase" and "debugger-restitch pattern" so the skill triggers on those keywords too.
592
+
593
+ The session that produced this proposal is captured in `xtrm-tools/.xtrm/reports/2026-05-09-31d59db.md` with full context (75 dispatches, 22 chains, 6 friction beads, debugger-restitch deployments, overthinker conversation).
594
+
595
+ The 2026-05-11 addendum draws from `xtrm-tools/.xtrm/reports/2026-05-11-1f573e2.md` (11 dispatches, 5-cluster epic, 34→0 cli test fails) and the durable memories:
596
+
597
+ - `xtrm-tools-cli-test-failure-topology-post-pr` — empirical concentration of test fragility (see A5b).
598
+ - `specialist-worktree-provisioning-in-xtrm-tools-replaces-trac` — workaround recipe (see Part C).
599
+ - `reviewer-specialist-gpt-5-3-codex-thinking-low` — gitnexus_impact rebuttal (see Part C + A6).
600
+ - `xtrm-tools-xtrm-config-hooks-json-is-generated` — project-specific but exemplifies the "don't edit generated files" lesson worth surfacing as a generic CONSTRAINT in executor beads that touch any compiled artifact.