@jaggerxtrm/specialists 3.16.0 → 3.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/README.md +268 -132
  2. package/config/mandatory-rules/json-only-final-output.md +13 -0
  3. package/config/mandatory-rules/research-tool-routing.md +4 -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 +1 -1
  7. package/config/skills/setup-specialists/SKILL.md +556 -0
  8. package/config/skills/specialists-creator/SKILL.md +160 -5
  9. package/config/skills/specialists-creator/scripts/audit-spec-uniformity.mjs +1 -1
  10. package/config/skills/using-specialists-auto/SKILL.md +1 -1
  11. package/config/skills/using-specialists-v2/SKILL.md +7 -7
  12. package/config/skills/using-specialists-v3/SKILL.md +223 -147
  13. package/config/specialists/bare.specialist.json +3 -3
  14. package/config/specialists/changelog-drafter.specialist.json +9 -6
  15. package/config/specialists/changelog-keeper.specialist.json +10 -7
  16. package/config/specialists/debugger.specialist.json +8 -6
  17. package/config/specialists/executor.specialist.json +9 -7
  18. package/config/specialists/explorer.specialist.json +8 -6
  19. package/config/specialists/memory-processor.specialist.json +7 -5
  20. package/config/specialists/node-coordinator.specialist.json +7 -5
  21. package/config/specialists/obligations-scanner.specialist.json +149 -0
  22. package/config/specialists/overthinker.specialist.json +7 -5
  23. package/config/specialists/planner.specialist.json +8 -6
  24. package/config/specialists/quant-methodologist.specialist.json +145 -0
  25. package/config/specialists/quant-researcher.specialist.json +144 -0
  26. package/config/specialists/researcher.specialist.json +14 -9
  27. package/config/specialists/reviewer.specialist.json +11 -9
  28. package/config/specialists/seconder.specialist.json +170 -0
  29. package/config/specialists/security-auditor.specialist.json +6 -4
  30. package/config/specialists/service-skills-sync.specialist.json +93 -0
  31. package/config/specialists/specialists-creator.specialist.json +9 -7
  32. package/config/specialists/sync-docs.specialist.json +6 -4
  33. package/config/specialists/test-engineer.specialist.json +134 -0
  34. package/config/specialists/test-runner.specialist.json +11 -9
  35. package/config/specialists/transcriber.specialist.json +59 -0
  36. package/config/specialists/xt-merge.specialist.json +7 -5
  37. package/dist/asset-contract.json +39 -8
  38. package/dist/index.js +37083 -26912
  39. package/dist/lib.js +9850 -6147
  40. package/dist/types/cli/console/components.d.ts +83 -0
  41. package/dist/types/cli/console/components.d.ts.map +1 -0
  42. package/dist/types/cli/console/config-source.d.ts +58 -0
  43. package/dist/types/cli/console/config-source.d.ts.map +1 -0
  44. package/dist/types/cli/console/forensic.d.ts +11 -0
  45. package/dist/types/cli/console/forensic.d.ts.map +1 -0
  46. package/dist/types/cli/console/git.d.ts +28 -0
  47. package/dist/types/cli/console/git.d.ts.map +1 -0
  48. package/dist/types/cli/console/help.d.ts +2 -0
  49. package/dist/types/cli/console/help.d.ts.map +1 -0
  50. package/dist/types/cli/console/log.d.ts +13 -0
  51. package/dist/types/cli/console/log.d.ts.map +1 -0
  52. package/dist/types/cli/console/repo-config.d.ts +26 -0
  53. package/dist/types/cli/console/repo-config.d.ts.map +1 -0
  54. package/dist/types/cli/console/repo-discovery.d.ts +12 -0
  55. package/dist/types/cli/console/repo-discovery.d.ts.map +1 -0
  56. package/dist/types/cli/console/runtime.d.ts +12 -0
  57. package/dist/types/cli/console/runtime.d.ts.map +1 -0
  58. package/dist/types/cli/console/subscribe-prototype.d.ts +18 -0
  59. package/dist/types/cli/console/subscribe-prototype.d.ts.map +1 -0
  60. package/dist/types/cli/console/theme.d.ts +91 -0
  61. package/dist/types/cli/console/theme.d.ts.map +1 -0
  62. package/dist/types/cli/console/types.d.ts +231 -0
  63. package/dist/types/cli/console/types.d.ts.map +1 -0
  64. package/dist/types/cli/console/view-model.d.ts +252 -0
  65. package/dist/types/cli/console/view-model.d.ts.map +1 -0
  66. package/dist/types/cli/console.d.ts +2 -0
  67. package/dist/types/cli/console.d.ts.map +1 -0
  68. package/dist/types/cli/db.d.ts.map +1 -1
  69. package/dist/types/cli/doctor.d.ts.map +1 -1
  70. package/dist/types/cli/edit.d.ts.map +1 -1
  71. package/dist/types/cli/epic.d.ts.map +1 -1
  72. package/dist/types/cli/feed.d.ts.map +1 -1
  73. package/dist/types/cli/forensic.d.ts +2 -0
  74. package/dist/types/cli/forensic.d.ts.map +1 -0
  75. package/dist/types/cli/format-helpers.d.ts +4 -2
  76. package/dist/types/cli/format-helpers.d.ts.map +1 -1
  77. package/dist/types/cli/help.d.ts.map +1 -1
  78. package/dist/types/cli/init.d.ts +10 -0
  79. package/dist/types/cli/init.d.ts.map +1 -1
  80. package/dist/types/cli/list.d.ts.map +1 -1
  81. package/dist/types/cli/log.d.ts +2 -0
  82. package/dist/types/cli/log.d.ts.map +1 -0
  83. package/dist/types/cli/metrics.d.ts +2 -0
  84. package/dist/types/cli/metrics.d.ts.map +1 -0
  85. package/dist/types/cli/ps.d.ts.map +1 -1
  86. package/dist/types/cli/result.d.ts.map +1 -1
  87. package/dist/types/cli/resume.d.ts.map +1 -1
  88. package/dist/types/cli/run.d.ts +1 -0
  89. package/dist/types/cli/run.d.ts.map +1 -1
  90. package/dist/types/cli/script.d.ts +3 -0
  91. package/dist/types/cli/script.d.ts.map +1 -1
  92. package/dist/types/cli/serve.d.ts.map +1 -1
  93. package/dist/types/cli/setup.d.ts +19 -1
  94. package/dist/types/cli/setup.d.ts.map +1 -1
  95. package/dist/types/cli/status.d.ts.map +1 -1
  96. package/dist/types/cli/steer.d.ts.map +1 -1
  97. package/dist/types/cli/version-check.d.ts +1 -0
  98. package/dist/types/cli/version-check.d.ts.map +1 -1
  99. package/dist/types/index.d.ts +1 -1
  100. package/dist/types/pi/session.d.ts +11 -1
  101. package/dist/types/pi/session.d.ts.map +1 -1
  102. package/dist/types/server.d.ts +15 -0
  103. package/dist/types/server.d.ts.map +1 -1
  104. package/dist/types/specialist/benchmarks.d.ts +37 -0
  105. package/dist/types/specialist/benchmarks.d.ts.map +1 -0
  106. package/dist/types/specialist/chain-identity.d.ts +7 -1
  107. package/dist/types/specialist/chain-identity.d.ts.map +1 -1
  108. package/dist/types/specialist/control.d.ts.map +1 -1
  109. package/dist/types/specialist/forensic-events.d.ts +138 -0
  110. package/dist/types/specialist/forensic-events.d.ts.map +1 -0
  111. package/dist/types/specialist/forensic-renderer.d.ts +34 -0
  112. package/dist/types/specialist/forensic-renderer.d.ts.map +1 -0
  113. package/dist/types/specialist/git-diff-evidence.d.ts +28 -0
  114. package/dist/types/specialist/git-diff-evidence.d.ts.map +1 -0
  115. package/dist/types/specialist/global-config.d.ts +389 -0
  116. package/dist/types/specialist/global-config.d.ts.map +1 -0
  117. package/dist/types/specialist/job-file-output.d.ts +2 -0
  118. package/dist/types/specialist/job-file-output.d.ts.map +1 -1
  119. package/dist/types/specialist/launch.d.ts +1 -0
  120. package/dist/types/specialist/launch.d.ts.map +1 -1
  121. package/dist/types/specialist/live-aggregates.d.ts +46 -0
  122. package/dist/types/specialist/live-aggregates.d.ts.map +1 -0
  123. package/dist/types/specialist/loader.d.ts +50 -1
  124. package/dist/types/specialist/loader.d.ts.map +1 -1
  125. package/dist/types/specialist/model-chain.d.ts +7 -0
  126. package/dist/types/specialist/model-chain.d.ts.map +1 -0
  127. package/dist/types/specialist/model-probes.d.ts +28 -0
  128. package/dist/types/specialist/model-probes.d.ts.map +1 -0
  129. package/dist/types/specialist/node-contract.d.ts +18 -18
  130. package/dist/types/specialist/node-supervisor.d.ts.map +1 -1
  131. package/dist/types/specialist/observability-db.d.ts +1 -1
  132. package/dist/types/specialist/observability-db.d.ts.map +1 -1
  133. package/dist/types/specialist/observability-sqlite.d.ts +25 -0
  134. package/dist/types/specialist/observability-sqlite.d.ts.map +1 -1
  135. package/dist/types/specialist/preset-resolver.d.ts +56 -0
  136. package/dist/types/specialist/preset-resolver.d.ts.map +1 -0
  137. package/dist/types/specialist/prometheus-projection.d.ts +25 -0
  138. package/dist/types/specialist/prometheus-projection.d.ts.map +1 -0
  139. package/dist/types/specialist/runner.d.ts +29 -1
  140. package/dist/types/specialist/runner.d.ts.map +1 -1
  141. package/dist/types/specialist/schema.d.ts +181 -63
  142. package/dist/types/specialist/schema.d.ts.map +1 -1
  143. package/dist/types/specialist/script-runner.d.ts +5 -1
  144. package/dist/types/specialist/script-runner.d.ts.map +1 -1
  145. package/dist/types/specialist/snapshot-diff.d.ts +8 -0
  146. package/dist/types/specialist/snapshot-diff.d.ts.map +1 -0
  147. package/dist/types/specialist/source-queue.d.ts +13 -0
  148. package/dist/types/specialist/source-queue.d.ts.map +1 -0
  149. package/dist/types/specialist/supervisor.d.ts +39 -2
  150. package/dist/types/specialist/supervisor.d.ts.map +1 -1
  151. package/dist/types/specialist/timeline-events.d.ts +88 -2
  152. package/dist/types/specialist/timeline-events.d.ts.map +1 -1
  153. package/dist/types/tools/specialist/resume_specialist.tool.d.ts +4 -4
  154. package/dist/types/tools/specialist/specialist_status.tool.d.ts +1 -1
  155. package/dist/types/tools/specialist/steer_specialist.tool.d.ts +4 -4
  156. package/dist/types/tools/specialist/use_specialist.tool.d.ts +16 -16
  157. package/docs/ARCHITECTURE.md +1176 -0
  158. package/docs/TODO.md +9 -0
  159. package/docs/architecture.md +11 -0
  160. package/docs/archive/2026-03-13-bd-decision-context-template-plan.md +96 -0
  161. package/docs/archive/AGENT-HANDOFF.md +351 -0
  162. package/docs/archive/PARITY-ANALYSIS.md +296 -0
  163. package/docs/archive/SPECIALISTS_REFACTOR.md.md +30 -0
  164. package/docs/archive/cc-programmatic.md +216 -0
  165. package/docs/archive/claude-agent-sdk.md +594 -0
  166. package/docs/archive/decision-specialist-directory.md +41 -0
  167. package/docs/archive/discoveries.md +148 -0
  168. package/docs/archive/executor-benchmark-protocol.md +198 -0
  169. package/docs/archive/future-features.md +66 -0
  170. package/docs/archive/gzrx-completion-critique.md +183 -0
  171. package/docs/archive/gzrx-research-notes.md +401 -0
  172. package/docs/archive/gzrx-tool-catalog.md +760 -0
  173. package/docs/archive/iron-review-hardening-qa-chain-substrate.md +322 -0
  174. package/docs/archive/iron-review-hardening.html +1004 -0
  175. package/docs/archive/issuetracking.md +312 -0
  176. package/docs/archive/qa-v3.0.2.md +220 -0
  177. package/docs/archive/restructure.md +231 -0
  178. package/docs/archive/script-specialists.md +1254 -0
  179. package/docs/archive/spec-v3.md +792 -0
  180. package/docs/archive/specialist-stats.md +127 -0
  181. package/docs/archive/specialists-friction-audit.md +1347 -0
  182. package/docs/archive/specialists-runtime-critique.md +170 -0
  183. package/docs/archive/specialists-service-evaluation.md +713 -0
  184. package/docs/archive/specialists-substrate-alignment.md +255 -0
  185. package/docs/archive/substrate-review.md +1288 -0
  186. package/docs/archive/test-writer-specialist.md +254 -0
  187. package/docs/archive/using-specialists-v3-improvements-2026-05-09.md +600 -0
  188. package/docs/archive/xtrm-specialists-analysis.md +314 -0
  189. package/docs/authoring.md +701 -0
  190. package/docs/background-jobs.md +203 -0
  191. package/docs/bare-specialists.md +83 -0
  192. package/docs/benchmarks/executor-benchmark-runner.md +66 -0
  193. package/docs/bootstrap.md +161 -0
  194. package/docs/cli-reference.md +1645 -0
  195. package/docs/deploying-alongside.md +155 -0
  196. package/docs/design/README.md +36 -0
  197. package/docs/design/darth-feedor-migration.md +290 -0
  198. package/docs/design/roadmap/README.md +32 -0
  199. package/docs/design/roadmap/chain-templates/README.md +146 -0
  200. package/docs/design/roadmap/chain-templates/code-quick.formula.json +27 -0
  201. package/docs/design/roadmap/chain-templates/code-standard.formula.json +126 -0
  202. package/docs/design/roadmap/chain-templates/code-with-advisors.formula.json +128 -0
  203. package/docs/design/roadmap/chain-templates/code-with-tests.formula.json +76 -0
  204. package/docs/design/roadmap/chain-templates/debug.formula.json +128 -0
  205. package/docs/design/roadmap/chain-templates/doc-sync.formula.json +28 -0
  206. package/docs/design/roadmap/chain-templates/memory-hygiene.formula.json +27 -0
  207. package/docs/design/roadmap/chain-templates/planning.formula.json +27 -0
  208. package/docs/design/roadmap/chain-templates/premortem.formula.json +26 -0
  209. package/docs/design/roadmap/chain-templates/release-prep.formula.json +36 -0
  210. package/docs/design/roadmap/chain-templates/research-only.formula.json +28 -0
  211. package/docs/design/roadmap/chain-templates/restitch.formula.json +125 -0
  212. package/docs/design/roadmap/chain-templates/security-deep.formula.json +161 -0
  213. package/docs/design/roadmap/chain-templates/test-only.formula.json +52 -0
  214. package/docs/design/roadmap/chain-templates/triage.formula.json +35 -0
  215. package/docs/design/roadmap/history/handoff-from-substrate-design.md +87 -0
  216. package/docs/design/roadmap/history/substrate-reconciliation.md +105 -0
  217. package/docs/design/roadmap/specialists-roadmap.md +1193 -0
  218. package/docs/design/sp-console-subscribe-via-materializer.md +231 -0
  219. package/docs/design/sp-console-tui-mock-v2.html +293 -0
  220. package/docs/design/sp-console-tui-mock.html +120 -0
  221. package/docs/design/sp-console-tui.md +340 -0
  222. package/docs/design/specialist-agentops-suite.md +323 -0
  223. package/docs/design/substrate/channels.md +14 -0
  224. package/docs/design/substrate/devops-platform-engineering-prd.md +446 -0
  225. package/docs/design/substrate/html-design-example.md +339 -0
  226. package/docs/design/xtrm-tiers-architecture.svg +132 -0
  227. package/docs/devops/dependency-verdict-materialization.md +46 -0
  228. package/docs/epic-readiness.md +75 -0
  229. package/docs/examples/mercury-atomic-summarizer.specialist.json +26 -0
  230. package/docs/examples/smoke-echo-text-expected-keys.specialist.json +25 -0
  231. package/docs/examples/smoke-echo.specialist.json +25 -0
  232. package/docs/features.md +1577 -0
  233. package/docs/hooks.md +81 -0
  234. package/docs/installation.md +142 -0
  235. package/docs/manifest.md +184 -0
  236. package/docs/mcp-servers.md +73 -0
  237. package/docs/mcp-tools.md +71 -0
  238. package/docs/nodes.md +231 -0
  239. package/docs/observability-metrics.md +152 -0
  240. package/docs/operator/sp-console-v2-walkthrough.md +410 -0
  241. package/docs/overrides-guide.md +306 -0
  242. package/docs/pi-rpc-boundary.md +118 -0
  243. package/docs/pi-session.md +195 -0
  244. package/docs/release.md +22 -0
  245. package/docs/skills.md +132 -0
  246. package/docs/specialists/handoff-schema.md +181 -0
  247. package/docs/specialists-catalog.md +99 -0
  248. package/docs/specialists-service-install.md +226 -0
  249. package/docs/specialists-service.md +363 -0
  250. package/docs/surface-ownership.md +138 -0
  251. package/docs/upgrade-notes/kan-90-global-user-config.md +114 -0
  252. package/docs/upgrade-notes/kan-91-expanded-overrides.md +261 -0
  253. package/docs/workflow.md +114 -0
  254. package/docs/worktree.md +71 -0
  255. package/docs/worktrees.md +309 -0
  256. package/package.json +17 -12
  257. package/config/specialists/code-sanity.specialist.json +0 -108
