cool-workflow 0.1.78

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 (193) hide show
  1. package/.claude-plugin/plugin.json +20 -0
  2. package/.codex-plugin/mcp.json +10 -0
  3. package/.codex-plugin/plugin.json +38 -0
  4. package/.mcp.json +10 -0
  5. package/LICENSE +24 -0
  6. package/README.md +638 -0
  7. package/apps/architecture-review/app.json +51 -0
  8. package/apps/architecture-review/workflow.js +116 -0
  9. package/apps/end-to-end-golden-path/app.json +30 -0
  10. package/apps/end-to-end-golden-path/workflow.js +33 -0
  11. package/apps/pr-review-fix-ci/app.json +59 -0
  12. package/apps/pr-review-fix-ci/workflow.js +90 -0
  13. package/apps/release-cut/app.json +54 -0
  14. package/apps/release-cut/workflow.js +82 -0
  15. package/apps/research-synthesis/app.json +50 -0
  16. package/apps/research-synthesis/workflow.js +76 -0
  17. package/apps/workflow-app-framework-demo/app.json +29 -0
  18. package/apps/workflow-app-framework-demo/workflow.js +44 -0
  19. package/dist/agent-config.js +223 -0
  20. package/dist/candidate-scoring.js +715 -0
  21. package/dist/capability-core.js +630 -0
  22. package/dist/capability-dispatcher.js +86 -0
  23. package/dist/capability-registry.js +523 -0
  24. package/dist/cli.js +1276 -0
  25. package/dist/collaboration.js +727 -0
  26. package/dist/commit.js +570 -0
  27. package/dist/contract-migration.js +234 -0
  28. package/dist/coordinator.js +1163 -0
  29. package/dist/daemon.js +44 -0
  30. package/dist/dispatch.js +201 -0
  31. package/dist/drive.js +503 -0
  32. package/dist/error-feedback.js +415 -0
  33. package/dist/evidence-grounding.js +179 -0
  34. package/dist/evidence-reasoning.js +733 -0
  35. package/dist/execution-backend.js +1279 -0
  36. package/dist/harness.js +61 -0
  37. package/dist/mcp-server.js +1615 -0
  38. package/dist/multi-agent-eval.js +857 -0
  39. package/dist/multi-agent-host.js +764 -0
  40. package/dist/multi-agent-operator-ux.js +537 -0
  41. package/dist/multi-agent-trust.js +366 -0
  42. package/dist/multi-agent.js +1173 -0
  43. package/dist/node-snapshot.js +270 -0
  44. package/dist/observability.js +922 -0
  45. package/dist/operator-ux.js +971 -0
  46. package/dist/orchestrator/audit-operations.js +182 -0
  47. package/dist/orchestrator/candidate-operations.js +117 -0
  48. package/dist/orchestrator/cli-options.js +288 -0
  49. package/dist/orchestrator/collaboration-operations.js +86 -0
  50. package/dist/orchestrator/feedback-operations.js +81 -0
  51. package/dist/orchestrator/host-operations.js +78 -0
  52. package/dist/orchestrator/lifecycle-operations.js +462 -0
  53. package/dist/orchestrator/migration-operations.js +44 -0
  54. package/dist/orchestrator/multi-agent-operations.js +362 -0
  55. package/dist/orchestrator/report.js +369 -0
  56. package/dist/orchestrator/topology-operations.js +84 -0
  57. package/dist/orchestrator.js +874 -0
  58. package/dist/pipeline-contract.js +92 -0
  59. package/dist/pipeline-runner.js +285 -0
  60. package/dist/reclamation.js +882 -0
  61. package/dist/result-normalize.js +194 -0
  62. package/dist/run-export.js +64 -0
  63. package/dist/run-registry.js +1347 -0
  64. package/dist/run-state-schema.js +67 -0
  65. package/dist/sandbox-profile.js +471 -0
  66. package/dist/scheduler.js +266 -0
  67. package/dist/scheduling.js +184 -0
  68. package/dist/schema-validate.js +98 -0
  69. package/dist/state-explosion.js +1213 -0
  70. package/dist/state-migrations.js +463 -0
  71. package/dist/state-node.js +301 -0
  72. package/dist/state.js +308 -0
  73. package/dist/telemetry-attestation.js +156 -0
  74. package/dist/telemetry-ledger.js +145 -0
  75. package/dist/topology.js +527 -0
  76. package/dist/triggers.js +159 -0
  77. package/dist/trust-audit.js +475 -0
  78. package/dist/types/blackboard.js +2 -0
  79. package/dist/types/boundary.js +29 -0
  80. package/dist/types/candidate.js +2 -0
  81. package/dist/types/collaboration.js +2 -0
  82. package/dist/types/core.js +2 -0
  83. package/dist/types/drive.js +10 -0
  84. package/dist/types/error-feedback.js +2 -0
  85. package/dist/types/evidence-reasoning.js +2 -0
  86. package/dist/types/execution-backend.js +2 -0
  87. package/dist/types/multi-agent.js +2 -0
  88. package/dist/types/observability.js +2 -0
  89. package/dist/types/pipeline.js +2 -0
  90. package/dist/types/reclamation.js +8 -0
  91. package/dist/types/result.js +2 -0
  92. package/dist/types/run-registry.js +2 -0
  93. package/dist/types/run.js +2 -0
  94. package/dist/types/sandbox.js +2 -0
  95. package/dist/types/schedule.js +2 -0
  96. package/dist/types/state-node.js +2 -0
  97. package/dist/types/topology.js +2 -0
  98. package/dist/types/trust.js +2 -0
  99. package/dist/types/workbench.js +2 -0
  100. package/dist/types/worker.js +2 -0
  101. package/dist/types/workflow-app.js +2 -0
  102. package/dist/types.js +43 -0
  103. package/dist/verifier-registry.js +46 -0
  104. package/dist/verifier.js +78 -0
  105. package/dist/version.js +8 -0
  106. package/dist/workbench-host.js +172 -0
  107. package/dist/workbench.js +190 -0
  108. package/dist/worker-isolation.js +1028 -0
  109. package/dist/workflow-api.js +98 -0
  110. package/dist/workflow-app-framework.js +626 -0
  111. package/docs/agent-delegation-drive.7.md +190 -0
  112. package/docs/agent-framework.md +176 -0
  113. package/docs/candidate-scoring.7.md +106 -0
  114. package/docs/canonical-workflow-apps.7.md +137 -0
  115. package/docs/capability-topology-registry.7.md +168 -0
  116. package/docs/cli-mcp-parity.7.md +373 -0
  117. package/docs/contract-migration-tooling.7.md +123 -0
  118. package/docs/control-plane-scheduling.7.md +110 -0
  119. package/docs/coordinator-blackboard.7.md +183 -0
  120. package/docs/dogfood/architecture-review-cool-workflow.md +16 -0
  121. package/docs/dogfood-one-real-repo.7.md +168 -0
  122. package/docs/durable-state-and-locking.7.md +107 -0
  123. package/docs/end-to-end-golden-path.7.md +117 -0
  124. package/docs/error-feedback.7.md +153 -0
  125. package/docs/evidence-adoption-reasoning-chain.7.md +270 -0
  126. package/docs/execution-backends.7.md +300 -0
  127. package/docs/getting-started.md +99 -0
  128. package/docs/index.md +41 -0
  129. package/docs/mcp-app-surface.7.md +235 -0
  130. package/docs/multi-agent-cli-mcp-surface.7.md +265 -0
  131. package/docs/multi-agent-eval-replay-harness.7.md +302 -0
  132. package/docs/multi-agent-operator-ux.7.md +314 -0
  133. package/docs/multi-agent-runtime-core.7.md +231 -0
  134. package/docs/multi-agent-topologies.7.md +103 -0
  135. package/docs/multi-agent-trust-policy-audit.7.md +154 -0
  136. package/docs/node-snapshot-diff-replay.7.md +135 -0
  137. package/docs/observability-cost-accounting.7.md +194 -0
  138. package/docs/operator-ux.7.md +180 -0
  139. package/docs/pipeline-runner.7.md +136 -0
  140. package/docs/project-index.md +261 -0
  141. package/docs/real-execution-backends.7.md +142 -0
  142. package/docs/release-and-migration.7.md +280 -0
  143. package/docs/release-tooling.7.md +159 -0
  144. package/docs/routines.md +48 -0
  145. package/docs/run-registry-control-plane.7.md +312 -0
  146. package/docs/run-retention-reclamation.7.md +191 -0
  147. package/docs/sandbox-profiles.7.md +137 -0
  148. package/docs/scheduled-tasks.md +80 -0
  149. package/docs/security-trust-hardening.7.md +117 -0
  150. package/docs/state-explosion-management.7.md +264 -0
  151. package/docs/state-node.7.md +96 -0
  152. package/docs/team-collaboration.7.md +207 -0
  153. package/docs/unix-principles.md +192 -0
  154. package/docs/verifier-gated-commit.7.md +140 -0
  155. package/docs/web-desktop-workbench.7.md +215 -0
  156. package/docs/worker-isolation.7.md +167 -0
  157. package/docs/workflow-app-framework.7.md +274 -0
  158. package/manifest/README.md +43 -0
  159. package/manifest/plugin.manifest.json +316 -0
  160. package/manifest/pricing.policy.json +14 -0
  161. package/package.json +79 -0
  162. package/scripts/agents/claude-p-agent.js +104 -0
  163. package/scripts/agents/claude-p-agent.sh +9 -0
  164. package/scripts/agents/cw-attest-keygen.js +55 -0
  165. package/scripts/agents/cw-attest-wrap.js +143 -0
  166. package/scripts/block-unapproved-tag.sh +39 -0
  167. package/scripts/bump-version.js +249 -0
  168. package/scripts/canonical-apps.js +171 -0
  169. package/scripts/cw.js +4 -0
  170. package/scripts/dist-drift-check.js +79 -0
  171. package/scripts/dogfood-architecture-review.js +237 -0
  172. package/scripts/dogfood-release.js +624 -0
  173. package/scripts/forward-ref-docs.js +73 -0
  174. package/scripts/gen-manifests.js +232 -0
  175. package/scripts/golden-path.js +300 -0
  176. package/scripts/mcp-server.js +4 -0
  177. package/scripts/new-feature.js +121 -0
  178. package/scripts/parity-check.js +213 -0
  179. package/scripts/release-check.js +118 -0
  180. package/scripts/release-flow.js +272 -0
  181. package/scripts/release-gate.sh +85 -0
  182. package/scripts/sync-project-index.js +387 -0
  183. package/scripts/validate-run-state-schema.js +126 -0
  184. package/scripts/verify-container-selfref.js +64 -0
  185. package/scripts/version-sync-check.js +237 -0
  186. package/skills/cool-workflow/SKILL.md +162 -0
  187. package/skills/cool-workflow/references/commands.md +282 -0
  188. package/tsconfig.json +16 -0
  189. package/ui/workbench/app.css +76 -0
  190. package/ui/workbench/app.js +159 -0
  191. package/ui/workbench/index.html +32 -0
  192. package/workflows/architecture-review.workflow.js +84 -0
  193. package/workflows/research-synthesis.workflow.js +47 -0
