@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
@@ -6,7 +6,7 @@
6
6
  # steps: 7
7
7
  # estimated_minutes: 45
8
8
 
9
- version: "0.1"
9
+ version: 1
10
10
 
11
11
  # refactor pipeline
12
12
  #
@@ -16,154 +16,154 @@ version: "0.1"
16
16
  # 3. plan — write a step-by-step refactoring plan
17
17
  # 4. execute — apply refactoring changes incrementally
18
18
  # 5. test — run full test suite, compare against snapshot
19
- # 6. review — codex reviews refactored code for correctness
19
+ # 6. review — cross-model review of the refactored code for correctness
20
20
  # 7. ship — commit and report
21
21
  #
22
- # Inputs:
23
- # task what to refactor (module, pattern, or scope description)
22
+ # COMP-PIPELINE-QUARANTINE: re-authored from v0.1 to TS v1. Linear chain, no
23
+ # gates or backward routing. `retries: N` -> `attempts: N + 1` (v0.1 counted
24
+ # retries AFTER the first try). The `outcome` enum moved into the contract.
25
+ # review declares `agent: codex` so the cross-model pass the header always
26
+ # promised is an actual dispatch rather than a hope.
24
27
  #
25
- # Usage:
26
- # stratum_plan <this yaml> "refactor" {"task": "..."}
28
+ #
29
+ # COMP-PIPELINE-QUARANTINE round 2: the flow input is the RUNNER's envelope, not
30
+ # a bespoke `task`. runBuild derives plan inputs from the MODE, not from the spec
31
+ # (lib/build.js startFresh), and feature mode always sends
32
+ # {featureCode, description, implementer_agent, reviewer_agent} plus an optional
33
+ # pre_merge_gate. Declaring `task` meant this spec resolved but could never plan —
34
+ # making it reachable via `--template` without this change just moved the failure
35
+ # from "not found" to a failed run. `${input.description}` carries what `task` did.
36
+ # Inputs (the runner's feature envelope):
37
+ # featureCode — the feature/work code
38
+ # description — what to do; this is what the old `task` input carried
27
39
 
28
40
  contracts:
29
41
  RefactorResult:
30
- phase: {type: string}
31
- summary: {type: string}
32
- outcome: {type: string, values: [complete, failed]}
42
+ phase: string
43
+ summary: string
44
+ outcome: complete|skipped|failed # `skipped` is reachable: compose offers an interactive skip
45
+
46
+ # The `ship` step is INTERCEPTED by compose (lib/build.js shouldInterceptShip:
47
+ # any step named `ship` outside plan mode), which submits this shape regardless
48
+ # of what the spec declares. It is a SEPARATE contract, not extra optional
49
+ # fields on the pipeline's own result: outputFieldsToJsonSchema marks every
50
+ # declared field required and ignores `?`, so widening the shared contract
51
+ # would instruct every other step to return commit metadata it has no business
52
+ # producing. Third instance of this defect class; see COMP-SHIP-CONTRACT.
53
+ ShipResult:
54
+ phase: string
55
+ artifact: string
56
+ outcome: complete|skipped|failed
57
+ summary: string
58
+ files_changed: string[]?
59
+ commit_hash: string?
33
60
 
34
61
  TestResult:
35
- passing: {type: boolean}
36
- summary: {type: string}
37
- failures: {type: array}
38
-
62
+ passing: boolean
63
+ summary: string
64
+ failures: string[]
65
+
66
+ # CANONICAL ReviewResult — STRAT-CLAUDE-EFFORT-PARITY. It MUST carry meta,
67
+ # lenses_run, auto_fixes and asks even though this pipeline never sets them by
68
+ # hand: compose enables review normalization for any step whose out contract is
69
+ # NAMED ReviewResult (deriveOrdinaryReviewScaffold), and the normalizer always
70
+ # stamps those four fields. Engine contracts are strict, so a narrower
71
+ # declaration makes every review step fail with unrecognized_keys and exhaust
72
+ # its attempts — the same defect class as COMP-SHIP-CONTRACT. Caught in review.
39
73
  ReviewResult:
