@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,261 @@
1
+ # KAN-91 / unitAI-gp7nq — Expanded global overrides
2
+
3
+ For the current canonical reference, see [`docs/overrides-guide.md`](../overrides-guide.md). This page documents the KAN-91 delta only.
4
+
5
+ KAN-91 expands the KAN-90 global `user.json` layer from model-only tuning into a per-user environment override surface. The new surface adds user-owned knobs for prompt composition, extension injection, notes/output behavior, prompt/stdout limits, fallback model chains, and `@preset/<name>` references. Specialist identity and safety fields remain blocked.
6
+
7
+ ## Overview
8
+
9
+ This expansion adds:
10
+
11
+ - Six allowlisted user-environment fields: `prompt.system_prompt_mode`, `execution.extensions.serena`, `execution.extensions.gitnexus`, `notes_mode`, `output_file`, `execution.prompt_limit_bytes`, and `execution.stdout_limit_bytes`.
12
+ - Follow-up fields now also exposed in the live global layer: `execution.interactive` and `stall_detection.waiting_auto_close_ms`.
13
+ - Fallback chains via `execution.fallback_models` while keeping legacy `execution.fallback_model`.
14
+ - Preset references like `@preset/cheap` for model and fallback entries.
15
+ - A top-level `_doc` sentinel in generated `user.json` pointing back to this guide. Keys starting with `_` are metadata, not specialist names.
16
+
17
+ The examples below are delta snippets to add inside an existing specialist entry from `sp init --global`; they are not complete standalone `user.json` files. Keep the surrounding generated entry shape, including its `execution`, `prompt`, `stall_detection`, `beads_write_notes`, and `skills` keys, and change only the highlighted field.
18
+
19
+ ## Per-field reference
20
+
21
+ ### `prompt.system_prompt_mode`
22
+
23
+ - Type: `"append" | "replace" | null`
24
+ - Default semantics: `null` inherits the shipped specialist value, normally `append`.
25
+ - Example:
26
+
27
+ ```json
28
+ {
29
+ "executor": {
30
+ "prompt": { "system_prompt_mode": "replace" }
31
+ }
32
+ }
33
+ ```
34
+
35
+ Pitfall: this controls composition mode only. It does not let `user.json` replace `prompt.system`; prompt content remains blocked.
36
+
37
+ ### `execution.extensions.serena`
38
+
39
+ - Type: `boolean | null`
40
+ - Default semantics: `null` inherits the shipped extension setting.
41
+ - Example:
42
+
43
+ ```json
44
+ {
45
+ "executor": {
46
+ "execution": { "extensions": { "serena": false } }
47
+ }
48
+ }
49
+ ```
50
+
51
+ Pitfall: extension overrides are per-key overlays. Setting `serena: false` does not change `gitnexus`.
52
+
53
+ ### `execution.extensions.gitnexus`
54
+
55
+ - Type: `boolean | null`
56
+ - Default semantics: `null` inherits the shipped extension setting.
57
+ - Example:
58
+
59
+ ```json
60
+ {
61
+ "executor": {
62
+ "execution": { "extensions": { "gitnexus": false } }
63
+ }
64
+ }
65
+ ```
66
+
67
+ Pitfall: disabling GitNexus removes graph tooling from that specialist run. Use only when project indexing is unavailable or too expensive.
68
+
69
+ ### `notes_mode`
70
+
71
+ - Type: `"full-trail" | "final-only" | null`
72
+ - Default semantics: `null` inherits the specialist default. `full-trail` appends turn handoffs; `final-only` keeps final handoff only.
73
+ - Example:
74
+
75
+ ```json
76
+ {
77
+ "researcher": {
78
+ "notes_mode": "final-only"
79
+ }
80
+ }
81
+ ```
82
+
83
+ Pitfall: `final-only` is quieter but removes intermediate turn notes from bead history.
84
+
85
+ ### `output_file`
86
+
87
+ - Type: `string | null`
88
+ - Default semantics: `null` inherits the specialist default or no file mirror.
89
+ - Example:
90
+
91
+ ```json
92
+ {
93
+ "researcher": {
94
+ "output_file": "./.specialists/researcher-result.md"
95
+ }
96
+ }
97
+ ```
98
+
99
+ Pitfall: paths are not expanded by the loader. `~/result.md` stays literal and is not converted to your home directory.
100
+
101
+ ### `execution.prompt_limit_bytes`
102
+
103
+ - Type: `number | null`
104
+ - Default semantics: `null` inherits the shipped prompt input limit.
105
+ - Example:
106
+
107
+ ```json
108
+ {
109
+ "executor": {
110
+ "execution": { "prompt_limit_bytes": 8388608 }
111
+ }
112
+ }
113
+ ```
114
+
115
+ Pitfall: raising this limit can increase token spend or provider rejection risk.
116
+
117
+ ### `execution.stdout_limit_bytes`
118
+
119
+ - Type: `number | null`
120
+ - Default semantics: `null` inherits the shipped stdout capture limit.
121
+ - Example:
122
+
123
+ ```json
124
+ {
125
+ "executor": {
126
+ "execution": { "stdout_limit_bytes": 67108864 }
127
+ }
128
+ }
129
+ ```
130
+
131
+ Pitfall: raising this limit can produce very large logs and result files.
132
+
133
+ ### `execution.fallback_model`
134
+
135
+ - Type: `string | null`
136
+ - Default semantics: legacy single fallback. `null` means no singular fallback from this layer.
137
+ - Example:
138
+
139
+ ```json
140
+ {
141
+ "executor": {
142
+ "execution": { "fallback_model": "openai-codex/gpt-5.4-mini" }
143
+ }
144
+ }
145
+ ```
146
+
147
+ Pitfall: if `fallback_models` is also set, plural wins.
148
+
149
+ ### `execution.fallback_models`
150
+
151
+ - Type: `string[] | null`
152
+ - Default semantics: `null` inherits lower layers. Array values replace the singular fallback chain for that layer.
153
+ - Example:
154
+
155
+ ```json
156
+ {
157
+ "executor": {
158
+ "execution": {
159
+ "fallback_models": [
160
+ "openai-codex/gpt-5.4-mini",
161
+ "nano-gpt/moonshotai/kimi-k2.5"
162
+ ]
163
+ }
164
+ }
165
+ }
166
+ ```
167
+
168
+ Pitfall: fallback walk is transient-failure-only. Auth failures, prompt rejections, and other logical failures do not advance to the next provider.
169
+
170
+ ## Preset reference syntax
171
+
172
+ Write a preset reference as an exact string inside the existing generated specialist entry:
173
+
174
+ ```json
175
+ {
176
+ "executor": {
177
+ "execution": {
178
+ "model": "@preset/cheap",
179
+ "fallback_models": ["@preset/medium", "openai-codex/gpt-5.4-mini"]
180
+ }
181
+ }
182
+ }
183
+ ```
184
+
185
+ Package presets live in `config/presets.json`. Current shipped names are `cheap`, `medium`, and `power`. User-defined preset files and repo-level preset shadowing are not part of KAN-91.
186
+
187
+ Preset references resolve transitively with depth cap 4. Cycles raise `SpecialistPresetCycleError` with the visited preset list. Unknown names raise `SpecialistPresetNotFoundError` and list known presets. Malformed preset payloads raise `SpecialistPresetTypeError` before the loader writes the resolved value into the merged specialist spec.
188
+
189
+ Only allowlisted override fields accept preset references. A blocked field such as `prompt.system` cannot smuggle a preset reference through `user.json`.
190
+
191
+ ## Fallback chain semantics
192
+
193
+ Runtime model order is:
194
+
195
+ 1. Primary `execution.model`.
196
+ 2. `execution.fallback_models` entries when plural is present.
197
+ 3. Legacy `execution.fallback_model` only when plural is absent.
198
+
199
+ Plural wins over singular in the same layer. A plural override in a higher layer replaces the lower layer's singular fallback chain because mixing singular and plural fallbacks across layers is ambiguous.
200
+
201
+ Each fallback step emits `fallback_step` telemetry with specialist, attempt number, tried model, error class, and whether the step was terminal. Chain walk only happens for transient failures such as rate limits, network errors, timeouts, and 5xx-class provider failures.
202
+
203
+ ## Migration
204
+
205
+ Existing `~/.config/specialists/user.json` files auto-extend on the next `sp init --global` run. Existing values are preserved. Missing fields are filled with `null` defaults, and `_doc` is added if absent.
206
+
207
+ Generated files stay strict JSON. `sp init --global` does not write comments; it writes `_doc` as a top-level metadata key instead.
208
+
209
+ ## Complete example (validates against `GlobalUserConfigSchema`)
210
+
211
+ This is a complete `user.json` shape, not a delta snippet. It keeps every required key from `sp init --global` and exercises `system_prompt_mode`, fallback chains, extension opt-out, and `@preset/<name>` references.
212
+
213
+ ```json
214
+ {
215
+ "_doc": "See docs/upgrade-notes/kan-91-expanded-overrides.md for expanded override fields.",
216
+ "executor": {
217
+ "execution": {
218
+ "model": "@preset/cheap",
219
+ "fallback_model": null,
220
+ "fallback_models": [
221
+ "@preset/medium",
222
+ "openai-codex/gpt-5.4-mini"
223
+ ],
224
+ "timeout_ms": null,
225
+ "stall_timeout_ms": null,
226
+ "interactive": true,
227
+ "thinking_level": null,
228
+ "max_retries": null,
229
+ "prompt_limit_bytes": 8388608,
230
+ "stdout_limit_bytes": null,
231
+ "extensions": {
232
+ "serena": false,
233
+ "gitnexus": null
234
+ }
235
+ },
236
+ "prompt": {
237
+ "system_prompt_mode": "replace"
238
+ },
239
+ "stall_detection": {
240
+ "waiting_auto_close_ms": 3600000
241
+ },
242
+ "beads_write_notes": null,
243
+ "notes_mode": "final-only",
244
+ "output_file": null,
245
+ "skills": {
246
+ "paths": []
247
+ }
248
+ }
249
+ }
250
+ ```
251
+
252
+ ## Cross-references
253
+
254
+ - Origin doc: `docs/upgrade-notes/kan-90-global-user-config.md`
255
+ - KAN-91 epic: `unitAI-gp7nq`
256
+ - Phase 0 override machinery: `unitAI-gp7nq.1`
257
+ - Phase 1 user-environment fields: `unitAI-gp7nq.2`
258
+ - Phase 2 fallback chains: `unitAI-gp7nq.3`
259
+ - Phase 3 preset references: `unitAI-gp7nq.4`
260
+ - Follow-up reference-doc update: `unitAI-aav4w`
261
+ - Follow-up stale 4-layer wording fix: `unitAI-v4i0j`
@@ -0,0 +1,114 @@
1
+ ---
2
+ title: Bead-First Workflow
3
+ scope: workflow
4
+ category: guide
5
+ version: 1.4.2
6
+ updated: 2026-06-24
7
+ synced_at: bf6baf7a
8
+ description: Canonical tracked and ad-hoc workflow for Specialists.
9
+ source_of_truth_for:
10
+ - "src/cli/run.ts"
11
+ - "src/cli/chat.ts"
12
+ - "src/specialist/runner.ts"
13
+ - "src/specialist/supervisor.ts"
14
+ - "src/cli/resume.ts"
15
+ - "src/cli/steer.ts"
16
+ domain:
17
+ - workflow
18
+ - beads
19
+ ---
20
+
21
+ # Bead-First Workflow
22
+
23
+ > `sp` is an alias for `specialists`.
24
+
25
+ The canonical flow is bead-first. `specialists run` is always Supervisor-backed and emits a job id.
26
+
27
+ ## Tracked work (primary)
28
+
29
+ ```bash
30
+ bd create "Investigate X" -t task -p 1 --json
31
+ bd update <id> --claim --json
32
+ specialists run <name> --bead <id> [--context-depth N]
33
+ specialists feed -f
34
+ bd close <id> --reason "Done" --json
35
+ ```
36
+
37
+ Key behavior for `--bead` runs:
38
+ - Bead content is the prompt source.
39
+ - Runner injects bead context variables (`$bead_context`, `$bead_id`).
40
+ - Runner applies a bead-aware system override to prevent sub-bead creation.
41
+ - Supervisor appends specialist output back to the input bead. Terminal bead closure still follows the current workflow gates and memory-ack rules; if `waiting_auto_close_ms` is configured, waiting keep-alive jobs can also close automatically after silence. Verify bead state before committing or publishing.
42
+
43
+ ## Ad-hoc work
44
+
45
+ ```bash
46
+ specialists run <name> --prompt "..."
47
+ ```
48
+
49
+ Use this for quick untracked tasks.
50
+
51
+ ## Async observation model
52
+
53
+ For headless or multi-job work, run specialists normally and inspect them with `feed`, `ps`, and `result`:
54
+
55
+ ```bash
56
+ specialists run explorer --bead unitAI-abc
57
+ sp feed -f
58
+ sp result <job-id>
59
+ ```
60
+
61
+ For a human-in-the-loop launch, use `sp chat`:
62
+
63
+ ```bash
64
+ sp chat explorer --bead unitAI-abc
65
+ ```
66
+
67
+ `sp chat` opens a TUI that combines a `sp feed -f`-style feed, pinned status row, final result display, and input prompt. Freeform input maps to `steer` while the job is running and `resume` while it is waiting. `/quit` and `Ctrl+C` detach without killing the job; use `/stop` when you intend to stop it.
68
+
69
+ `--background` may also create a legacy tmux session when tmux is available. `sp attach <job>` reconnects to that tmux session only; it is not yet the chat TUI attach flow. Existing-job TUI attach is tracked separately in bead `unitAI-hx4ln`.
70
+
71
+ Use:
72
+ - CLI: run/chat, then inspect with `feed`, `ps`, `result`
73
+ - MCP: `use_specialist` (only exposed tool)
74
+ - Shell backgrounding (`&`) when needed
75
+
76
+ ## `--context-depth`
77
+
78
+ `--context-depth` controls blocker context injection when using `--bead`.
79
+
80
+ | Value | Meaning |
81
+ |---|---|
82
+ | `0` | Disable dependency context injection |
83
+ | `3` | Walk 3 levels up completed blockers (default) |
84
+ | `N` | Walk N levels up completed blockers |
85
+
86
+ ## `--no-beads`
87
+
88
+ `--no-beads` disables tracking bead creation/updates for the run.
89
+
90
+ Important:
91
+ - It does not disable bead reading when `--bead <id>` is used.
92
+ - Prompt source is still the bead when `--bead` is provided.
93
+
94
+ ## Steering vs resume
95
+
96
+ - `steer`: for jobs currently `running` (mid-turn redirection)
97
+ - `resume`: for keep-alive jobs in `waiting` (next turn)
98
+
99
+ Inside `sp chat`, freeform input chooses between those two actions automatically based on the current status. Use explicit `sp steer` / `sp resume` commands when operating outside the chat TUI or from scripts.
100
+
101
+ Keep-alive may be enabled explicitly (`--keep-alive`) or by specialist YAML (`execution.interactive: true`).
102
+ Use `--no-keep-alive` when you want one-shot behavior for an otherwise interactive specialist.
103
+
104
+ `resume` is not valid for non-waiting jobs.
105
+
106
+ ## Auto-append bead notes (all specialists)
107
+
108
+ For **all specialists** invoked with `--bead`, Supervisor appends output notes back to the input bead automatically. This includes READ_ONLY, LOW, MEDIUM, and HIGH specialists.
109
+
110
+ ## See also
111
+
112
+ - [background-jobs.md](background-jobs.md)
113
+ - [mcp-tools.md](mcp-tools.md)
114
+ - [authoring.md](authoring.md)
@@ -0,0 +1,71 @@
1
+ ---
2
+ title: Worktree Integration
3
+ scope: worktree
4
+ category: guide
5
+ version: 1.2.1
6
+ updated: 2026-06-24
7
+ synced_at: bf6baf7a
8
+ description: xtrm worktree usage alongside Specialists.
9
+ source_of_truth_for:
10
+ - "src/cli/help.ts"
11
+ - "config/specialists/xt-merge.specialist.json"
12
+ domain:
13
+ - worktrees
14
+ - xtrm
15
+ ---
16
+
17
+ <!-- INDEX: auto-generated by validate_doc.py — do not edit manually -->
18
+ | Section | Summary |
19
+ |---|---|
20
+ | [Common commands](#common-commands) | xt pi, xt claude, xt attach, xt worktree list, xt end, xt report |
21
+ | [Recommended pattern](#recommended-pattern) | create/claim bead → worktree → specialists --bead → feed → close |
22
+ | [PR queue help](#pr-queue-help) | Use `xt-merge` when you need a specialist to drain the PR queue in FIFO order |
23
+ | [See also](#see-also) | workflow.md, specialists-catalog.md |
24
+ <!-- END INDEX -->
25
+
26
+ # Worktree Integration
27
+
28
+ Specialists can be used alongside xtrm worktree workflows.
29
+
30
+ ## Common commands
31
+
32
+ | Command | Purpose |
33
+ |---|---|
34
+ | `xt pi [name]` | Start a Pi session in a sandboxed xt worktree |
35
+ | `xt claude [name]` | Start a Claude session in a sandboxed xt worktree |
36
+ | `xt attach [slug]` | Resume an existing xt worktree session |
37
+ | `xt worktree list` | List worktrees with runtime and activity |
38
+ | `xt end [--epic <id>] [--pr]` | Close session: push, PR/merge, cleanup. Use `--epic` for wave-bound chain publication. |
39
+ | `xt report show\|list\|diff` | Session report surfaces (same .xtrm/reports files) |
40
+
41
+ ## Recommended pattern
42
+
43
+ 1. create/claim a bead
44
+ 2. work in a dedicated worktree
45
+ 3. use specialists with `--bead`
46
+ 4. monitor with `specialists feed -f`
47
+ 5. close the bead and end the worktree session
48
+
49
+ ### Epic-aware session close
50
+
51
+ For wave-bound chains, use `xt end --epic <id>` or let auto-detection redirect:
52
+
53
+ ```bash
54
+ # Explicit epic publication
55
+ xt end --epic unitAI-3f7b --pr
56
+
57
+ # Auto-detect epic from chain membership
58
+ xt end
59
+ # → redirects to sp epic merge if chain belongs to unresolved epic
60
+ ```
61
+
62
+ See `docs/worktrees.md` for full `sp end` behavior.
63
+
64
+ ## PR queue help
65
+
66
+ Use `xt-merge` when you need a specialist to drain the PR queue in FIFO order.
67
+
68
+ ## See also
69
+
70
+ - [workflow.md](workflow.md)
71
+ - [specialists-catalog.md](specialists-catalog.md)