@smartmemory/compose 0.3.7 → 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 (215) hide show
  1. package/.compose-deps.json +1 -13
  2. package/README.md +72 -5
  3. package/bin/compose.js +470 -351
  4. package/bin/judgment-migrate.js +387 -0
  5. package/contracts/comp-obs-contract.schema.json +9 -3
  6. package/contracts/fluid-record.schema.json +209 -0
  7. package/contracts/lifecycle-backfill.schema.json +322 -0
  8. package/dist/assets/App-Z4MU-H_F.js +916 -0
  9. package/dist/assets/{_baseUniq-Bo837sRJ.js → _baseUniq-ClWoCPFl.js} +1 -1
  10. package/dist/assets/{arc-BafGpyqE.js → arc-DY26UIVo.js} +1 -1
  11. package/dist/assets/{architectureDiagram-Q4EWVU46-BOBfUsqL.js → architectureDiagram-Q4EWVU46-6Ggq4DqJ.js} +1 -1
  12. package/dist/assets/{blockDiagram-DXYQGD6D-Dwodev1a.js → blockDiagram-DXYQGD6D-CH3Ked0l.js} +1 -1
  13. package/dist/assets/{browser-1ntj1-x_.js → browser-BWkrenen.js} +1 -1
  14. package/dist/assets/{c4Diagram-AHTNJAMY-CU_bhYag.js → c4Diagram-AHTNJAMY-Bk8dYilu.js} +1 -1
  15. package/dist/assets/channel-SnZzzh7k.js +1 -0
  16. package/dist/assets/{chunk-4BX2VUAB-p8WsDwnO.js → chunk-4BX2VUAB-BMR0XaAQ.js} +1 -1
  17. package/dist/assets/{chunk-4TB4RGXK-B8h7-eR0.js → chunk-4TB4RGXK-JytR14a9.js} +1 -1
  18. package/dist/assets/{chunk-55IACEB6-DxeEr98s.js → chunk-55IACEB6-B4Q97BCP.js} +1 -1
  19. package/dist/assets/{chunk-EDXVE4YY-BYt8F151.js → chunk-EDXVE4YY-R_qarkSf.js} +1 -1
  20. package/dist/assets/{chunk-FMBD7UC4-DGSOVeie.js → chunk-FMBD7UC4-C9s7KR9m.js} +1 -1
  21. package/dist/assets/{chunk-OYMX7WX6-B-QdgYR2.js → chunk-OYMX7WX6-BySQzVxc.js} +1 -1
  22. package/dist/assets/{chunk-QZHKN3VN-Du5UAZLs.js → chunk-QZHKN3VN-DdpSYZsW.js} +1 -1
  23. package/dist/assets/{chunk-YZCP3GAM-C8JbNBSk.js → chunk-YZCP3GAM-iE_tzriw.js} +1 -1
  24. package/dist/assets/classDiagram-6PBFFD2Q-CBu92dSH.js +1 -0
  25. package/dist/assets/classDiagram-v2-HSJHXN6E-CBu92dSH.js +1 -0
  26. package/dist/assets/clone-DgklGjHm.js +1 -0
  27. package/dist/assets/{cose-bilkent-S5V4N54A-O1ESaqge.js → cose-bilkent-S5V4N54A-BdlU6ZX_.js} +1 -1
  28. package/dist/assets/{dagre-KV5264BT-CPTmFPHw.js → dagre-KV5264BT-Cp3F5KTn.js} +1 -1
  29. package/dist/assets/{diagram-5BDNPKRD-B3PNrWs5.js → diagram-5BDNPKRD-DiR6_2q_.js} +1 -1
  30. package/dist/assets/{diagram-G4DWMVQ6-Cscfr6vc.js → diagram-G4DWMVQ6-w0i-p5HX.js} +1 -1
  31. package/dist/assets/{diagram-MMDJMWI5-CSfqZ-TM.js → diagram-MMDJMWI5-tIHhwUv3.js} +1 -1
  32. package/dist/assets/{diagram-TYMM5635-Cg4aYS7W.js → diagram-TYMM5635-BAeY3B19.js} +1 -1
  33. package/dist/assets/{erDiagram-SMLLAGMA-_ZqwG5pl.js → erDiagram-SMLLAGMA-Ckx_Knko.js} +1 -1
  34. package/dist/assets/{flowDiagram-DWJPFMVM-C83boxFT.js → flowDiagram-DWJPFMVM-DeoNka6J.js} +1 -1
  35. package/dist/assets/{ganttDiagram-T4ZO3ILL-CWnIjuEi.js → ganttDiagram-T4ZO3ILL-BmGnFbEg.js} +1 -1
  36. package/dist/assets/{gitGraphDiagram-UUTBAWPF-DrMdxZfH.js → gitGraphDiagram-UUTBAWPF-Dk48IHsx.js} +1 -1
  37. package/dist/assets/{graph-RE4I7Ty7.js → graph-BNzKGvoy.js} +1 -1
  38. package/dist/assets/{graph-Bi99_6Yf.js → graph-CI_1htl0.js} +1 -1
  39. package/dist/assets/{index-Rm2RE-c0.js → index-BEfrNBp8.js} +3 -3
  40. package/dist/assets/index-yyrA5OZd.css +1 -0
  41. package/dist/assets/{infoDiagram-42DDH7IO-BLmP4Epr.js → infoDiagram-42DDH7IO-BRf827i0.js} +1 -1
  42. package/dist/assets/{ishikawaDiagram-UXIWVN3A-yuWWshKN.js → ishikawaDiagram-UXIWVN3A-0kCZaeCM.js} +1 -1
  43. package/dist/assets/{journeyDiagram-VCZTEJTY-BOfhaJov.js → journeyDiagram-VCZTEJTY-rvU7ayRt.js} +1 -1
  44. package/dist/assets/{kanban-definition-6JOO6SKY-Bbolde15.js → kanban-definition-6JOO6SKY-DpQwX1C5.js} +1 -1
  45. package/dist/assets/{layout-BSf33zm8.js → layout-BI8cXFPI.js} +1 -1
  46. package/dist/assets/{linear-AvSTWMqx.js → linear-a0glcDiw.js} +1 -1
  47. package/dist/assets/{min-QBM8H4xN.js → min-vPHfnXcC.js} +1 -1
  48. package/dist/assets/{mindmap-definition-QFDTVHPH-BuvgtqIc.js → mindmap-definition-QFDTVHPH-D14eF-7C.js} +1 -1
  49. package/dist/assets/mobile-B7m9EO9D.js +17 -0
  50. package/dist/assets/{pieDiagram-DEJITSTG-DIzF16vh.js → pieDiagram-DEJITSTG-Cno-gETh.js} +1 -1
  51. package/dist/assets/{quadrantDiagram-34T5L4WZ-D-mbUIjS.js → quadrantDiagram-34T5L4WZ-BUQM1Hfm.js} +1 -1
  52. package/dist/assets/{requirementDiagram-MS252O5E-CEs4kCLd.js → requirementDiagram-MS252O5E-pOXlN2-q.js} +1 -1
  53. package/dist/assets/{sankeyDiagram-XADWPNL6-DFsnCr9n.js → sankeyDiagram-XADWPNL6-Crynd3_b.js} +1 -1
  54. package/dist/assets/{sequenceDiagram-FGHM5R23-BEJYdTjQ.js → sequenceDiagram-FGHM5R23-D9fZdCM8.js} +1 -1
  55. package/dist/assets/{stateDiagram-FHFEXIEX-BBXs57uY.js → stateDiagram-FHFEXIEX-CW9qVec8.js} +1 -1
  56. package/dist/assets/stateDiagram-v2-QKLJ7IA2-DkVLzHbY.js +1 -0
  57. package/dist/assets/{timeline-definition-GMOUNBTQ-BGvLoVAY.js → timeline-definition-GMOUNBTQ-BcHzhm_8.js} +1 -1
  58. package/dist/assets/{vennDiagram-DHZGUBPP-9LaBTMe0.js → vennDiagram-DHZGUBPP-BfytJcWk.js} +1 -1
  59. package/dist/assets/{wardley-RL74JXVD-P4MEqMTP.js → wardley-RL74JXVD-DLj-IjyB.js} +1 -1
  60. package/dist/assets/{wardleyDiagram-NUSXRM2D-o-tmxnlC.js → wardleyDiagram-NUSXRM2D-Ds0Ue68c.js} +1 -1
  61. package/dist/assets/{xychartDiagram-5P7HB3ND-Dpn7V6qk.js → xychartDiagram-5P7HB3ND-vjWDXFL6.js} +1 -1
  62. package/dist/index.html +3 -3
  63. package/lib/agent-string.js +7 -5
  64. package/lib/append-integrity.js +81 -0
  65. package/lib/backfill-evidence.js +109 -0
  66. package/lib/bug-escalation.js +9 -0
  67. package/lib/build-stream-schema.js +3 -1
  68. package/lib/build-stream-writer.js +25 -0
  69. package/lib/build.js +874 -170
  70. package/lib/canon-guard.js +28 -6
  71. package/lib/canon-override.js +196 -0
  72. package/lib/canon-registry.js +104 -0
  73. package/lib/cli-commands.js +144 -0
  74. package/lib/codex-preflight.js +26 -13
  75. package/lib/colleague/context.js +215 -0
  76. package/lib/colleague/writeback.js +95 -0
  77. package/lib/completion-gate.js +1421 -0
  78. package/lib/completion-writer.js +47 -47
  79. package/lib/consumer-fanout.js +105 -11
  80. package/lib/coverage-gate.js +200 -0
  81. package/lib/dir-lock.js +170 -0
  82. package/lib/dispatch-ledger.js +3 -3
  83. package/lib/feature-json.js +1 -1
  84. package/lib/feature-reconciler.js +8 -0
  85. package/lib/feature-validator.js +64 -1
  86. package/lib/feature-writer.js +57 -2
  87. package/lib/fluid/factory.js +167 -0
  88. package/lib/fluid/ideabox-dates.js +73 -0
  89. package/lib/fluid/ideabox-migrate.js +154 -0
  90. package/lib/fluid/ideabox-ops.js +585 -0
  91. package/lib/fluid/ideabox-view.js +146 -0
  92. package/lib/fluid/import-ideabox.js +186 -0
  93. package/lib/fluid/local-provider.js +606 -0
  94. package/lib/fluid/provider.js +684 -0
  95. package/lib/fluid/record-shape.js +214 -0
  96. package/lib/fluid/record-store.js +328 -0
  97. package/lib/fluid/render-ideabox.js +261 -0
  98. package/lib/fluid/schema.js +40 -0
  99. package/lib/fluid/smartmemory-provider.js +1695 -0
  100. package/lib/gsd.js +63 -23
  101. package/lib/guard-cli.js +175 -0
  102. package/lib/guard-custody.js +141 -0
  103. package/lib/guard-descriptors.js +530 -0
  104. package/lib/guard-enrol.js +254 -0
  105. package/lib/health-score.js +1 -1
  106. package/lib/ideabox-cli.js +315 -0
  107. package/lib/ideabox.js +121 -21
  108. package/lib/judgment/store/index.js +9 -1
  109. package/lib/judgment/store/records.js +1 -1
  110. package/lib/judgment/trace.js +380 -0
  111. package/lib/judgment-decision-write.js +277 -0
  112. package/lib/judgment-decisions.js +466 -0
  113. package/lib/judgment-gen.js +5 -1
  114. package/lib/judgment-writer.js +56 -2
  115. package/lib/lifecycle-modes.js +4 -4
  116. package/lib/lineage.js +400 -0
  117. package/lib/local-claude-connector.js +52 -1
  118. package/lib/maya-client.js +302 -0
  119. package/lib/maya-config.js +53 -0
  120. package/lib/maya-identity.js +283 -0
  121. package/lib/migrate-anon.js +5 -0
  122. package/lib/migrate-roadmap.js +15 -0
  123. package/lib/new.js +13 -1
  124. package/lib/pipeline-compat.js +104 -0
  125. package/lib/policy-catalog.js +295 -0
  126. package/lib/policy-check.js +0 -0
  127. package/lib/process-termination.js +98 -0
  128. package/lib/resolve-workspace.js +5 -1
  129. package/lib/result-normalizer.js +396 -199
  130. package/lib/roadmap-errors.js +65 -0
  131. package/lib/roadmap-preservers.js +24 -4
  132. package/lib/roadmap-residue.js +299 -0
  133. package/lib/smartmemory-client.js +614 -78
  134. package/lib/smartmemory-config.js +54 -0
  135. package/lib/smartmemory-ingest.js +19 -2
  136. package/lib/step-prompt.js +7 -6
  137. package/lib/stratum-engine.js +53 -4
  138. package/lib/stratum-mcp-client.js +271 -36
  139. package/lib/test-bootstrap.js +31 -0
  140. package/lib/tool-inventory.js +122 -0
  141. package/lib/version-check.js +91 -19
  142. package/lib/vision-writer.js +88 -1
  143. package/package.json +7 -6
  144. package/pipelines/bug-fix.stratum.yaml +205 -211
  145. package/pipelines/build-quick.profiles.json +12 -0
  146. package/pipelines/build-quick.stratum.yaml +263 -350
  147. package/pipelines/content.stratum.yaml +81 -77
  148. package/pipelines/coverage-sweep.stratum.yaml +49 -30
  149. package/pipelines/plan.stratum.yaml +76 -86
  150. package/pipelines/refactor.stratum.yaml +125 -125
  151. package/pipelines/research.stratum.yaml +56 -58
  152. package/pipelines/review-fix.profiles.json +6 -0
  153. package/pipelines/review-fix.stratum.yaml +110 -83
  154. package/presets/team-feature.profiles.json +6 -0
  155. package/presets/team-feature.stratum.yaml +93 -66
  156. package/presets/team-research.profiles.json +6 -0
  157. package/presets/team-research.stratum.yaml +89 -80
  158. package/presets/team-review.profiles.json +8 -0
  159. package/presets/team-review.stratum.yaml +98 -80
  160. package/scripts/cost-census.mjs +70 -0
  161. package/scripts/guard-sign/compose-guard-sign.sh +62 -0
  162. package/server/agent-health.js +22 -0
  163. package/server/agent-hooks.js +14 -1
  164. package/server/agent-server.js +5 -248
  165. package/server/agent-spawn.js +3 -4
  166. package/server/agent-workspace.js +294 -0
  167. package/server/build-routes.js +6 -5
  168. package/server/build-stream-bridge.js +53 -0
  169. package/server/cc-session-watcher.js +4 -1
  170. package/server/coalescing-buffer.js +7 -1
  171. package/server/completion-projection.js +228 -0
  172. package/server/compose-mcp-tools.js +109 -23
  173. package/server/compose-mcp.js +88 -882
  174. package/server/decision-event-emit.js +41 -2
  175. package/server/decision-event-id.js +17 -0
  176. package/server/decision-events-snapshot.js +3 -0
  177. package/server/design-routes.js +14 -8
  178. package/server/feature-scan.js +76 -2
  179. package/server/file-watcher.js +170 -21
  180. package/server/ideabox-routes.js +166 -224
  181. package/server/index.js +70 -100
  182. package/server/lifecycle-guard.js +240 -10
  183. package/server/lifecycle-phase-history.js +276 -0
  184. package/server/maya-routes.js +507 -0
  185. package/server/mcp-tool-defs.js +940 -0
  186. package/server/mcp-tool-policy.js +34 -2
  187. package/server/model-tiers.js +22 -5
  188. package/server/pipeline-routes.js +21 -11
  189. package/server/project-root.js +58 -19
  190. package/server/remote-utils.js +3 -1
  191. package/server/schema-validator.js +7 -1
  192. package/server/session-manager.js +5 -6
  193. package/server/session-routes.js +3 -1
  194. package/server/stratum-client.js +57 -10
  195. package/server/stratum-sync.js +6 -3
  196. package/server/summarizer.js +3 -4
  197. package/server/supervisor.js +0 -1
  198. package/server/vision-routes.js +208 -98
  199. package/server/vision-server.js +86 -23
  200. package/server/vision-store.js +60 -6
  201. package/server/vision-utils.js +3 -4
  202. package/server/workspace-activity.js +18 -0
  203. package/server/workspace-middleware.js +2 -2
  204. package/server/workspace-runtime.js +243 -0
  205. package/server/worktree-gc.js +1 -0
  206. package/dist/assets/App-PkZzHeMj.js +0 -894
  207. package/dist/assets/channel-qVK_qn4E.js +0 -1
  208. package/dist/assets/classDiagram-6PBFFD2Q-B8UcfC1q.js +0 -1
  209. package/dist/assets/classDiagram-v2-HSJHXN6E-B8UcfC1q.js +0 -1
  210. package/dist/assets/clone-Pu3RyLUh.js +0 -1
  211. package/dist/assets/index-LIwREYgH.css +0 -1
  212. package/dist/assets/mobile-BnXEOE3U.js +0 -17
  213. package/dist/assets/stateDiagram-v2-QKLJ7IA2-BqKuX4rj.js +0 -1
  214. package/lib/staleness.js +0 -87
  215. package/server/ideabox-cache.js +0 -77
