@smartmemory/compose 0.3.6-beta → 0.3.8

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 (269) hide show
  1. package/.claude/skills/compose/SKILL.md +42 -88
  2. package/.compose-deps.json +1 -13
  3. package/README.md +72 -5
  4. package/bin/compose.js +754 -347
  5. package/bin/git-hooks/pre-push.template +29 -0
  6. package/bin/judgment-import.js +7 -0
  7. package/bin/judgment-migrate.js +387 -0
  8. package/contracts/comp-obs-contract.schema.json +9 -3
  9. package/contracts/feature-json.schema.json +5 -0
  10. package/contracts/fluid-record.schema.json +209 -0
  11. package/contracts/judgment-record.schema.json +425 -4
  12. package/contracts/lifecycle-backfill.schema.json +322 -0
  13. package/dist/assets/App-Z4MU-H_F.js +916 -0
  14. package/dist/assets/_baseUniq-ClWoCPFl.js +1 -0
  15. package/dist/assets/arc-DY26UIVo.js +1 -0
  16. package/dist/assets/architectureDiagram-Q4EWVU46-6Ggq4DqJ.js +36 -0
  17. package/dist/assets/blockDiagram-DXYQGD6D-CH3Ked0l.js +132 -0
  18. package/dist/assets/{browser-BSM23If2.js → browser-BWkrenen.js} +6 -6
  19. package/dist/assets/{c4Diagram-LMCZKHZV-DZf45Fbz.js → c4Diagram-AHTNJAMY-Bk8dYilu.js} +1 -1
  20. package/dist/assets/channel-SnZzzh7k.js +1 -0
  21. package/dist/assets/{chunk-JWPE2WC7-_7ujgd_Q.js → chunk-4BX2VUAB-BMR0XaAQ.js} +1 -1
  22. package/dist/assets/chunk-4TB4RGXK-JytR14a9.js +206 -0
  23. package/dist/assets/{chunk-XXDRQBXY-DfdVhbmA.js → chunk-55IACEB6-B4Q97BCP.js} +1 -1
  24. package/dist/assets/{chunk-VR4S4FIN-Dt9NZ67m.js → chunk-EDXVE4YY-R_qarkSf.js} +1 -1
  25. package/dist/assets/{chunk-5VM5RSS4-BY4_PV5H.js → chunk-FMBD7UC4-C9s7KR9m.js} +1 -1
  26. package/dist/assets/chunk-OYMX7WX6-BySQzVxc.js +231 -0
  27. package/dist/assets/{chunk-2Q5K7J3B-Dn1spZYu.js → chunk-QZHKN3VN-DdpSYZsW.js} +1 -1
  28. package/dist/assets/{chunk-32BRIVSS-pURGrJDk.js → chunk-YZCP3GAM-iE_tzriw.js} +1 -1
  29. package/dist/assets/classDiagram-6PBFFD2Q-CBu92dSH.js +1 -0
  30. package/dist/assets/classDiagram-v2-HSJHXN6E-CBu92dSH.js +1 -0
  31. package/dist/assets/clone-DgklGjHm.js +1 -0
  32. package/dist/assets/{cose-bilkent-JH36ORCC-BieYif4o.js → cose-bilkent-S5V4N54A-BdlU6ZX_.js} +1 -1
  33. package/dist/assets/dagre-KV5264BT-Cp3F5KTn.js +4 -0
  34. package/dist/assets/diagram-5BDNPKRD-DiR6_2q_.js +10 -0
  35. package/dist/assets/diagram-G4DWMVQ6-w0i-p5HX.js +24 -0
  36. package/dist/assets/diagram-MMDJMWI5-tIHhwUv3.js +43 -0
  37. package/dist/assets/diagram-TYMM5635-BAeY3B19.js +24 -0
  38. package/dist/assets/erDiagram-SMLLAGMA-Ckx_Knko.js +85 -0
  39. package/dist/assets/flowDiagram-DWJPFMVM-DeoNka6J.js +162 -0
  40. package/dist/assets/ganttDiagram-T4ZO3ILL-BmGnFbEg.js +292 -0
  41. package/dist/assets/gitGraphDiagram-UUTBAWPF-Dk48IHsx.js +106 -0
  42. package/dist/assets/graph-BNzKGvoy.js +1 -0
  43. package/dist/assets/graph-CI_1htl0.js +331 -0
  44. package/dist/assets/index-BEfrNBp8.js +123 -0
  45. package/dist/assets/index-yyrA5OZd.css +1 -0
  46. package/dist/assets/infoDiagram-42DDH7IO-BRf827i0.js +2 -0
  47. package/dist/assets/{ishikawaDiagram-FXEZZL3T-CzEB9fQS.js → ishikawaDiagram-UXIWVN3A-0kCZaeCM.js} +5 -5
  48. package/dist/assets/{journeyDiagram-5HDEW3XC-Bz8TCdz2.js → journeyDiagram-VCZTEJTY-rvU7ayRt.js} +1 -1
  49. package/dist/assets/{kanban-definition-HUTT4EX6-tozrMoV_.js → kanban-definition-6JOO6SKY-DpQwX1C5.js} +7 -7
  50. package/dist/assets/katex-DkKDou_j.js +257 -0
  51. package/dist/assets/layout-BI8cXFPI.js +1 -0
  52. package/dist/assets/{linear-Ck7gpa5N.js → linear-a0glcDiw.js} +1 -1
  53. package/dist/assets/min-vPHfnXcC.js +1 -0
  54. package/dist/assets/{mindmap-definition-LN4V7U3C-DTcHO0DJ.js → mindmap-definition-QFDTVHPH-D14eF-7C.js} +7 -7
  55. package/dist/assets/mobile-B7m9EO9D.js +17 -0
  56. package/dist/assets/pieDiagram-DEJITSTG-Cno-gETh.js +30 -0
  57. package/dist/assets/quadrantDiagram-34T5L4WZ-BUQM1Hfm.js +7 -0
  58. package/dist/assets/{requirementDiagram-TGXJPOKE-bnI2zJeT.js → requirementDiagram-MS252O5E-pOXlN2-q.js} +3 -3
  59. package/dist/assets/sankeyDiagram-XADWPNL6-Crynd3_b.js +10 -0
  60. package/dist/assets/sequenceDiagram-FGHM5R23-D9fZdCM8.js +157 -0
  61. package/dist/assets/stateDiagram-FHFEXIEX-CW9qVec8.js +1 -0
  62. package/dist/assets/stateDiagram-v2-QKLJ7IA2-DkVLzHbY.js +1 -0
  63. package/dist/assets/{timeline-definition-FHXFAJF6-D267GQFF.js → timeline-definition-GMOUNBTQ-BcHzhm_8.js} +3 -3
  64. package/dist/assets/vennDiagram-DHZGUBPP-BfytJcWk.js +34 -0
  65. package/dist/assets/wardley-RL74JXVD-DLj-IjyB.js +162 -0
  66. package/dist/assets/wardleyDiagram-NUSXRM2D-Ds0Ue68c.js +20 -0
  67. package/dist/assets/xychartDiagram-5P7HB3ND-vjWDXFL6.js +7 -0
  68. package/dist/index.html +3 -3
  69. package/lib/agent-string.js +7 -5
  70. package/lib/append-integrity.js +81 -0
  71. package/lib/backfill-evidence.js +109 -0
  72. package/lib/bug-escalation.js +39 -4
  73. package/lib/build-stream-schema.js +3 -1
  74. package/lib/build-stream-writer.js +25 -0
  75. package/lib/build.js +1624 -195
  76. package/lib/canon-guard.js +245 -0
  77. package/lib/canon-override.js +196 -0
  78. package/lib/canon-registry.js +291 -0
  79. package/lib/cli-commands.js +144 -0
  80. package/lib/codex-preflight.js +50 -15
  81. package/lib/colleague/context.js +215 -0
  82. package/lib/colleague/writeback.js +95 -0
  83. package/lib/completion-gate.js +1421 -0
  84. package/lib/completion-writer.js +47 -47
  85. package/lib/consumer-fanout.js +105 -11
  86. package/lib/coverage-gate.js +200 -0
  87. package/lib/dir-lock.js +170 -0
  88. package/lib/dispatch-ledger.js +301 -0
  89. package/lib/dispatch-metrics.js +236 -0
  90. package/lib/experiment-judge.js +6 -1
  91. package/lib/feature-json.js +1 -1
  92. package/lib/feature-reconciler.js +8 -0
  93. package/lib/feature-validator.js +64 -1
  94. package/lib/feature-writer.js +66 -2
  95. package/lib/fluid/factory.js +167 -0
  96. package/lib/fluid/ideabox-dates.js +73 -0
  97. package/lib/fluid/ideabox-migrate.js +154 -0
  98. package/lib/fluid/ideabox-ops.js +585 -0
  99. package/lib/fluid/ideabox-view.js +146 -0
  100. package/lib/fluid/import-ideabox.js +186 -0
  101. package/lib/fluid/local-provider.js +606 -0
  102. package/lib/fluid/provider.js +684 -0
  103. package/lib/fluid/record-shape.js +214 -0
  104. package/lib/fluid/record-store.js +328 -0
  105. package/lib/fluid/render-ideabox.js +261 -0
  106. package/lib/fluid/schema.js +40 -0
  107. package/lib/fluid/smartmemory-provider.js +1695 -0
  108. package/lib/gsd.js +63 -14
  109. package/lib/guard-cli.js +175 -0
  110. package/lib/guard-custody.js +141 -0
  111. package/lib/guard-descriptors.js +530 -0
  112. package/lib/guard-enrol.js +254 -0
  113. package/lib/health-score.js +1 -1
  114. package/lib/hooks-status.js +32 -3
  115. package/lib/ideabox-cli.js +315 -0
  116. package/lib/ideabox.js +121 -21
  117. package/lib/judgment/store/index.js +166 -0
  118. package/lib/judgment/store/records.js +184 -25
  119. package/lib/judgment/trace.js +380 -0
  120. package/lib/judgment-attest.js +259 -0
  121. package/lib/judgment-decision-write.js +277 -0
  122. package/lib/judgment-decisions.js +466 -0
  123. package/lib/judgment-gen.js +375 -22
  124. package/lib/judgment-verify.js +153 -0
  125. package/lib/judgment-writer.js +2842 -262
  126. package/lib/lane-gate.js +2 -0
  127. package/lib/lifecycle-modes.js +4 -4
  128. package/lib/lineage.js +400 -0
  129. package/lib/local-claude-connector.js +250 -54
  130. package/lib/maya-client.js +302 -0
  131. package/lib/maya-config.js +53 -0
  132. package/lib/maya-identity.js +283 -0
  133. package/lib/mcp-enforcement.js +21 -35
  134. package/lib/migrate-anon.js +5 -0
  135. package/lib/migrate-roadmap.js +15 -0
  136. package/lib/new.js +13 -1
  137. package/lib/pipeline-compat.js +104 -0
  138. package/lib/policy-catalog.js +295 -0
  139. package/lib/policy-check.js +0 -0
  140. package/lib/process-termination.js +98 -0
  141. package/lib/resolve-workspace.js +5 -1
  142. package/lib/result-normalizer.js +428 -153
  143. package/lib/review-normalize.js +4 -0
  144. package/lib/roadmap-errors.js +65 -0
  145. package/lib/roadmap-preservers.js +24 -4
  146. package/lib/roadmap-residue.js +299 -0
  147. package/lib/smartmemory-client.js +614 -78
  148. package/lib/smartmemory-config.js +54 -0
  149. package/lib/smartmemory-ingest.js +19 -2
  150. package/lib/step-prompt.js +7 -6
  151. package/lib/stratum-engine.js +53 -4
  152. package/lib/stratum-mcp-client.js +391 -31
  153. package/lib/test-bootstrap.js +31 -0
  154. package/lib/tool-inventory.js +122 -0
  155. package/lib/version-check.js +91 -19
  156. package/lib/vision-writer.js +88 -1
  157. package/package.json +7 -6
  158. package/pipelines/bug-fix.stratum.yaml +205 -211
  159. package/pipelines/build-quick.profiles.json +12 -0
  160. package/pipelines/build-quick.stratum.yaml +263 -350
  161. package/pipelines/content.stratum.yaml +81 -77
  162. package/pipelines/coverage-sweep.stratum.yaml +49 -30
  163. package/pipelines/plan.stratum.yaml +76 -86
  164. package/pipelines/refactor.stratum.yaml +125 -125
  165. package/pipelines/research.stratum.yaml +56 -58
  166. package/pipelines/review-fix.profiles.json +6 -0
  167. package/pipelines/review-fix.stratum.yaml +110 -83
  168. package/presets/team-feature.profiles.json +6 -0
  169. package/presets/team-feature.stratum.yaml +93 -66
  170. package/presets/team-research.profiles.json +6 -0
  171. package/presets/team-research.stratum.yaml +89 -80
  172. package/presets/team-review.profiles.json +8 -0
  173. package/presets/team-review.stratum.yaml +98 -80
  174. package/scripts/cost-census.mjs +70 -0
  175. package/scripts/guard-sign/compose-guard-sign.sh +62 -0
  176. package/server/agent-health.js +22 -0
  177. package/server/agent-hooks.js +14 -1
  178. package/server/agent-server.js +5 -248
  179. package/server/agent-spawn.js +3 -4
  180. package/server/agent-workspace.js +294 -0
  181. package/server/build-routes.js +6 -5
  182. package/server/build-stream-bridge.js +53 -0
  183. package/server/cc-session-watcher.js +4 -1
  184. package/server/coalescing-buffer.js +7 -1
  185. package/server/completion-projection.js +228 -0
  186. package/server/compose-mcp-tools.js +124 -24
  187. package/server/compose-mcp.js +91 -790
  188. package/server/decision-event-emit.js +41 -2
  189. package/server/decision-event-id.js +17 -0
  190. package/server/decision-events-snapshot.js +3 -0
  191. package/server/design-routes.js +14 -8
  192. package/server/feature-scan.js +76 -2
  193. package/server/file-watcher.js +170 -21
  194. package/server/ideabox-routes.js +166 -224
  195. package/server/index.js +70 -100
  196. package/server/lifecycle-guard.js +240 -10
  197. package/server/lifecycle-phase-history.js +276 -0
  198. package/server/maya-routes.js +507 -0
  199. package/server/mcp-tool-defs.js +940 -0
  200. package/server/mcp-tool-policy.js +35 -3
  201. package/server/model-tiers.js +22 -5
  202. package/server/pipeline-routes.js +21 -11
  203. package/server/project-root.js +58 -19
  204. package/server/remote-utils.js +3 -1
  205. package/server/schema-validator.js +7 -1
  206. package/server/session-manager.js +5 -6
  207. package/server/session-routes.js +3 -1
  208. package/server/stratum-client.js +57 -10
  209. package/server/stratum-sync.js +6 -3
  210. package/server/summarizer.js +3 -4
  211. package/server/supervisor.js +0 -1
  212. package/server/vision-routes.js +208 -98
  213. package/server/vision-server.js +86 -23
  214. package/server/vision-store.js +60 -6
  215. package/server/vision-utils.js +3 -4
  216. package/server/workspace-activity.js +18 -0
  217. package/server/workspace-middleware.js +2 -2
  218. package/server/workspace-runtime.js +243 -0
  219. package/server/worktree-gc.js +1 -0
  220. package/dist/assets/App-BG3ngu8H.js +0 -896
  221. package/dist/assets/abnfDiagram-VRR7QNED-CjB_sD3D.js +0 -1
  222. package/dist/assets/arc-_v4hR_uD.js +0 -1
  223. package/dist/assets/architectureDiagram-ZJ3FMSHR-DreJmzXQ.js +0 -36
  224. package/dist/assets/blockDiagram-677ZJIJ3-BG9-c0O1.js +0 -132
  225. package/dist/assets/channel-B3U5wFAT.js +0 -1
  226. package/dist/assets/chunk-EX3LRPZG-DdELs1qP.js +0 -231
  227. package/dist/assets/chunk-MOJQB5TN-D-ky35G-.js +0 -88
  228. package/dist/assets/chunk-RYQCIY6F-Dag_kVlO.js +0 -1
  229. package/dist/assets/chunk-V7JOEXUC-BtewURat.js +0 -206
  230. package/dist/assets/classDiagram-OUVF2IWQ-B6fCN-ht.js +0 -1
  231. package/dist/assets/classDiagram-v2-EOCWNBFH-B6fCN-ht.js +0 -1
  232. package/dist/assets/cynefin-VYW2F7L2-CT2BA6KE.js +0 -178
  233. package/dist/assets/cynefinDiagram-TSTJHNR4-Bh6exbyg.js +0 -62
  234. package/dist/assets/dagre-VKFMJZFB-aXMLSmQL.js +0 -4
  235. package/dist/assets/diagram-FQU43EPY-Dr7JAOuQ.js +0 -3
  236. package/dist/assets/diagram-G47NLZAW-DUvA3FQK.js +0 -24
  237. package/dist/assets/diagram-NH7WQ7WH-BQUARqcu.js +0 -24
  238. package/dist/assets/diagram-OA4YK3LP-dDUc1zHi.js +0 -30
  239. package/dist/assets/diagram-WEI45ONY-B2h5Qlb1.js +0 -41
  240. package/dist/assets/ebnfDiagram-CCIWWBDH-DThRGupB.js +0 -1
  241. package/dist/assets/erDiagram-Q63AITRT-BUCsprO2.js +0 -85
  242. package/dist/assets/flowDiagram-23GEKE2U-DXtNNi6r.js +0 -156
  243. package/dist/assets/ganttDiagram-NO4QXBWP-D4zbBHh_.js +0 -292
  244. package/dist/assets/gitGraphDiagram-IHSO6WYX-DpoQws0W.js +0 -106
  245. package/dist/assets/graph-BXPQrYYB.js +0 -331
  246. package/dist/assets/graph-C9eacEi8.js +0 -1
  247. package/dist/assets/index-3ZH5eMcZ.js +0 -119
  248. package/dist/assets/index-LIwREYgH.css +0 -1
  249. package/dist/assets/infoDiagram-FWYZ7A6U-Bbas2GAo.js +0 -2
  250. package/dist/assets/katex-C5jXJg4s.js +0 -257
  251. package/dist/assets/layout-DEXfKzaS.js +0 -1
  252. package/dist/assets/map-Czzmt4hB.js +0 -1
  253. package/dist/assets/mobile-CaoXUwAr.js +0 -17
  254. package/dist/assets/pegDiagram-2B236MQR-CHiINrNy.js +0 -1
  255. package/dist/assets/pieDiagram-ENE6RG2P-CfS4YFlR.js +0 -39
  256. package/dist/assets/quadrantDiagram-ABIIQ3AL-CadesS9w.js +0 -7
  257. package/dist/assets/railroadDiagram-RFXS5EU6-CgWEspBN.js +0 -1
  258. package/dist/assets/sankeyDiagram-HTMAVEWB-YWKFgOGw.js +0 -40
  259. package/dist/assets/sequenceDiagram-DBY2YBRQ-BvkNOyF9.js +0 -162
  260. package/dist/assets/sizeCapture-X5ZJPWSS-DlFPA2yO.js +0 -1
  261. package/dist/assets/stateDiagram-2N3HPSRC-h8NIx0kQ.js +0 -1
  262. package/dist/assets/stateDiagram-v2-6OUMAXLB-DjPgZtJ9.js +0 -1
  263. package/dist/assets/swimlanes-5IMT3BWC-CT5n22kG.js +0 -2
  264. package/dist/assets/swimlanesDiagram-G3AALYLV-Dn318Bhq.js +0 -8
  265. package/dist/assets/vennDiagram-L72KCM5P-Dj-wWLYG.js +0 -34
  266. package/dist/assets/wardleyDiagram-EHGQE667-BxCeYxkG.js +0 -78
  267. package/dist/assets/xychartDiagram-FW5EYKEG-DMFqWn7z.js +0 -7
  268. package/lib/staleness.js +0 -87
  269. package/server/ideabox-cache.js +0 -77
