@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
@@ -0,0 +1,254 @@
1
+ # Test-Writer Specialist
2
+
3
+ Status: design capture. Do not implement in this task.
4
+
5
+ This document captures the proposed `test-writer` specialist: a dedicated specialist that writes behavior-first tests independently from the implementation specialist.
6
+
7
+ ## Why this exists
8
+
9
+ Implementation quality improves when code authoring, test authoring, test execution, and review are separate cognitive roles.
10
+
11
+ A single executor can write implementation and tests, but that often creates weak tests:
12
+
13
+ - tests mirror implementation details
14
+ - tests assert internal shape instead of observable behavior
15
+ - tests are written to justify the diff rather than verify the issue contract
16
+ - executor self-bias leaks into validation
17
+
18
+ A `test-writer` specialist gives the system an independent testing faculty.
19
+
20
+ It should derive tests from the bead/spec/repro and desired behavior, not from the executor's private reasoning.
21
+
22
+ ## Position in the chain
23
+
24
+ For non-trivial feature work:
25
+
26
+ ```text
27
+ planner/test-planning
28
+ → executor
29
+ → test-writer
30
+ → test-runner
31
+ → code-sanity
32
+ → reviewer
33
+ ```
34
+
35
+ For unknown-cause bugs:
36
+
37
+ ```text
38
+ debugger
39
+ → test-writer
40
+ → test-runner
41
+ → code-sanity
42
+ → reviewer
43
+ ```
44
+
45
+ For simple work, `test-writer` should be conditional rather than mandatory.
46
+
47
+ Use it when:
48
+
49
+ - new behavior was added
50
+ - bug fix needs regression coverage
51
+ - executor changed logic without tests
52
+ - reviewer finds missing coverage
53
+ - test-planning says coverage is required
54
+ - feature spans multiple layers
55
+ - acceptance criteria are behavior-heavy
56
+ - no existing test clearly covers the changed behavior
57
+
58
+ Skip it when:
59
+
60
+ - docs-only
61
+ - changelog/release-only
62
+ - formatting-only
63
+ - config-only with no harness
64
+ - existing tests already cover acceptance criteria and `test-runner` confirms
65
+
66
+ ## Relationship to existing specialists
67
+
68
+ | Role | Writes tests? | Runs tests? | Fixes production code? | Purpose |
69
+ |---|---:|---:|---:|---|
70
+ | `test-writer` | yes | targeted smoke only, if needed | no | Add or improve behavior/regression tests |
71
+ | `test-runner` | no | yes | no | Execute and classify tests |
72
+ | `executor` | maybe, when explicitly scoped | validation only | yes | Implement scoped production/doc changes |
73
+ | `debugger` | maybe regression test if seam is obvious | repro command | yes | Diagnose and fix root cause |
74
+ | `reviewer` | no | may inspect evidence | no | Judge diff/tests against contract |
75
+
76
+ Do not overload `test-runner`. It should remain low-permission and execution/classification focused.
77
+
78
+ ## Core contract
79
+
80
+ `test-writer` writes tests from the issue contract, not from implementation internals.
81
+
82
+ Inputs:
83
+
84
+ - bead/issue contract
85
+ - PRD/spec acceptance criteria, if present
86
+ - original bug repro, if any
87
+ - debugger/executor handoff
88
+ - changed diff for context only
89
+ - existing test patterns
90
+ - project test conventions
91
+
92
+ Primary source of truth order:
93
+
94
+ 1. issue contract / acceptance criteria
95
+ 2. user-visible behavior / public API
96
+ 3. original repro or failing command
97
+ 4. existing test conventions
98
+ 5. implementation diff, only to locate seams and touched behavior
99
+
100
+ The implementation diff is not the spec.
101
+
102
+ ## Mandatory behavior rules
103
+
104
+ Suggested mandatory rule set: `test-writer-behavior-first`.
105
+
106
+ ```text
107
+ - Write tests against public interfaces and observable behavior, not private implementation details.
108
+ - Derive expected behavior from bead/spec/repro, not from production diff internals.
109
+ - Do not modify production code unless explicitly authorized for a minimal test seam or fixture.
110
+ - Prefer vertical tracer bullets: one behavior test at a time.
111
+ - Convert minimized repros into regression tests when a correct seam exists.
112
+ - If no correct test seam exists, report BLOCKED with architecture/testability finding.
113
+ - Do not mock internal collaborators merely to make the current implementation easy to test.
114
+ - Preserve existing test style and project runner conventions.
115
+ - Report untested acceptance criteria explicitly.
116
+ ```
117
+
118
+ ## Anti-patterns
119
+
120
+ `test-writer` must avoid:
121
+
122
+ - testing private methods directly
123
+ - asserting internal call order unless that is public behavior
124
+ - snapshotting implementation-shaped data without user-facing meaning
125
+ - writing tests after reading only the diff
126
+ - adding broad brittle mocks to avoid real integration seams
127
+ - changing production code to satisfy tests unless explicitly allowed
128
+ - declaring coverage complete when acceptance criteria remain untested
129
+
130
+ ## Output contract
131
+
132
+ Final report should include:
133
+
134
+ ```text
135
+ STATUS: PASS | PARTIAL | BLOCKED
136
+ TESTS_CHANGED:
137
+ - path/to/test
138
+
139
+ BEHAVIORS_COVERED:
140
+ - acceptance criterion or repro case covered
141
+
142
+ UNTESTED_ACCEPTANCE_CRITERIA:
143
+ - any remaining gaps, or none
144
+
145
+ COMMANDS_TO_RUN:
146
+ - exact test command(s)
147
+
148
+ TESTABILITY_FINDINGS:
149
+ - missing seam, brittle seam, or none
150
+
151
+ PRODUCTION_CODE_CHANGED:
152
+ - no, or explicit explanation if authorized
153
+ ```
154
+
155
+ Machine-readable summary should be suitable for reviewer/test-runner consumption.
156
+
157
+ ## Testability blocker behavior
158
+
159
+ If no correct seam exists, `test-writer` should not invent shallow tests for false confidence.
160
+
161
+ It should report:
162
+
163
+ ```text
164
+ BLOCKED: no correct regression-test seam
165
+ ```
166
+
167
+ and explain:
168
+
169
+ - what behavior needs testing
170
+ - why available seams are too shallow or too coupled
171
+ - what architecture/testability follow-up is needed
172
+ - whether `overthinker` or `planner` should create a refactor/testability issue
173
+
174
+ This finding is valuable. It means the codebase architecture is preventing the bug or feature from being locked down.
175
+
176
+ ## Chain examples
177
+
178
+ ### Feature chain
179
+
180
+ ```mermaid
181
+ flowchart TD
182
+ Issue[Issue contract] --> Executor[Executor]
183
+ Executor --> TestWriter[Test-writer]
184
+ TestWriter --> TestRunner[Test-runner]
185
+ TestRunner --> CodeSanity[Code-sanity]
186
+ CodeSanity --> Reviewer[Reviewer]
187
+
188
+ TestWriter -->|missing seam| Followup[Testability follow-up]
189
+ Reviewer -->|PARTIAL/FAIL| Resume[Resume responsible specialist]
190
+ ```
191
+
192
+ ### Bug chain
193
+
194
+ ```mermaid
195
+ flowchart TD
196
+ Repro[Bug repro] --> Debugger[Debugger]
197
+ Debugger --> Fix[Root-cause fix]
198
+ Fix --> TestWriter[Test-writer]
199
+ TestWriter --> Regression[Regression test]
200
+ Regression --> TestRunner[Test-runner]
201
+ TestRunner --> Reviewer[Reviewer]
202
+ ```
203
+
204
+ ## Reviewer expectations
205
+
206
+ Reviewer should check that `test-writer`:
207
+
208
+ - read the issue/spec/repro first
209
+ - covered acceptance criteria, not just changed lines
210
+ - used public interfaces
211
+ - did not add implementation-coupled assertions
212
+ - reported gaps instead of hiding them
213
+ - provided exact commands for `test-runner`
214
+
215
+ Reviewer should not treat “tests were added” as sufficient. Tests must be meaningful against the contract.
216
+
217
+ ## Implementation notes for later
218
+
219
+ A future specialist definition should likely be:
220
+
221
+ - name: `test-writer`
222
+ - category: `testing`
223
+ - permission: `MEDIUM` or `HIGH` because it writes test files
224
+ - worktree: required
225
+ - keep-alive: useful, so reviewer can ask for coverage fixes
226
+ - model: cheaper capable coding model may be enough if contract is good
227
+ - mandatory rules:
228
+ - `test-writer-behavior-first`
229
+ - `gitnexus-required` only if modifying existing symbols or test helpers
230
+ - `serena-cheatsheet`
231
+ - `per-turn-handoff-schema`
232
+ - `bead-id-verbatim`
233
+
234
+ Possible chain update in `using-specialists`:
235
+
236
+ ```text
237
+ executor → test-writer → test-runner → code-sanity → reviewer
238
+ ```
239
+
240
+ but only when the issue shape requires independent test authoring.
241
+
242
+ ## Open questions
243
+
244
+ - Should `test-writer` be allowed to create test fixtures under production-adjacent directories?
245
+ - Should it ever change production code to expose a seam, or always file follow-up?
246
+ - Should it run targeted tests itself, or leave all execution to `test-runner`?
247
+ - Should planner automatically add a test-writer stage for feature beads with new behavior?
248
+ - Should reviewer downgrade verdict when test-writer was skipped on behavior-heavy work?
249
+
250
+ ## Summary
251
+
252
+ `test-writer` exists to decouple implementation from validation.
253
+
254
+ It should be an independent testing faculty that turns issue contracts, repros, and acceptance criteria into behavior tests. It is valuable precisely because it starts from a fresh context and does not share the executor's implementation bias.