@@ -6,7 +6,7 @@
6
6
  # steps: 4
7
7
  # estimated_minutes: 20
8
8
 
9
- version: "0.1"
9
+ version: 1
10
10
 
11
11
  # content pipeline
12
12
  #
@@ -16,97 +16,101 @@ version: "0.1"
16
16
  # 3. review — review for accuracy, completeness, and clarity
17
17
  # 4. publish — finalize and commit
18
18
  #
19
- # Inputs:
20
- # task what to write (doc type, topic, target audience)
19
+ # COMP-PIPELINE-QUARANTINE: re-authored from v0.1 to TS v1. Linear chain, no
20
+ # gates or backward routing. `retries: N` -> `attempts: N + 1` (v0.1 counted
21
+ # retries AFTER the first try). The `outcome` enum moved into the contract.
22
+ # review's fix loop is its own `attempts` budget: `ensure` rejects an unclean
23
+ # review and the engine re-runs the step with the findings as feedback.
21
24
  #
22
- # Usage:
23
- # stratum_plan <this yaml> "content" {"task": "..."}
25
+ #
26
+ # COMP-PIPELINE-QUARANTINE round 2: the flow input is the RUNNER's envelope, not
27
+ # a bespoke `task`. runBuild derives plan inputs from the MODE, not from the spec
28
+ # (lib/build.js startFresh), and feature mode always sends
29
+ # {featureCode, description, implementer_agent, reviewer_agent} plus an optional
30
+ # pre_merge_gate. Declaring `task` meant this spec resolved but could never plan —
31
+ # making it reachable via `--template` without this change just moved the failure
32
+ # from "not found" to a failed run. `${input.description}` carries what `task` did.
33
+ # Inputs (the runner's feature envelope):
34
+ # featureCode — the feature/work code
35
+ # description — what to do; this is what the old `task` input carried
24
36
 