@@ -5,8 +5,8 @@ description: >
5
5
  agent through writing a valid `.specialist.json`, choosing supported models,
6
6
  validating against the schema, and avoiding common specialist authoring
7
7
  mistakes.
8
- version: 1.3
9
- synced_at: 78a7883e
8
+ version: 1.4
9
+ synced_at: fc9168e2
10
10
  ---
11
11
 
12
12
  # Specialist Author Guide
@@ -266,7 +266,7 @@ Avoid vague descriptions like "general purpose assistant" or "helps with code".
266
266
  | `mode` | enum | `auto` | `tool` \| `skill` \| `auto` |
267
267
  | `timeout_ms` | number | `120000` | ms |
268
268
  | `stall_timeout_ms` | number | — | kill if no event for N ms |
269
- | `interactive` | boolean | `false` | enable multi-turn keep-alive by default |
269
+ | `interactive` | boolean | `false` | enable multi-turn keep-alive by default (also overridable globally via `~/.config/specialists/user.json`) |
270
270
  | `response_format` | enum | `text` | `text` \| `json` \| `markdown` |
271
271
  | `output_type` | enum | `custom` | `codegen` \| `analysis` \| `review` \| `synthesis` \| `orchestration` \| `workflow` \| `research` \| `custom` |
272
272
  | `permission_required` | enum | `READ_ONLY` | see tier table below |