@@ -3,419 +3,332 @@
3
3
  # label: "Quick Feature Build"
4
4
  # description: "Trimmed build lifecycle for small additive work — design → implement → ship, single gate, Phase-7 enforcement preserved"
5
5
  # category: development
6
- # steps: 11
6
+ # steps: 16
7
7
  # estimated_minutes: 45
8
8
  #
9
9
  # COMP-BUILD-QUICK: a trimmed variant of build.stratum.yaml. Symmetric to fix
10
10
  # mode's Quick path. Collapses the full lifecycle to design → implement → ship:
11
- # prd, architecture, blueprint, verification, plan, plan_gate, and report are
11
+ # prd, architecture, blueprint, verification, plan, plan_gate and report are
12
12
  # OMITTED (not self-skipping). Phase-7 enforcement (parallel + codex review,
13
- # coverage sweep, test review) is preserved verbatim — only phase ceremony
14
- # shrinks. NOT OpenSpec's no-gates model: the design gate and ship gate remain.
13
+ # coverage sweep, generated-test review, TDD) is preserved — only phase
14
+ # ceremony shrinks.
15
15
  #
16
- # workflow.name is kept as `build` so the runner (lib/build.js extractFlowName /
17
- # step-id couplings for execute|docs|ship) sees the identical flow; only the
18
- # step list differs. Selected via `compose build --quick` template 'build-quick'.
19
-
20
- version: "0.3"
16
+ # COMP-PIPELINE-QUARANTINE: re-authored from v0.3 to TS v1, which is what makes
17
+ # `compose build --quick` runnable again. It was NOT hand-converted: it is
18
+ # DERIVED from the already-migrated build.stratum.yaml by dropping exactly the
19
+ # seven steps above, which is precisely how the two differed in v0.3 (verified by
20
+ # diffing their v0.3 ancestors — the step lists were otherwise identical).
21
+ # Deriving from the migrated sibling means the fanout, subflow and gate-revise
22
+ # constructs are the reviewed ones from that conversion rather than a second,
23
+ # independently-guessed translation of the same v0.3 source.
24
+ #
25
+ # Three edges had to be rewired after the trim, each matching the choice the v0.3
26
+ # quick spec had already made:
27
+ # - design_gate approves straight to decompose (there is no plan_gate).
28
+ # - decompose reads the design doc, since there is no plan artifact. Its
29
+ # quick-path guardrail (stop and recommend the full build if the work turns
30
+ # out to be cross-cutting) is carried over verbatim.
31
+ # - docs follows test_review, since report is gone; the codex_review and
32
+ # coverage subflows take the design doc for `blueprint` and the feature
33
+ # description for `plan`.
34
+ #
35
+ # The quick path's escalation guardrail ("stop and recommend the full build if
36
+ # this turns out to be cross-cutting") is required in BOTH explore_design and
37
+ # decompose per COMP-BUILD-QUICK's blueprint. Deriving from `build` dropped the
38
+ # explore_design one, since `build` has no such guardrail; restored after review.
39
+ #
40
+ # Attempt budgets are inherited from build.stratum.yaml deliberately: build-quick
41
+ # IS build with phases removed, so a step that survives the trim should retry
42
+ # exactly as often as its counterpart in the pipeline it was cut from. That means
43
+ # they do NOT follow the `retries + 1` rule used when converting a spec from its
44
+ # own v0.x ancestor — there is no ancestor step here, only a sibling.
21
45
 