25
37
  contracts:
26
38
  ContentResult:
27
- phase: {type: string}
28
- artifact: {type: string}
29
- summary: {type: string}
30
- outcome: {type: string, values: [complete, failed]}
39
+ phase: string
40
+ artifact: string
41
+ summary: string
42
+ outcome: complete|skipped|failed # `skipped` is reachable: compose offers an interactive skip
31
43
 
44
+ # CANONICAL ReviewResult — STRAT-CLAUDE-EFFORT-PARITY. It MUST carry meta,
45
+ # lenses_run, auto_fixes and asks even though this pipeline never sets them by
46
+ # hand: compose enables review normalization for any step whose out contract is
47
+ # NAMED ReviewResult (deriveOrdinaryReviewScaffold), and the normalizer always
48
+ # stamps those four fields. Engine contracts are strict, so a narrower
49
+ # declaration makes every review step fail with unrecognized_keys and exhaust
50
+ # its attempts — the same defect class as COMP-SHIP-CONTRACT. Caught in review.
32
51
  ReviewResult:
33
- clean: {type: boolean}
34
- summary: {type: string}
35
- findings: {type: array}
36
-
37
- functions:
38
- research:
39
- mode: compute
40
- intent: >
41
- Gather context for the content. Read existing documentation, related
42
- code, and prior art. Identify gaps and outline key topics to cover.
43
- Return a summary of research findings.
44
- input:
45
- task: {type: string}
46
- output: ContentResult
47
- retries: 1
48
-
49
- draft:
50
- mode: compute
51
- intent: >
52
- Write the content based on research findings. Follow existing
53
- documentation conventions and standards. Write to the appropriate
54
- file path. Return the artifact path.
55
- input:
56
- task: {type: string}
57
- output: ContentResult
58
- ensure:
59
- - "result.outcome == 'complete'"
60
- retries: 2
61
-
62
- review:
63
- mode: compute
64
- intent: >
65
- Review the drafted content for accuracy, completeness, and clarity.
66
- Check that all claims are supported by code or documentation.
67
- Return { "clean": boolean, "summary": string, "findings": string[] }.
68
- input:
69
- task: {type: string}
70
- output: ReviewResult
71
- ensure:
72
- - "result.clean == true"
73
- retries: 3
74
-
75
- publish:
76
- mode: compute
77
- intent: >
78
- Finalize the content. Update any cross-references (README, CHANGELOG,
79
- index files). Commit with a descriptive message.
80
- input:
81
- task: {type: string}
82
- output: ContentResult
83
- retries: 1
52
+ clean: boolean
53
+ summary: string
54
+ findings: array
55
+ meta: object
56
+ lenses_run: string[]
57
+ auto_fixes: array
58
+ asks: array
84
59
 