@@ -281,7 +281,8 @@ Avoid vague descriptions like "general purpose assistant" or "helps with code".
281
281
  - Run-level overrides still apply:
282
282
  - CLI: `--keep-alive` enables, `--no-keep-alive` disables.
283
283
  - MCP `start_specialist`: `keep_alive` enables, `no_keep_alive` disables.
284
- - Effective precedence: explicit disable (`--no-keep-alive` / `no_keep_alive`) → explicit enable (`--keep-alive` / `keep_alive`) → `execution.interactive` → one-shot default.
284
+ - Effective precedence: explicit disable (`--no-keep-alive` / `no_keep_alive`) → explicit enable (`--keep-alive` / `keep_alive`) → merged `execution.interactive` (package / global user.json / repo) → one-shot default.
285
+ - When the operator wants a cross-repo default, prefer `sp edit --global --set <name>.execution.interactive true|false` over forking per-repo specs.
285
286
 
286
287
  **Permission tiers** — controls the *native* pi tools the specialist gets. The full resolved tool set also includes catalog-defined GitNexus and Serena tools per tier; see [docs/manifest.md](../../../docs/manifest.md) for the complete picture.
287
288
 
@@ -575,7 +576,34 @@ Informational declarations used by pre-run validation and future tooling (e.g. `
575
576
  }
576
577
  ```
577
578
 
578
- Writes the final session output to this file path after the session completes. Relative to the working directory.
579
+ When set, the specialist writes its **handoff block** to this file on every substantive turn foreground and `--background`. The content is identical to what is appended to the input bead notes and shown by `sp result`: a markdown heading, the verbatim specialist output, and an italic metadata footer.
580
+
581
+ - **No env flag required.** `output_file` is honored whenever it is set (since unitAI-f58ma). It does NOT require `SPECIALISTS_JOB_FILE_OUTPUT` — that flag now only gates the debug file-mirrors (events.jsonl / status.json / result.txt).
582
+ - **Single writer.** In a supervised run (`sp run`) the supervisor owns the file and the runner's own write is suppressed, so the file is never double-written. (In script/serve runs there is no supervisor; the runner writes the raw output instead of the enveloped block.)
583
+ - **Format is the rendered handoff block, not bare output.** A downstream specialist that consumes this file as input will see the header/footer envelope around the body.
584
+ - **Append vs overwrite is controlled by `notes_mode`** (see below): `full-trail` appends each turn; `final-only` overwrites with just the final `[FINAL · DONE]` block.
585
+ - **Gitignore the path** if you don't want it committed — specs with `output_file` always write, so add the path (e.g. `.specialists/*-result.md`) to `.gitignore`.
586
+
587
+ Relative paths resolve from the working directory.
588
+
589
+ ### `specialist.notes_mode`
590
+
591
+ Controls how per-turn handoff output is persisted to BOTH the input bead notes and `output_file`.
592
+
593
+ | Value | Behavior |
594
+ |---|---|
595
+ | `"full-trail"` (default) | Append every substantive turn. Bead notes / `output_file` accumulate `### … [turn N · WAITING]` blocks, ending with a final `## … [FINAL · DONE]` block. Best for keep-alive specialists where the operator wants the full trail. |
596
+ | `"final-only"` | Persist only the single canonical `## … [FINAL · DONE]` block; intermediate turns are skipped and `output_file` is OVERWRITTEN (not appended). Best for non-coding / chained pipelines where the next specialist reads the previous specialist's bead note or `output_file` as its input and only wants the final result. |
597
+
598
+ Empty turns are never persisted. The handoff block is markdown-native (heading + verbatim body + one italic metadata footer); the model string is normalized (provider prefix stripped, e.g. `nano-gpt/moonshotai/kimi-k2.5` renders as `kimi-k2.5`).
599
+
600
+ ```json
601
+ { "notes_mode": "final-only" }
602
+ ```
603
+
604
+ ### Handoff / pipeline output recipe
605
+
606
+ For a non-coding pipeline where each specialist reads the previous one's result, set `output_file` to a known path AND `notes_mode: "final-only"` so the file (and the bead note) holds exactly the final result, overwritten each run — clean for the next specialist to consume. For a human-monitored keep-alive specialist, leave `notes_mode: "full-trail"` (default) so the operator sees every turn accumulate. `output_file` needs no env flag; just gitignore its path.
579
607
 
580
608
  ### `specialist.validation` (optional)
581
609
 
@@ -624,6 +652,131 @@ This specialist goes STALE the moment `schema.ts` or `runner.ts` is modified aft
624
652
 
625
653
  ---
626
654
 
655
+ ## Global User Override Layer (KAN-90/91)
656
+
657
+ The same per-spec field schema documented above is also exposed at a **global,
658
+ cross-repo layer** since 2026-06-13. Operators do not need to fork a
659
+ `.specialists/user/<name>.specialist.json` per repo just to swap their model or
660
+ opt out of an extension — those changes live once in
661
+ `~/.config/specialists/user.json` and apply everywhere.
662
+
663
+ ### 3-layer field merge
664
+
665
+ `SpecialistLoader.get()` resolves fields top-down:
666
+
667
+ 1. **Package canonical** — `config/specialists/<name>.specialist.json` shipped
668
+ in `@jaggerxtrm/specialists`. Most fields are concrete defaults; `model` and
669
+ `fallback_model` ship as `null` since KAN-90 part 2.
670
+ 2. **`~/.config/specialists/user.json`** — operator's global override. Wins
671
+ over package canonical for the allowlisted user-environment fields.
672
+ 3. **`.specialists/user/<name>.specialist.json`** — per-repo override. Wins
673
+ over global. Can change any field, including ones blocked at the global
674
+ layer.
675
+
676
+ The pre-KAN-90 `.specialists/default/<name>.specialist.json` mirror is no
677
+ longer walked (commit `31a6421c`).
678
+
679
+ ### CLI surface
680
+
681
+ | Command | Effect |
682
+ |---|---|
683
+ | `sp init --global` | Bootstraps `~/.config/specialists/user.json` with null placeholders for every spec; writes `_doc` sentinel + `overrides-guide.md`. Idempotent — preserves existing values, only adds entries for newly-discovered specialists on re-run. |
684
+ | `sp edit --global --set <name>.<dot.path> <value>` | Writes one field in `user.json` (schema-validated). |
685
+ | `sp edit --global --get <name>.<dot.path>` | Reads the current merged value. |
686
+ | `sp doctor --specialists` | Reports `N/M specialists have a model configured`, lists missing models, and surfaces blocked-field overrides applied with warning. |
687
+ | `sp config show <name> --resolved` | Shows the merged spec for one specialist with per-layer attribution. |
688
+
689
+ The bare positional form (`sp edit --global <name>.field value` without
690
+ `--set`) currently falls through to `$EDITOR` in some environments — prefer
691
+ `--set` in scripts.
692
+
693
+ ### Allowlist mapping (which fields can be set globally)
694
+
695
+ The constants in `src/specialist/schema.ts` define what the global layer may
696
+ write:
697
+
698
+ ```ts
699
+ OVERRIDE_ALLOWED_EXECUTION_FIELDS = [
700
+ 'model', 'fallback_model', 'fallback_models',
701
+ 'timeout_ms', 'stall_timeout_ms', 'interactive', 'thinking_level',
702
+ 'max_retries', 'prompt_limit_bytes', 'stdout_limit_bytes',
703
+ ]
704
+ OVERRIDE_ALLOWED_NESTED_EXECUTION_PATHS = [
705
+ 'extensions.serena', 'extensions.gitnexus',
706
+ ]
707
+ OVERRIDE_ALLOWED_STALL_DETECTION_PATHS = ['waiting_auto_close_ms']
708
+ OVERRIDE_ALLOWED_PROMPT_FIELDS = ['system_prompt_mode']
709
+ OVERRIDE_ALLOWED_TOP_FIELDS = ['beads_write_notes', 'notes_mode', 'output_file']
710
+ ```
711
+
712
+ So `sp edit --global --set executor.notes_mode final-only` is allowed; the
713
+ same effect for `permission_required`, `prompt.system`, `mandatory_rules`,
714
+ `capabilities`, `output_schema`, `auto_commit`, `skills.scripts`, or
715
+ `prompt.task_template` is **blocked at the global layer** and must be done
716
+ per-repo in `.specialists/user/<name>.specialist.json`. A blocked field that
717
+ sneaks into `user.json` is applied with a `BlockedFieldWarning` and reported
718
+ by `sp doctor --specialists`.
719
+
720
+ ### Same fields as the per-spec reference
721
+
722
+ Every field documented above in `## Schema Reference` applies at the global
723
+ layer with the same semantics — only the **scope** changes (one machine vs one
724
+ repo). Examples:
725
+
726
+ ```bash
727
+ # Set notes_mode + output_file globally for a chained pipeline reader
728
+ sp edit --global --set sync-docs.notes_mode final-only
729
+ sp edit --global --set sync-docs.output_file ".specialists/sync-docs-result.md"
730
+
731
+ # Opt out of Serena MCP injection on a read-only specialist (RAM saver)
732
+ sp edit --global --set overthinker.execution.extensions.serena false
733
+
734
+ # Set the default keep-alive behavior globally for one specialist
735
+ sp edit --global --set reviewer.execution.interactive false
736
+
737
+ # Auto-close forgotten waiting sessions after 1h (graceful close first)
738
+ sp edit --global --set reviewer.stall_detection.waiting_auto_close_ms 3600000
739
+
740
+ # Set system_prompt_mode to replace globally for a bare specialist
741
+ sp edit --global --set my-bare-spec.prompt.system_prompt_mode replace
742
+
743
+ # Plural fallback chain (KAN-91 Phase 2; walked on transient failures only)
744
+ sp edit --global --set executor.execution.fallback_models \
745
+ '["openai-codex/gpt-5.5","anthropic/claude-sonnet-4-6"]'
746
+ ```
747
+
748
+ ### Preset references (KAN-91 Phase 3)
749
+
750
+ Both `model` and `fallback_model`/`fallback_models` entries may be a
751
+ `@preset/<name>` reference:
752
+
753
+ ```bash
754
+ sp edit --global --set executor.execution.model @preset/medium
755
+ sp edit --global --set executor.execution.fallback_models '["@preset/cheap"]'
756
+ sp edit --list-presets # show available preset names in the installed package
757
+ ```
758
+
759
+ Built-in presets typically include `cheap`, `medium`, `power`. Depth cap = 5;
760
+ cycles surface a structured error at dispatch.
761
+
762
+ ### `_doc` sentinel and `overrides-guide.md`
763
+
764
+ `sp init --global` writes a `_doc` key at the top of `user.json` pointing at
765
+ `./overrides-guide.md`, and (re)generates that guide with the live field
766
+ reference. Any other `_`-prefixed keys are tolerated as comments. Authors of a
767
+ new specialist should run `sp init --global` after release so existing operators
768
+ get a fresh null-placeholder entry on next bootstrap.
769
+
770
+ ### Pitfall — `thinking_level: "off"`
771
+
772
+ `thinking_level: null` inherits pi's `defaultThinkingLevel` (typically `high`
773
+ on most installs). Forcing `off` on certain thinking-class models (verified:
774
+ Kimi-via-nano-gpt) silently produces an empty assistant text turn after
775
+ multi-tool runs because the model's tool-result-summary phase needs thinking
776
+ budget. Leave it `null` unless you have a documented reason to force a level.
777
+
778
+ ---
779
+
627
780
  ## Built-in Template Variables
