@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,146 @@
1
+ # Chain Templates — Default Catalog (operator quick-start)
2
+
3
+ > **Status:** operator quick-start to the executable `.formula.json` files in this directory.
4
+ >
5
+ > **Canonical design canon** for chain templates lives in [`docs/design/chain-templates.md`](../../chain-templates.md). That is where the canonical pipeline every production-diff chain runs (§2), the per-template resolved canonical chains (§3), the pending DevOps-gates gap (§4), composition mechanism (§5), and evolution protocol (§6) live. **Consult the canon first for design questions.** A non-maintained editorial snapshot in `substrate.html` style is at `chain-templates.html`. This README covers the operator quick-start: schema notes, pour mechanism, search-path resolution, post-pour edge helper, per-repo extension example.
6
+ >
7
+ > **Schema:** verified `bd formula` schema. Pour mechanism creates a `molecule` parent issue (the chain identity) + one bd issue per formula step as children with `parent-child` edge. `needs` produces `blocks` edges between siblings. Per-step `labels` carry role identity for the post-pour edge-wiring helper (roadmap Opportunity 5).
8
+ >
9
+ > **Reference:** `docs/design/roadmap/specialists-roadmap.md` §3 (twelve alignment opportunities), Opp 4 (`sp chain review/approve/insert`), Opp 10 (`--chain` redesign), Opp 14 (QA chain integration via `test-engineer` + `test-runner` upgrade), §12 (sp epic decoration). For substrate alignment: `docs/design/substrate/substrate.md` §6.9.10.
10
+
11
+ ## What's in this directory
12
+
13
+ **15 chain template `.formula.json` files** currently in this directory (named `<template>.formula.json`). Each uses only `[package]` tier specialists from `config/specialists/` — these are the cross-repo defaults. Per-repo overrides via `extends` can add custom specialists (see market-data example pattern below).
14
+
15
+ **2 templates are authored in the canon and now shipped as formula files**: `code-with-tests` (dual-writer for production+tests at high+ scrutiny) and `test-only` (single-writer test-engineer chain). Both are wired for the same `test-engineer` specialist via position-specific mandate text in the formula step description.
16
+
17
+ Catalog table (for full per-template detail with mermaid step diagrams, severity floors, and the canonical pipeline that wraps production-diff chains, see [`chain-templates.md` §3](../../chain-templates.md#3-the-template-catalog)):
18
+
19
+ | File | Layer-1 roles (canonical pipeline §2 wraps production-diff chains) | Use case |
20
+ |---|---|---|
21
+ | `code-quick.formula.json` | root → reviewer *(test-engineer optional/skippable at low scrutiny)* | LOW-blast trivial change (one-line fix, typo) |
22
+ | `code-standard.formula.json` | root → executor → seconder → test-engineer → test-runner → obligations-scanner → reviewer | Production diff default — canonical pipeline applies |
23
+ | `code-with-advisors.formula.json` | root → [explorer + researcher + overthinker] → executor → seconder → test-engineer → test-runner → obligations-scanner → reviewer | HIGH/CRITICAL blast — canonical pipeline applies |
24
+ | `debug.formula.json` | root → debugger (non-skippable) → seconder → test-engineer → test-runner → obligations-scanner → reviewer | Bug fix — canonical pipeline applies; regression test mandatory |
25
+ | `security-deep.formula.json` | root → security-auditor (advisor) → executor → seconder → test-engineer → test-runner → security-auditor (gate) → obligations-scanner → reviewer | Sensitive surface; SCRUTINY: critical default; security-auditor runs twice |
26
+ | `release-prep.formula.json` | root → changelog-drafter → changelog-keeper | Release prep — reconcile [Unreleased] CHANGELOG.md (meta chain, pipeline N/A) |
27
+ | `triage.formula.json` | root → explorer → overthinker | Board health (READ_ONLY, pipeline N/A) |
28
+ | `research-only.formula.json` | root → {explorer or researcher via `{{specialist}}` var} | Investigation (READ_ONLY, pipeline N/A) |
29
+ | `restitch.formula.json` | root → debugger → seconder → test-engineer → test-runner → obligations-scanner → reviewer | Conflict recovery (inherits original chain's pipeline state) |
30
+ | `planning.formula.json` | root → planner | Vague initiative → phased bd issue board (pipeline N/A) |
31
+ | `premortem.formula.json` | root → overthinker | Devil's-advocate before risky decisions (pipeline N/A) |
32
+ | `doc-sync.formula.json` | root → sync-docs | Single-document drift-aware update (pipeline N/A) |
33
+ | `memory-hygiene.formula.json` | root → memory-processor | Stale memory consolidation (pipeline N/A) |
34
+
35
+ **Canonical pipeline.** The Layer-1 shapes above are what the formula files declare. On top of Layer-1, every production-diff chain runs the **canonical pipeline** described in [canon §2](../../chain-templates.md#2-the-canonical-pipeline) — `seconder → test-engineer → test-runner → security-auditor (if sensitive) → obligations-scanner → reviewer` with Release Checklist. The canonical pipeline is not opt-in; severity (`SCRUTINY: low|medium|high|critical`) modulates which steps fire. Each template's resolved canonical chain is in [canon §3](../../chain-templates.md#3-the-template-catalog).
36
+
37
+ **Status today.** The Iron portion of the canonical pipeline (seconder gate + obligations-scanner + reviewer + auto-escalation) is **in production** via `config/skills/using-specialists-v3/SKILL.md`. The QA portion (`test-engineer` + upgraded `test-runner`) is now **wired in formula files** via epic `unitAI-f9kku` (blocked on sfwe1.1/.2 at specialist layer). Once shipped, both are canonical pipeline behavior — not "overlays." The one currently-pending piece is **DevOps gates** for operational validation ([canon §4](../../chain-templates.md#4-devops-gates--design-pending)); design fill follows in a separate session segment.
38
+
39
+ ## Shipping path
40
+
41
+ Templates land in one of three bd formula search paths (resolution order):
42
+
43
+ 1. **`<repo>/.beads/formulas/`** — per-repo, highest priority. Use for project-specific extensions (e.g. mercury's `quant-validation` extending `code-with-advisors`).
44
+ 2. **`~/.beads/formulas/`** — user-global. Use to install personal preferences.
45
+ 3. **`$GT_ROOT/.beads/formulas/`** — orchestrator-global (if `GT_ROOT` env set).
46
+
47
+ **Recommended shipping mechanism:** package these defaults into the `@jaggerxtrm/specialists` npm package and have `xt init` / `xt update` copy them to `~/.beads/formulas/` (or per-repo, behind a flag). Per-repo customizations live in `<repo>/.beads/formulas/` and `extends` the package defaults.
48
+
49
+ ## How to use a template
50
+
51
+ ```bash
52
+ # List available formulas
53
+ bd formula list
54
+
55
+ # Inspect a formula
56
+ bd formula show code-standard
57
+
58
+ # Dry-run pour (preview)
59
+ bd mol pour code-standard --dry-run --var root_title="Fix Treasury rounding" --var scope="analytics/**"
60
+
61
+ # Actual pour (creates the chain: molecule + step beads)
62
+ bd mol pour code-standard --var root_title="Fix Treasury rounding" --var scope="analytics/**"
63
+ # → returns the molecule id (this IS the chain identity)
64
+ # → produces N child beads (root step + step beads) with parent-child edges + blocks edges
65
+
66
+ # After pour: run the post-pour helper to apply semantic edges (validates/informs/etc.)
67
+ sp chain wire-edges <molecule-id>
68
+ # → reads each child's labels (role:X, edge:validates->root, etc.)
69
+ # → applies the semantic edge types beyond bd's native blocks-on
70
+ ```
71
+
72
+ ## Post-pour helper — `sp chain wire-edges`
73
+
74
+ bd formula's `needs` field only produces `blocks-on` edges (ordering). For the richer semantic edges from Opportunity 5 (`validates`, `informs`, `discovered-from`), each step's `labels` carry the intended edge type as `edge:<type>-><target-step-id>`. A small post-pour helper script applies these:
75
+
76
+ **Pseudocode:**
77
+ ```
78
+ sp chain wire-edges <molecule-id>:
79
+ for each child of <molecule-id>:
80
+ for each label matching `edge:<type>-><target>`:
81
+ target_bead_id = resolve <target> step within molecule
82
+ bd dep add <child> <target_bead_id> --type <type>
83
+ ```
84
+
85
+ The helper is ~50 LOC in shell or node. It runs immediately after `bd mol pour` (chained or called by `sp chain plan`). Idempotent: re-running is safe (bd dep add deduplicates by source+target+type).
86
+
87
+ **Why labels not formula extension:** bd formula's edge support is limited to `needs` (blocks-on). Putting edges in labels keeps formulas portable to vanilla bd while letting our helper layer richer semantics on top. When substrate lands and absorbs chain composition (§22 of friction audit), the edge information ships natively as substrate step-issue relationships — no helper needed at that point.
88
+
89
+ ## Selection logic — NOT in formula
90
+
91
+ bd formula does NOT support `applies_when` matcher fields at the formula level. The choice of WHICH template to use for a given bead lives elsewhere:
92
+
93
+ 1. **Claude Code hook on `bd create` (roadmap §4)** — detects bead type/scope/scrutiny/keywords and proposes a template. Highest-leverage layer.
94
+ 2. **`sp chain plan <bead>` (roadmap §3.1.4)** — explicit composition gate; resolves template from bead attributes; pours; wires edges.
95
+ 3. **Operator override** — `sp chain plan <bead> --template <name>` or direct `bd mol pour <template>`.
96
+
97
+ The selection matchers (scope_matches, type, scrutiny_gte, etc.) ship as a separate config file consumed by the hook + dispatcher. **One matcher language across the system** (substrate-review §18 reuse audit) — but applied at the selection layer, not encoded in each formula.
98
+
99
+ ## Per-repo extension example
100
+
101
+ Market-data extends `code-with-advisors` with `quant-methodologist` and `quant-researcher`:
102
+
103
+ ```jsonc
104
+ // ~/projects/mercury/market-data/.beads/formulas/quant-validation.formula.json
105
+ {
106
+ "formula": "quant-validation",
107
+ "type": "workflow",
108
+ "version": 1,
109
+ "description": "Per-repo quant chain extending code-with-advisors with mercury's domain specialists.",
110
+ "extends": ["code-with-advisors"],
111
+ "steps": [
112
+ {
113
+ "id": "quant-methodologist",
114
+ "title": "quant-methodologist:{{root_title}}",
115
+ "type": "task",
116
+ "needs": ["root"],
117
+ "description": "MANDATE: lock numerical methodology before executor. Define rounding policy, tick grid, statistical assumptions, real-data smoke requirements.\nINPUTS: root contract.\nOUTPUTS: methodology memo with concrete formulas/policies; required test vectors; smoke-data requirements.",
118
+ "labels": ["chain-step", "kind:step", "role:quant-methodologist", "edge:informs->root", "advisor:pre-impl"]
119
+ }
120
+ ]
121
+ }
122
+ ```
123
+
124
+ The child template's steps APPEND to parent's. Behavior: bd cook resolves parent + child steps into the full chain shape; pour creates the molecule with all steps.
125
+
126
+ ## Limitations + future evolution
127
+
128
+ 1. **`needs` is `blocks-on` only.** Semantic edges via labels + post-pour helper (above). Acceptable bridge; substrate §22 absorbs natively.
129
+ 2. **`extends` APPENDS child steps** (not prepend, not replace). To put advisors BEFORE executor when extending, the child must duplicate the executor's `needs` to depend on the new advisors. We avoided extends in defaults; per-repo extension still uses it with this caveat.
130
+ 3. **No `applies_when` in formula.** Selection logic external. Documented above.
131
+ 4. **`bd mol pour` creates a NEW molecule** every time — operator can't pour into an existing molecule. For chain insertion (Opportunity 4 `sp chain insert`), helper logic creates step beads directly and wires edges, bypassing pour. Documented in roadmap §3.1.4.
132
+ 5. **Variables substitute at pour time only.** No runtime variables; no late-binding from bd context. Fine for chain shape; selection logic handles dynamic context.
133
+
134
+ ## Cross-reference
135
+
136
+ - **Design canon (philosophy + canonical pipeline)** [`docs/design/chain-templates.md`](../../chain-templates.md) — the source-of-truth for the canonical pipeline (§2), template catalog (§3), DevOps gates design gap (§4), composition mechanism (§5), evolution protocol (§6). Non-maintained editorial snapshot: [`chain-templates.html`](../../chain-templates.html).
137
+ - **Roadmap** `docs/design/roadmap/specialists-roadmap.md`:
138
+ - §3 twelve alignment opportunities (Opp 4 `sp chain review/approve/insert`, Opp 5 step-bead conventions, Opp 10 `--chain` redesign, Opp 13 `sp stop --all` + `sp chain stop`, Opp 14 QA chain integration)
139
+ - §12 `sp epic` decoration (chain ≡ bd molecule replaces the old chain ≡ bd epic mental model where molecule auto-creates)
140
+ - Phase 6 `using-specialists-v4` SKILL (operator-facing how-to derived from the canon)
141
+ - **Substrate (background canonical future)** `docs/design/substrate/substrate.md`:
142
+ - §6.9.2 step-issues (substrate analog of step beads)
143
+ - §6.9.3 mandatory layer (substrate primitive that maps to the canonical pipeline)
144
+ - §6.9.5 composition in three moments
145
+ - §6.9.10 substrate-side catalog reference (points back at canon for full roster)
146
+ - §4.3 chain coordinator (entry-gate at container start)
@@ -0,0 +1,27 @@
1
+ {
2
+ "formula": "code-quick",
3
+ "type": "workflow",
4
+ "version": 1,
5
+ "description": "Trivial LOW-blast change — lean chain (root → reviewer). For one-line fixes, typo corrections, comment edits where operator can implement directly without an executor specialist. Reviewer validates the change against acceptance.",
6
+ "vars": {
7
+ "root_title": { "default": "Untitled work", "required": false },
8
+ "scope": { "default": "src/**", "required": false }
9
+ },
10
+ "steps": [
11
+ {
12
+ "id": "root",
13
+ "title": "{{root_title}}",
14
+ "type": "task",
15
+ "description": "PROBLEM: (fill in: what needs changing and why)\nSCOPE: {{scope}}\nNON_GOALS: (fill in: what NOT to touch)\nVALIDATION: (fill in: command that proves correctness)\nACCEPTANCE: (fill in: externally observable outcome)\n\nLOW-blast trivial change. Operator implements directly or via a one-shot executor dispatch. Reviewer validates.",
16
+ "labels": ["chain-root", "kind:root", "scrutiny:low"]
17
+ },
18
+ {
19
+ "id": "reviewer",
20
+ "title": "reviewer:{{root_title}}",
21
+ "type": "task",
22
+ "needs": ["root"],
23
+ "description": "MANDATE: review root's diff against ACCEPTANCE.\nINPUTS: root's diff (on chain branch) + root's contract.\nOUTPUTS: structured verdict (PASS | PARTIAL | FAIL) + Release Checklist. Cite file:line for findings.\nSCOPE: same as root ({{scope}}).\nNON_GOALS: no code edits; do not escalate scrutiny beyond root's declared level unless surface auto-escalation table fires.",
24
+ "labels": ["chain-step", "kind:step", "role:reviewer", "edge:validates->root"]
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,126 @@
1
+ {
2
+ "formula": "code-standard",
3
+ "type": "workflow",
4
+ "version": 1,
5
+ "description": "Production-diff default chain (Iron pipeline + QA). root → executor → seconder → test-engineer → test-runner → obligations-scanner → reviewer. For type=task/bug with scrutiny>=medium. security-auditor is dispatched separately if scope hits sensitive surface (auth/secrets/migrations/etc.) — see security-deep template for embedded variant.",
6
+ "vars": {
7
+ "root_title": {
8
+ "default": "Untitled work",
9
+ "required": false
10
+ },
11
+ "scope": {
12
+ "default": "src/**",
13
+ "required": false
14
+ },
15
+ "scrutiny": {
16
+ "default": "medium",
17
+ "required": false
18
+ }
19
+ },
20
+ "steps": [
21
+ {
22
+ "id": "root",
23
+ "title": "{{root_title}}",
24
+ "type": "task",
25
+ "description": "PROBLEM: (fill in: what needs implementing and why)\nSCOPE: {{scope}}\nNON_GOALS: (fill in)\nVALIDATION: (fill in: tests/commands that prove correctness)\nACCEPTANCE: (fill in: externally observable outcome)\n\nProduction-diff scrutiny: {{scrutiny}}. Iron pipeline applies (seconder + obligations-scanner mandatory; reviewer may auto-escalate scrutiny on surface match).",
26
+ "labels": [
27
+ "chain-root",
28
+ "kind:root",
29
+ "scrutiny:{{scrutiny}}"
30
+ ]
31
+ },
32
+ {
33
+ "id": "executor",
34
+ "title": "executor:{{root_title}}",
35
+ "type": "task",
36
+ "needs": [
37
+ "root"
38
+ ],
39
+ "description": "MANDATE: implement root's deliverable per its contract.\nINPUTS: root's PROBLEM/SCOPE/ACCEPTANCE/VALIDATION; existing code in {{scope}}.\nOUTPUTS: diff on chain branch satisfying ACCEPTANCE; tests passing per VALIDATION; obligations discipline (no unstructured TODO/FIXME in production; structured `// TODO(<bead-id>):` only when bead-tracked in NON_GOALS).\nSCOPE: same as root ({{scope}}).\nNON_GOALS: no `--no-verify`; no edits outside SCOPE; no merge.",
40
+ "labels": [
41
+ "chain-step",
42
+ "kind:step",
43
+ "role:executor",
44
+ "edge:implements->root"
45
+ ]
46
+ },
47
+ {
48
+ "id": "seconder",
49
+ "title": "seconder:{{root_title}}",
50
+ "type": "task",
51
+ "needs": [
52
+ "executor"
53
+ ],
54
+ "description": "MANDATE: fused scope/compliance + quality gate on executor's diff.\nINPUTS: executor's diff; root contract.\nOUTPUTS: verdict JSON with scope_verdict, scope_findings, quality_verdict, quality_findings, overall_verdict.\nSCOPE: same as root.\nNON_GOALS: no edits.",
55
+ "labels": [
56
+ "chain-step",
57
+ "kind:step",
58
+ "role:seconder",
59
+ "edge:validates->executor",
60
+ "gate:mandatory"
61
+ ]
62
+ },
63
+ {
64
+ "id": "test-engineer",
65
+ "title": "test-engineer:{{root_title}}",
66
+ "type": "task",
67
+ "needs": [
68
+ "seconder"
69
+ ],
70
+ "description": "MANDATE: write tests against the actual diff.\nINPUTS: executor's diff; seconder verdict; root contract.\nOUTPUTS: tests, fixtures, smoke scripts, telemetry assertions, exact test-runner commands.\nSCOPE: test paths plus diff-adjacent harness code.\nNON_GOALS: no production source edits unless root explicitly authorizes helper/export change.",
71
+ "labels": [
72
+ "chain-step",
73
+ "kind:step",
74
+ "role:test-engineer",
75
+ "edge:validates->executor"
76
+ ]
77
+ },
78
+ {
79
+ "id": "test-runner",
80
+ "title": "test-runner:{{root_title}}",
81
+ "type": "task",
82
+ "needs": [
83
+ "test-engineer"
84
+ ],
85
+ "description": "MANDATE: execute exact commands supplied by test-engineer and classify failures by owner.\nINPUTS: exact commands; tests; telemetry assertions.\nOUTPUTS: pass/fail counts, artifact evidence, owner routing, rerun guidance.\nSCOPE: requested commands only; fallback must be labeled.\nNON_GOALS: no edits; no scope expansion.",
86
+ "labels": [
87
+ "chain-step",
88
+ "kind:step",
89
+ "role:test-runner",
90
+ "gate:mandatory"
91
+ ]
92
+ },
93
+ {
94
+ "id": "obligations-scanner",
95
+ "title": "obligations-scanner:{{root_title}}",
96
+ "type": "task",
97
+ "needs": [
98
+ "test-runner"
99
+ ],
100
+ "description": "MANDATE: scan executor's diff for unstructured TODO/FIXME/HACK/XXX/TEMP/WIP/NOTE(release) markers in production code.\nINPUTS: executor's diff.\nOUTPUTS: structured JSON: CLEAN | OBLIGATIONS_FOUND | BLOCKED. Distinguish production vs test/fixture surface; distinguish TRACKED `// TODO(<bead-id>):` vs UNTRACKED.\nSCOPE: same as root.\nNON_GOALS: no edits; reviewer enforces, scanner only reports.",
101
+ "labels": [
102
+ "chain-step",
103
+ "kind:step",
104
+ "role:obligations-scanner",
105
+ "edge:validates->executor",
106
+ "gate:mandatory"
107
+ ]
108
+ },
109
+ {
110
+ "id": "reviewer",
111
+ "title": "reviewer:{{root_title}}",
112
+ "type": "task",
113
+ "needs": [
114
+ "obligations-scanner"
115
+ ],
116
+ "description": "MANDATE: compliance reviewer + adversarial code-quality auditor. Iron-aware: SCRUTINY={{scrutiny}}, may auto-escalate on sensitive-surface match.\nINPUTS: executor diff + seconder verdict + test evidence + obligations-scanner output + root contract.\nOUTPUTS: verdict PASS|PARTIAL|FAIL + machine-readable Release Checklist. PARTIAL triggers ddiff re-review after fix.\nSCOPE: same as root.\nNON_GOALS: no edits; do not waive mandatory gates.",
117
+ "labels": [
118
+ "chain-step",
119
+ "kind:step",
120
+ "role:reviewer",
121
+ "edge:validates->root",
122
+ "gate:final"
123
+ ]
124
+ }
125
+ ]
126
+ }
@@ -0,0 +1,128 @@
1
+ {
2
+ "formula": "code-with-advisors",
3
+ "type": "workflow",
4
+ "version": 1,
5
+ "description": "HIGH/CRITICAL blast or unknown approach. Adds explorer + researcher + overthinker as parallel advisors BEFORE executor. Includes seconder + QA pipeline after executor.",
6
+ "vars": {
7
+ "root_title": {
8
+ "default": "Untitled work",
9
+ "required": false
10
+ },
11
+ "scope": {
12
+ "default": "src/**",
13
+ "required": false
14
+ },
15
+ "scrutiny": {
16
+ "default": "high",
17
+ "required": false
18
+ }
19
+ },
20
+ "steps": [
21
+ {
22
+ "id": "root",
23
+ "title": "{{root_title}}",
24
+ "type": "task",
25
+ "description": "PROBLEM: (fill in: what needs implementing and why)\nSCOPE: {{scope}}\nNON_GOALS: (fill in)\nVALIDATION: (fill in)\nACCEPTANCE: (fill in: externally observable outcome)\n\nHIGH/CRITICAL blast. Three parallel advisors (explorer + researcher + overthinker) prep before executor implements. Full Iron pipeline gates apply.",
26
+ "labels": [
27
+ "chain-root",
28
+ "kind:root",
29
+ "scrutiny:{{scrutiny}}"
30
+ ]
31
+ },
32
+ {
33
+ "id": "executor",
34
+ "title": "executor:{{root_title}}",
35
+ "type": "task",
36
+ "needs": [
37
+ "explorer",
38
+ "researcher",
39
+ "overthinker"
40
+ ],
41
+ "description": "MANDATE: implement root's deliverable per its contract, informed by advisor evidence.\nINPUTS: root contract + explorer findings + researcher evidence (if dispatched) + overthinker recommendations.\nOUTPUTS: diff on chain branch satisfying ACCEPTANCE; tests per VALIDATION; obligations discipline.\nSCOPE: same as root.\nNON_GOALS: no `--no-verify`; no scope creep; no merge.",
42
+ "labels": [
43
+ "chain-step",
44
+ "kind:step",
45
+ "role:executor",
46
+ "edge:implements->root"
47
+ ]
48
+ },
49
+ {
50
+ "id": "seconder",
51
+ "title": "seconder:{{root_title}}",
52
+ "type": "task",
53
+ "needs": [
54
+ "executor"
55
+ ],
56
+ "description": "MANDATE: fused scope/compliance + quality gate on executor's diff.\nINPUTS: executor's diff; root contract.\nOUTPUTS: verdict JSON with scope_verdict, scope_findings, quality_verdict, quality_findings, overall_verdict.\nSCOPE: same as root.\nNON_GOALS: no edits.",
57
+ "labels": [
58
+ "chain-step",
59
+ "kind:step",
60
+ "role:seconder",
61
+ "edge:validates->executor",
62
+ "gate:mandatory"
63
+ ]
64
+ },
65
+ {
66
+ "id": "test-engineer",
67
+ "title": "test-engineer:{{root_title}}",
68
+ "type": "task",
69
+ "needs": [
70
+ "seconder"
71
+ ],
72
+ "description": "MANDATE: write tests against the actual diff.\nINPUTS: executor's diff; seconder verdict; root contract.\nOUTPUTS: tests, fixtures, smoke scripts, telemetry assertions, exact test-runner commands.\nSCOPE: test paths plus diff-adjacent harness code.\nNON_GOALS: no production source edits unless root explicitly authorizes helper/export change.",
73
+ "labels": [
74
+ "chain-step",
75
+ "kind:step",
76
+ "role:test-engineer",
77
+ "edge:validates->executor"
78
+ ]
79
+ },
80
+ {
81
+ "id": "test-runner",
82
+ "title": "test-runner:{{root_title}}",
83
+ "type": "task",
84
+ "needs": [
85
+ "test-engineer"
86
+ ],
87
+ "description": "MANDATE: execute exact commands supplied by test-engineer and classify failures by owner.\nINPUTS: exact commands; tests; telemetry assertions.\nOUTPUTS: pass/fail counts, artifact evidence, owner routing, rerun guidance.\nSCOPE: requested commands only; fallback must be labeled.\nNON_GOALS: no edits; no scope expansion.",
88
+ "labels": [
89
+ "chain-step",
90
+ "kind:step",
91
+ "role:test-runner",
92
+ "gate:mandatory"
93
+ ]
94
+ },
95
+ {
96
+ "id": "obligations-scanner",
97
+ "title": "obligations-scanner:{{root_title}}",
98
+ "type": "task",
99
+ "needs": [
100
+ "test-runner"
101
+ ],
102
+ "description": "MANDATE: scan executor's diff for unstructured markers in production code.\nINPUTS: executor's diff.\nOUTPUTS: CLEAN | OBLIGATIONS_FOUND | BLOCKED.\nSCOPE: same as root.\nNON_GOALS: no edits.",
103
+ "labels": [
104
+ "chain-step",
105
+ "kind:step",
106
+ "role:obligations-scanner",
107
+ "edge:validates->executor",
108
+ "gate:mandatory"
109
+ ]
110
+ },
111
+ {
112
+ "id": "reviewer",
113
+ "title": "reviewer:{{root_title}}",
114
+ "type": "task",
115
+ "needs": [
116
+ "obligations-scanner"
117
+ ],
118
+ "description": "MANDATE: compliance reviewer + adversarial code-quality auditor at SCRUTINY={{scrutiny}}.\nINPUTS: executor diff + seconder verdict + test evidence + obligations-scanner output + advisor findings + root contract.\nOUTPUTS: verdict PASS|PARTIAL|FAIL + Release Checklist. PARTIAL triggers ddiff re-review.\nSCOPE: same as root.\nNON_GOALS: no edits; do not waive mandatory gates.",
119
+ "labels": [
120
+ "chain-step",
121
+ "kind:step",
122
+ "role:reviewer",
123
+ "edge:validates->root",
124
+ "gate:final"
125
+ ]
126
+ }
127
+ ]
128
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "formula": "code-with-tests",
3
+ "type": "workflow",
4
+ "version": 1,
5
+ "description": "Dual-writer chain for production-touching diffs at high+ scrutiny. Executor writes production diff, test-engineer writes tests against the actual diff, seconder validates scope+quality, then test-runner executes. Planned secondary-writer mode for test-engineer.",
6
+ "vars": {
7
+ "root_title": { "default": "Untitled work", "required": false },
8
+ "scope": { "default": "src/**", "required": false },
9
+ "scrutiny": { "default": "high", "required": false }
10
+ },
11
+ "steps": [
12
+ {
13
+ "id": "root",
14
+ "title": "{{root_title}}",
15
+ "type": "task",
16
+ "description": "PROBLEM: (fill in: what needs implementing and why)\nSCOPE: {{scope}}\nNON_GOALS: (fill in)\nVALIDATION: (fill in)\nACCEPTANCE: (fill in: externally observable outcome)\n\nHigh-blast production diff. Executor writes production changes first; test-engineer follows as secondary writer with tests that validate the diff.",
17
+ "labels": ["chain-root", "kind:root", "scrutiny:{{scrutiny}}"]
18
+ },
19
+ {
20
+ "id": "executor",
21
+ "title": "executor:{{root_title}}",
22
+ "type": "task",
23
+ "needs": ["root"],
24
+ "description": "MANDATE: implement root's deliverable per its contract.\nINPUTS: root's PROBLEM/SCOPE/ACCEPTANCE/VALIDATION; existing code in {{scope}}.\nOUTPUTS: diff on chain branch satisfying ACCEPTANCE; obligations discipline.\nSCOPE: same as root ({{scope}}).\nNON_GOALS: no `--no-verify`; no edits outside SCOPE; no merge.",
25
+ "labels": ["chain-step", "kind:step", "role:executor", "edge:implements->root"]
26
+ },
27
+ {
28
+ "id": "seconder",
29
+ "title": "seconder:{{root_title}}",
30
+ "type": "task",
31
+ "needs": ["executor"],
32
+ "description": "MANDATE: fused scope/compliance + quality gate on executor's diff.\nINPUTS: executor's diff; root contract.\nOUTPUTS: verdict JSON with scope_verdict, scope_findings, quality_verdict, quality_findings, overall_verdict.\nSCOPE: same as root.\nNON_GOALS: no edits.",
33
+ "labels": ["chain-step", "kind:step", "role:seconder", "edge:validates->executor", "gate:mandatory"]
34
+ },
35
+ {
36
+ "id": "test-engineer",
37
+ "title": "test-engineer:{{root_title}}",
38
+ "type": "task",
39
+ "needs": ["seconder"],
40
+ "description": "MANDATE: you are the secondary writer after the executor; write tests that validate their production diff.\nINPUTS: executor's diff; seconder verdict; root contract.\nOUTPUTS: tests, fixtures, smoke scripts, telemetry assertions, exact test-runner commands.\nSCOPE: test paths plus diff-adjacent harness code.\nNON_GOALS: no production source edits unless root explicitly authorizes helper/export change.",
41
+ "labels": ["chain-step", "kind:step", "role:test-engineer", "edge:validates->executor", "position:secondary-writer"]
42
+ },
43
+ {
44
+ "id": "test-runner",
45
+ "title": "test-runner:{{root_title}}",
46
+ "type": "task",
47
+ "needs": ["test-engineer"],
48
+ "description": "MANDATE: execute exact commands supplied by test-engineer and classify failures by owner.\nINPUTS: exact commands; tests; telemetry assertions.\nOUTPUTS: pass/fail counts, artifact evidence, owner routing, rerun guidance.\nSCOPE: requested commands only; fallback must be labeled.\nNON_GOALS: no edits; no scope expansion.",
49
+ "labels": ["chain-step", "kind:step", "role:test-runner", "gate:mandatory"]
50
+ },
51
+ {
52
+ "id": "security-auditor",
53
+ "title": "security-auditor:{{root_title}}",
54
+ "type": "task",
55
+ "needs": ["test-runner"],
56
+ "description": "MANDATE: LOW-permission validation pass after test-runner for sensitive surfaces.\nINPUTS: executor diff; test evidence; root contract.\nOUTPUTS: verdict OK or FINDINGS.\nSCOPE: same as root.\nNON_GOALS: no edits; no exploits.",
57
+ "labels": ["chain-step", "kind:step", "role:security-auditor", "edge:validates->executor", "gate:mandatory", "optional:sensitive"]
58
+ },
59
+ {
60
+ "id": "obligations-scanner",
61
+ "title": "obligations-scanner:{{root_title}}",
62
+ "type": "task",
63
+ "needs": ["security-auditor"],
64
+ "description": "MANDATE: scan executor's diff for unstructured markers in production code.\nINPUTS: executor's diff.\nOUTPUTS: CLEAN | OBLIGATIONS_FOUND | BLOCKED.\nSCOPE: same as root.\nNON_GOALS: no edits; reviewer enforces, scanner only reports.",
65
+ "labels": ["chain-step", "kind:step", "role:obligations-scanner", "edge:validates->executor", "gate:mandatory"]
66
+ },
67
+ {
68
+ "id": "reviewer",
69
+ "title": "reviewer:{{root_title}}",
70
+ "type": "task",
71
+ "needs": ["obligations-scanner"],
72
+ "description": "MANDATE: compliance reviewer + adversarial code-quality auditor at SCRUTINY={{scrutiny}}; findings_per_writer attribution required.\nINPUTS: executor diff + seconder verdict + test evidence + obligations-scanner output + root contract.\nOUTPUTS: verdict PASS|PARTIAL|FAIL + Release Checklist.\nSCOPE: same as root.\nNON_GOALS: no edits; do not waive mandatory gates.",
73
+ "labels": ["chain-step", "kind:step", "role:reviewer", "edge:validates->root", "gate:final"]
74
+ }
75
+ ]
76
+ }
@@ -0,0 +1,128 @@
1
+ {
2
+ "formula": "debug",
3
+ "type": "workflow",
4
+ "version": 1,
5
+ "description": "Bug-fix chain. Debugger is non-skippable opener; Iron pipeline gates + QA apply after debugger's fix lands.",
6
+ "vars": {
7
+ "root_title": {
8
+ "default": "Untitled bug",
9
+ "required": false
10
+ },
11
+ "scope": {
12
+ "default": "src/**",
13
+ "required": false
14
+ },
15
+ "scrutiny": {
16
+ "default": "medium",
17
+ "required": false
18
+ }
19
+ },
20
+ "steps": [
21
+ {
22
+ "id": "root",
23
+ "title": "{{root_title}}",
24
+ "type": "bug",
25
+ "description": "PROBLEM: (symptom; failing test; regression; error message)\nSCOPE: {{scope}}\nNON_GOALS: (fill in)\nVALIDATION: (failing test that should pass after fix)\nACCEPTANCE: (symptom no longer reproduces; regression test stays green)\n\nBug fix. Debugger is non-skippable opener; do NOT dispatch executor here — executor is for adding features, debugger is for symptom investigation + targeted fix + verification.",
26
+ "labels": [
27
+ "chain-root",
28
+ "kind:root",
29
+ "type:bug",
30
+ "scrutiny:{{scrutiny}}"
31
+ ]
32
+ },
33
+ {
34
+ "id": "debugger",
35
+ "title": "debugger:{{root_title}}",
36
+ "type": "task",
37
+ "needs": [
38
+ "root"
39
+ ],
40
+ "description": "MANDATE: root-cause specialist. Diagnose symptom, trace, fix targeted code, verify regression test passes.\nINPUTS: root's PROBLEM + failing test + repro steps.\nOUTPUTS: root-cause analysis + minimal-diff fix + passing regression test on chain branch.\nSCOPE: same as root ({{scope}}); broaden only when root cause requires.\nNON_GOALS: no scope creep; no refactoring beyond fix; no `--no-verify`.",
41
+ "labels": [
42
+ "chain-step",
43
+ "kind:step",
44
+ "role:debugger",
45
+ "edge:implements->root",
46
+ "non-skippable:true"
47
+ ]
48
+ },
49
+ {
50
+ "id": "seconder",
51
+ "title": "seconder:{{root_title}}",
52
+ "type": "task",
53
+ "needs": [
54
+ "debugger"
55
+ ],
56
+ "description": "MANDATE: fused scope/compliance + quality gate on debugger's diff.\nINPUTS: debugger's diff; root contract.\nOUTPUTS: verdict JSON with scope_verdict, scope_findings, quality_verdict, quality_findings, overall_verdict.\nSCOPE: same as root.\nNON_GOALS: no edits.",
57
+ "labels": [
58
+ "chain-step",
59
+ "kind:step",
60
+ "role:seconder",
61
+ "edge:validates->debugger",
62
+ "gate:mandatory"
63
+ ]
64
+ },
65
+ {
66
+ "id": "test-engineer",
67
+ "title": "test-engineer:{{root_title}}",
68
+ "type": "task",
69
+ "needs": [
70
+ "seconder"
71
+ ],
72
+ "description": "MANDATE: write tests against the actual diff.\nINPUTS: debugger's diff; seconder verdict; root contract.\nOUTPUTS: tests, fixtures, smoke scripts, telemetry assertions, exact test-runner commands.\nSCOPE: test paths plus diff-adjacent harness code.\nNON_GOALS: no production source edits unless root explicitly authorizes helper/export change.",
73
+ "labels": [
74
+ "chain-step",
75
+ "kind:step",
76
+ "role:test-engineer",
77
+ "edge:validates->debugger"
78
+ ]
79
+ },
80
+ {
81
+ "id": "test-runner",
82
+ "title": "test-runner:{{root_title}}",
83
+ "type": "task",
84
+ "needs": [
85
+ "test-engineer"
86
+ ],
87
+ "description": "MANDATE: execute exact commands supplied by test-engineer and classify failures by owner.\nINPUTS: exact commands; tests; telemetry assertions.\nOUTPUTS: pass/fail counts, artifact evidence, owner routing, rerun guidance.\nSCOPE: requested commands only; fallback must be labeled.\nNON_GOALS: no edits; no scope expansion.",
88
+ "labels": [
89
+ "chain-step",
90
+ "kind:step",
91
+ "role:test-runner",
92
+ "gate:mandatory"
93
+ ]
94
+ },
95
+ {
96
+ "id": "obligations-scanner",
97
+ "title": "obligations-scanner:{{root_title}}",
98
+ "type": "task",
99
+ "needs": [
100
+ "test-runner"
101
+ ],
102
+ "description": "MANDATE: scan debugger's diff for unstructured markers in production code.\nINPUTS: debugger's diff.\nOUTPUTS: CLEAN | OBLIGATIONS_FOUND | BLOCKED.\nSCOPE: same as root.\nNON_GOALS: no edits.",
103
+ "labels": [
104
+ "chain-step",
105
+ "kind:step",
106
+ "role:obligations-scanner",
107
+ "edge:validates->debugger",
108
+ "gate:mandatory"
109
+ ]
110
+ },
111
+ {
112
+ "id": "reviewer",
113
+ "title": "reviewer:{{root_title}}",
114
+ "type": "task",
115
+ "needs": [
116
+ "obligations-scanner"
117
+ ],
118
+ "description": "MANDATE: compliance reviewer at SCRUTINY={{scrutiny}}; debugger-restitch ddiff mode on PARTIAL.\nINPUTS: debugger diff + seconder verdict + obligations-scanner output + root contract.\nOUTPUTS: verdict PASS|PARTIAL|FAIL + Release Checklist.\nSCOPE: same as root.\nNON_GOALS: no edits.",
119
+ "labels": [
120
+ "chain-step",
121
+ "kind:step",
122
+ "role:reviewer",
123
+ "edge:validates->root",
124
+ "gate:final"
125
+ ]
126
+ }
127
+ ]
128
+ }