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
package/README.md ADDED
@@ -0,0 +1,638 @@
1
+ # Cool Workflow
2
+
3
+ ```text
4
+ ══════════════════════════════════════════════════════════════════════
5
+ auditable agent-workflow control-plane — delegate, don't execute
6
+ plan → dispatch → record → verify → commit → report
7
+ ══════════════════════════════════════════════════════════════════════
8
+ ```
9
+
10
+ [![CI](https://img.shields.io/github/actions/workflow/status/coo1white/cool-workflow/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/coo1white/cool-workflow/actions/workflows/ci.yml)
11
+ [![release](https://img.shields.io/github/v/tag/coo1white/cool-workflow?style=flat-square&label=release&color=brightgreen&sort=semver)](https://github.com/coo1white/cool-workflow/tags)
12
+ [![license](https://img.shields.io/badge/license-BSD--2--Clause-blue?style=flat-square)](../../LICENSE)
13
+ ![MCP](https://img.shields.io/badge/MCP-native-8A2BE2?style=flat-square)
14
+ ![runtime](https://img.shields.io/badge/runtime-TypeScript%20%C2%B7%20Node-3178C6?style=flat-square)
15
+
16
+ **[Structure](#structure)** · [Commands](#commands) · [Result Envelope](#result-envelope) · [Scheduled Tasks](#scheduled-tasks) · [License](#license)
17
+
18
+ Cool Workflow, or CW, is an independent agent workflow control-plane packaged as a
19
+ TypeScript runtime. It provides a COL-Architecture: Router / Orchestrator,
20
+ Subagent Dispatch, Deterministic Harness, Adversarial Verifier, Git/State
21
+ Commit, and MCP JSON-RPC 2.0 bridge.
22
+
23
+ The mental model is base system plus userland apps: CW provides the runtime and
24
+ contracts, while developers write reusable workflow apps in
25
+ `apps/<app-id>/app.json`. Legacy `workflows/*.workflow.js` files remain
26
+ loadable as compatibility wrappers.
27
+
28
+ CW records the model workflow loop explicitly:
29
+
30
+ ```text
31
+ interpret -> act -> observe -> adjust -> checkpoint
32
+ ```
33
+
34
+ These loop stages are stored in `state.json`, task records, reports, and state
35
+ commit snapshots.
36
+
37
+ CW keeps orchestration state and task queues in files. An agent host executes
38
+ the tasks and feeds results back into the workflow.
39
+
40
+ CW follows a small set of Unix-inspired workflow principles: small kernel,
41
+ explicit state, composable pipes, isolated workers, and verifier-gated commits.
42
+ See [docs/unix-principles.md](docs/unix-principles.md).
43
+
44
+ CW v0.1.32 adds Team Collaboration: a host-attested actor, append-only
45
+ approvals/rejections/comments/handoffs provenance-linked to a durable target
46
+ (`run|task|candidate|selection|commit|node`), and a review gate that STACKS ON the
47
+ verifier gate. Identity is ATTESTED provenance, never authenticated — an absent
48
+ identity is the explicit `unattributed` actor, never a fabricated one. The review
49
+ gate is POLICY layered on the verifier MECHANISM: it runs inside `resolveCommitGate`
50
+ AFTER the verifier checks and can only ADD a required-approvals constraint, never
51
+ remove the verifier's — so an approval can never turn an unverified result into a
52
+ committed one. It FAILS CLOSED on quorum, authority, self-approval, and
53
+ unattributed actors, recording exactly which approvals are missing, and a
54
+ gate-satisfied commit is stamped with WHO approved the very artifact that shipped.
55
+ Required approvals, authorized roles, and the self-approval rule are POLICY as data
56
+ (`review policy`), default off (pre-v0.1.32 behavior unchanged). Each verb is
57
+ declared once in the capability registry so `cw <cmd> --json` is identical to
58
+ `cw_<tool>`; the v0.1.30 Workbench renders the review timeline read-only and the
59
+ v0.1.31 metrics report adds derived approval-rate/time-to-approval/handoff-count.
60
+ See [docs/team-collaboration.7.md](docs/team-collaboration.7.md).
61
+
62
+ CW v0.1.29 adds Execution Backends: the execution layer is lifted OUT of the
63
+ kernel into pluggable, swappable drivers — `node`, `bun`, `shell`, `container`,
64
+ `remote`, and `ci` — behind ONE narrow `ExecutionBackend` contract
65
+ (`src/execution-backend.ts`). Modeled on a BSD VFS / device-driver layer, the
66
+ kernel (orchestrator/dispatch/pipeline-runner) never learns which backend ran a
67
+ task: WHAT to run and which evidence to record is kernel policy; HOW and WHERE it
68
+ runs is the driver's concern. The sandbox profile is the contract — every backend
69
+ enforces or attests each requested read/write/command/network/env dimension, or
70
+ FAILS CLOSED rather than silently running unsandboxed. The result/evidence
71
+ envelope is schema-identical across backends (CW's own self-verify produces
72
+ byte-stable evidence on `node`, `shell`, and `bun`); the backend id + sandbox
73
+ attestation are recorded AS provenance, so eval/replay, the verifier gates, and
74
+ the v0.1.28 run registry stay backend-agnostic. The container/remote/ci drivers
75
+ DELEGATE and record a handle + attestation + result — CW does not become the
76
+ executor. Selection mirrors `--sandbox` with a parallel `--backend` flag and
77
+ `backend list|show|probe`, declared once in the capability registry so
78
+ `cw <cmd> --json` is schema-identical to `cw_<tool>`. The default (`node`) backend
79
+ reproduces pre-v0.1.29 behavior exactly. See
80
+ [docs/execution-backends.7.md](docs/execution-backends.7.md).
81
+
82
+ CW v0.1.31 adds Observability + Cost Accounting: time/duration, failure rate,
83
+ verifier pass rate, candidate acceptance rate, and token/cost — all DERIVED from
84
+ the run state CW already keeps (timestamps → durations; verifier nodes → pass
85
+ rate; candidates → acceptance; failed workers/feedback → failure rate). There is
86
+ NO metrics database, NO collector daemon, NO hidden counter. A rate over zero
87
+ samples is `n/a`, never a fabricated 0%/100%. Cost is ATTESTED, never measured:
88
+ CW does not call the model, so token usage is recorded as host-attested
89
+ provenance on the existing result/worker intake (absent ⇒ `unreported`, never 0),
90
+ and a monetary figure is `attested` only from attested usage × a recorded pricing
91
+ policy — assumed pricing is a SEPARATE `estimated` figure, never conflated.
92
+ Pricing is POLICY as data (`--pricing <path>|default`), out of the kernel.
93
+ `metrics show`/`metrics summary` are declared once in the capability registry so
94
+ `cw <cmd> --json` is byte-identical to `cw_<tool>`, and the v0.1.30 Workbench
95
+ renders a read-only metrics panel from the same payload. See
96
+ [docs/observability-cost-accounting.7.md](docs/observability-cost-accounting.7.md).
97
+
98
+ CW v0.1.30 adds the Web / Desktop Workbench: a human-facing console rendering a
99
+ run's run graph, blackboard, worker logs, candidate compare, and audit timeline,
100
+ plus a cross-run entry point over the v0.1.28 Run Registry. It is a THIRD FRONT
101
+ DOOR alongside the CLI (human speed) and MCP (machine context) — all three are
102
+ presentation policy over ONE mechanism. Upholding CW's "no hidden dashboard
103
+ database" promise, the Workbench holds ZERO authoritative state: it is a
104
+ stateless, READ-ONLY renderer over the durable `.cw/` files and the existing
105
+ capability payloads, so each panel equals its `cw <cmd> --json` payload
106
+ byte-for-byte (parity-gated) and refresh re-derives everything from disk — delete
107
+ the host and nothing is lost. The optional localhost host (`cw workbench serve`)
108
+ binds `127.0.0.1` only, is read-only (writes refused `405`), rejects non-localhost
109
+ `Host` headers and path traversal, and fails closed on unreadable state. It is an
110
+ OPTIONAL surface: the committed `dist/` and a plain `node` runtime keep working
111
+ with the Workbench (and its dependency-light static UI) absent. See
112
+ [docs/web-desktop-workbench.7.md](docs/web-desktop-workbench.7.md).
113
+
114
+ CW v0.1.28 adds the Run Registry / Control Plane: a layer that manages MANY
115
+ workflow runs across repositories — `run search`, `run resume`, `run archive`, a
116
+ durable `queue`, cross-repo `history`, and failed-run `run rerun` — over the
117
+ per-run `.cw/runs/<id>/state.json`, which stays the single source of truth. The
118
+ registry (`src/run-registry.ts`) is a DERIVED, rebuildable, fingerprinted index:
119
+ it classifies a documented lifecycle (`queued → running → blocked → completed →
120
+ failed → archived`), discovers runs cross-repo through a plain-file home registry
121
+ (`CW_HOME`/XDG), and fails closed — tampered or missing source surfaces as
122
+ `stale`/`missing` and triggers a rebuild, never a fabricated status. Resume
123
+ continues a run, rerun creates a NEW run linked to the original by provenance, and
124
+ archive marks without deleting source. Every verb is declared once in the
125
+ capability registry, so `cw <cmd> --json` is schema-identical to `cw_<tool>`. See
126
+ [docs/run-registry-control-plane.7.md](docs/run-registry-control-plane.7.md).
127
+
128
+ CW v0.1.27 adds CLI ↔ MCP Parity: the command-line surface and the MCP surface
129
+ are now two renderings of ONE data source, declared in a single capability
130
+ registry (`src/capability-registry.ts`) and enforced fail-closed. Each capability
131
+ names one shared core `entry`; `cw <cmd> --json` is payload-identical to the
132
+ matching `cw_<tool>` MCP result, the CLI stays terse for humans while MCP stays
133
+ complete for machines, and `npm run parity:check` (wired into `release:check`)
134
+ blocks any drift — a capability on only one surface, an undeclared tool or
135
+ command, or a payload divergence. See
136
+ [docs/cli-mcp-parity.7.md](docs/cli-mcp-parity.7.md).
137
+
138
+ CW v0.1.26 adds the Evidence Adoption Reasoning Chain: a derived, fingerprinted,
139
+ fail-closed view that explains *why* each evidence item was adopted, rejected,
140
+ superseded, or conflicting. For every gate (`fanin`, `candidate-score`,
141
+ `selection`, `verifier`, `commit`) it records the decision, basis (evidence +
142
+ provenance + trust source), authority (role/membership/worker + role policy),
143
+ rationale (reusing existing reason fields), and counterfactual (the alternatives
144
+ that lost). A "why" that cannot be traced to a real record renders as
145
+ `unexplained` rather than a fabricated rationale. New surfaces: `multi-agent
146
+ reasoning <run-id> [--evidence <id>] [--refresh]`, the MCP tools
147
+ `cw_evidence_reasoning` and `cw_evidence_reasoning_refresh`, and an additive
148
+ `rationaleStatus` on `multi-agent evidence`. The chain is derived, never
149
+ authoritative over raw state, and stored under `.cw/runs/<run-id>/reasoning/`.
150
+ See
151
+ [docs/evidence-adoption-reasoning-chain.7.md](docs/evidence-adoption-reasoning-chain.7.md).
152
+
153
+ CW v0.1.25 adds State Explosion Management: durable, versioned,
154
+ provenance-backed summary records (`MultiAgentSummaryIndex`,
155
+ `BlackboardSummaryRecord`, `GraphSummaryRecord`, `OperatorDigest`,
156
+ `StateExplosionReport`), compact and focused graph views with synthetic summary
157
+ nodes, blackboard digests, and eval/replay-gated freshness checks. Summaries are
158
+ derived userland indexes that never delete raw blackboard, graph, audit, or
159
+ evidence records and fail closed when stale. New surfaces: `summary refresh`,
160
+ `summary show`, `blackboard summarize`, `multi-agent summarize`, and
161
+ `multi-agent graph --view`. See
162
+ [docs/state-explosion-management.7.md](docs/state-explosion-management.7.md).
163
+
164
+ CW v0.1.24 hardens state loading, migrations, MCP tool calls, multi-agent and
165
+ blackboard persistence, and eval/replay artifact validation with fail-closed
166
+ operator diagnostics.
167
+
168
+ CW v0.1.23 adds Multi-Agent Eval & Replay Harness: deterministic snapshots,
169
+ isolated replays, normalized comparisons, replay scoring, release gates, human
170
+ reports, and MCP parity for topology-backed multi-agent runs. See
171
+ [docs/multi-agent-eval-replay-harness.7.md](docs/multi-agent-eval-replay-harness.7.md).
172
+
173
+ CW v0.1.22 adds Multi-Agent Trust / Policy / Audit: role policies, permission
174
+ decisions, provenance-rich blackboard messages, blackboard write audit, judge
175
+ rationale, panel decisions, and policy violations in the existing trust-audit
176
+ log. See
177
+ [docs/multi-agent-trust-policy-audit.7.md](docs/multi-agent-trust-policy-audit.7.md).
178
+
179
+ CW v0.1.21 adds Multi-Agent Operator UX: compact graph, dependencies,
180
+ failures, and evidence adoption views for topology-backed multi-agent runs.
181
+ Operators can trace agent -> dependency -> evidence -> fanin -> score ->
182
+ selection -> verifier-gated commit without a separate dashboard state. See
183
+ [docs/multi-agent-operator-ux.7.md](docs/multi-agent-operator-ux.7.md).
184
+
185
+ CW v0.1.20 adds Multi-Agent CLI + MCP Surface: the preferred host loop for
186
+ `multi-agent run`, `multi-agent status`, `multi-agent step`,
187
+ `multi-agent blackboard`, `multi-agent score`, and `multi-agent select`.
188
+ The matching MCP tools are `cw_multi_agent_run`, `cw_multi_agent_status`,
189
+ `cw_multi_agent_step`, `cw_multi_agent_blackboard`, `cw_multi_agent_score`,
190
+ and `cw_multi_agent_select`. See
191
+ [docs/multi-agent-cli-mcp-surface.7.md](docs/multi-agent-cli-mcp-surface.7.md).
192
+
193
+ CW v0.1.19 adds Multi-Agent Topologies: official `map-reduce`, `debate`, and
194
+ `judge-panel` coordination definitions with validation, apply-time
195
+ materialization, topology run state, topology graphs, Operator UX panels, trust
196
+ audit provenance, CLI commands, and MCP parity. Applying a topology creates the
197
+ linked MultiAgentRun, roles, groups, fanout, blackboard topics, coordinator
198
+ decisions, and deterministic next actions that the agent host can execute.
199
+ See [docs/multi-agent-topologies.7.md](docs/multi-agent-topologies.7.md).
200
+
201
+ CW v0.1.18 adds Coordinator / Blackboard: first-class shared topics,
202
+ messages, context frames, artifact refs, snapshots, and coordinator decisions.
203
+ The blackboard is the coordination filesystem used by topology runs to index
204
+ evidence, conflicts, fanin readiness, and synthesis decisions. See
205
+ [docs/coordinator-blackboard.7.md](docs/coordinator-blackboard.7.md).
206
+
207
+ CW v0.1.17 added Multi-Agent Runtime Core: first-class `MultiAgentRun`,
208
+ `AgentRole`, `AgentGroup`, `AgentMembership`, `AgentFanout`, and `AgentFanin`
209
+ state with lifecycle validation, dispatch attachment, worker manifest metadata,
210
+ fanin evidence coverage, Operator UX panels, trust audit events, CLI commands,
211
+ and MCP parity. See
212
+ [docs/multi-agent-runtime-core.7.md](docs/multi-agent-runtime-core.7.md).
213
+
214
+ CW v0.1.16 adds Dogfood One Real Repo: a dry-run release proof that runs the
215
+ canonical `release-cut` app against this repository, records real command
216
+ evidence, scores/selects a release candidate, creates a verifier-gated CW state
217
+ commit, and explains trust through audit provenance. See
218
+ [docs/dogfood-one-real-repo.7.md](docs/dogfood-one-real-repo.7.md).
219
+
220
+ CW v0.1.15 adds Security / Trust Hardening: durable trust audit records,
221
+ worker sandbox decision history, evidence provenance, acceptance rationale,
222
+ and CLI/MCP audit inspection. See
223
+ [docs/security-trust-hardening.7.md](docs/security-trust-hardening.7.md).
224
+
225
+ CW v0.1.14 added Release & Migration Discipline: explicit run-state schema
226
+ migration policy, fixture-based backward compatibility tests, version
227
+ synchronization checks, and a dry-run release gate. See
228
+ [docs/release-and-migration.7.md](docs/release-and-migration.7.md).
229
+
230
+ CW v0.1.13 completes the MCP / App Surface so agent hosts can treat CW as a
231
+ runtime instead of a CLI wrapper. MCP now covers app runs, worker inspection and
232
+ output recording, candidate scoring/selection, sandbox profile resolution,
233
+ verifier-gated commits, and structured operator summaries while preserving old
234
+ tool names. See [docs/mcp-app-surface.7.md](docs/mcp-app-surface.7.md).
235
+
236
+ CW v0.1.12 added Operator UX: human-readable status, graph, report summaries,
237
+ resource summaries, commit/feedback/worker/candidate panels, and deterministic
238
+ next-step recommendations. JSON remains available with `--json` or
239
+ `--format json`. See [docs/operator-ux.7.md](docs/operator-ux.7.md).
240
+
241
+ CW v0.1.11 added Canonical Workflow Apps: official app-directory userland for
242
+ `architecture-review`, `pr-review-fix-ci`, `release-cut`, and
243
+ `research-synthesis`. They validate and plan through `npm run canonical-apps`
244
+ and are the app matrix used to judge whether the framework is pleasant, stable, and
245
+ expressive. See
246
+ [docs/canonical-workflow-apps.7.md](docs/canonical-workflow-apps.7.md).
247
+
248
+ CW v0.1.10 added the End-to-End Golden Path: a deterministic regression command
249
+ that validates a first-class app, plans a run, dispatches a readonly isolated
250
+ worker, records a simulated worker result, scores/selects a candidate, creates a
251
+ verifier-gated commit, and renders a report. See
252
+ [docs/end-to-end-golden-path.7.md](docs/end-to-end-golden-path.7.md).
253
+
254
+ CW v0.1.9 added the Workflow App framework: first-class app metadata, validation,
255
+ deterministic app discovery, app CLI/MCP tools, app templates, and run
256
+ state/report metadata. See
257
+ [docs/workflow-app-framework.7.md](docs/workflow-app-framework.7.md).
258
+
259
+ CW v0.1.8 added Sandbox Profiles: named worker policy contracts for read paths,
260
+ write paths, command execution, network access, and environment exposure. CW
261
+ stores and validates the policy, while the agent host enforces OS/process
262
+ runtime controls. See [docs/sandbox-profiles.7.md](docs/sandbox-profiles.7.md).
263
+
264
+ ## Structure
265
+
266
+ ```text
267
+ cool-workflow
268
+ skills/cool-workflow/SKILL.md
269
+ src/
270
+ dist/
271
+ scripts/cw.js
272
+ workflows/architecture-review.workflow.js
273
+ workflows/research-synthesis.workflow.js
274
+ apps/architecture-review/app.json
275
+ apps/end-to-end-golden-path/app.json
276
+ apps/pr-review-fix-ci/app.json
277
+ apps/release-cut/app.json
278
+ apps/research-synthesis/app.json
279
+ apps/workflow-app-framework-demo/app.json
280
+ docs/index.md
281
+ docs/getting-started.md
282
+ docs/coordinator-blackboard.7.md
283
+ docs/multi-agent-runtime-core.7.md
284
+ docs/multi-agent-eval-replay-harness.7.md
285
+ docs/dogfood-one-real-repo.7.md
286
+ docs/release-and-migration.7.md
287
+ docs/agent-framework.md
288
+ docs/unix-principles.md
289
+ docs/mcp-app-surface.7.md
290
+ docs/operator-ux.7.md
291
+ docs/workflow-app-framework.7.md
292
+ docs/sandbox-profiles.7.md
293
+ docs/candidate-scoring.7.md
294
+ docs/verifier-gated-commit.7.md
295
+ docs/run-registry-control-plane.7.md
296
+ docs/execution-backends.7.md
297
+ ```
298
+
299
+ ## Commands
300
+
301
+ List bundled workflows:
302
+
303
+ ```bash
304
+ node scripts/cw.js list
305
+ ```
306
+
307
+ List, inspect, validate, and create workflow apps:
308
+
309
+ ```bash
310
+ node scripts/cw.js app list
311
+ node scripts/cw.js app show architecture-review
312
+ node scripts/cw.js app validate apps/architecture-review/app.json
313
+ node scripts/cw.js app show pr-review-fix-ci
314
+ node scripts/cw.js app show release-cut
315
+ node scripts/cw.js app show research-synthesis
316
+ node scripts/cw.js app show workflow-app-framework-demo
317
+ node scripts/cw.js app validate apps/workflow-app-framework-demo/app.json
318
+ node scripts/cw.js app validate end-to-end-golden-path
319
+ node scripts/cw.js app package architecture-review
320
+ node scripts/cw.js app init my-app --title "My App"
321
+ ```
322
+
323
+ Create a reusable workflow script:
324
+
325
+ ```bash
326
+ node scripts/cw.js init my-workflow --title "My Workflow"
327
+ ```
328
+
329
+ Create a run:
330
+
331
+ ```bash
332
+ node scripts/cw.js plan architecture-review \
333
+ --repo /path/to/repo \
334
+ --question "Is this architecture sound?" \
335
+ --invariant "single-box self-hosted"
336
+ ```
337
+
338
+ Inspect a run as an operator:
339
+
340
+ ```bash
341
+ node scripts/cw.js status <run-id>
342
+ node scripts/cw.js status <run-id> --json
343
+ node scripts/cw.js graph <run-id>
344
+ node scripts/cw.js graph <run-id> --json
345
+ node scripts/cw.js report <run-id> --show
346
+ node scripts/cw.js topology summary <run-id>
347
+ node scripts/cw.js topology graph <run-id>
348
+ node scripts/cw.js worker summary <run-id>
349
+ node scripts/cw.js multi-agent summary <run-id>
350
+ node scripts/cw.js multi-agent graph <run-id>
351
+ node scripts/cw.js candidate summary <run-id>
352
+ node scripts/cw.js feedback summary <run-id>
353
+ node scripts/cw.js commit summary <run-id>
354
+ node scripts/cw.js state check <run-id>
355
+ ```
356
+
357
+ MCP hosts can drive the same flow with JSON tools:
358
+
359
+ ```text
360
+ cw_app_run -> cw_dispatch -> cw_worker_manifest -> cw_worker_output
361
+ -> cw_candidate_register -> cw_candidate_score -> cw_candidate_select
362
+ -> cw_commit -> cw_operator_report
363
+ ```
364
+
365
+ MCP also exposes topology tools:
366
+
367
+ ```text
368
+ cw_topology_list
369
+ cw_topology_show
370
+ cw_topology_validate
371
+ cw_topology_apply
372
+ cw_topology_summary
373
+ cw_topology_graph
374
+ ```
375
+
376
+ List, inspect, validate, and apply official multi-agent topologies:
377
+
378
+ ```bash
379
+ node scripts/cw.js topology list
380
+ node scripts/cw.js topology show map-reduce
381
+ node scripts/cw.js topology show debate
382
+ node scripts/cw.js topology show judge-panel
383
+ node scripts/cw.js topology validate map-reduce
384
+ node scripts/cw.js topology apply <run-id> map-reduce --task <task-id> --mappers 2
385
+ node scripts/cw.js topology apply <run-id> debate --id debate-round --rounds 2
386
+ node scripts/cw.js topology apply <run-id> judge-panel --judgeCount 3
387
+ node scripts/cw.js topology summary <run-id>
388
+ node scripts/cw.js topology summary <run-id> --json
389
+ node scripts/cw.js topology graph <run-id>
390
+ node scripts/cw.js topology graph <run-id> --json
391
+ node scripts/cw.js topology show <run-id> <topology-run-id>
392
+ ```
393
+
394
+ Topology runs are stored under `.cw/runs/<run-id>/topologies/`, referenced from
395
+ `state.json`, included in operator status and graph output, and counted in the
396
+ trust audit summary.
397
+
398
+ Create a dispatch manifest for the current runnable phase:
399
+
400
+ ```bash
401
+ node scripts/cw.js dispatch <run-id> --limit 6
402
+ node scripts/cw.js dispatch <run-id> --sandbox readonly
403
+ node scripts/cw.js dispatch <run-id> --multi-agent-run ma --multi-agent-group group --multi-agent-role role
404
+ node scripts/cw.js dispatch <run-id> --multi-agent-fanout <fanout-id>
405
+ ```
406
+
407
+ Inspect sandbox profiles:
408
+
409
+ ```bash
410
+ node scripts/cw.js sandbox list
411
+ node scripts/cw.js sandbox show readonly
412
+ node scripts/cw.js sandbox validate ./site-sandbox.json
413
+ ```
414
+
415
+ Record an agent result after a worker finishes:
416
+
417
+ ```bash
418
+ node scripts/cw.js result <run-id> <task-id> path/to/result.md
419
+ ```
420
+
421
+ Register, score, rank, and verifier-gate a candidate output:
422
+
423
+ ```bash
424
+ node scripts/cw.js candidate register <run-id> --worker <worker-id>
425
+ node scripts/cw.js candidate score <run-id> <candidate-id> \
426
+ --criterion correctness=4 \
427
+ --criterion evidence=4 \
428
+ --criterion fit=2 \
429
+ --maxTotal 10 \
430
+ --evidence /path/to/file.ts:42
431
+ node scripts/cw.js candidate rank <run-id>
432
+ node scripts/cw.js candidate select <run-id> <candidate-id> --reason "verified winner"
433
+ ```
434
+
435
+ Create a deterministic state commit:
436
+
437
+ ```bash
438
+ node scripts/cw.js commit <run-id> --verifier <node-id> --reason "verified result"
439
+ node scripts/cw.js commit <run-id> --selection <selection-id> --reason "verified winner"
440
+ node scripts/cw.js commit <run-id> --allow-unverified-checkpoint --reason "manual checkpoint"
441
+ ```
442
+
443
+ The first two commands create verifier-gated committed state. The last command
444
+ creates an explicit non-gated checkpoint.
445
+
446
+ Render a report:
447
+
448
+ ```bash
449
+ node scripts/cw.js report <run-id>
450
+ ```
451
+
452
+ Manage runs across repos with the control plane (derived, fail-closed registry):
453
+
454
+ ```bash
455
+ node scripts/cw.js registry refresh --scope home
456
+ node scripts/cw.js run search --app architecture-review --status failed
457
+ node scripts/cw.js run show <run-id>
458
+ node scripts/cw.js run resume <run-id>
459
+ node scripts/cw.js run rerun <failed-run-id> --reason "retry"
460
+ node scripts/cw.js run archive <run-id> --reason "old"
461
+ node scripts/cw.js queue add --app release-cut --priority 10
462
+ node scripts/cw.js queue list
463
+ node scripts/cw.js queue drain --limit 1
464
+ node scripts/cw.js history --scope home --json
465
+ ```
466
+
467
+ Run the deterministic release golden path:
468
+
469
+ ```bash
470
+ npm run dogfood:release
471
+ npm run release:check
472
+ npm run canonical-apps
473
+ npm run golden-path
474
+ npm run fixture-compat
475
+ npm run version:sync
476
+ npm test
477
+ ```
478
+
479
+ Run data lives under `.cw/runs/<run-id>/` in `--cwd`, or in `--repo` when
480
+ `--cwd` is omitted.
481
+
482
+ Build the TypeScript runtime:
483
+
484
+ ```bash
485
+ npm install --no-package-lock
486
+ npm run build
487
+ ```
488
+
489
+ See [docs/agent-framework.md](docs/agent-framework.md) for the developer contract.
490
+ See [docs/index.md](docs/index.md) for a docs map.
491
+ See [docs/getting-started.md](docs/getting-started.md) for a clone-to-run path.
492
+ See [docs/release-and-migration.7.md](docs/release-and-migration.7.md) for
493
+ release and migration discipline.
494
+ See [docs/dogfood-one-real-repo.7.md](docs/dogfood-one-real-repo.7.md) for the
495
+ real-repository dogfood release proof.
496
+ See [docs/operator-ux.7.md](docs/operator-ux.7.md) for the operator command
497
+ surface.
498
+ See [docs/workflow-app-framework.7.md](docs/workflow-app-framework.7.md) for the app
499
+ contract.
500
+ See [docs/canonical-workflow-apps.7.md](docs/canonical-workflow-apps.7.md) for
501
+ the canonical app matrix.
502
+ See [docs/candidate-scoring.7.md](docs/candidate-scoring.7.md) for the
503
+ candidate scoring file contract.
504
+ See [docs/verifier-gated-commit.7.md](docs/verifier-gated-commit.7.md) for the
505
+ commit gate contract.
506
+ See [docs/sandbox-profiles.7.md](docs/sandbox-profiles.7.md) for the sandbox
507
+ profile contract.
508
+ See [docs/end-to-end-golden-path.7.md](docs/end-to-end-golden-path.7.md) for
509
+ the release golden path contract.
510
+ See [docs/run-registry-control-plane.7.md](docs/run-registry-control-plane.7.md)
511
+ for the cross-repo run registry / control plane contract.
512
+
513
+ ## License
514
+
515
+ CW is released under the BSD-2-Clause License.
516
+
517
+ ## Scheduled Tasks
518
+
519
+ ```bash
520
+ node scripts/cw.js loop --intervalMinutes 30 --prompt "Continue this workflow."
521
+ node scripts/cw.js schedule create --kind loop --intervalMinutes 30 --prompt "Continue this workflow."
522
+ node scripts/cw.js schedule due
523
+ node scripts/cw.js schedule pause <schedule-id>
524
+ node scripts/cw.js schedule resume <schedule-id>
525
+ node scripts/cw.js schedule run-now <schedule-id>
526
+ node scripts/cw.js schedule history <schedule-id>
527
+ node scripts/cw.js schedule daemon --once
528
+ ```
529
+
530
+ See [docs/scheduled-tasks.md](docs/scheduled-tasks.md).
531
+
532
+ ## Routine-Style Triggers
533
+
534
+ ```bash
535
+ node scripts/cw.js routine create --kind api --prompt "Handle this API event."
536
+ node scripts/cw.js routine create --kind github --prompt "Handle this GitHub event."
537
+ node scripts/cw.js routine fire api payload.json
538
+ node scripts/cw.js routine events
539
+ ```
540
+
541
+ ## Result Envelope
542
+
543
+ Verification and synthesis tasks require a structured result block:
544
+
545
+ ````text
546
+ ```cw:result
547
+ {
548
+ "summary": "short summary",
549
+ "findings": [
550
+ {
551
+ "id": "risk-1",
552
+ "classification": "real",
553
+ "severity": "P1",
554
+ "evidence": ["/absolute/path/file.ts:42"]
555
+ }
556
+ ],
557
+ "evidence": ["/absolute/path/file.ts:42"]
558
+ }
559
+ ```
560
+ ````
561
+
562
+ ## Release Tooling (v0.1.33)
563
+
564
+ the per-tag mechanical surfaces (version bump across 17 surfaces, feature scaffold, and the forward-reference docs) become deterministic scripts, with a de-duplicated release gate. See release-tooling(7).
565
+
566
+ ## Real Execution Backend Integrations (v0.1.34)
567
+
568
+ container/remote/ci backends really execute (docker/podman run, remote/CI POST-and-poll) under the sandbox contract, with byte-stable evidence vs node and fail-closed refusal when a runtime/endpoint is unavailable. See real-execution-backends(7).
569
+
570
+ ## Node Snapshot / Diff / Replay (v0.1.35)
571
+
572
+ per-node snapshot, structural diff, and isolated deterministic replay over StateNode, reusing the v0.1.23 eval harness; fail-closed on source drift (valid|stale|absent). See node-snapshot-diff-replay(7).
573
+
574
+ ## Contract Migration Tooling (v0.1.36)
575
+
576
+ first-class declared migration registry (run-state + workflow-app) with per-edge compatibility proofs, fail-closed reachability, and a round-trip/non-destruction prover. See contract-migration-tooling(7).
577
+
578
+ ## Control-Plane Scheduling (v0.1.37)
579
+
580
+ priority + concurrency limits + lease lifecycle + retry/backoff + fail-closed park over the v0.1.28 Run Registry queue; policy-as-data, deterministic. See control-plane-scheduling(7).
581
+
582
+ ## Agent Delegation Drive (v0.1.38)
583
+
584
+ spawn an external agent process per worker, capture result.md + attestation, auto-drive plan->dispatch->fulfill->accept->commit
585
+
586
+ ## Run Retention & Provable Reclamation (v0.1.39)
587
+
588
+ tiered, append-only, cryptographically-verifiable disk reclamation: `gc plan|run|verify` seal the audit skeleton, free the reconstructable/scratch bulk, and prove it via a hash-chained tombstone. Write-ahead + fail-closed (skeleton -> tombstone -> fsync -> free); explicit capability downgrade (verify-only / re-runnable-by-reconstruction); CW never reclaims by default.
589
+
590
+ ## Durable State & Locking (v0.1.40)
591
+
592
+ every authoritative write is now atomic (temp -> rename, so a crash can never truncate state.json) with fsync-durability for the audit-essential stores; the cross-process read-modify-write stores (home queue, archive overlay, reclamation chain) are serialized by a portable stale-stealing file lock. Closes the architecture self-audit's non-atomic/unlocked P1 and pulls reclamation's result-node re-point inside the write-ahead boundary (durable persist + dangling-ref proof before any free) with a content-validated skeleton.
593
+
594
+ ## Self-Audit Hardening & Pure-Router Decomposition (v0.1.41)
595
+
596
+ closes the v0.1.41 architecture self-audit's real findings and pays down its top maintainability debt. Hardening: evidence-gated commits now require GROUNDED locators (path/URL/namespace:value), not just presence, with opt-in `CW_REQUIRE_RESOLVABLE_EVIDENCE` on-disk resolution; the trust-audit event log is appended with fsync (durable like state.json); path containment is symlink-hardened (realpath of the deepest existing ancestor) across sandbox checks and reclamation proofs; worker ids are deterministic; coordinator secret redaction recurses. Maintainability: the `descriptor.id ===` switches in the execution backend are gone — drivers self-describe through a `registerBackend` registry — and the ~2100-line CoolWorkflowRunner god-object is decomposed into per-domain operation modules under `src/orchestrator/`, leaving the runner a pure `loadRun -> delegate` router. Behavior-preserving (verified by adversarial review + full release:check).
597
+
598
+ ## Robust Result Ingest (v0.1.42)
599
+
600
+ capture findings/evidence from any reasonable agent shape (alt keys + prose), CW derives grounded evidence itself, warn on empty capture — closes the v0.1.41 live-drive 'accepted with 0 captured' failure
601
+
602
+ ## No-False-Green Gate & Launch Prep (v0.1.43)
603
+
604
+ Hard gate blocking empty-capture verifier-gated commits, plus quickstart and launch-prep docs.
605
+
606
+ ## Release-Gate Determinism & Agents Vendor (v0.1.44)
607
+
608
+ Release-readiness checks now validate the committed blob (`git show HEAD:<path>`) instead of the mutable working tree — eliminating false-red/false-green from concurrent working-tree writes (iCloud/Spotlight/editor). Adds the `agents` vendor manifest target: a generated `.agents/plugins/cool-workflow/` adapter giving any non-Claude AI agent one common interface to CW.
609
+
610
+ ## Migration DAG (v0.1.45)
611
+
612
+ Replaces the linear migration chain with a BFS graph path resolver (`findMigrationPath()`) over directed migration edges. Each `StateMigrationStep` carries an optional `reverse()` function, enabling rollback/downgrade paths via `reverseRunState()`.
613
+
614
+ ## Capability Auto-Discovery (v0.1.46)
615
+
616
+ `registerCapability()` builder pattern replaces manual registry entries. Capabilities self-register at implementation sites via Map-based dedup; no need to touch `capability-registry.ts`. New capabilities call `registerCapability()` next to their entry function.
617
+
618
+ ## Vendor-Adapter Registry (v0.1.47)
619
+
620
+ Data-driven manifest generation: vendor JSON shapes extracted from `gen-manifests.js` into declarative templates in `plugin.manifest.json`. A `_resolveTemplate()` engine resolves `{{path.to.field}}` markers. Adding a new AI platform is pure data.
621
+
622
+ ## P2 Fixes (v0.1.48)
623
+
624
+ State auto-compaction via `setPostSaveCallback()` hook — after every `saveCheckpoint()`, the orchestrator checks `computeStateSize()` and auto-triggers compaction. Agent dedup docs, npm `ci` aggregate script.
625
+
626
+ ## CI Content-Surface Fix (v0.1.49)
627
+
628
+ CHANGELOG.md and RELEASE.md are content surfaces checked by the dogfood-release gate. The bump-version script covers structured surfaces only; content surface updates are now documented as a release step.
629
+
630
+ ## Auto-Compaction Fix (v0.1.50, v0.1.51)
631
+
632
+ Auto-compaction hook moved from `saveCheckpoint()` to explicit `maybeCompactRun()` calls after major lifecycle mutations. Fixes test fixture fingerprint instability. Also fixes the dogfood-release version-sync pipeline: always use `npm run bump:version`, never hand-edit version.ts alone.
633
+
634
+ v0.1.76
635
+
636
+ v0.1.77
637
+
638
+ v0.1.78