85
60
  flows:
61
+ entry: content
86
62
  content:
87
63
  input:
88
- task: {type: string}
89
- output: ContentResult
64
+ featureCode: string
65
+ description: string
66
+ implementer_agent: string?
67
+ reviewer_agent: string?
68
+ pre_merge_gate: string[]?
69
+ output:
70
+ from: "${publish.output}"
71
+ contract: ContentResult
90
72
  steps:
91
73
  - id: research
92
- function: research
93
- inputs:
94
- task: "$.input.task"
74
+ agent: claude
75
+ do: >
76
+ Gather context for this content: ${input.description}. Read existing
77
+ documentation, related code and prior art. Identify gaps and outline
78
+ the key topics to cover. Return a summary of research findings.
79
+ out: ContentResult
80
+ attempts: 2
95
81
 
96
82
  - id: draft
97
- function: draft
98
- inputs:
99
- task: "$.input.task"
100
- depends_on: [research]
83
+ after: [research]
84
+ agent: claude
85
+ do: >
86
+ Write the content for ${input.description} based on the research findings:
87
+ ${research.output.summary}. Follow existing documentation conventions
88
+ and standards. Write to the appropriate file path and return the
89
+ artifact path.
90
+ out: ContentResult
91
+ ensure:
92
+ - expr: "result.outcome == 'complete'"
93
+ attempts: 3
101
94
 