@@ -0,0 +1,282 @@
1
+ # Cool Workflow — Command & MCP Reference
2
+
3
+ Full CLI catalog and the matching MCP tool surface. The `SKILL.md` body covers
4
+ the operating loop and the handful of commands you need most; come here when you
5
+ need the exact invocation for a specific capability.
6
+
7
+ Run CLI commands from the plugin root (`plugins/cool-workflow`) or with the
8
+ absolute plugin script path. Run data is written to `.cw/runs/<run-id>/` under
9
+ `--cwd`, or under `--repo` when `--cwd` is not given.
10
+
11
+ ## Contents
12
+
13
+ - [Discovery & apps](#discovery--apps)
14
+ - [Plan / dispatch / result / report](#plan--dispatch--result--report)
15
+ - [Topologies](#topologies)
16
+ - [Multi-agent host surface](#multi-agent-host-surface)
17
+ - [Multi-agent low-level state](#multi-agent-low-level-state)
18
+ - [Eval & replay](#eval--replay)
19
+ - [Blackboard & coordinator](#blackboard--coordinator)
20
+ - [Sandbox profiles](#sandbox-profiles)
21
+ - [Commit, state & summaries](#commit-state--summaries)
22
+ - [Scheduling & routines](#scheduling--routines)
23
+ - [Release & maintenance npm scripts](#release--maintenance-npm-scripts)
24
+ - [MCP tools](#mcp-tools)
25
+
26
+ ## Discovery & apps
27
+
28
+ ```bash
29
+ node scripts/cw.js list
30
+ node scripts/cw.js app list
31
+ node scripts/cw.js app show architecture-review
32
+ node scripts/cw.js app show pr-review-fix-ci
33
+ node scripts/cw.js app show release-cut
34
+ node scripts/cw.js app show research-synthesis
35
+ node scripts/cw.js app validate apps/architecture-review/app.json
36
+ node scripts/cw.js app show workflow-app-framework-demo
37
+ node scripts/cw.js app validate apps/workflow-app-framework-demo/app.json
38
+ node scripts/cw.js app validate end-to-end-golden-path
39
+ node scripts/cw.js app package workflow-app-framework-demo
40
+ node scripts/cw.js app init my-app --title "My App"
41
+ node scripts/cw.js init my-workflow --title "My Workflow"
42
+ ```
43
+
44
+ The canonical app ids are `architecture-review`, `pr-review-fix-ci`,
45
+ `release-cut`, and `research-synthesis`. First-class apps live under
46
+ `apps/<app-id>/app.json`; legacy `workflows/*.workflow.js` factories remain valid
47
+ and are wrapped as compatibility apps with explicit `legacy-*` ids.
48
+
49
+ ## Portable release flow (any platform)
50
+
51
+ ```bash
52
+ # Delegate the independent review to the model of this host (Codex shown):
53
+ export CW_AGENT_COMMAND="codex exec {{input}}"
54
+ node plugins/cool-workflow/scripts/release-flow.js --check
55
+ node plugins/cool-workflow/scripts/release-flow.js --cut --version 0.1.77 [--push]
56
+ ```
57
+
58
+ One zero-dependency orchestrator runs the gate + independent reviewer under any
59
+ harness; the reviewer is delegated via `CW_AGENT_COMMAND`/`CW_AGENT_ENDPOINT`
60
+ (presets for Claude/Codex/Gemini/OpenCode/DeepSeek in `docs/release-tooling.7.md`).
61
+
62
+ ## Plan / dispatch / result / report
63
+
64
+ ```bash
65
+ node scripts/cw.js plan architecture-review --repo /path/to/repo --question "Is this architecture sound?"
66
+ node scripts/cw.js status <run-id>
67
+ node scripts/cw.js status <run-id> --json
68
+ node scripts/cw.js graph <run-id>
69
+ node scripts/cw.js graph <run-id> --json
70
+ node scripts/cw.js dispatch <run-id> --limit 6
71
+ node scripts/cw.js dispatch <run-id> --sandbox readonly
72
+ node scripts/cw.js result <run-id> <task-id> /path/to/result.md
73
+ node scripts/cw.js report <run-id>
74
+ node scripts/cw.js report <run-id> --show
75
+ ```
76
+
77
+ Operator UX is human-readable by default for `status`, `graph`, report
78
+ `--show`/`--summary`, and resource `summary` commands. Use `--json` or
79
+ `--format json` when scripts or MCP-style integrations need structured output.
80
+ Status recommendations are deterministic hints, not hidden automation.
81
+
82
+ ## Topologies
83
+
84
+ Official userland recipes on top of the process table and shared coordination
85
+ filesystem. `map-reduce`, `debate`, and `judge-panel` materialize ordinary run,
86
+ role, group, fanout/fanin, blackboard, coordinator, candidate, commit, and audit
87
+ records — deterministic recipes, not hidden autonomous coordination.
88
+
89
+ ```bash
90
+ node scripts/cw.js topology list
91
+ node scripts/cw.js topology show map-reduce
92
+ node scripts/cw.js topology validate map-reduce
93
+ node scripts/cw.js topology apply <run-id> map-reduce --task task-id --mapper-count 2
94
+ node scripts/cw.js topology summary <run-id>
95
+ node scripts/cw.js topology graph <run-id>
96
+ ```
97
+
98
+ ## Multi-agent host surface
99
+
100
+ Prefer this high-level surface (`run -> status -> step -> blackboard -> score ->
101
+ select`) when an agent host needs to drive multi-agent work without manual id
102
+ plumbing. It wraps the topology, multi-agent, blackboard, candidate, commit, and
103
+ audit primitives; it does not replace them.
104
+
105
+ ```bash
106
+ node scripts/cw.js multi-agent run <run-id> --topology judge-panel --task task-id
107
+ node scripts/cw.js multi-agent status <run-id>
108
+ node scripts/cw.js multi-agent step <run-id> --sandbox readonly
109
+ node scripts/cw.js multi-agent blackboard <run-id> summary
110
+ node scripts/cw.js multi-agent score <run-id> candidate-id --criterion correctness=1 --evidence ref
111
+ node scripts/cw.js multi-agent select <run-id> candidate-id --reason "verified winner"
112
+ ```
113
+
114
+ Operator views (who depends on whom, who is blocked, which evidence was adopted):
115
+
116
+ ```bash
117
+ node scripts/cw.js multi-agent summary <run-id>
118
+ node scripts/cw.js multi-agent graph <run-id>
119
+ node scripts/cw.js multi-agent dependencies <run-id>
120
+ node scripts/cw.js multi-agent failures <run-id>
121
+ node scripts/cw.js multi-agent evidence <run-id>
122
+ ```
123
+
124
+ State Explosion Management — when a run grows too large to read, use derived,
125
+ provenance-backed digests (they never delete raw records and fail closed when
126
+ stale; every synthetic node carries source ids and an expansion command):
127
+
128
+ ```bash
129
+ node scripts/cw.js summary refresh <run-id>
130
+ node scripts/cw.js summary show <run-id>
131
+ node scripts/cw.js blackboard summarize <run-id>
132
+ node scripts/cw.js multi-agent summarize <run-id>
133
+ node scripts/cw.js multi-agent graph <run-id> --view compact|critical-path|failures|... [--focus <id>] [--depth <n>]
134
+ ```
135
+
136
+ Trust / Policy / Audit — inspect role authority, message provenance, blackboard
137
+ write decisions, judge rationale, panel decisions, and why a result is trusted
138
+ (missing policy/evidence/provenance/rationale fail closed):
139
+
140
+ ```bash
141
+ node scripts/cw.js audit multi-agent <run-id>
142
+ node scripts/cw.js audit policy <run-id>
143
+ node scripts/cw.js audit role <run-id>
144
+ node scripts/cw.js audit blackboard <run-id>
145
+ node scripts/cw.js audit judge <run-id>
146
+ ```
147
+
148
+ ## Multi-agent low-level state
149
+
150
+ First-class runtime state around dispatches (`MultiAgentRun`, `AgentRole`,
151
+ `AgentGroup`, `AgentMembership`, `AgentFanout`, `AgentFanin`). CW records and
152
+ validates this state; the host still executes agents. Invalid lifecycle
153
+ transitions, duplicate memberships, ambiguous dispatch attachment, and missing
154
+ fanin evidence fail closed.
155
+
156
+ ```bash
157
+ node scripts/cw.js multi-agent run <run-id> --id ma --objective "coordinated work"
158
+ node scripts/cw.js multi-agent role <run-id> role --multi-agent-run ma --responsibility "do work" --required-evidence "result evidence"
159
+ node scripts/cw.js multi-agent group <run-id> group --multi-agent-run ma --task task-id
160
+ node scripts/cw.js multi-agent fanout <run-id> fanout --group group --reason "split work" --role role --task task-id
161
+ node scripts/cw.js dispatch <run-id> --multi-agent-run ma --multi-agent-group group --multi-agent-role role --multi-agent-fanout fanout
162
+ node scripts/cw.js multi-agent fanin <run-id> fanin --group group --fanout fanout --required-role role
163
+ ```
164
+
165
+ ## Eval & replay
166
+
167
+ Use when a topology-backed multi-agent run needs release-gate evidence.
168
+ Artifacts live under `.cw/evals/<suite-id>/` as plain JSON plus `report.md`.
169
+
170
+ ```bash
171
+ node scripts/cw.js eval snapshot <run-id> --id suite-id
172
+ node scripts/cw.js eval replay .cw/evals/suite-id/snapshot.json
173
+ node scripts/cw.js eval compare .cw/evals/suite-id/snapshot.json .cw/evals/suite-id/replay-run.json
174
+ node scripts/cw.js eval score .cw/evals/suite-id/replay-run.json
175
+ node scripts/cw.js eval gate .cw/evals/suite-id
176
+ node scripts/cw.js eval report .cw/evals/suite-id/replay-run.json
177
+ ```
178
+
179
+ ## Blackboard & coordinator
180
+
181
+ The shared coordination substrate: durable blackboards, topics, messages,
182
+ context frames, artifact refs, snapshots, and coordinator decisions under
183
+ `.cw/runs/<run-id>/blackboard/`.
184
+
185
+ ```bash
186
+ node scripts/cw.js blackboard summary <run-id>
187
+ node scripts/cw.js blackboard topic create <run-id> --id topic --title "Shared context"
188
+ node scripts/cw.js blackboard message post <run-id> --topic topic --body "message"
189
+ node scripts/cw.js blackboard context put <run-id> --topic topic --kind fact --key finding --value "evidence-backed fact"
190
+ node scripts/cw.js blackboard artifact add <run-id> --topic topic --path /path/to/result.md --kind worker-result
191
+ node scripts/cw.js blackboard snapshot <run-id>
192
+ node scripts/cw.js coordinator summary <run-id>
193
+ node scripts/cw.js coordinator decision <run-id> --kind conflict-resolution --outcome accepted --reason "evidence supports this"
194
+ ```
195
+
196
+ ## Sandbox profiles
197
+
198
+ Named CW policy contracts describing worker read paths, write paths, command
199
+ policy, network policy, environment exposure, and host enforcement requirements.
200
+ CW enforces profile validation and worker result acceptance; the agent host
201
+ enforces OS/process/network/environment controls.
202
+
203
+ ```bash
204
+ node scripts/cw.js sandbox list
205
+ node scripts/cw.js sandbox show readonly
206
+ node scripts/cw.js sandbox validate ./site-sandbox.json
207
+ node scripts/cw.js worker manifest <run-id> <worker-id>
208
+ ```
209
+
210
+ ## Commit, state & summaries
211
+
212
+ Durable run state lives at `.cw/runs/<run-id>/state.json`. `state check`
213
+ dry-runs migration and normalization; newer unsupported schemas fail closed and
214
+ unknown user data is preserved.
215
+
216
+ ```bash
217
+ node scripts/cw.js commit <run-id> --verifier <node-id> --reason "verified result"
218
+ node scripts/cw.js commit <run-id> --selection <selection-id> --reason "verified winner"
219
+ node scripts/cw.js commit <run-id> --allow-unverified-checkpoint --reason "manual checkpoint"
220
+ node scripts/cw.js worker summary <run-id>
221
+ node scripts/cw.js candidate summary <run-id>
222
+ node scripts/cw.js feedback summary <run-id>
223
+ node scripts/cw.js commit summary <run-id>
224
+ node scripts/cw.js state check <run-id>
225
+ ```
226
+
227
+ ## Scheduling & routines
228
+
229
+ CW supports loop, cron, and reminder schedules in `.cw/schedules/tasks.json`.
230
+ Use `schedule due` to find due work and `schedule complete <id>` after the due
231
+ prompt is handled. `routine create`/`routine fire` handle API/GitHub trigger
232
+ events.
233
+
234
+ ```bash
235
+ node scripts/cw.js loop --intervalMinutes 30 --prompt "Continue this workflow."
236
+ node scripts/cw.js schedule create --kind loop --intervalMinutes 30 --prompt "Continue this workflow."
237
+ node scripts/cw.js schedule due
238
+ node scripts/cw.js schedule daemon --once
239
+ node scripts/cw.js routine create --kind github --prompt "Handle this GitHub event."
240
+ node scripts/cw.js routine fire github payload.json
241
+ ```
242
+
243
+ ## Release & maintenance npm scripts
244
+
245
+ ```bash
246
+ npm run canonical-apps # validate + plan the official app matrix (no network)
247
+ npm run golden-path # release regression for the full public chain
248
+ npm run dogfood:release # real-repo release-cut dry-run against this repo
249
+ npm run fixture-compat # check old run fixtures still load
250
+ npm run eval:replay # deterministic multi-agent eval/replay harness
251
+ npm run version:sync # verify version synchronization across surfaces
252
+ npm run release:check # dry-run release gate (build, types, tests, replay, dogfood)
253
+ ```
254
+
255
+ `golden-path` exercises `workflow app -> plan -> dispatch -> isolated worker ->
256
+ candidate scoring -> verifier -> gated commit -> report`, writing a simulated
257
+ worker `cw:result` and asserting durable state files rather than exit codes.
258
+ `release:check` does not tag, push, publish, or mutate fixtures.
259
+
260
+ ## MCP tools
261
+
262
+ When an MCP host is available, the same runtime surface is exposed with
263
+ JSON-first tools. **Preserve CLI/MCP parity when extending CW** — every CLI
264
+ capability must have a matching MCP tool and vice versa.
265
+
266
+ `cw_app_run`, `cw_dispatch`, `cw_worker_manifest`, `cw_worker_output`,
267
+ `cw_candidate_register`, `cw_candidate_score`, `cw_candidate_select`,
268
+ `cw_commit`, `cw_operator_status`, `cw_operator_graph`, `cw_operator_report`,
269
+ `cw_topology_list`, `cw_topology_show`, `cw_topology_validate`,
270
+ `cw_topology_apply`, `cw_topology_summary`, `cw_topology_graph`,
271
+ `cw_multi_agent_summary`, `cw_multi_agent_graph`, `cw_multi_agent_dependencies`,
272
+ `cw_multi_agent_failures`, `cw_multi_agent_evidence`, `cw_multi_agent_run`,
273
+ `cw_multi_agent_status`, `cw_multi_agent_step`, `cw_multi_agent_blackboard`,
274
+ `cw_multi_agent_score`, `cw_multi_agent_select`, `cw_multi_agent_run_create`,
275
+ `cw_multi_agent_role_create`, `cw_multi_agent_group_create`,
276
+ `cw_multi_agent_membership_create`, `cw_multi_agent_fanout_create`,
277
+ `cw_multi_agent_fanin_collect`, `cw_eval_snapshot`, `cw_eval_replay`,
278
+ `cw_eval_compare`, `cw_eval_score`, `cw_eval_gate`, `cw_eval_report`,
279
+ `cw_blackboard_summary`, `cw_blackboard_context_put`,
280
+ `cw_blackboard_artifact_add`, `cw_coordinator_decision`, `cw_summary_refresh`,
281
+ `cw_summary_show`, `cw_blackboard_summarize`, `cw_multi_agent_summarize`, and
282
+ `cw_multi_agent_graph_compact`.
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "CommonJS",
5
+ "moduleResolution": "Node",
6
+ "rootDir": "src",
7
+ "outDir": "dist",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "skipLibCheck": true
12
+ },
13
+ "include": [
14
+ "src/**/*.ts"
15
+ ]
16
+ }
@@ -0,0 +1,76 @@
1
+ /* Cool Workflow Workbench — static, dependency-light styling.
2
+ No framework; system fonts only; ~self-contained. */
3
+ :root {
4
+ --bg: #0f1115;
5
+ --panel: #171a21;
6
+ --panel-2: #1d212a;
7
+ --ink: #e6e8ec;
8
+ --muted: #8a92a3;
9
+ --line: #2a2f3a;
10
+ --accent: #5aa9ff;
11
+ --present: #3fb950;
12
+ --absent: #d29922;
13
+ --bad: #f85149;
14
+ }
15
+ * { box-sizing: border-box; }
16
+ body {
17
+ margin: 0;
18
+ font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
19
+ background: var(--bg);
20
+ color: var(--ink);
21
+ font-size: 14px;
22
+ }
23
+ header { padding: 14px 20px; border-bottom: 1px solid var(--line); }
24
+ header h1 { margin: 0; font-size: 18px; font-weight: 600; }
25
+ header .muted, .muted { color: var(--muted); font-weight: 400; }
26
+ header .trust { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
27
+ code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
28
+ main { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 64px); }
29
+ .sidebar { border-right: 1px solid var(--line); overflow-y: auto; padding: 12px; }
30
+ .bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
31
+ button {
32
+ background: var(--panel-2); color: var(--ink); border: 1px solid var(--line);
33
+ border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12px;
34
+ }
35
+ button:hover { border-color: var(--accent); }
36
+ input[type="search"] {
37
+ width: 100%; background: var(--panel); color: var(--ink);
38
+ border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin-bottom: 8px;
39
+ }
40
+ .freshness { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
41
+ .run-list { list-style: none; margin: 0; padding: 0; }
42
+ .run-list li {
43
+ padding: 8px; border: 1px solid var(--line); border-radius: 6px;
44
+ margin-bottom: 6px; cursor: pointer; background: var(--panel);
45
+ }
46
+ .run-list li:hover { border-color: var(--accent); }
47
+ .run-list li.active { border-color: var(--accent); background: var(--panel-2); }
48
+ .run-list .rid { font-family: ui-monospace, monospace; font-size: 12px; }
49
+ .run-list .meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
50
+ .detail { overflow-y: auto; padding: 16px 20px; }
51
+ .detail .empty { color: var(--muted); }
52
+ .tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
53
+ .tabs button.tab { background: transparent; border: 1px solid transparent; }
54
+ .tabs button.tab.active { border-color: var(--line); background: var(--panel-2); }
55
+ .panel-card { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; background: var(--panel); }
56
+ .panel-card > .head {
57
+ display: flex; align-items: center; justify-content: space-between;
58
+ padding: 8px 12px; border-bottom: 1px solid var(--line);
59
+ }
60
+ .panel-card > .head .title { font-weight: 600; }
61
+ .panel-card > .head .src { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; }
62
+ .badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
63
+ .badge.present { color: var(--present); border-color: var(--present); }
64
+ .badge.absent { color: var(--absent); border-color: var(--absent); }
65
+ .badge.stale { color: var(--absent); border-color: var(--absent); }
66
+ .badge.valid { color: var(--present); border-color: var(--present); }
67
+ .badge.missing, .badge.bad { color: var(--bad); border-color: var(--bad); }
68
+ pre.json {
69
+ margin: 0; padding: 12px; overflow-x: auto; font-size: 12px;
70
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.5;
71
+ color: var(--ink); white-space: pre; max-height: 460px;
72
+ }
73
+ .panel-card .absent-note { padding: 10px 12px; color: var(--absent); font-size: 12px; }
74
+ .kv { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 12px; font-size: 12px; color: var(--muted); }
75
+ .kv b { color: var(--ink); font-weight: 600; }
76
+ .err { color: var(--bad); }
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ // Cool Workflow Workbench UI — vanilla JS, no dependencies.
3
+ //
4
+ // The UI holds NO state of its own and contains NO business logic: it fetches
5
+ // the read-only JSON views from the localhost host and renders them. Every panel
6
+ // is exactly one capability payload; refresh re-derives everything from disk.
7
+
8
+ const PANEL_GROUPS = [
9
+ { key: "graph", label: "Run graph", panels: ["operator", "multiAgent", "compact", "criticalPath"] },
10
+ { key: "blackboard", label: "Blackboard", panels: ["coordinator", "digest", "graph"] },
11
+ { key: "worker", label: "Worker logs", panels: ["summary"] },
12
+ { key: "candidate", label: "Candidate compare", panels: ["summary", "reasoning"] },
13
+ { key: "audit", label: "Audit timeline", panels: ["summary", "multiAgent", "policy", "judge"] },
14
+ { key: "metrics", label: "Metrics & cost", panels: ["report"] },
15
+ { key: "collaboration", label: "Review & collaboration", panels: ["review", "comments"] }
16
+ ];
17
+
18
+ const state = { activeRunId: null, activeTab: "graph" };
19
+
20
+ async function getJson(url) {
21
+ const res = await fetch(url, { headers: { Accept: "application/json" } });
22
+ const text = await res.text();
23
+ let body;
24
+ try {
25
+ body = JSON.parse(text);
26
+ } catch {
27
+ throw new Error(`non-JSON response (${res.status})`);
28
+ }
29
+ if (!res.ok) throw new Error(body && body.error ? body.error : `HTTP ${res.status}`);
30
+ return body;
31
+ }
32
+
33
+ function el(tag, attrs = {}, children = []) {
34
+ const node = document.createElement(tag);
35
+ for (const [k, v] of Object.entries(attrs)) {
36
+ if (k === "class") node.className = v;
37
+ else if (k === "text") node.textContent = v;
38
+ else node.setAttribute(k, v);
39
+ }
40
+ for (const child of [].concat(children)) {
41
+ if (child) node.appendChild(typeof child === "string" ? document.createTextNode(child) : child);
42
+ }
43
+ return node;
44
+ }
45
+
46
+ function freshnessBadge(value) {
47
+ const v = String(value || "").toLowerCase();
48
+ return el("span", { class: `badge ${v || "absent"}`, text: value || "unknown" });
49
+ }
50
+
51
+ async function loadIndex() {
52
+ const filter = document.getElementById("filter").value.trim();
53
+ const list = document.getElementById("run-list");
54
+ list.innerHTML = "";
55
+ let view;
56
+ try {
57
+ view = await getJson(`/api/index${filter ? `?text=${encodeURIComponent(filter)}` : ""}`);
58
+ } catch (error) {
59
+ list.appendChild(el("li", { class: "err", text: `failed to load index: ${error.message}` }));
60
+ return;
61
+ }
62
+ const reg = view.registry || {};
63
+ const fresh = document.getElementById("registry-freshness");
64
+ fresh.innerHTML = "";
65
+ fresh.append("registry ", freshnessBadge(reg.freshness), ` · scope ${view.scope}`);
66
+ const records = (view.runs && view.runs.records) || [];
67
+ if (!records.length) {
68
+ list.appendChild(el("li", { class: "muted", text: "no runs indexed in this scope" }));
69
+ return;
70
+ }
71
+ for (const record of records) {
72
+ const li = el("li", { class: state.activeRunId === record.runId ? "active" : "" }, [
73
+ el("div", { class: "rid", text: record.runId }),
74
+ el("div", {
75
+ class: "meta",
76
+ text: [record.appId || record.workflowId, record.lifecycle || record.status, record.repo]
77
+ .filter(Boolean)
78
+ .join(" · ")
79
+ })
80
+ ]);
81
+ li.addEventListener("click", () => selectRun(record.runId));
82
+ list.appendChild(li);
83
+ }
84
+ }
85
+
86
+ async function selectRun(runId) {
87
+ state.activeRunId = runId;
88
+ loadIndex();
89
+ const detail = document.getElementById("run-panel");
90
+ detail.innerHTML = "";
91
+ detail.appendChild(el("p", { class: "muted", text: `loading ${runId}…` }));
92
+ let view;
93
+ try {
94
+ view = await getJson(`/api/run/${encodeURIComponent(runId)}`);
95
+ } catch (error) {
96
+ detail.innerHTML = "";
97
+ detail.appendChild(el("p", { class: "err", text: `failed to load run: ${error.message}` }));
98
+ return;
99
+ }
100
+ renderRun(view);
101
+ }
102
+
103
+ function renderRun(view) {
104
+ const detail = document.getElementById("run-panel");
105
+ detail.innerHTML = "";
106
+ const header = el("div", { class: "kv" }, [
107
+ el("span", {}, [el("b", { text: "run " }), document.createTextNode(view.runId)]),
108
+ el("span", {}, [document.createTextNode("resolved "), freshnessBadge(view.resolved ? "valid" : "missing")])
109
+ ]);
110
+ if (view.error) header.appendChild(el("span", { class: "err", text: view.error }));
111
+ detail.appendChild(header);
112
+
113
+ const tabs = el("div", { class: "tabs" });
114
+ for (const group of PANEL_GROUPS) {
115
+ const btn = el("button", { class: `tab ${state.activeTab === group.key ? "active" : ""}`, text: group.label });
116
+ btn.addEventListener("click", () => {
117
+ state.activeTab = group.key;
118
+ renderRun(view);
119
+ });
120
+ tabs.appendChild(btn);
121
+ }
122
+ detail.appendChild(tabs);
123
+
124
+ const group = PANEL_GROUPS.find((g) => g.key === state.activeTab) || PANEL_GROUPS[0];
125
+ const panels = (view.panels && view.panels[group.key]) || {};
126
+ for (const name of group.panels) {
127
+ const panel = panels[name];
128
+ if (panel) detail.appendChild(renderPanel(name, panel));
129
+ }
130
+ }
131
+
132
+ function renderPanel(name, panel) {
133
+ const card = el("div", { class: "panel-card" });
134
+ const head = el("div", { class: "head" }, [
135
+ el("span", { class: "title", text: `${name} — ${panel.capability}` }),
136
+ el("span", { class: `badge ${panel.status}`, text: panel.status })
137
+ ]);
138
+ card.appendChild(head);
139
+ card.appendChild(el("div", { class: "kv" }, [el("span", { class: "src", text: panel.cli }), el("span", { class: "src", text: panel.mcp })]));
140
+ if (panel.status === "present") {
141
+ card.appendChild(el("pre", { class: "json", text: JSON.stringify(panel.data, null, 2) }));
142
+ } else {
143
+ card.appendChild(el("div", { class: "absent-note", text: `absent — ${panel.error || "source unreadable"}` }));
144
+ }
145
+ return card;
146
+ }
147
+
148
+ document.getElementById("refresh").addEventListener("click", loadIndex);
149
+ document.getElementById("filter").addEventListener("input", debounce(loadIndex, 200));
150
+
151
+ function debounce(fn, ms) {
152
+ let timer;
153
+ return (...args) => {
154
+ clearTimeout(timer);
155
+ timer = setTimeout(() => fn(...args), ms);
156
+ };
157
+ }
158
+
159
+ loadIndex();
@@ -0,0 +1,32 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>Cool Workflow Workbench</title>
7
+ <!-- Dependency-light: no framework, no bundler, no network. Static assets
8
+ only; all data is fetched from the localhost read-only JSON routes. -->
9
+ <link rel="stylesheet" href="/ui/app.css" />
10
+ </head>
11
+ <body>
12
+ <header>
13
+ <h1>Cool Workflow <span class="muted">Workbench</span></h1>
14
+ <p class="trust">read-only · localhost · no hidden dashboard — every view re-derived from <code>.cw/</code> files</p>
15
+ </header>
16
+ <main>
17
+ <section id="index-panel" class="sidebar">
18
+ <div class="bar">
19
+ <strong>Runs</strong>
20
+ <button id="refresh" title="Re-derive from disk">refresh</button>
21
+ </div>
22
+ <input id="filter" type="search" placeholder="filter runs (app/status/text)" />
23
+ <div id="registry-freshness" class="freshness"></div>
24
+ <ul id="run-list" class="run-list"></ul>
25
+ </section>
26
+ <section id="run-panel" class="detail">
27
+ <p class="empty">Select a run to inspect its graph, blackboard, worker logs, candidate compare, and audit timeline.</p>
28
+ </section>
29
+ </main>
30
+ <script src="/ui/app.js"></script>
31
+ </body>
32
+ </html>
@@ -0,0 +1,84 @@
1
+ module.exports = ({ workflow, phase, agent, artifact }) =>
2
+ workflow({
3
+ id: "legacy-architecture-review",
4
+ title: "Legacy Architecture Review",
5
+ summary:
6
+ "Compatibility workflow-file wrapper for the canonical architecture-review app.",
7
+ limits: {
8
+ maxAgents: 40,
9
+ maxConcurrentAgents: 6
10
+ },
11
+ inputs: [
12
+ { name: "repo", required: true },
13
+ { name: "question", required: true },
14
+ { name: "invariant", repeated: true }
15
+ ],
16
+ phases: [
17
+ phase("Map", [
18
+ agent(
19
+ "legacy-map:server-api",
20
+ "Map server/API entrypoints, request flows, service boundaries, auth surfaces, and owned state. Return inspected files, dependencies, invariants, and candidate risks."
21
+ ),
22
+ agent(
23
+ "legacy-map:web-client",
24
+ "Map web/client/UI boundaries, local state, backend dependencies, build/runtime assumptions, and candidate risks."
25
+ ),
26
+ agent(
27
+ "legacy-map:db-security",
28
+ "Map database, persistence, migrations, secrets, auth, permissions, and security-sensitive paths. Return candidate risks with evidence."
29
+ ),
30
+ agent(
31
+ "legacy-map:deploy-config",
32
+ "Map deployment, Docker/compose, CI, reverse proxies, environment config, supervision, and operational assumptions."
33
+ ),
34
+ agent(
35
+ "legacy-map:jobs-operators",
36
+ "Map background jobs, admin/operator surfaces, queues, scheduled work, and failure recovery paths."
37
+ ),
38
+ agent(
39
+ "legacy-map:transport-core",
40
+ "Map protocol, daemon, transport, rendering, networking, or core engine boundaries when present; otherwise explain why this scope is not applicable."
41
+ )
42
+ ]),
43
+ phase("Assess", [
44
+ agent(
45
+ "legacy-assess:security",
46
+ "Assess mapper findings through a security lens. Separate real, conditional, non-issue, and unknown risks with evidence and falsifiers."
47
+ ),
48
+ agent(
49
+ "legacy-assess:data-correctness",
50
+ "Assess data correctness, schema drift, persistence invariants, concurrency, transactions, and state corruption risks."
51
+ ),
52
+ agent(
53
+ "legacy-assess:failure-modes",
54
+ "Assess startup, shutdown, retries, partial failure, dependency outage, backup/restore, and recovery behavior."
55
+ ),
56
+ agent(
57
+ "legacy-assess:scale-ops",
58
+ "Assess scale, operational complexity, observability, configuration, deployment, and maintenance risks."
59
+ ),
60
+ agent(
61
+ "legacy-assess:maintainability",
62
+ "Assess module boundaries, ownership clarity, coupling, extensibility, testability, and future change risk."
63
+ ),
64
+ agent(
65
+ "legacy-assess:domain",
66
+ "Assess domain-specific risks implied by the repo and user invariants. If the domain includes networking/proxy/tunnel behavior, include anti-censorship and abuse-resistance concerns."
67
+ )
68
+ ]),
69
+ phase("Verify", [
70
+ agent(
71
+ "legacy-verify:p0-p2-risks",
72
+ "Re-open evidence for every candidate P0/P1/P2 risk. Confirm real risks, downgrade unsupported concerns, and list exact files or unknowns.",
73
+ { requiresEvidence: true }
74
+ )
75
+ ]),
76
+ phase("Verdict", [
77
+ artifact(
78
+ "legacy-verdict:synthesis",
79
+ "Synthesize the architecture verdict: short answer, architecture map, ranked risks, non-issues, recommended changes, and evidence links.",
80
+ { requiresEvidence: true }
81
+ )
82
+ ])
83
+ ]
84
+ });