40
- clean: {type: boolean}
41
- summary: {type: string}
42
- findings: {type: array}
43
-
44
- functions:
45
- snapshot:
46
- mode: compute
47
- intent: >
48
- Run the full test suite and capture results as a baseline snapshot.
49
- Record pass/fail counts and test names. Return a summary of the
50
- current test state before any changes.
51
- input:
52
- task: {type: string}
53
- output: RefactorResult
54
- retries: 1
55
-
56
- analyze:
57
- mode: compute
58
- intent: >
59
- Analyze the target code for refactoring opportunities. Identify code
60
- smells, duplication, coupling issues, and improvement targets.
61
- Return a structured summary of findings.
62
- input:
63
- task: {type: string}
64
- output: RefactorResult
65
- retries: 1
66
-
67
- plan:
68
- mode: compute
69
- intent: >
70
- Write a step-by-step refactoring plan. Each step should be a safe,
71
- incremental change that preserves behavior. Include file paths and
72
- expected changes.
73
- input:
74
- task: {type: string}
75
- output: RefactorResult
76
- retries: 1
77
-
78
- execute:
79
- mode: compute
80
- intent: >
81
- Apply the refactoring changes incrementally following the plan.
82
- Make each change as small as possible. Return a summary of all
83
- modifications made.
84
- input:
85
- task: {type: string}
86
- output: RefactorResult
87
- retries: 3
88
-
89
- test:
90
- mode: compute
91
- intent: >
92
- Run the full test suite. Compare results against the baseline snapshot.
93
- Return structured JSON: { "passing": boolean, "summary": string, "failures": string[] }.
94
- All tests that passed before must still pass.
95
- input:
96
- task: {type: string}
97
- output: TestResult
98
- ensure:
99
- - "result.passing == true"
100
- retries: 5
101
-
102
- review:
103
- mode: compute
104
- intent: >
105
- Review the refactored code for correctness and quality. Verify that
106
- behavior is preserved and the code is cleaner than before.
107
- Return { "clean": boolean, "summary": string, "findings": string[] }.
108
- input:
109
- task: {type: string}
110
- output: ReviewResult
111
- ensure:
112
- - "result.clean == true"
113
- retries: 3
114
-
115
- ship:
116
- mode: compute
117
- intent: >
118
- Commit all changes with a descriptive message. Return a summary.
119
- input:
120
- task: {type: string}
121
- output: RefactorResult
122
- retries: 1
74
+ clean: boolean
75
+ summary: string
76
+ findings: array
77
+ meta: object
78
+ lenses_run: string[]
79
+ auto_fixes: array
80
+ asks: array
123
81
 
124
82
  flows:
83
+ entry: refactor
125
84
  refactor:
126
85
  input:
127
- task: {type: string}
128
- output: RefactorResult
86
+ featureCode: string
87
+ description: string
88
+ implementer_agent: string?
89
+ reviewer_agent: string?
90
+ pre_merge_gate: string[]?
91
+ output:
92
+ from: "${ship.output}"
93
+ contract: ShipResult
129
94
  steps:
130
95
  - id: snapshot
131
- function: snapshot
132
- inputs:
133
- task: "$.input.task"
96
+ agent: claude
97
+ do: >
98
+ Run the full test suite and capture the results as a baseline snapshot
99
+ before any changes to ${input.description}. Record pass/fail counts and test
100
+ names. Return a summary of the current test state.
101
+ out: RefactorResult
102
+ attempts: 2
134
103
 
135
104
  - id: analyze
136
- function: analyze
137
- inputs:
138
- task: "$.input.task"
139
- depends_on: [snapshot]
105
+ after: [snapshot]
106
+ agent: claude
107
+ do: >
108
+ Analyze ${input.description} for refactoring opportunities. Identify code
109
+ smells, duplication, coupling issues and improvement targets. Return a
110
+ structured summary of findings.
111
+ out: RefactorResult
112
+ attempts: 2
140
113
 
141
114
  - id: plan
142
- function: plan
143
- inputs:
144
- task: "$.input.task"
145
- depends_on: [analyze]
115
+ after: [analyze]
116
+ agent: claude
117
+ do: >
118
+ Write a step-by-step refactoring plan for ${input.description} addressing
119
+ ${analyze.output.summary}. Each step must be a safe, incremental change
120
+ that preserves behavior. Include file paths and expected changes.
121
+ out: RefactorResult
122
+ attempts: 2
146
123
 
147
124
  - id: execute
148
- function: execute
149
- inputs:
150
- task: "$.input.task"
151
- depends_on: [plan]
125
+ after: [plan]
126
+ agent: claude
127
+ do: >
128
+ Apply the refactoring changes incrementally, following the plan:
129
+ ${plan.output.summary}. Make each change as small as possible. Return
130
+ a summary of all modifications made.
131
+ out: RefactorResult
132
+ attempts: 4
152
133
 