22
- workflow:
23
- name: build
24
- description: "Quick feature build — design → implement → ship (single design gate, Phase-7 enforcement preserved)"
25
- input:
26
- featureCode:
27
- type: string
28
- required: true
29
- description:
30
- type: string
31
- required: true
32
- pre_merge_gate:
33
- type: array
34
- required: false # COMP-PAR-MERGE-QUEUE-CONSUMER-RETRY: default-OFF per-task gate (lint+build), omitted unless capabilities.preMergeGate
46
+ version: 1
35
47
 
36
48
  contracts:
37
49
  PhaseResult:
38
- phase: {type: string}
39
- artifact: {type: string}
40
- outcome: {type: string, values: [complete, skipped, failed]}
41
- summary: {type: string}
50
+ phase: string
51
+ artifact: string
52
+ outcome: complete|skipped|failed
53
+ summary: string
54
+ plan_items: array?
55
+ files_changed: string[]?
56
+ commit_hash: string?
42
57
 
43
- # Canonical review output — produced by both review_check (Codex) and parallel_review (Claude).
44
- # Schema source: compose/contracts/review-result.json (_roadmap: STRAT-CLAUDE-EFFORT-PARITY)
45
58
  ReviewResult:
46
- clean: {type: boolean}
47
- summary: {type: string}
48
- findings: {type: array}
49
- meta: {type: object}
50
- lenses_run: {type: array}
51
- auto_fixes: {type: array}
52
- asks: {type: array}
59
+ clean: boolean
60
+ summary: string
61
+ findings: array
62
+ meta: object
63
+ lenses_run: string[]
64
+ auto_fixes: array
65
+ asks: array
53
66
 