628
781
 
629
782
  These are **always available** in `task_template` — no configuration needed:
@@ -767,6 +920,7 @@ Quality degrades as the context grows — compressed early context causes incons
767
920
 
768
921
  **Rules when authoring a specialist:**
769
922
  - Set `stall_timeout_ms` explicitly for any specialist that may idle between turns (keep-alive/interactive). Without it, a stuck session holds resources indefinitely.
923
+ - If the operator wants forgotten waiting sessions to retire automatically, set `stall_detection.waiting_auto_close_ms` explicitly; keep it unset/0 when human follow-up should remain indefinitely resumable.
770
924
  - Use `thinking_level: low` for orchestration/coordinator specialists that emit structured JSON output — thinking tokens cost context budget without improving structured output quality.
771
925
  - For research/explorer specialists: bounded scope per session + `handoff_summary` in `output_schema` > one unbounded session.
772
926
  - `interactive: true` specialists must define what "done" looks like in their system prompt — otherwise they drift.
@@ -800,6 +954,7 @@ Before finalising a specialist that uses `interactive: true` or is expected to r
800
954
 
801
955
  ```
802
956
  [ ] stall_timeout_ms set (not relying on timeout_ms alone)
957
+ [ ] waiting_auto_close_ms decision made (unset/0 for indefinite waiting, explicit ms for auto-retire)
803
958
  [ ] thinking_level set appropriately for the output type
804
959
  [ ] output_schema includes handoff_summary or equivalent for rotation
805
960
  [ ] system prompt has explicit termination condition ("you are done when...")
@@ -27,7 +27,7 @@ const KNOWN = {
27
27
  capabilities: new Set(['required_tools','external_commands','diagnostic_scripts']),
28
28
  communication: new Set(['next_specialists','publishes']),
29
29
  validation: new Set(['files_to_watch','stale_threshold_days']),
30
- stall_detection: new Set(['running_idle_warn_ms','running_idle_kill_ms','waiting_stale_ms','tool_duration_warn_ms']),
30
+ stall_detection: new Set(['running_idle_warn_ms','running_idle_kill_ms','waiting_stale_ms','waiting_auto_close_ms','tool_duration_warn_ms']),
31
31
  };
32
32
 
33
33
  function unknownKeys(obj, knownSet, path) {
@@ -39,7 +39,7 @@ read bead → write 7-section contract (child impl bead) → bd dep add parent
39
39
  → sleep 10 && sp ps # confirm started, not stuck queued
40
40
  → sleep <role-typical from v3> & sp ps # check (see v3 Monitoring section)
41
41
  → sp result <exec-job> # consume immediately on transition to waiting
42
- → optional advisory passes per v3 (code-sanity if smelly, security-auditor if risk surface)
42
+ → optional advisory passes per v3 (seconder if smelly, security-auditor if risk surface)
43
43
  → write reviewer bead contract → sp run reviewer --bead <review> --job <exec-job> --background
44
44
  → sleep 90 & sp ps
45
45
  → sp result <reviewer-job>
@@ -215,7 +215,7 @@ Run `specialists list` if you need the live registry. Choose by task, not by hab
215
215
  | Design/tradeoffs | `overthinker` | The approach is risky, ambiguous, or needs critique. |
216
216
  | Implementation | `executor` | The contract is clear enough to write code or docs. |
217
217
  | Compliance/code review | `reviewer` | An executor/debugger produced changes that need the final PASS/PARTIAL/FAIL verdict. |
218
- | Implementation sanity | `code-sanity` | You want a cheap READ_ONLY smell pass for simplicity, type safety, dead code, brittle async/error handling, or maintainability before reviewer. |
218
+ | Implementation sanity | `seconder` | You want a cheap READ_ONLY smell pass for simplicity, type safety, dead code, brittle async/error handling, or maintainability before reviewer. |
219
219
  | Security/dependency audit | `security-auditor` | You need threat modeling, secure-code review, package advisory triage, or agent/config security scanning. LOW: scan/read/recommend only. |
220
220
  | Multiple review perspectives | `parallel-review` | A critical diff needs independent review passes. |
221
221
  | Test execution | `test-runner` | You need suites run and failures interpreted. |
@@ -247,7 +247,7 @@ specialists doctor --check-drift # inspect stale .specialists/de
247
247
  sp prune-stale-defaults --dry-run # preview redundant default snapshots
248
248
  specialists run <name> --bead <id> --background
249
249
  specialists run executor --bead <impl-bead> --background # worktree auto-provisioned
250
- specialists run code-sanity --bead <sanity-bead> --job <exec-job> --keep-alive --background
250
+ specialists run seconder --bead <sanity-bead> --job <exec-job> --keep-alive --background
251
251
  specialists run security-auditor --bead <security-bead> --job <exec-job> --keep-alive --background
252
252
  specialists run reviewer --bead <review-bead> --job <exec-job> --keep-alive --background
253
253
  specialists ps
@@ -343,7 +343,7 @@ specialists run executor --worktree --bead <impl> --context-depth 3 --background
343
343
  specialists result <exec-job>
344
344
  ```