102
95
  - id: review
103
- function: review
104
- inputs:
105
- task: "$.input.task"
106
- depends_on: [draft]
96
+ after: [draft]
97
+ agent: claude
98
+ do: >
99
+ Review the drafted content at ${draft.output.artifact} for accuracy,
100
+ completeness and clarity. Check that every claim is supported by code
101
+ or documentation. If this is a retry, fix the previous findings before
102
+ re-reviewing. Return { "clean": boolean, "summary": string,
103
+ "findings": string[] }.
104
+ out: ReviewResult
105
+ ensure:
106
+ - expr: "result.clean == true"
107
+ attempts: 4
107
108
 
108
109
  - id: publish
109
- function: publish
110
- inputs:
111
- task: "$.input.task"
112
- depends_on: [review]
110
+ after: [review]
111
+ agent: claude
112
+ do: >
113
+ Finalize the content for ${input.description}. Update any cross-references
114
+ (README, CHANGELOG, index files). Commit with a descriptive message.
115
+ out: ContentResult
116
+ attempts: 2
@@ -6,47 +6,66 @@
6
6
  # steps: 1
7
7
  # estimated_minutes: 10
8
8
 
9
- version: "0.1"
9
+ version: 1
10
10
 
11
11
  # coverage-sweep pipeline