54
67
  TestResult:
55
- passing: {type: boolean}
56
- summary: {type: string}
57
- failures: {type: array}
68
+ passing: boolean
69
+ summary: string
70
+ failures: string[]
58
71
 
59
72
  TaskGraph:
60
- tasks: {type: array}
73
+ tasks: object[]
61
74
 
62
- LensTask:
63
- id: {type: string}
64
- lens_name: {type: string}
65
- lens_focus: {type: string}
66
- confidence_gate: {type: number}
67
- exclusions: {type: string}
75
+ TaskResult:
76
+ outcome: string
77
+ summary: string
78
+ files_changed: string[]?
68
79
 
69
80
  TriageResult:
70
- tasks: {type: array}
71
-
72
- functions:
73
- design_gate:
74
- mode: gate
75
- timeout: 3600
76
-
77
- ship_gate:
78
- mode: gate
79
- timeout: 1800
81
+ tasks: object[]
80
82
 
81
83
  flows:
82
- # --- Sub-flow: review ---
83
- # Single-step: codex reviews, stratum retries via ensure_failed.
84
- # Cross-agent fix (claude) is dispatched by build.js when ensure_failed
85
- # fires with a recovery_agent configured on the parent flow step.
84
+ entry: build
85
+
86
+ # Task-only subflow: cross-model implementation review.
86
87
  review_check:
87
88
  input:
88
- task: {type: string}
89
- blueprint: {type: string}
90
- output: ReviewResult
89
+ task: string
90
+ blueprint: string
91
+ reviewer_agent: string
92
+ output:
93
+ from: "${review.output}"
94
+ contract: ReviewResult
91
95
  steps:
92
96
  - id: review
93
- agent: codex
94
- intent: >
97
+ agent: "$.input.reviewer_agent"
98
+ do: >
95
99
  Review the implementation against the blueprint and task.
96
- inputs:
97
- task: "$.input.task"
98
- blueprint: "$.input.blueprint"
99
- review_mode: "true"
100
- confidence_gate: "7"
101
- output_contract: ReviewResult
100
+ Task: ${input.task}
101
+ Blueprint: ${input.blueprint}
102
+ Return the canonical ReviewResult shape.
103
+ out: ReviewResult
102
104
  ensure:
103
- - "result.clean == True"
104
- retries: 5
105
+ - expr: "result.clean == true"
106
+ attempts: 5
105
107
 
106
- # --- Sub-flow: parallel_review ---
107
- # Multi-lens review: triage selects lenses, parallel dispatch runs them,
108
- # merge deduplicates and classifies findings. Falls back to review_check
109
- # if parallel dispatch is unavailable.
110
- parallel_review:
111
- input:
112
- task: {type: string}
113
- blueprint: {type: string}
114
- diff: {type: string}
115
- output: ReviewResult
116
- steps:
117
- - id: triage
118
- agent: "claude:orchestrator"
119
- intent: >
120
- Decide which review lenses to activate.
121
-
122
- Always include diff-quality and contract-compliance.
123
- Add security if files touch auth, crypto, SQL, HTTP handlers.
124
- Add framework if detected framework files (React, Express, Next.js, etc).
125
-
126
- Return JSON: { "tasks": LensTask[] } where each task has id, lens_name,
127
- lens_focus, confidence_gate, exclusions.
128
- inputs:
129
- diff: "$.input.diff"
130
- output_contract: TriageResult
131
-
132
- - id: review_lenses
133
- type: parallel_dispatch
134
- agent: "claude:read-only-reviewer"
135
- source: "$.steps.triage.output.tasks"
136
- max_concurrent: 4
137
- isolation: none
138
- output_contract: ReviewResult
139
- intent_template: >
140
- Lens: {lens_name}. Focus: {lens_focus}.
141
- require: all
142
-
143
- - id: merge
144
- agent: "claude:orchestrator"
145
- intent: >
146
- Merge ReviewResult arrays from all lens runs into a single canonical ReviewResult.
147
- The input contains the parallel dispatch aggregate with tasks[].result for each lens.
148
- 1. Concatenate all findings arrays from completed task results.
149
- Deduplicate by file+line+lens: keep finding with highest confidence;
150
- carry over its applied_gate.
151
- 2. Recompute clean: zero must-fix AND zero should-fix findings (post-dedupe, post-gate).
152
- 3. lenses_run = IDs of lenses that produced any must-fix or should-fix finding.
153
- 4. auto_fixes = mechanical fixes (formatting, typos, simple tests).
154
- 5. asks = findings requiring human judgment.
155
- Return canonical ReviewResult with clean, summary, findings, lenses_run,
156
- auto_fixes, asks, meta.
157
- inputs:
158
- results: "$.steps.review_lenses.output"
159
- task: "$.input.task"
160
- blueprint: "$.input.blueprint"
161
- reduce_mode: "true"
162
- output_contract: ReviewResult
163
- depends_on: [review_lenses]
164
-
165
- # --- Sub-flow: coverage ---
166
- # Single-step: claude runs tests, stratum retries via ensure_failed.
167
- # Cross-agent fix is dispatched by build.js on ensure_failed.
108
+ # Task-only subflow: test generation and coverage sweep.
168
109
  coverage_check:
169
110
  input:
170
- task: {type: string}
171
- plan: {type: string}
172
- output: TestResult
111
+ task: string
112
+ plan: string
113
+ output:
114
+ from: "${run_tests.output}"
115
+ contract: TestResult
173
116
  steps:
174
117
  - id: run_tests
175
- agent: "claude::fast"
176
- intent: >
177
- Run the project test suite. Return structured JSON:
178
- { "passing": boolean, "summary": string, "failures": string[] }.
179
- inputs:
180
- task: "$.input.task"
181
- output_contract: TestResult
118
+ agent: claude
119
+ do: >
120
+ Run the project test suite for ${input.task}, following plan ${input.plan}.
121
+ Return {passing, summary, failures}.
122
+ out: TestResult
182
123
  ensure:
183
- - "result.passing == True"
184
- retries: 15
185
-
186
- # --- Sub-flow: test_review (COMP-TEST-BOOTSTRAP-4-1) ---
187
- # Reviews the test files the coverage step generated this build. The
188
- # implementation review (review/codex_review) runs BEFORE coverage, so
189
- # generated tests are never otherwise reviewed. build.js injects the exact
190
- # generated-test file list into this step's intent, and skips the step
191
- # entirely (synthetic clean stepDone) when coverage produced no test files.
192
- # ADVISORY: no blocking ensure — findings surface to the human, never fail ship.
193
- test_review:
194
- input:
195
- task: {type: string}
196
- blueprint: {type: string}
197
- output: ReviewResult
198
- steps:
199
- - id: review_generated_tests
200
- agent: codex
201
- intent: >
202
- Review the auto-generated test files listed below (written by the coverage
203
- step this build) and verify their assertions match intent. Read each file.
204
- Flag tests that are placeholders (assert true / pass with no real assertion),
205
- tautological, or assert only on mocks/stubs rather than exercising the
206
- feature's behavior. For each weak test, cite file:line and state what real
207
- assertion is missing. Do NOT flag hand-written tests or pure style. Output a
208
- canonical ReviewResult.
209
- inputs:
210
- task: "$.input.task"
211
- blueprint: "$.input.blueprint"
212
- review_mode: "true"
213
- confidence_gate: "7"
214
- # ADVISORY (COMP-TEST-BOOTSTRAP-4-1): deliberately NO output_contract and NO
215
- # ensure. A schema/postcondition failure here would trigger executeChildFlow's
216
- # blocking fix-retry path and could block ship (report→docs→ship chain through
217
- # test_review). Without either gate the step always completes; build.js captures
218
- # whatever the reviewer returns and surfaces it via the test_review stream event.
124
+ - expr: "result.passing == true"
125
+ attempts: 15
219
126
 
220
- # --- Main flow: quick feature lifecycle (design → implement → ship) ---
221
127
  build:
222
128
  input:
223
- featureCode: {type: string}
224
- description: {type: string}
225
- pre_merge_gate: {type: array} # COMP-PAR-MERGE-QUEUE-CONSUMER-RETRY: optional per-task pre-merge gate
226
- output: PhaseResult
129
+ featureCode: string
130
+ description: string
131
+ pre_merge_gate: string[]?
132
+ implementer_agent: string
133
+ reviewer_agent: string
134
+ output:
135
+ from: "${ship.output}"
136
+ contract: PhaseResult
227
137
  max_rounds: 10
228
138
  steps:
229
- # Phase: Explore & Design
230
139
  - id: explore_design
231
140
  agent: claude
232
- intent: >
233
- Explore the codebase and write a design doc for this feature.
234
- Launch 2-3 explorer subagents in parallel to map architecture,
235
- find similar features, and analyze related implementations.
236
- Write the design to docs/features/{featureCode}/design.md.
237
- Return the artifact path in the "artifact" field.
238
-
239
- QUICK-PATH GUARDRAIL: this is `compose build --quick`, scoped to small
240
- additive work (e.g. one flag + a test). If the work proves multi-file,
241
- cross-cutting, or in need of architecture/PRD-level design, STOP and
242
- recommend the user re-run with full `compose build` (no `--quick`)
243
- rather than under-scoping. Note the recommendation in the design doc.
244
- inputs:
245
- featureCode: "$.input.featureCode"
246
- description: "$.input.description"
247
- output_contract: PhaseResult
141
+ do: >
142
+ Explore the codebase and write a design doc for ${input.featureCode}.
143
+ Launch 2-3 explorer subagents in parallel to map architecture, find similar
144
+ features, and analyze related implementations. Feature: ${input.description}.
145
+ Write docs/features/${input.featureCode}/design.md and return PhaseResult.
146
+
147
+ QUICK-PATH GUARDRAIL: if the design reveals the work is actually
148
+ multi-file, cross-cutting, or architecture-dependent, STOP and recommend
149
+ the user re-run with the full `compose build` (no `--quick`) rather than
150
+ under-scoping it.
151
+ out: PhaseResult
248
152
  ensure:
249
- - "result.outcome == 'complete'"
250
- - "file_exists(result.artifact)"
251
- retries: 2
153
+ - expr: "result.outcome == 'complete'"
154
+ - expr: "file_exists(result.artifact)"
155
+ attempts: 2
252
156
 
253
- # Gate: Design review
254
157
  - id: design_gate
255
- function: design_gate
256
- on_approve: decompose
257
- on_revise: explore_design
258
- on_kill: null
259
- depends_on: [explore_design]
158
+ after: [explore_design]
159
+ gate:
160
+ on_approve: decompose
161
+ on_revise: explore_design
162
+ on_kill: null
260
163
 
261
- # Phase: Decompose — analyze the design and emit a task graph
262
- # (Quick path: no separate plan step — decompose reads the design doc directly.)
263
164
  - id: decompose
264
- type: decompose
265
165
  agent: claude
266
- intent: >
267
- Read the design doc at docs/features/{featureCode}/design.md and decompose
268
- it into independent tasks. For each task, identify files_owned (exclusive
269
- write), files_read (read-only), and depends_on (tasks that must complete first).
270
- Return a TaskGraph with the task array.
271
-
272
- QUICK-PATH GUARDRAIL: if decomposition reveals the work is actually multi-file,
273
- cross-cutting, or architecture-dependent, STOP and recommend the user re-run
274
- with full `compose build` (no `--quick`) rather than under-scoping.
275
- output_contract: TaskGraph
166
+ do: >
167
+ Read the design doc at docs/features/${input.featureCode}/design.md and
168
+ decompose it into independent tasks. For each task identify id, description,
169
+ files_owned, files_read, and depends_on. Reject file ownership conflicts.
170
+ Return {tasks}.
171
+
172
+ QUICK-PATH GUARDRAIL: if decomposition reveals the work is actually
173
+ multi-file, cross-cutting, or architecture-dependent, STOP and recommend the
174
+ user re-run with the full `compose build` (no `--quick`) rather than
175
+ under-scoping it.
176
+ out: TaskGraph
276
177
  ensure:
277
- - "no_file_conflicts(result.tasks)"
278
- - "len(result.tasks) >= 1"
279
- retries: 2
280
- depends_on: [design_gate]
178
+ - expr: "len(result.tasks) >= 1"
179
+ attempts: 2
281
180
 
282
- # Phase: Execute parallel dispatch of decomposed tasks
181
+ # v0.3 parallel_dispatch -> TS v1 consumer fanout. Compose owns worktrees,
182
+ # pre-merge commands, retained diffs, and the downstream merge handshake.
283
183
  - id: execute
284
- type: parallel_dispatch
285
- source: "$.steps.decompose.output.tasks"
184
+ after: [decompose]
185
+ attempts: 2
186
+ fanout:
187
+ over: "${decompose.output.tasks}"
188
+ dispatch: consumer
189
+ concurrency: 3
190
+ isolation: worktree
191
+ require: all
192
+ merge: sequential
193
+ pre_merge: "$.input.pre_merge_gate"
194
+ steps:
195
+ - agent: "$.input.implementer_agent"
196
+ do: >
197
+ Implement the task described by ${item} using TDD. Write the test first,
198
+ watch it fail, implement, and watch it pass. Honor the item's id,
199
+ files_owned, files_read, description, and dependency fields.
200
+ Return {outcome, summary, files_changed}.
201
+ out: TaskResult
202
+
203
+ - id: execute_merge
204
+ after: [execute]
205
+ gate:
206
+ on_approve: review_triage
207
+ on_revise: execute
208
+ on_kill: null
209
+ max_rounds: 10
210
+
211
+ # The former parallel_review subflow is flattened because TS v1 permits
212
+ # fanout only in the entry flow.
213
+ - id: review_triage
286
214
  agent: claude
287
- max_concurrent: 3
288
- isolation: worktree
289
- capture_diff: true
290
- defer_advance: true
291
- pre_merge_verify: "$.input.pre_merge_gate" # COMP-PAR-MERGE-QUEUE-CONSUMER-RETRY: optional per-task fast gate (default-OFF)
292
- require: all
293
- merge: sequential_apply
294
- intent_template: >
295
- Implement this task using TDD. Write the test first, watch it fail,
296
- implement, watch it pass.
215
+ do: >
216
+ Select review lenses for the implementation results ${execute.output}.
297
217
 
298
- Task: {task.description}
299
- You own these files (may create/modify): {task.files_owned}
300
- You may read (but NOT modify): {task.files_read}
218
+ RETRY PATH — If .compose/prior_dirty_lenses.json exists, read its JSON array.
219
+ Activate all lenses listed in that array. Always also include diff-quality
220
+ and contract-compliance. Skip all other lenses because they already passed
221
+ clean.
301
222
 
302
- Feature: {task.id}
303
- depends_on: [decompose]
223
+ FIRST RUN PATH — If .compose/prior_dirty_lenses.json does not exist, always
224
+ include diff-quality, contract-compliance, and debug-discipline. Add security
225
+ for auth, crypto, SQL, or HTTP-handler changes, and add framework for detected
226
+ framework files.
304
227
 
305
- # Sub-flow: Review (parallel multi-lens review; falls back to review_check)
306
- # Parent-step ensure retries the whole review flow after a failed result.
307
- # Quick path: review reference is the design doc (no blueprint step exists).
308
- - id: review
309
- flow: parallel_review
310
- inputs:
311
- task: "$.steps.execute.output.outcome"
312
- blueprint: "$.steps.explore_design.output.artifact"
313
- diff: "$.steps.execute.output.tasks"
314
- ensure:
315
- - "result.clean == True"
316
- depends_on: [execute]
228
+ Return {tasks}; each task must include id, lens_name, lens_focus,
229
+ confidence_gate, and exclusions.
230
+ out: TriageResult
231
+
232
+ - id: review_lenses
233
+ after: [review_triage]
234
+ fanout:
235
+ over: "${review_triage.output.tasks}"
236
+ dispatch: consumer
237
+ concurrency: 4
238
+ isolation: none
239
+ require: all
240
+ merge: sequential
241
+ steps:
242
+ - agent: claude
243
+ do: >
244
+ Run the review lens described by ${item}. Honor its lens_name,
245
+ lens_focus, confidence_gate, and exclusions fields. Return the canonical
246
+ ReviewResult shape.
247
+ out: ReviewResult
248
+
249
+ - id: review_lenses_gate
250
+ after: [review_lenses]
251
+ gate:
252
+ on_approve: review_merge
253
+ on_revise: review_triage
254
+ on_kill: null
255
+ max_rounds: 10
256
+
257
+ - id: review_merge
258
+ agent: claude
259
+ do: >
260
+ Merge ${review_lenses.output} into one canonical ReviewResult. Concatenate and
261
+ deduplicate findings by file+line+lens, keep the highest confidence, recompute
262
+ clean, set lenses_run to dirty lens ids, and classify auto_fixes and asks.
263
+ out: ReviewResult
264
+
265
+ # I1: dirty-review recovery is engine-native. review_merge cannot converge on
266
+ # its own (re-running the reducer re-merges the SAME frozen lens outputs), so
267
+ # the cleanliness decision is a GATE. Compose resolves it by policy: a clean
268
+ # merge approves; a dirty merge runs the corrective fixer, persists the dirty
269
+ # lens ids, and REVISES — the engine reroutes to review_triage, whose RETRY
270
+ # PATH reads the sidecar and re-runs only the dirty lenses on the fixed code.
271
+ - id: review_gate
272
+ after: [review_merge]
273
+ gate:
274
+ on_approve: codex_review
275
+ on_revise: review_triage
276
+ on_kill: null
277
+ max_rounds: 10
317
278
 
318
- # Sub-flow: Codex review (independent cross-model pass after Claude lenses + fixes)
319
279
  - id: codex_review
320
- flow: review_check
321
- inputs:
322
- task: "$.steps.execute.output.outcome"
323
- blueprint: "$.steps.explore_design.output.artifact"
324
- ensure:
325
- - "result.clean == True"
326
- depends_on: [review]
280
+ after: [review_gate]
281
+ run: review_check
282
+ with:
283
+ task: "${review_merge.output.summary}"
284
+ blueprint: "${explore_design.output.artifact}"
285
+ reviewer_agent: "${input.reviewer_agent}"
327
286
 