153
134
  - id: test
154
- function: test
155
- inputs:
156
- task: "$.input.task"
157
- depends_on: [execute]
135
+ after: [execute]
136
+ agent: claude
137
+ do: >
138
+ Run the full test suite and compare the results against the baseline
139
+ snapshot: ${snapshot.output.summary}. Every test that passed before
140
+ MUST still pass — this is the behavior-preservation check, not a
141
+ general green-suite check. Return structured JSON:
142
+ { "passing": boolean, "summary": string, "failures": string[] }.
143
+ out: TestResult
144
+ ensure:
145
+ - expr: "result.passing == true"
146
+ attempts: 6
158
147
 
159
148
  - id: review
160
- function: review
161
- inputs:
162
- task: "$.input.task"
163
- depends_on: [test]
149
+ after: [test]
150
+ agent: codex
151
+ do: >
152
+ Review the refactored code for ${input.description} for correctness and
153
+ quality. Verify that behavior is preserved and the code is cleaner than
154
+ before. If this is a retry, fix the previous findings before
155
+ re-reviewing. Return { "clean": boolean, "summary": string,
156
+ "findings": string[] }.
157
+ out: ReviewResult
158
+ ensure:
159
+ - expr: "result.clean == true"
160
+ attempts: 4
164
161
 
165
162
  - id: ship
166
- function: ship
167
- inputs:
168
- task: "$.input.task"
169
- depends_on: [review]
163
+ after: [review]
164
+ agent: claude
165
+ do: >
166
+ Commit all changes for ${input.description} with a descriptive message.
167
+ Return a summary.
168
+ out: ShipResult
169
+ attempts: 2
@@ -6,7 +6,7 @@
6
6
  # steps: 3
7
7
  # estimated_minutes: 15
8
8
 
9
- version: "0.1"
9
+ version: 1
10
10
 
11
11
  # research pipeline
12
12
  #
@@ -15,74 +15,72 @@ version: "0.1"
15
15
  # 2. analyze — synthesize findings, identify patterns and gaps
16
16
  # 3. report — produce a structured summary with recommendations
17
17
  #
18
- # Inputs:
19
- # task research question or topic to explore
18
+ # COMP-PIPELINE-QUARANTINE: re-authored from v0.1 to TS v1. Linear chain, no
19
+ # gates or backward routing. `retries: 1` -> `attempts: 2` (v0.1 counted retries
20
+ # AFTER the first try, so a bare rename would leave every step with no retry at
21
+ # all). The `outcome` enum moved from the old `values:` list into the contract.
20
22
  #
21
- # Usage:
22
- # stratum_plan <this yaml> "research" {"task": "..."}
23
+ #
24
+ # COMP-PIPELINE-QUARANTINE round 2: the flow input is the RUNNER's envelope, not
25
+ # a bespoke `task`. runBuild derives plan inputs from the MODE, not from the spec
26
+ # (lib/build.js startFresh), and feature mode always sends
27
+ # {featureCode, description, implementer_agent, reviewer_agent} plus an optional
28
+ # pre_merge_gate. Declaring `task` meant this spec resolved but could never plan —
29
+ # making it reachable via `--template` without this change just moved the failure
30
+ # from "not found" to a failed run. `${input.description}` carries what `task` did.
31
+ # Inputs (the runner's feature envelope):
32
+ # featureCode — the feature/work code
33
+ # description — what to do; this is what the old `task` input carried
23
34
 
24
35
  contracts:
25
36
  ResearchResult:
26
- phase: {type: string}
27
- artifact: {type: string}
28
- summary: {type: string}
29
- outcome: {type: string, values: [complete, failed]}
30
-
31
- functions:
32
- gather:
33
- mode: compute
34
- intent: >
35
- Collect sources relevant to the research topic. Search the codebase,
36
- read documentation, and gather external references. Return a summary
37
- of sources found and key data points.
38
- input:
39
- task: {type: string}
40
- output: ResearchResult
41
- retries: 1
42
-
43
- analyze:
44
- mode: compute
45
- intent: >
46
- Synthesize the gathered information. Identify patterns, contradictions,
47
- gaps, and insights. Organize findings into themes. Return a structured
48
- analysis summary.
49
- input:
50
- task: {type: string}
51
- output: ResearchResult
52
- retries: 1
53
-
54
- report:
55
- mode: compute
56
- intent: >
57
- Produce a structured research report with findings, analysis, and
58
- actionable recommendations. Write to an appropriate file path.
59
- Return the artifact path and summary.
60
- input:
61
- task: {type: string}
62
- output: ResearchResult
63
- ensure:
64
- - "result.outcome == 'complete'"
65
- retries: 1
37
+ phase: string
38
+ artifact: string
39
+ summary: string
40
+ outcome: complete|skipped|failed # `skipped` is reachable: compose offers an interactive skip
66
41
 