345
345
 
346
- Optional code-sanity pass for implementation smell checks (use when the diff is non-trivial or likely to accumulate agent-code complexity):
346
+ Optional seconder pass for implementation smell checks (use when the diff is non-trivial or likely to accumulate agent-code complexity):
347
347
 
348
348
  ```bash
349
349
  bd create --title "Code sanity check token refresh retry" --type task --priority 3 \
@@ -355,11 +355,11 @@ CONSTRAINTS: At most 5 concrete findings; cite files/symbols/lines where possibl
355
355
  VALIDATION: Findings are suitable to paste into specialists resume <exec-job>.
356
356
  OUTPUT: OK/FINDINGS/BLOCKED with handoff."
357
357
  bd dep add <sanity> <impl>
358
- specialists run code-sanity --bead <sanity> --job <exec-job> --context-depth 3 --keep-alive --background
358
+ specialists run seconder --bead <sanity> --job <exec-job> --context-depth 3 --keep-alive --background
359
359
  specialists result <sanity-job>
360
360
  ```
361
361
 
362
- If code-sanity returns `FINDINGS`, resume executor with those concrete instructions, then rerun code-sanity only if the fixes were substantive. Do not treat code-sanity `OK` as reviewer PASS.
362
+ If seconder returns `FINDINGS`, resume executor with those concrete instructions, then rerun seconder only if the fixes were substantive. Do not treat seconder `OK` as reviewer PASS.
363
363
 