328
- # Sub-flow: Coverage (claude runs tests)
329
287
  - id: coverage
330
- flow: coverage_check
331
- inputs:
332
- task: "$.steps.execute.output.outcome"
333
- plan: "$.input.description"
334
- ensure:
335
- - "result.passing == True"
336
- depends_on: [codex_review]
288
+ after: [codex_review]
289
+ run: coverage_check
290
+ with:
291
+ task: "${input.description}"
292
+ plan: "${input.description}"
337
293
 
338
- # Sub-flow: Test review (COMP-TEST-BOOTSTRAP-4-1) review the tests the
339
- # coverage step generated this build. build.js injects the generated-test
340
- # file list into the intent, and reports a synthetic clean result (skip)
341
- # when coverage produced no test files. Advisory — never blocks ship.
294
+ # Advisory by construction: no output contract and no ensure.
342
295
  - id: test_review
343
- flow: test_review
344
- inputs:
345
- task: "$.steps.execute.output.outcome"
346
- blueprint: "$.steps.explore_design.output.artifact"
347
- depends_on: [coverage]
296
+ after: [coverage]
297
+ agent: "$.input.reviewer_agent"
298
+ do: >
299
+ Review tests generated for ${input.featureCode}. Flag placeholders,
300
+ tautologies, and assertions that only exercise mocks. Cite file:line and the
301
+ missing real assertion. This is advisory and must not block ship.
348
302
 
349
- # Phase: Update Docs
350
303
  - id: docs
304
+ after: [test_review]
351
305
  agent: claude
352
- intent: >
353
- Update project documentation for this feature. You MUST:
354
-
355
- 1. CHANGELOG.md Add an entry under today's date with the feature code
356
- and a bullet list of what was built. Read the existing format first.
357
- 2. ROADMAP.md — Find this feature's row and change its status to COMPLETE.
358
- If this completes a parent feature, update the parent header too.
359
- 3. README.md — Update ONLY if the feature changes user-facing setup,
360
- commands, or capabilities. Skip if purely internal.
361
- 4. CLAUDE.md — Update ONLY if new conventions, commands, or architecture
362
- patterns were introduced. Skip if no changes.
363
- 5. Public docs — If the feature introduces or changes any of these, update
364
- the relevant file in docs/:
365
- - New CLI commands or flags → docs/compose-one-pager.md
366
- - New connector or agent type → docs/connectors.md
367
- - New workflow or lifecycle change → docs/use-cases.md
368
- - API or config changes → docs/PRODUCT-SPEC.md
369
- Read each file before editing. Skip if the feature is purely internal
370
- with no user-facing changes.
371
-
372
- Read each file before editing. Do not skip CHANGELOG and ROADMAP —
373
- they are always required. Commit nothing — the ship step handles commits.
374
- inputs:
375
- featureCode: "$.input.featureCode"
376
- description: "$.input.description"
377
- output_contract: PhaseResult
378
- retries: 2
379
- depends_on: [test_review]
306
+ do: >
307
+ Update CHANGELOG.md and ROADMAP.md for ${input.featureCode}. Update README.md,
308
+ CLAUDE.md, and public docs only when the feature changes their documented
309
+ surfaces. Commit nothing. Return PhaseResult.
310
+ out: PhaseResult
311
+ attempts: 2
380
312
 
381
- # Phase: Ship
382
313
  - id: ship
383
- agent: "claude::critical"
384
- intent: >
385
- Final verification and commit. You MUST:
386
-
387
- 1. Run the test suite (npm test or node --test test/*.test.js).
388
- If tests fail, fix them before proceeding.
389
- 2. Run the build (npx vite build). Must pass.
390
- 3. Check git status — verify CHANGELOG.md and ROADMAP.md were updated
391
- by the docs step. If they weren't, update them now.
392
- 4. Stage all changed files for this feature (git add be explicit,
393
- never stage worktrees, pycache, or node_modules).
394
- 5. Commit with message: "feat(<featureCode>): <one-line summary>"
395
- 6. Push to remote.
396
- 7. Read docs/features/{featureCode}/design.md and extract acceptance criteria
397
- as plan_items: an array of objects { text, file, critical } where:
398
- - text is the checkbox item text
399
- - file is the backtick-quoted file path in the item (null if none)
400
- - critical is true if the item mentions MUST, required, security, or tests
401
- Use lib/plan-parser.js (parsePlanItems) to do this extraction.
402
- 8. Collect the list of files you staged as files_changed.
403
-
404
- Include plan_items and files_changed in your result JSON.
405
- Report the commit hash and files changed.
406
- inputs:
407
- featureCode: "$.input.featureCode"
408
- description: "$.input.description"
409
- output_contract: PhaseResult
410
- ensure:
411
- - "plan_completion(result.plan_items, result.files_changed)"
412
- retries: 2
413
- depends_on: [docs]
314
+ after: [docs]
315
+ agent: claude
316
+ do: >
317
+ Run the full test suite and build for ${input.featureCode}; fix failures.
318
+ Verify CHANGELOG.md and ROADMAP.md, stage only feature files, commit and push.
319
+ Parse plan acceptance criteria with lib/plan-parser.js and return PhaseResult
320
+ including plan_items, files_changed, and commit_hash.
321
+ out: PhaseResult
322
+ # C5: the judged ship ensure was removed it is unevaluable from the
323
+ # {result, input} the judge receives (it fails closed even on evidenced
324
+ # results, so real TS-default builds would plausibly die at ship). Same
325
+ # class as the F5 vocabulary ruling. Ship stays gated by ship_gate; revisit
326
+ # when a deterministic/tunable judge backend exists (stratum follow-up).
327
+ attempts: 2
414
328
 
415
- # Gate: Ship review
416
329
  - id: ship_gate
417
- function: ship_gate
418
- on_approve: null
419
- on_revise: ship
420
- on_kill: null
421
- depends_on: [ship]
330
+ after: [ship]
331
+ gate:
332
+ on_approve: null
333
+ on_revise: ship
334
+ on_kill: null