67
42
  flows:
43
+ entry: research
68
44
  research:
69
45
  input:
70
- task: {type: string}
71
- output: ResearchResult
46
+ featureCode: string
47
+ description: string
48
+ implementer_agent: string?
49
+ reviewer_agent: string?
50
+ pre_merge_gate: string[]?
51
+ output:
52
+ from: "${report.output}"
53
+ contract: ResearchResult
72
54
  steps:
73
55
  - id: gather
74
- function: gather
75
- inputs:
76
- task: "$.input.task"
56
+ agent: claude
57
+ do: >
58
+ Collect sources relevant to the research topic: ${input.description}.
59
+ Search the codebase, read documentation, and gather external
60
+ references. Return a summary of sources found and key data points.
61
+ out: ResearchResult
62
+ attempts: 2
77
63
 
78
64
  - id: analyze
79
- function: analyze
80
- inputs:
81
- task: "$.input.task"
82
- depends_on: [gather]
65
+ after: [gather]
66
+ agent: claude
67
+ do: >
68
+ Synthesize the information gathered on ${input.description}. What was found:
69
+ ${gather.output.summary}. Identify patterns, contradictions, gaps and
70
+ insights. Organize findings into themes. Return a structured analysis
71
+ summary.
72
+ out: ResearchResult
73
+ attempts: 2
83
74
 
84
75
  - id: report
85
- function: report
86
- inputs:
87
- task: "$.input.task"
88
- depends_on: [analyze]
76
+ after: [analyze]
77
+ agent: claude
78
+ do: >
79
+ Produce a structured research report on ${input.description} with findings,
80
+ analysis and actionable recommendations, drawing on the analysis:
81
+ ${analyze.output.summary}. Write it to an appropriate file path.
82
+ Return the artifact path and summary.
83
+ out: ResearchResult
84
+ ensure:
85
+ - expr: "result.outcome == 'complete'"
86
+ attempts: 2
@@ -0,0 +1,6 @@
1
+ {
2
+ "_comment": "COMP-PIPELINE-QUARANTINE follow-up: compose-owned agent profiles for review-fix.stratum.yaml, applied at invocation by lib/build.js loadPipelineProfiles.",
3
+ "_reduceSteps": ["review"],
4
+ "_reduceSteps_comment": "LOAD-BEARING, not an optimization. `review` is the step whose ReviewResult the programmatic review_gate reads to decide clean vs dirty. Without this entry the gate never sees a result, so the corrective fixer never runs and the cross-model repair loop this pipeline exists for does not happen.",
5
+ "review": "codex:read-only-reviewer"
6
+ }
@@ -3,107 +3,134 @@
3
3
  # label: "Review & Fix"
4
4
  # description: "Iterative review-fix loop — Codex reviews, Claude fixes until clean"
5
5
  # category: quality
6
- # steps: 2
6
+ # steps: 3
7
7
  # estimated_minutes: 15
8
8
 
9
- version: "0.1"
9
+ version: 1
10
10
 
11
11
  # review-fix pipeline
12
12
  #
13
- # Runs a task to completion via a two-phase loop:
14
- # 1. execute claude_run produces the initial implementation
15
- # 2. review codex_run reviews against the blueprint; on failure,
16
- # claude_run fixes findings before codex re-reviews
13
+ # Runs a task to completion via a two-model loop:
14
+ # 1. execute the implementer writes the initial implementation
15
+ # 2. review the REVIEWER (a different model) reviews it
16
+ # 3. review_gate clean approves; dirty runs the corrective fixer as the
17
+ # IMPLEMENTER and revises, so the reviewer re-reviews the
18
+ # fixed code. The two roles never collapse into one model.
17
19
  #
18
- # The fix_and_review step is a single unit so findings always feed back
19
- # into a fix pass before re-review runs. retries: 10 is the iteration cap.
20
+ # COMP-PIPELINE-QUARANTINE: re-authored from v0.1 to TS v1.
20
21
  #