12
12
  #
13
- # Runs the test suite in a loop until all tests pass.
14
- # Same pattern as review-fix.stratum.yaml but for test coverage.
13
+ # Runs the test suite until it passes. The loop is the step's own `attempts`
14
+ # budget: `ensure` rejects a run with failures, the engine retries the step with
15
+ # the previous failure as feedback, and the step only settles when the suite is
16
+ # green. Same pattern as review-fix.stratum.yaml but for test coverage.
15
17
  #
16
- # Inputs:
17
- # taskwhat to test (feature description, file paths, etc.)
18
+ # COMP-PIPELINE-QUARANTINE: re-authored from v0.1 to TS v1. `retries: 15` became
19
+ # `attempts: 16` v0.1 counted retries AFTER the first try, so a bare rename
20
+ # would have cost this pipeline a run.
18
21
  #
19
- # Usage:
20
- # stratum_plan <this yaml> "coverage_sweep" {"task": "..."}
22
+ # DELIBERATE BEHAVIOR CHANGE (owner decision, not a side effect of the dialect
23
+ # move): the v0.1 prompt only RAN the suite and reported failures, so a retry
24
+ # re-ran identical code and reported the identical failure up to fifteen times —
25
+ # a loop that could not converge. The step now fixes what it finds before the
26
+ # next attempt, which is what makes the retry budget meaningful. This makes the
27
+ # pipeline write-capable, so it is no longer safe to treat as read-only.
28
+ #
29
+ #
30
+ # COMP-PIPELINE-QUARANTINE round 2: the flow input is the RUNNER's envelope, not
31
+ # a bespoke `task`. runBuild derives plan inputs from the MODE, not from the spec
32
+ # (lib/build.js startFresh), and feature mode always sends
33
+ # {featureCode, description, implementer_agent, reviewer_agent} plus an optional
34
+ # pre_merge_gate. Declaring `task` meant this spec resolved but could never plan —
35
+ # making it reachable via `--template` without this change just moved the failure
36
+ # from "not found" to a failed run. `${input.description}` carries what `task` did.
37
+ # Inputs (the runner's feature envelope):
38
+ # featureCode — the feature/work code
39
+ # description — what to do; this is what the old `task` input carried
21
40
 
22
41
  contracts:
23
42
  CoverageResult:
24
- passing: {type: boolean}
25
- summary: {type: string}
26
- failures: {type: array}
27
-
28
- functions:
29
- run_coverage:
30
- mode: compute
31
- intent: >
32
- Run the project test suite. Return structured JSON:
33
- { "passing": boolean, "summary": string, "failures": string[] }.
34
- Set passing=true only if all tests pass with no failures.
35
- If tests fail, list each failing test name in the failures array.
36
- input:
37
- task: {type: string}
38
- output: CoverageResult
39
- ensure:
40
- - "result.passing == true"
41
- retries: 15
43
+ passing: boolean
44
+ summary: string
45
+ failures: string[]
42
46
 
43
47
  flows:
48
+ entry: coverage_sweep
44
49
  coverage_sweep:
45
50
  input:
46
- task: {type: string}
47
- output: CoverageResult
51
+ featureCode: string
52
+ description: string
53
+ implementer_agent: string?
54
+ reviewer_agent: string?
55
+ pre_merge_gate: string[]?
56
+ output:
57
+ from: "${sweep.output}"
58
+ contract: CoverageResult
48
59
  steps:
49
60
  - id: sweep
50
- function: run_coverage
51
- inputs:
52
- task: "$.input.task"
61
+ agent: claude
62
+ do: >
63
+ Run the project test suite for ${input.description}. Return structured JSON:
64
+ { "passing": boolean, "summary": string, "failures": string[] }.
65
+ Set passing=true only if all tests pass with no failures.
66
+ If tests fail, list each failing test name in the failures array and
67
+ fix them before the next attempt.
68
+ out: CoverageResult
69
+ ensure:
70
+ - expr: "result.passing == true"
71
+ attempts: 16
@@ -1,4 +1,4 @@
1
- version: "0.3"
1
+ version: 1
2
2
 
3
3
  # COMP-ROADMAP-PLAN — the `plan` product-planning lifecycle (peer to build/fix).
4
4
  # Front half of goal-to-product: frame → research → ideate → converge → estimate
@@ -8,95 +8,93 @@ version: "0.3"
8
8
  # planInputs envelope (lib/lifecycle-modes.js plan.runner.planInputs == 'plan').
9
9
  # Absorbs `compose new`: ideation routes to the ideabox, output is canonical
10
10
  # feature.json (not hand-authored ROADMAP rows or design.md-only seeds).
