@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,312 @@
1
+ # Agent-Native Issue Tracking Contract Board
2
+
3
+ Status: deferred design. Do not implement now.
4
+
5
+ This document captures a future direction for the xt/sp ecosystem after the current specialists and xtrm backlogs settle, conversations layer lands, and preflight/long-run stress testing has exposed more orchestration friction.
6
+
7
+ The idea is likely a third package in the xt/sp ecosystem, not an immediate replacement of bd.
8
+
9
+ ## Problem
10
+
11
+ Specialist job quality depends heavily on issue quality.
12
+
13
+ A vague issue produces vague prompts, weak specialist behavior, missing validation, and reviewer ambiguity. A precise issue behaves like an executable contract: it gives the orchestrator a clear chain, gives specialists tight scope, gives reviewers evidence targets, and makes failures diagnosable.
14
+
15
+ Current bd usage gives us useful IDs, status, dependency links, JSONL export, and CLI ergonomics, but bd is still primarily an issue tracker. The emerging need is a contract runtime for agent work.
16
+
17
+ ## Core Thesis
18
+
19
+ Job quality is roughly:
20
+
21
+ ```text
22
+ issue contract quality × orchestration discipline × specialist prompt invariants
23
+ ```
24
+
25
+ The issue/prompt determines the job heavily. Therefore issue creation and update should not be a passive write. It should trigger contract validation before any specialist dispatch.
26
+
27
+ ## Future System Shape
28
+
29
+ The future system should treat issues as executable job contracts.
30
+
31
+ ```text
32
+ issue contract → validator → specialist chain → evidence graph → review → merge/close
33
+ ```
34
+
35
+ Key properties:
36
+
37
+ - Contract-first: every dispatchable issue has enough information for an AFK specialist chain.
38
+ - Validator-gated: a small/simple model validates readiness and blocks dispatch if required fields are missing or vague.
39
+ - Issue-local prompt rules: issue-specific mandatory rules append into spawned specialist prompts at job start.
40
+ - State-aware: readiness, work state, review state, dependency state, and evidence state are distinct.
41
+ - Auditable: every validator verdict, override, dispatch, result, review, and close reason is persisted.
42
+ - Conversation-aware: later conversations/agent-mail layer can coordinate clarification, handoff, and cross-agent review around the same contract.
43
+
44
+ ## Contract Readiness States
45
+
46
+ These are conceptual states, not a final schema.
47
+
48
+ Work state:
49
+
50
+ ```text
51
+ draft
52
+ ready
53
+ claimed
54
+ running
55
+ waiting
56
+ reviewing
57
+ blocked
58
+ failed
59
+ done
60
+ archived
61
+ ```
62
+
63
+ Contract readiness:
64
+
65
+ ```text
66
+ invalid
67
+ partial
68
+ ready
69
+ waived
70
+ ```
71
+
72
+ Review state:
73
+
74
+ ```text
75
+ unreviewed
76
+ partial
77
+ pass
78
+ fail
79
+ ```
80
+
81
+ Execution readiness:
82
+
83
+ ```text
84
+ blocked_by_dependencies
85
+ blocked_by_contract
86
+ blocked_by_workspace
87
+ ready_to_dispatch
88
+ ```
89
+
90
+ The important split: `ready` should not mean only “not blocked by deps”. It should mean the issue contract is specific enough to launch the right specialist chain.
91
+
92
+ ## Dispatchable Issue Contract
93
+
94
+ A dispatchable issue should include, either explicitly or derivable from structured fields:
95
+
96
+ ```text
97
+ PROBLEM
98
+ Current bad/missing behavior. Why work exists.
99
+
100
+ DESIRED OUTCOME
101
+ Observable behavior after completion.
102
+
103
+ SCOPE
104
+ Allowed files/modules/surfaces. Use likely scope when discovery is expected.
105
+
106
+ NON-GOALS
107
+ What must not be changed.
108
+
109
+ ACCEPTANCE CRITERIA
110
+ Concrete behavior checks, preferably user-visible or externally observable.
111
+
112
+ VALIDATION
113
+ Commands, tests, smoke path, or manual verification instructions.
114
+
115
+ CONTEXT
116
+ Relevant previous jobs, commits, issues, reports, decisions, known failures.
117
+
118
+ DEPENDENCIES
119
+ Blocking issues and why they block.
120
+
121
+ RISK
122
+ Auth/data/destructive/perf/migration/UI/security/config/etc.
123
+
124
+ SPECIALIST ROUTING
125
+ Suggested chain: explorer/debugger/executor/test-writer/test-runner/code-sanity/security-auditor/reviewer/etc.
126
+
127
+ ISSUE-LOCAL MANDATORY RULES
128
+ Extra prompt invariants appended to every job spawned from this issue.
129
+ ```
130
+
131
+ ## Contract Validator
132
+
133
+ On issue create/update, a small model should validate the contract and write a structured verdict.
134
+
135
+ Example output:
136
+
137
+ ```json
138
+ {
139
+ "contract_status": "not_ready",
140
+ "dispatch_allowed": false,
141
+ "blocking_gaps": [
142
+ "Acceptance criteria are not observable",
143
+ "Validation command missing",
144
+ "Scope mixes two unrelated runtime surfaces"
145
+ ],
146
+ "suggested_rewrite": {
147
+ "problem": "...",
148
+ "scope": "...",
149
+ "non_goals": "...",
150
+ "validation": "..."
151
+ },
152
+ "recommended_chain": ["explorer", "executor", "test-writer", "test-runner", "reviewer"]
153
+ }
154
+ ```
155
+
156
+ Dispatch should be refused when `dispatch_allowed=false` unless the orchestrator explicitly records an override reason.
157
+
158
+ ```bash
159
+ sp run executor --issue X
160
+ # refuses: contract not ready
161
+
162
+ sp run executor --issue X --allow-unready --reason "emergency prod hotfix; validation is manual"
163
+ # allowed, but override is persisted and review confidence is reduced
164
+ ```
165
+
166
+ ## Issue-Local Mandatory Rules
167
+
168
+ Global and role mandatory rules help specialists, but issue-local rules can make each job much tighter.
169
+
170
+ Example:
171
+
172
+ ```text
173
+ ISSUE_MANDATORY_RULES:
174
+ - Do not touch source files outside src/specialist/runner.ts and tests/unit/specialist.
175
+ - Preserve DB-first behavior; file fallback remains legacy-only.
176
+ - Reviewer must verify staged diff and branch-vs-base diff.
177
+ ```
178
+
179
+ At specialist spawn time, these rules should append alongside package mandatory rules, after global and role rules, so the specialist starts with exact constraints.
180
+
181
+ ## Orchestrator Guardrails
182
+
183
+ The orchestrator should behave like a workflow engine, not a heroic manual driver.
184
+
185
+ Expected loop:
186
+
187
+ 1. Read issue contract.
188
+ 2. Validate or refresh readiness verdict.
189
+ 3. Improve contract before dispatch if validator blocks.
190
+ 4. Decide specialist chain.
191
+ 5. Launch first specialist.
192
+ 6. Monitor job state and consume structured handoff.
193
+ 7. Decide next edge in the chain.
194
+ 8. Route missing tests to test-writer/test-runner.
195
+ 9. Route risky diffs to code-sanity/security-auditor.
196
+ 10. Route final diff to reviewer.
197
+ 11. File friction bugs discovered during long runs.
198
+ 12. Close only with evidence mapped to acceptance criteria.
199
+
200
+ Principles for a future `using-specialists-v4`:
201
+
202
+ ```text
203
+ 1. No specialist dispatch from vague contract.
204
+ 2. Issue contract is source of truth; job prompt is generated from it.
205
+ 3. Readiness is validated before dispatch.
206
+ 4. Orchestrator must repair contract before launching.
207
+ 5. Issue-local mandatory rules append into every job spawned from issue.
208
+ 6. Every specialist output maps back to acceptance criteria.
209
+ 7. Reviewer checks contract compliance, not vibes.
210
+ 8. Long runs are expected; orchestration must tolerate context, process, and state friction.
211
+ 9. Friction discovered during runs becomes first-class follow-up issues.
212
+ 10. Merge/close requires evidence, not completion claims.
213
+ ```
214
+
215
+ ## Long Runs as Stress Harness
216
+
217
+ Long specialist/test runs are valuable. They are not just slow validation; they are chaos engineering for orchestration.
218
+
219
+ They expose:
220
+
221
+ - context rot
222
+ - missing progress semantics
223
+ - malformed handoff JSON
224
+ - weak issue contracts
225
+ - reviewer evidence gaps
226
+ - process leaks
227
+ - stuck waiting states
228
+ - bad retry/resume semantics
229
+ - tool/runtime drift
230
+ - model-specific failure modes
231
+
232
+ Future preflight may include soak mode:
233
+
234
+ ```bash
235
+ sp preflight --soak
236
+ ```
237
+
238
+ Possible checks:
239
+
240
+ - no orphan processes
241
+ - no unconsumed jobs
242
+ - no missing timeline events
243
+ - no invalid handoff JSON
244
+ - no unresolved issue states
245
+ - reviewer can reconstruct evidence
246
+ - contract validator blocks intentionally bad issues
247
+
248
+ ## Relationship to bd
249
+
250
+ Do not replace bd now.
251
+
252
+ Near-term, bd remains the tracker and dependency store. The contract-board idea should influence orchestration docs, hooks, and specialist prompts first.
253
+
254
+ Long-term options:
255
+
256
+ 1. Build a new package that wraps bd initially, adding validator state and contract metadata.
257
+ 2. Migrate to a separate issue store only once contract runtime semantics are proven.
258
+ 3. Keep export/import compatibility so current repositories can transition gradually.
259
+
260
+ ## Near-Term Work Before the New Package
261
+
262
+ These ideas should land incrementally in current surfaces:
263
+
264
+ ### `using-specialists` / `using-specialists-v4`
265
+
266
+ - Make issue contract quality a first-class orchestration step.
267
+ - Refuse vague/title-only beads before dispatch.
268
+ - Define required bead contract fields.
269
+ - Teach orchestrator to improve a bead before launching specialists.
270
+ - Teach chain selection from issue shape.
271
+ - Treat long-run friction as source of follow-up issues.
272
+
273
+ ### `CLAUDE.md` / `AGENTS.md`
274
+
275
+ - Add issue-contract expectations for any agent creating bd issues.
276
+ - Tell agents not to dispatch specialists from vague issues.
277
+ - Require acceptance criteria, validation, non-goals, and scope for implementation beads.
278
+
279
+ ### Hooks
280
+
281
+ Potential Claude orchestrator hook set:
282
+
283
+ - On `bd create`: inspect created issue and nudge if contract is weak.
284
+ - On `bd update`: re-check when description/scope/acceptance criteria changed.
285
+ - On `specialists run` / `sp run`: block or warn if bead is not contract-ready.
286
+ - On session stop: warn about in-progress issues without contract/readiness notes.
287
+
288
+ Initial hooks should be nudges, not hard blockers, until false positives are understood.
289
+
290
+ ### Mandatory Rules
291
+
292
+ - Add compact issue-contract mandatory rule for orchestrators and planning specialists.
293
+ - Allow issue-local mandatory rules to flow into specialist prompt at job start.
294
+
295
+ ## Open Questions
296
+
297
+ - Should readiness validation be deterministic schema checks first, then small-model review?
298
+ - Where should validator verdicts live while bd remains the tracker?
299
+ - How are issue-local mandatory rules represented in bd descriptions without becoming fragile prose?
300
+ - What override levels are acceptable, and who can waive readiness?
301
+ - How does conversations/agent-mail attach clarification threads to a contract?
302
+ - Should evidence be stored as timeline events, issue comments, or a separate evidence graph?
303
+ - How much of this belongs in specialists vs a third package?
304
+
305
+ ## Non-Goals For Now
306
+
307
+ - Do not build the new issue system now.
308
+ - Do not replace bd now.
309
+ - Do not make all hooks blocking immediately.
310
+ - Do not require every small chore/doc edit to pass heavyweight validation.
311
+
312
+ The current goal is to preserve the design, then backport the most valuable constraints into existing specialist orchestration docs and prompts.
@@ -0,0 +1,220 @@
1
+ ---
2
+ title: QA Report — `@jaggerxtrm/specialists` v3.0.2
3
+ scope: qa-v3.0.2
4
+ category: reference
5
+ version: 1.0.0
6
+ updated: 2026-03-19
7
+ domain: []
8
+ ---
9
+
10
+ <!-- INDEX: auto-generated by validate_doc.py — do not edit manually -->
11
+ | Section | Summary |
12
+ |---|---|
13
+ | [Summary](#summary) | | Result | Count | |
14
+ | [Full Results](#full-results) | | ID | Description | Result | Notes | |
15
+ | [Bugs](#bugs) | **Tests:** T16, T17 |
16
+ | [Backend Note](#backend-note) | All original failures on `google-gemini-cli/gemini-3-flash-preview` (T07, T12, T13, T18 in initial runs) are **environme |
17
+ | [Hook Implementation Reference](#hook-implementation-reference) | `specialists-complete |
18
+ | [Bead Policy Reference](#bead-policy-reference) | | Specialist | Permission | Bead auto-created | |
19
+ <!-- END INDEX -->
20
+
21
+ # QA Report — `@jaggerxtrm/specialists` v3.0.2
22
+
23
+ **Date:** 2026-03-11
24
+ **Tester:** Claude Sonnet 4.6 (automated QA agent)
25
+ **Environment:** Linux 6.18.13, Node v25.2.1, Bun runtime, project `gitboard`
26
+ **Scope:** Full CLI + MCP surface, background job lifecycle, hook integration, bead integration
27
+
28
+ ---
29
+
30
+ ## Summary
31
+
32
+ | Result | Count |
33
+ |--------|-------|
34
+ | **PASS** | 23 |
35
+ | **FAIL** | 6 |
36
+ | **SKIP** | 1 |
37
+ | **Total** | 30 |
38
+
39
+ ---
40
+
41
+ ## Full Results
42
+
43
+ ### Phase 0 — Preflight
44
+
45
+ | ID | Description | Result | Notes |
46
+ |----|-------------|--------|-------|
47
+ | T01 | `specialists version` | **PASS** | Prints `@jaggerxtrm/specialists v3.0.2` |
48
+ | T02 | `specialists install` | **FAIL** | Completely silent — no output under any condition (piped, TTY, `--force`). Cannot verify hook status or count. |
49
+ | T03 | `specialists status` includes Active Jobs | **FAIL** | pi, beads, MCP sections present; Active Jobs section only renders when ≥1 job exists — absent when queue is empty. |
50
+ | T04 | `specialists list` | **PASS** | Lists 9 specialists with model and description. |
51
+ | T05 | `specialists models` | **PASS** | Lists 42 models across 5 providers (anthropic, google-gemini-cli, qwen, qwen-cli, zai). |
52
+
53
+ ### Phase 1 — Foreground Run
54
+
55
+ | ID | Description | Result | Notes |
56
+ |----|-------------|--------|-------|
57
+ | T06 | `specialists init` | **FAIL** | `.specialists/` pre-existed; `jobs/` and `ready/` subdirs not created by init (lazy-created on first background run). `.gitignore` entry confirmed. |
58
+ | T07 | Foreground run | **PASS** | `report-generator` (haiku-4-5) returned full response in 16.9 s. *gemini-3-flash-preview times out at 180 s in this environment — backend-specific, not a CLI bug.* |
59
+ | T08 | `specialists status` after T07 shows Active Jobs | **FAIL** | Active Jobs section absent when no background jobs in queue (same as T03). |
60
+
61
+ ### Phase 2 — Background Job Lifecycle
62
+
63
+ | ID | Description | Result | Notes |
64
+ |----|-------------|--------|-------|
65
+ | T09 | `--background` prints `Job started: <id>` | **PASS** | `Job started: 43221b` captured. Parent CLI exits immediately; pi subprocess continues in background. |
66
+ | T10 | `specialists status` shows active JOB_ID | **PASS** | Active Jobs table with id, specialist name, status, elapsed time. |
67
+ | T11 | `specialists feed <JOB_ID>` | **PASS** | Prints `meta`, `text`, `tool_execution_end`, `done` event lines; no crash; exit 0. |
68
+ | T12 | `specialists feed <JOB_ID> --follow` streams to "Job complete." | **PASS** | 30+ live events streamed on `init-session` job; printed `Job complete. Run: specialists result 2d7516` on completion. |
69
+ | T13 | `specialists result <JOB_ID>` prints non-empty output | **PASS** | 8,963-byte markdown report printed, exit 0. *gemini `done` jobs produce 0-byte `result.txt` — backend-specific.* |
70
+ | T14 | `specialists status --job <JOB_ID>` single-job detail | **SKIP** | `--job` flag not implemented; shows full table instead. |
71
+
72
+ ### Phase 3 — Stop / Error Path
73
+
74
+ | ID | Description | Result | Notes |
75
+ |----|-------------|--------|-------|
76
+ | T15 | `specialists stop <JOB_ID>` | **PASS** | Prints `✓ Sent SIGTERM to PID … (job …)`, exit 0. |
77
+ | T16 | `specialists result` after stop exits 1 with error message | **FAIL** | Exits 1 (correct) but prints "still running" or "still starting" — never "failed" or "error". Status file not updated post-SIGTERM. |
78
+ | T17 | `specialists feed` after stop shows error event | **FAIL** | SIGTERM kills pi process (events freeze, confirmed by EPIPE crash); `status.json` stays `"running"` forever — no error event written. |
79
+
80
+ ### Phase 4 — MCP Tool Surface
81
+
82
+ | ID | Description | Result | Notes |
83
+ |----|-------------|--------|-------|
84
+ | T18 | MCP `use_specialist` | **PASS** | `report-generator` returned non-empty result in 6.5 s. *gemini times out — backend-specific.* |
85
+ | T19 | MCP `specialist_status` | **PASS** | Returns JSON with `background_jobs` array. |
86
+ | T20 | MCP `list_specialists` | **PASS** | Returns array of 9 entries each with `name`, `model`, `description`. |
87
+ | T21 | MCP `start_specialist` description is deprecated | **PASS** | Description starts with `[DEPRECATED v3] Start a specialist asynchronously…` |
88
+
89
+ ### Phase 5 — Completion Hook
90
+
91
+ | ID | Description | Result | Notes |
92
+ |----|-------------|--------|-------|
93
+ | T22 | `ready/` empty after completed job | **FAIL** | At check time an unrelated concurrent completed job had an unconsumed marker. Hook is functional (see T23) — timing-dependent. |
94
+ | T23 | Marker created, hook injects on next message | **PASS** | Marker created on job completion; hook consumed it at next `UserPromptSubmit` and emitted correct `{"type":"inject","content":"[Specialist '...' completed …]"}`. |
95
+
96
+ ### Phase 6 — Edge Cases
97
+
98
+ | ID | Description | Result | Notes |
99
+ |----|-------------|--------|-------|
100
+ | T24 | `specialists result nonexistent` | **PASS** | Prints `No job found: nonexistent`, exit 1. |
101
+ | T25 | `specialists stop nonexistent` | **PASS** | Prints `No job found: nonexistent`, exit 1. |
102
+ | T26 | `specialists result <still-running>` | **PASS** | Prints `Job … is still starting. Use 'specialists feed --job …' to follow.`, exit 1. |
103
+ | T27 | `specialists run nonexistent-specialist` | **PASS** | Prints `Specialist not found: nonexistent-specialist`, exit 1. No stack trace. |
104
+
105
+ ### Bead Integration (supplemental)
106
+
107
+ | ID | Description | Result | Notes |
108
+ |----|-------------|--------|-------|
109
+ | B1 | MCP `use_specialist` (LOW permission) creates bead | **PASS** | `test-runner` created `forge-dz4`; auto-closed with `COMPLETE, 19373ms, anthropic/claude-haiku-4-5`. `beadId` returned in JSON response. |
110
+ | B2 | CLI `specialists run` (LOW permission) creates bead | **PASS** | `test-runner` created `forge-3hg`; `[bead: forge-3hg]` printed inline during run; `✓ bead forge-3hg 18.9s` footer on completion. |
111
+ | B3 | READ_ONLY specialists skip bead creation | **PASS** | `codebase-explorer`, `report-generator`, `init-session` produced no beads — correct per `auto` policy. |
112
+
113
+ ---
114
+
115
+ ## Bugs
116
+
117
+ ### Bug 1 — SIGTERM doesn't update job status `(HIGH)`
118
+
119
+ **Tests:** T16, T17
120
+
121
+ **Symptom:** After `specialists stop <id>`, the job's `status.json` stays `"running"` indefinitely. `specialists result` reports "still running" forever. No error event is written to `events.jsonl`.
122
+
123
+ **Root cause (confirmed via EPIPE crash log):**
124
+ `specialists run --background` forks the pi subprocess and immediately exits after printing `Job started:`. There is no persistent watcher process. When `specialists stop` sends SIGTERM to the pi PID, pi attempts to write its final event to a now-dead pipe and crashes with an unhandled EPIPE:
125
+
126
+ ```
127
+ Error: write EPIPE
128
+ at afterWriteDispatched (node:internal/stream_base_commons:159:15)
129
+ at rpc-mode.js:22 ← pi trying to emit final event
130
+ at AgentSession._emit (agent-session.js:140:13)
131
+ ```
132
+
133
+ Since no parent process is watching the pi subprocess's exit, `status.json` is never updated to `"error"` or `"cancelled"`.
134
+
135
+ **Suggested fix:** Spawn a lightweight watcher/daemon per background job that traps the pi process exit (via `SIGCHLD` or `process.on('exit')`) and writes a final `status.json` with `status: "error"` plus an error event to `events.jsonl`.
136
+
137
+ ---
138
+
139
+ ### Bug 2 — `specialists install` is completely silent `(MEDIUM)`
140
+
141
+ **Test:** T02
142
+
143
+ **Symptom:** `specialists install` produces zero output under all conditions — interactive TTY, piped, `--force` flag. Cannot verify which hooks are registered or whether anything is up to date.
144
+
145
+ **Expected:** Per-hook status lines (e.g. `○ specialists-complete.mjs — up to date`) and a final count of registered hooks.
146
+
147
+ ---
148
+
149
+ ### Bug 3 — Active Jobs section absent when queue is empty `(MEDIUM)`
150
+
151
+ **Tests:** T03, T08
152
+
153
+ **Symptom:** `specialists status` omits the Active Jobs section entirely when there are zero background jobs.
154
+
155
+ **Expected:** Active Jobs section always present, rendered empty (e.g. `── Active Jobs ─── (none)`), so users know the feature is available without needing to start a job first.
156
+
157
+ ---
158
+
159
+ ### Bug 4 — `specialists init` doesn't create `jobs/` and `ready/` subdirs `(MEDIUM)`
160
+
161
+ **Test:** T06
162
+
163
+ **Symptom:** `specialists init` does not create `.specialists/jobs/` or `.specialists/ready/`. These directories are created lazily on the first background job run.
164
+
165
+ **Expected:** `init` should create the full directory structure upfront so users can inspect the layout before running any jobs.
166
+
167
+ ---
168
+
169
+ ### Bug 5 — `specialists status --job` not implemented `(LOW)`
170
+
171
+ **Test:** T14 (SKIP)
172
+
173
+ **Symptom:** `specialists status --job <id>` shows the full status table instead of a single-job detail view with model, elapsed, bead_id fields.
174
+
175
+ ---
176
+
177
+ ### Bug 6 — `ready/` marker timing `(LOW)`
178
+
179
+ **Test:** T22
180
+
181
+ **Symptom:** Markers accumulate in `.specialists/ready/` between user messages. Checking immediately after a job completes may show stale markers from other concurrently completed jobs. The `specialists-complete.mjs` hook only fires at `UserPromptSubmit` boundaries.
182
+
183
+ **Impact:** Low — markers are always consumed correctly at the next message boundary; no data loss.
184
+
185
+ ---
186
+
187
+ ## Backend Note
188
+
189
+ All original failures on `google-gemini-cli/gemini-3-flash-preview` (T07, T12, T13, T18 in initial runs) are **environment-specific** — the gemini backend times out at 180 s on every invocation in this environment. All tests pass cleanly with `anthropic/claude-haiku-4-5`. The empty `result.txt` observed on gemini `done` jobs is also backend-specific (pi exits before writing output).
190
+
191
+ ---
192
+
193
+ ## Hook Implementation Reference
194
+
195
+ `specialists-complete.mjs` installed at `~/.claude/hooks/specialists-complete.mjs`:
196
+
197
+ - Fires on every `UserPromptSubmit`
198
+ - Reads `.specialists/ready/` for completed-job marker files
199
+ - For each marker: reads `status.json`, emits injection JSON to stdout
200
+ - Injection format: `{"type":"inject","content":"[Specialist '<name>' completed (job <id>, <n>s). Run: specialists result <id>]"}`
201
+ - Deletes marker after injection (fires once per job)
202
+ - Only `status: done` jobs create markers; errored jobs do not
203
+
204
+ ---
205
+
206
+ ## Bead Policy Reference
207
+
208
+ | Specialist | Permission | Bead auto-created |
209
+ |------------|-----------|-------------------|
210
+ | `auto-remediation` | HIGH | Yes |
211
+ | `bug-hunt` | LOW | Yes |
212
+ | `test-runner` | LOW | Yes (tested) |
213
+ | `codebase-explorer` | READ_ONLY | No |
214
+ | `feature-design` | READ_ONLY | No |
215
+ | `init-session` | READ_ONLY | No |
216
+ | `overthinker` | READ_ONLY | No |
217
+ | `parallel-review` | READ_ONLY | No |
218
+ | `report-generator` | READ_ONLY | No |
219
+
220
+ `beads_integration` is not set in any specialist YAML — all use the `auto` default (create for LOW/MEDIUM/HIGH, skip for READ_ONLY).