21
- # Inputs:
22
- # task — what to implement (full task description with file paths, etc.)
23
- # blueprint the feature blueprint to review against (file content or path)
22
+ # The first v1 draft of this file collapsed the whole loop into ONE `agent: codex`
23
+ # step, which meant that on every retry Codex fixed the findings and then reviewed
24
+ # its own repair. That silently destroyed the point of the pipeline — independent
25
+ # cross-model repair — while the header still claimed it. Caught in review.
24
26
  #
25
- # Usage:
26
- # stratum_plan <this yaml> "review_fix" {"task": "...", "blueprint": "..."}
27
+ # The loop is now expressed the way the engine and compose actually implement it:
28
+ # - `review` is the reducer. It carries NO convergence `ensure`: re-running a
29
+ # reviewer against unchanged code cannot converge, so an ensure here would
30
+ # just burn attempts and fail (the same lesson as build.stratum.yaml note I1).
31
+ # - The decision is `review_gate`. Compose resolves that gate id
32
+ # PROGRAMMATICALLY (lib/build.js): a clean result approves, a dirty one runs
33
+ # the corrective fixer under `implementerAgent` — a DIFFERENT model from the
34
+ # reviewer — and then revises back to `review`.
35
+ # - `review-fix.profiles.json` declares `review` as a `_reduceSteps` entry,
36
+ # which is what routes its result into that gate decision. Without the
37
+ # sidecar the gate would never see the review result.
38
+ #
39
+ # Other conversion notes:
40
+ # - The two `functions:` collapse into inline steps; v1 has no function table.
41
+ # - `retries: 1` -> `attempts: 2` (v0.1 counted retries after the first try).
42
+ # - The old `retries: 10` iteration cap becomes the flow's `max_rounds`, which
43
+ # is where v1 bounds a gate-revise loop.
44
+ #
45
+ #
46
+ # COMP-PIPELINE-QUARANTINE round 2: the flow input is the RUNNER's envelope, not
47
+ # a bespoke `task`. runBuild derives plan inputs from the MODE, not from the spec
48
+ # (lib/build.js startFresh), and feature mode always sends
49
+ # {featureCode, description, implementer_agent, reviewer_agent} plus an optional
50
+ # pre_merge_gate. Declaring `task` meant this spec resolved but could never plan —
51
+ # making it reachable via `--template` without this change just moved the failure
52
+ # from "not found" to a failed run. `${input.description}` carries what `task` did.
53
+ # Inputs (the runner's feature envelope):
54
+ # featureCode — the feature code; the blueprint is read from its folder
55
+ # description — what to implement; this is what the old `task` input carried
27
56
 
28
57
  contracts:
29
58
  ExecuteResult:
30
- summary: {type: string}
31
- findings: {type: array}
59
+ summary: string
60
+ findings: string[]
32
61
 
62
+ # CANONICAL ReviewResult — STRAT-CLAUDE-EFFORT-PARITY. It MUST carry meta,
63
+ # lenses_run, auto_fixes and asks even though this pipeline never sets them by
64
+ # hand: compose enables review normalization for any step whose out contract is
65
+ # NAMED ReviewResult (deriveOrdinaryReviewScaffold), and the normalizer always
66
+ # stamps those four fields. Engine contracts are strict, so a narrower
67
+ # declaration makes every review step fail with unrecognized_keys and exhaust
68
+ # its attempts — the same defect class as COMP-SHIP-CONTRACT. Caught in review.
33
69
  ReviewResult:
34
- clean: {type: boolean}
35
- summary: {type: string}
36
- findings: {type: array}
37
-
38
- functions:
39
- execute_task:
40
- mode: compute
41
- intent: >
42
- Call the agent_run MCP tool with type "claude" and the given task prompt.
43
- Implement the task fully — write all required files and make all required changes.
44
- Return a summary of what was done and an empty findings array.
45
- Do not review — only implement.
46
- input:
47
- task: {type: string}
48
- output: ExecuteResult
49
- retries: 1
50
-
51
- fix_and_review:
52
- mode: compute
53
- intent: >
54
- Implement one full fix-then-review cycle using the agent_run MCP tool.
55
-
56
- Step A — Fix (skip on first attempt if no prior findings):
57
- If this is a retry (previous ensure failed with findings), call agent_run
58
- with type "claude". Pass the original task plus the previous findings.
59
- Instruct Claude to fix every finding before proceeding.
60
-
61
- Step B — Review:
62
- Call agent_run with type "codex" and the following JSON Schema for structured output:
63
- {
64
- "type": "object",
65
- "required": ["clean", "summary", "findings"],
66
- "properties": {
67
- "clean": { "type": "boolean" },
68
- "summary": { "type": "string" },
69
- "findings": { "type": "array", "items": { "type": "string" } }
70
- }
71
- }
72
- The review prompt must include:
73
- - the task description
74
- - the execute_summary (what was implemented)
75
- - the blueprint content
76
- - instruction: "List actionable findings with confidence >= 7.
77
- Set clean=true only if no actionable findings remain."
78
- Pass the schema to agent_run so it returns structured JSON.
79
-
80
- Return the parsed codex ReviewResult directly.
81
- Never re-review without fixing first on a retry.
82
- input:
83
- task: {type: string}
84
- execute_summary: {type: string}
85
- blueprint: {type: string}
86
- output: ReviewResult
87
- ensure:
88
- - "result.clean == true"
89
- retries: 10
70
+ clean: boolean
71
+ summary: string
72
+ findings: array
73
+ meta: object
74
+ lenses_run: string[]
75
+ auto_fixes: array
76
+ asks: array
90
77
 