11
-
12
- workflow:
13
- name: plan
14
- description: "Product-planning lifecycle — frame, research, ideate, converge to build-ready feature specs"
15
- input:
16
- projectName:
17
- type: string
18
- required: true
19
- intent:
20
- type: string
21
- required: true
11
+ #
12
+ # COMP-PIPELINE-QUARANTINE: re-authored from v0.3 to TS v1, which is what makes
13
+ # `compose plan` runnable again — it had been dead since the STRAT-PY-RETIRE
14
+ # cutover, and was edited on 2026-08-05 while already unrunnable.
15
+ # - The `workflow:` header and the `functions:` gate declarations are gone; v1
16
+ # declares flow input on the flow and gates inline as `gate:` blocks. The
17
+ # approve/revise/kill routing is carried over unchanged, including the
18
+ # backward `on_revise` edges, which v1 gates express natively.
19
+ # - Interpolation moves from single-brace `{intent}` to `${input.intent}`, and
20
+ # step references from `$.steps.plan.output.created` to `${plan.output.created}`.
21
+ # The `{{...}}` escape the old templater needed for literal JSON braces is no
22
+ # longer required, so those are plain braces now.
23
+ # - `retries: N` -> `attempts: N + 1` (v0.3 counted retries AFTER the first try).
22
24
 
23
25
  contracts:
24
26
  PlanDesignResult:
25
- artifact: {type: string}
26
- features: {type: array}
27
- summary: {type: string}
27
+ artifact: string
28
+ features: string[]
29
+ summary: string
28
30
 
29
31
  PlanConvergeResult:
30
- artifact: {type: string}
31
- created: {type: array}
32
- summary: {type: string}
32
+ artifact: string
33
+ created: string[]
34
+ summary: string
33
35
 
34
36
  PlanHandoffResult:
35
- handed_off: {type: array}
36
- summary: {type: string}
37
-
38
- functions:
39
- plan_design_gate:
40
- mode: gate
41
- timeout: 7200
42
-
43
- plan_converge_gate:
44
- mode: gate
45
- timeout: 7200
37
+ handed_off: string[]
38
+ summary: string
46
39
 
47
40
  flows:
41
+ entry: plan
48
42
  plan:
49
43
  input:
50
- projectName: {type: string}
51
- intent: {type: string}
52
- output: PlanHandoffResult
44
+ projectName: string
45
+ intent: string
46
+ output:
47
+ from: "${ship.output}"
48
+ contract: PlanHandoffResult
49
+ max_rounds: 10
53
50
  steps:
54
51
  # Phase: explore_design — frame, research, ideate
55
52
  - id: explore_design
56
53
  agent: claude
57
- intent: >
58
- You are running the PRODUCT-PLANNING front half for this intent: {intent}
54
+ do: >
55
+ You are running the PRODUCT-PLANNING front half for this intent:
56
+ ${input.intent}
59
57
 
60
- Do three things, then write the result to docs/plans/{projectName}/design.md:
58
+ Do three things, then write the result to
59
+ docs/plans/${input.projectName}/design.md:
61
60
  1. FRAME — restate the goal, the problem it solves, who it is for, and the
62
61
  scope boundaries (what is in v1, what is explicitly out).
63
62
  2. RESEARCH — search the web and the codebase for prior art, existing
64
63
  tools, architectural patterns, and risks. Summarize what is relevant.
65
64
  3. IDEATE — propose candidate features (each with a short code and a
66
- one-line description, ordered by dependency). Capture each idea in the
67
- ideabox funnel (append to docs/product/ideabox.md, or run
68
- `compose ideabox add`) so ideation lives in the funnel, not here. Then
69
- shortlist the features you recommend building first.
70
-
71
- Write docs/plans/{projectName}/design.md containing FRAME, RESEARCH, and
72
- the shortlist (with feature codes). Return its path in "artifact" and the
65
+ one-line description, ordered by dependency). Capture each idea with
66
+ `compose ideabox add "<title>" [--desc ...] [--cluster ...]` so ideation
67
+ lives in the funnel, not here. Do NOT edit docs/product/ideabox.md
68
+ directly: it is generated output now, and an edit to it is discarded by
69
+ the next render. Then shortlist the features you recommend building first.
70
+
71
+ Write docs/plans/${input.projectName}/design.md containing FRAME, RESEARCH,
72
+ and the shortlist (with feature codes). Return its path in "artifact" and the
73
73
  shortlisted feature codes in "features".
74
- inputs:
75
- projectName: "$.input.projectName"
76
- intent: "$.input.intent"
77
- output_contract: PlanDesignResult
74
+ out: PlanDesignResult
78
75
  ensure:
79
- - "file_exists(result.artifact)"
80
- - "len(result.features) > 0"
81
- retries: 2
76
+ - expr: "file_exists(result.artifact)"
77
+ - expr: "len(result.features) > 0"
78
+ attempts: 3
82
79
 
83
80
  # Gate: human reviews the framing + research + shortlist
84
81
  - id: plan_design_gate