364
364
  Optional security pass when the task touches auth, secrets, input handling, dependency updates, package advisories, agent config, hooks, or exposed endpoints:
365
365
 
@@ -492,7 +492,7 @@ Standard loop:
492
492
  ```text
493
493
  executor --worktree --bead impl
494
494
  -> waiting after turn
495
- optional code-sanity --bead sanity --job exec-job
495
+ optional seconder --bead sanity --job exec-job
496
496
  -> OK: continue
497
497
  -> FINDINGS: resume executor with exact sanity findings
498
498
  optional security-auditor --bead security --job exec-job
@@ -506,7 +506,7 @@ reviewer --bead review --job exec-job
506
506
 
507
507
  Prefer `sp resume <exec-job>` over a new fix executor when the original job is waiting and context is healthy. Use a new fix bead with `--job <exec-job>` only when the original executor is dead, context exhausted, or a separate audit trail is required.
508
508
 
509
- Code-sanity and security-auditor outputs are advisory inputs to the chain; reviewer output must still be consumed before publishing. Do not treat job completion, code-sanity OK, or security no-findings as equivalent to reviewer acceptance.
509
+ Seconder and security-auditor outputs are advisory inputs to the chain; reviewer output must still be consumed before publishing. Do not treat job completion, seconder OK, or security no-findings as equivalent to reviewer acceptance.
510
510
 
511
511
  ## Dependency Mapping
512
512