91
78
  flows:
79
+ entry: review_fix
92
80
  review_fix:
93
81
  input:
94
- task: {type: string}
95
- blueprint: {type: string}
96
- output: ReviewResult
82
+ featureCode: string
83
+ description: string
84
+ # REQUIRED, not optional: the review step interpolates reviewer_agent, and
85
+ # the corrective fixer runs as implementer_agent. Hard-coding the reviewer
86
+ # to codex looked safe until you notice `--implementer codex` is a supported
87
+ # override — then Codex fixes and reviews its own repair again, which is the
88
+ # exact defect this file was corrected for. Deriving both roles from the
89
+ # envelope keeps them whatever the invocation says, and always distinct.
90
+ implementer_agent: string
91
+ reviewer_agent: string
92
+ pre_merge_gate: string[]?
93
+ output:
94
+ from: "${review.output}"
95
+ contract: ReviewResult
96
+ # Bounds the review -> fix -> re-review loop; the v0.1 `retries: 10` cap.
97
+ max_rounds: 10
97
98
  steps:
98
99
  - id: execute
99
- function: execute_task
100
- inputs:
101
- task: "$.input.task"
100
+ agent: "$.input.implementer_agent"
101
+ do: >
102
+ Implement this task fully — write all required files and make all
103
+ required changes: ${input.description}.
104
+ Return a summary of what was done and an empty findings array.
105
+ Do not review — only implement.
106
+ out: ExecuteResult
107
+ attempts: 2
102
108
 
103
109
  - id: review
104
- function: fix_and_review
105
- inputs:
106
- task: "$.input.task"
107
- execute_summary: "$.steps.execute.output.summary"
108
- blueprint: "$.input.blueprint"
109
- depends_on: [execute]
110
+ after: [execute]
111
+ agent: "$.input.reviewer_agent"
112
+ do: >
113
+ Review the implementation against the blueprint. Do NOT fix anything —
114
+ reviewing is your only job, and a corrective pass runs separately before
115
+ you are asked again.
116
+
117
+ Task: ${input.description}
118
+ What was implemented: ${execute.output.summary}
119
+ Blueprint: docs/features/${input.featureCode}/blueprint.md (fall back to design.md if absent)
120
+
121
+ List actionable findings with confidence >= 7. Each finding has file,
122
+ line, severity and a description. Set clean=true only if no actionable
123
+ findings remain.
124
+ out: ReviewResult
125
+ attempts: 3
126
+
127
+ # Resolved programmatically by compose, not by a human: clean approves and
128
+ # ends the flow; dirty runs the corrective fixer as the implementer, then
129
+ # revises so the reviewer sees the fixed code.
130
+ - id: review_gate
131
+ after: [review]
132
+ gate:
133
+ on_approve: null
134
+ on_revise: review
135
+ on_kill: null
136
+ max_rounds: 10
@@ -0,0 +1,6 @@
1
+ {
2
+ "_comment": "COMP-PIPELINE-QUARANTINE: compose-owned agent profiles for team-feature.stratum.yaml. The TS engine accepts only the literal claude|codex agent, so the profile strings (tool restrictions + model tier) that the v0.3->v1 conversion stripped live here, keyed by step id, and are applied compose-side at invocation (lib/build.js loadPipelineProfiles).",
3
+ "decompose": "claude:orchestrator",
4
+ "execute": "claude:implementer",
5
+ "verify": "claude:orchestrator"
6
+ }