85
- function: plan_design_gate
86
- on_approve: plan
87
- on_revise: explore_design
88
- on_kill: null
89
- depends_on: [explore_design]
82
+ after: [explore_design]
83
+ gate:
84
+ on_approve: plan
85
+ on_revise: explore_design
86
+ on_kill: null
90
87
 
91
88
  # Phase: plan — converge, estimate, write build-ready specs
92
89
  - id: plan
90
+ after: [plan_design_gate]
93
91
  agent: claude
94
- intent: >
95
- Converge the shortlist in docs/plans/{projectName}/design.md into
92
+ do: >
93
+ Converge the shortlist in docs/plans/${input.projectName}/design.md into
96
94
  build-ready feature specs. For EACH feature you commit to building:
97
95
  1. ESTIMATE — assign a complexity (S | M | L | XL) and a triage build
98
96
  profile (which lifecycle phases it needs, e.g.
99
- {{"needs_prd": false, "needs_architecture": false}}).
97
+ {"needs_prd": false, "needs_architecture": false}).
100
98
  2. SPEC — first write the per-feature design to <CODE>/design.md inside the
101
99
  project features dir (docs/features/<CODE>/design.md by default, or the
102
100
  paths.features root in .compose/compose.json). This is a real
@@ -109,53 +107,45 @@ flows:
109
107
  compose roadmap add <CODE> --description "<one-line>" --phase "<phase>" \
110
108
  --status PLANNED --complexity <S|M|L|XL> \
111
109
  --profile '{"needs_prd":<bool>,"needs_architecture":<bool>,"needs_verification":<bool>,"needs_report":<bool>}' \
112
- --planned-by "{projectName}" [--impact <low|medium|high>]
110
+ --planned-by "${input.projectName}" [--impact <low|medium|high>]
113
111
 
114
112
  Write design.md BEFORE running it (the command verifies design.md exists
115
113
  and refuses otherwise). Do NOT hand-author ROADMAP rows or write
116
114
  feature.json by hand.
117
115
 
118
116
  Then write the planning narrative (decisions, estimates, sequencing) to
119
- docs/plans/{projectName}/plan.md. Return plan.md in "artifact" and the
117
+ docs/plans/${input.projectName}/plan.md. Return plan.md in "artifact" and the
120
118
  created feature codes in "created".
121
- inputs:
122
- projectName: "$.input.projectName"
123
- intent: "$.input.intent"
124
- output_contract: PlanConvergeResult
119
+ out: PlanConvergeResult
125
120
  ensure:
126
- - "file_exists(result.artifact)"
127
- - "len(result.created) > 0"
128
- retries: 2
129
- depends_on: [plan_design_gate]
121
+ - expr: "file_exists(result.artifact)"
122
+ - expr: "len(result.created) > 0"
123
+ attempts: 3
130
124
 
131
125
  # Gate: human approves the converged plan + build-ready specs
132
126
  - id: plan_converge_gate
133
- function: plan_converge_gate
134
- on_approve: ship
135
- on_revise: plan
136
- on_kill: null
137
- depends_on: [plan]
127
+ after: [plan]
128
+ gate:
129
+ on_approve: ship
130
+ on_revise: plan
131
+ on_kill: null
138
132
 
139
133
  # Phase: ship — handoff / verify build-readiness (plan mode does NOT git-commit
140
134
  # here; runBuild's ship interception is gated off for mode=plan).
141
135
  - id: ship
136
+ after: [plan_converge_gate]
142
137
  agent: claude
143
- intent: >
144
- Finalize the planbuild handoff. For EACH feature code in the provided
145
- "created" list (the features the plan phase produced), verify its folder
146
- under the project features dir (docs/features/<CODE>/ by default, or the
147
- paths.features root in .compose/compose.json) has a feature.json (status
148
- PLANNED, with plannedBy "{projectName}", complexity, profile,
138
+ do: >
139
+ Finalize the plan-to-build handoff. For EACH feature code in
140
+ ${plan.output.created} (the features the plan phase produced), verify its
141
+ folder under the project features dir (docs/features/<CODE>/ by default, or
142
+ the paths.features root in .compose/compose.json) has a feature.json (status
143
+ PLANNED, with plannedBy "${input.projectName}", complexity, profile,
149
144
  triageTimestamp) and a design.md. Produce a short handoff summary listing
150
145
  each build-ready feature and the exact `compose build <CODE>` command to
151
146
  start it. Do NOT git-commit here — just verify and summarize. Return the
152
147
  verified feature codes in "handed_off".
153
- inputs:
154
- projectName: "$.input.projectName"
155
- intent: "$.input.intent"
156
- created: "$.steps.plan.output.created"
157
- output_contract: PlanHandoffResult
148
+ out: PlanHandoffResult
158
149
  ensure:
159
- - "len(result.handed_off) > 0"
160
- retries: 1
161
- depends_on: [plan_converge_gate]
150
+ - expr: "len(result.handed_off) > 0"
151
+ attempts: 2