@iowarp/clio-coder 0.3.6 → 0.3.7

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 (258) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +16 -5
  3. package/dist/{acp-2BEHC4DL.js → acp-SK4MD6MM.js} +10 -10
  4. package/dist/{agents-LNNFTM53.js → agents-2FN2K6ME.js} +30 -25
  5. package/dist/assets/codewiki.json +1 -1
  6. package/dist/{auth-KXXFI2VS.js → auth-QIYZWM5I.js} +13 -13
  7. package/dist/{chunk-KHSFENX2.js → chunk-3HAPLH5M.js} +10 -10
  8. package/dist/{chunk-24I7BN55.js → chunk-465YSENW.js} +2 -2
  9. package/dist/{chunk-4OC57DA6.js → chunk-4DGYLA73.js} +53 -2
  10. package/dist/{chunk-CYQKWTG3.js → chunk-4DWFMQDR.js} +4 -4
  11. package/dist/{chunk-E2ER4LJF.js → chunk-5C3AQNDW.js} +25 -1
  12. package/dist/{chunk-22NAGB7X.js → chunk-5C77SEEY.js} +5 -94
  13. package/dist/{chunk-43AOLP7E.js → chunk-5FR74PWO.js} +2 -1
  14. package/dist/{chunk-K7T3E2SR.js → chunk-5UJ6ECTS.js} +10 -9
  15. package/dist/{chunk-6US73PDB.js → chunk-6M7VS3J3.js} +5 -5
  16. package/dist/{chunk-CJUB2JJ2.js → chunk-6TUKSZVF.js} +5 -5
  17. package/dist/{chunk-5JGRAMKL.js → chunk-AB4XIIVB.js} +8 -6
  18. package/dist/{chunk-R46L2BIR.js → chunk-BMWK7ZIZ.js} +14 -20
  19. package/dist/{chunk-4BPJXDWC.js → chunk-C4JBQ5SR.js} +30 -14
  20. package/dist/{chunk-XXQNGV4M.js → chunk-CEYBNUGC.js} +243 -63
  21. package/dist/{chunk-VEZEGCGW.js → chunk-D4MDIG46.js} +20 -18
  22. package/dist/chunk-DJNLUABN.js +843 -0
  23. package/dist/{chunk-RY3LY4J5.js → chunk-DMD2AGVS.js} +5 -4
  24. package/dist/{chunk-KOHPCX4K.js → chunk-DOOEX22V.js} +2 -2
  25. package/dist/chunk-DQA7QLMD.js +123 -0
  26. package/dist/chunk-DR52UMZW.js +21 -0
  27. package/dist/{chunk-XF5N4U5A.js → chunk-EBEFWSGL.js} +6 -5
  28. package/dist/{chunk-EYPA3EGJ.js → chunk-EELBMBT6.js} +120 -13
  29. package/dist/{chunk-CKXWIANG.js → chunk-EOOQZZDE.js} +16 -14
  30. package/dist/{chunk-WR67VIZY.js → chunk-FOT2FX5J.js} +63 -5
  31. package/dist/{chunk-FYYLNIL5.js → chunk-GH5622CP.js} +2 -2
  32. package/dist/chunk-GWS3VEIW.js +195 -0
  33. package/dist/{chunk-LYF7OHWH.js → chunk-J7PIKKWC.js} +8 -463
  34. package/dist/{chunk-NILBFAPG.js → chunk-JNXPYBB4.js} +2 -2
  35. package/dist/{chunk-4VP4KH3K.js → chunk-JRIO5UD2.js} +4 -4
  36. package/dist/{chunk-6XXKFVSN.js → chunk-JTSEDYVQ.js} +7 -7
  37. package/dist/{chunk-QKMUKYO7.js → chunk-KCMKRQX4.js} +236 -84
  38. package/dist/chunk-KZ2H5X4G.js +1026 -0
  39. package/dist/{chunk-QNQHSOLF.js → chunk-LADCF22A.js} +12 -12
  40. package/dist/chunk-M4AKACEO.js +382 -0
  41. package/dist/{chunk-XYDYPRZI.js → chunk-MXI6J5JF.js} +7 -7
  42. package/dist/{chunk-G7MUEIGA.js → chunk-OB5HIGJY.js} +1 -1
  43. package/dist/{chunk-EKY57CSP.js → chunk-OBMAI2DP.js} +61 -767
  44. package/dist/chunk-PD3MESLB.js +242 -0
  45. package/dist/{chunk-ZRGEBJ4T.js → chunk-QCTRSGHQ.js} +21 -21
  46. package/dist/chunk-RVG5JXAL.js +41 -0
  47. package/dist/{chunk-RD5U66HV.js → chunk-SROCI7ZU.js} +7 -7
  48. package/dist/{chunk-MFFY33HR.js → chunk-THKY7CD7.js} +466 -205
  49. package/dist/{chunk-PCZJO5TI.js → chunk-UFQ3F4FW.js} +13 -178
  50. package/dist/{chunk-AD2SYQYC.js → chunk-UHXRNZ2J.js} +121 -3
  51. package/dist/chunk-UND3GU2L.js +103 -0
  52. package/dist/{chunk-QM3F2GKX.js → chunk-UUANF5CR.js} +2247 -2096
  53. package/dist/chunk-UVDSQ6LW.js +472 -0
  54. package/dist/{chunk-DJVECN66.js → chunk-VQNODYQ4.js} +14 -14
  55. package/dist/{chunk-3BPUFZDL.js → chunk-VREKEFLL.js} +3 -3
  56. package/dist/{chunk-PBTHKCPN.js → chunk-WJHBC77E.js} +6 -6
  57. package/dist/{chunk-XE2VEJHX.js → chunk-X2KV5FXT.js} +2 -2
  58. package/dist/{chunk-ZXF4XRKW.js → chunk-XEGB6BCN.js} +157 -7
  59. package/dist/{chunk-E25LMLRW.js → chunk-YD734TPH.js} +2 -2
  60. package/dist/{verifiers-NCBTHHN2.js → chunk-YTYFXUI3.js} +65 -322
  61. package/dist/{chunk-OH3TOQTB.js → chunk-ZGH7FGS5.js} +13 -7
  62. package/dist/cli/index.js +32 -30
  63. package/dist/{clio-M2KGYUFZ.js → clio-WBVQEBKO.js} +7 -7
  64. package/dist/{code-nav-GQNL7XA6.js → code-nav-FGGFIE7L.js} +3 -3
  65. package/dist/{components-5TTYYX6G.js → components-F7OEATSO.js} +4 -4
  66. package/dist/{config-XUUYQIWO.js → config-TRBL3RCF.js} +34 -29
  67. package/dist/{configure-IHJ7YOMV.js → configure-OLCVPHNM.js} +15 -15
  68. package/dist/{context-74JLXAWD.js → context-MJIJ6GOX.js} +11 -11
  69. package/dist/{context-ZQ7SIFJV.js → context-WFPKQSM6.js} +19 -3
  70. package/dist/{context-75MIWW3U.js → context-XEWE3MOJ.js} +31 -26
  71. package/dist/{context-clear-GYKWNUML.js → context-clear-KNOS2JPB.js} +31 -26
  72. package/dist/{context-working-set-UX5KEP4J.js → context-working-set-EUXAZI6N.js} +8 -8
  73. package/dist/{dispatch-runner-GIJBHNFL.js → dispatch-runner-B7MTOVKL.js} +313 -53
  74. package/dist/{docs-6FZSCG5B.js → docs-FLJTIDSE.js} +4 -4
  75. package/dist/{doctor-SVJ5BZCW.js → doctor-RN4YKO2X.js} +14 -14
  76. package/dist/{eval-CG6LLBLD.js → eval-RUBJVSNQ.js} +8 -7
  77. package/dist/{evidence-ZYFIEN42.js → evidence-JZNBUOQZ.js} +30 -25
  78. package/dist/{evolve-QGEXEMDW.js → evolve-FJVC4KKI.js} +30 -25
  79. package/dist/{extensions-ADGNCJJD.js → extensions-IQL36S7K.js} +4 -4
  80. package/dist/{fleet-S5R4ZOQY.js → fleet-BDKYJFCP.js} +214 -360
  81. package/dist/fleet-commands-ZFIWZSB3.js +70 -0
  82. package/dist/fleet-graph-Y6HPXIVF.js +125 -0
  83. package/dist/fleet-new-RDVJLHHH.js +48 -0
  84. package/dist/fleet-validate-BIYREGIK.js +79 -0
  85. package/dist/{init-5DRU55YR.js → init-LQUB5COQ.js} +44 -37
  86. package/dist/library-NJAHIGG4.js +217 -0
  87. package/dist/{memory-7YKKR6UC.js → memory-OG6HOYKM.js} +31 -26
  88. package/dist/{models-ZPOLRU2C.js → models-5ZG5XY7J.js} +21 -20
  89. package/dist/{monitor-US5F5YGZ.js → monitor-TJ7AMTGB.js} +49 -30
  90. package/dist/{orchestrator-E2AL4T5N.js → orchestrator-WZYB54DM.js} +3827 -581
  91. package/dist/{paths-E7KYAQWE.js → paths-XUC7GS6E.js} +4 -4
  92. package/dist/{reset-KZ652EK6.js → reset-PXQT45IY.js} +7 -7
  93. package/dist/{run-SRNBKDWD.js → run-FQ74YF62.js} +53 -45
  94. package/dist/{share-CGZE33UP.js → share-FW7SVCL3.js} +33 -9
  95. package/dist/{skills-S2X4DLY5.js → skills-7E7IRB3R.js} +24 -8
  96. package/dist/{skills-eval-W2GGIC4R.js → skills-eval-LI75W6OK.js} +34 -27
  97. package/dist/{targets-54SWINWB.js → targets-4CIFKCTW.js} +23 -22
  98. package/dist/{terminal-lease-SAIF2OGY.js → terminal-lease-WUZY7ZV5.js} +4 -4
  99. package/dist/{uninstall-BVLWXKBT.js → uninstall-7FV7IP4E.js} +4 -4
  100. package/dist/{upgrade-JKAR27XC.js → upgrade-K2HVIVMQ.js} +20 -19
  101. package/dist/{usage-MSAWCLX4.js → usage-GTZELZQX.js} +116 -49
  102. package/dist/verifiers-RLAHT27O.js +336 -0
  103. package/dist/{verify-X5HDROLA.js → verify-BX3BRKH5.js} +7 -6
  104. package/dist/{wiki-generate-GUSOQ6ZP.js → wiki-generate-ASIFASCN.js} +45 -37
  105. package/dist/worker/entry.js +38 -35
  106. package/docs/README.md +3 -2
  107. package/docs/acp.md +1 -1
  108. package/docs/alcf-provider.md +1 -1
  109. package/docs/architecture.md +2 -2
  110. package/docs/artifact-versions.md +10 -6
  111. package/docs/built-in-agents.md +26 -2
  112. package/docs/capacity-and-scheduling.md +1 -1
  113. package/docs/commands-and-modes.md +82 -2
  114. package/docs/configuration-and-targets.md +79 -2
  115. package/docs/context-engine.md +1 -1
  116. package/docs/development-pipeline.md +1 -1
  117. package/docs/dispatch-architecture-rationale.md +1 -1
  118. package/docs/documentation-coverage.md +3 -3
  119. package/docs/documentation-guide.md +3 -3
  120. package/docs/eval-runner.md +1 -1
  121. package/docs/evals-internal.md +1 -1
  122. package/docs/evidence-and-memory.md +5 -5
  123. package/docs/evolution.md +1 -1
  124. package/docs/exit-codes-and-output.md +4 -1
  125. package/docs/extensions-and-sharing.md +6 -2
  126. package/docs/fleet-demo-runbook.md +2 -2
  127. package/docs/fleet-dispatch.md +197 -10
  128. package/docs/git-commit-provenance.md +2 -2
  129. package/docs/glossary.md +1 -1
  130. package/docs/installation-and-lifecycle.md +2 -2
  131. package/docs/middleware-and-components.md +2 -1
  132. package/docs/model-catalog.md +1 -1
  133. package/docs/observability.md +55 -8
  134. package/docs/proactive-memory.md +1 -1
  135. package/docs/prompt-envelope-and-tools.md +1 -1
  136. package/docs/provider-adapter-cookbook.md +1 -1
  137. package/docs/release-cut-checklist.md +79 -64
  138. package/docs/resource-library.md +59 -0
  139. package/docs/safety-model.md +2 -2
  140. package/docs/scientific-validation.md +3 -3
  141. package/docs/session-lifecycle.md +37 -1
  142. package/docs/skills-marketplace.md +16 -3
  143. package/docs/tool-usage.md +14 -7
  144. package/docs/trace-store.md +1 -1
  145. package/docs/troubleshooting.md +1 -1
  146. package/docs/tui-design.md +1 -1
  147. package/docs/worker-dispatch-mechanics.md +3 -3
  148. package/package.json +1 -1
  149. package/src/cli/fleet-commands.ts +37 -0
  150. package/src/cli/fleet-graph.ts +102 -0
  151. package/src/cli/fleet-new.ts +36 -0
  152. package/src/cli/fleet-preflight.ts +121 -0
  153. package/src/cli/fleet-validate.ts +30 -0
  154. package/src/cli/fleet.ts +173 -335
  155. package/src/cli/index.ts +3 -1
  156. package/src/cli/library.ts +190 -0
  157. package/src/cli/share.ts +13 -1
  158. package/src/cli/usage.ts +111 -19
  159. package/src/core/bus-events.ts +4 -0
  160. package/src/core/commit-attribution.ts +4 -4
  161. package/src/core/config.ts +130 -0
  162. package/src/core/defaults.ts +81 -0
  163. package/src/domains/agents/builtins/architect.md +1 -0
  164. package/src/domains/agents/builtins/oracle.md +33 -0
  165. package/src/domains/agents/catalog.ts +13 -1
  166. package/src/domains/agents/fleet-contract.ts +278 -16
  167. package/src/domains/agents/index.ts +14 -0
  168. package/src/domains/agents/result-contract.ts +235 -1
  169. package/src/domains/config/classify.ts +4 -0
  170. package/src/domains/dispatch/active-route-planner.ts +14 -0
  171. package/src/domains/dispatch/backoff.ts +2 -1
  172. package/src/domains/dispatch/capability-match.ts +1 -0
  173. package/src/domains/dispatch/checkout-writer-lease.ts +175 -0
  174. package/src/domains/dispatch/contract.ts +34 -0
  175. package/src/domains/dispatch/delegation-plan.ts +167 -0
  176. package/src/domains/dispatch/execution-plan.ts +76 -5
  177. package/src/domains/dispatch/execution-role.ts +3 -1
  178. package/src/domains/dispatch/execution-scheduler.ts +183 -67
  179. package/src/domains/dispatch/extension.ts +258 -9
  180. package/src/domains/dispatch/fleet-gate.ts +14 -0
  181. package/src/domains/dispatch/fleet-plan.ts +63 -3
  182. package/src/domains/dispatch/fleet-run.ts +737 -0
  183. package/src/domains/dispatch/gate-role-prompts.ts +9 -0
  184. package/src/domains/dispatch/host-verification.ts +178 -0
  185. package/src/domains/dispatch/index.ts +38 -0
  186. package/src/domains/dispatch/intent.ts +159 -0
  187. package/src/domains/dispatch/receipt-integrity.ts +8 -4
  188. package/src/domains/dispatch/state.ts +36 -3
  189. package/src/domains/dispatch/types.ts +51 -6
  190. package/src/domains/dispatch/validation.ts +66 -6
  191. package/src/domains/evidence/trust-status.ts +10 -1
  192. package/src/domains/middleware/index.ts +15 -0
  193. package/src/domains/middleware/watchdog.ts +281 -0
  194. package/src/domains/observability/contract.ts +3 -1
  195. package/src/domains/observability/cost.ts +12 -1
  196. package/src/domains/observability/extension.ts +2 -2
  197. package/src/domains/observability/index.ts +10 -0
  198. package/src/domains/observability/out-of-turn-usage.ts +223 -0
  199. package/src/domains/resources/index.ts +20 -0
  200. package/src/domains/resources/library.ts +326 -0
  201. package/src/domains/resources/skills/marketplace.ts +37 -12
  202. package/src/domains/session/handoff.ts +629 -0
  203. package/src/domains/share/archive.ts +67 -2
  204. package/src/entry/orchestrator.ts +37 -0
  205. package/src/interactive/bus-notices.ts +26 -0
  206. package/src/interactive/chat-loop.ts +235 -1
  207. package/src/interactive/chat-renderer.ts +22 -0
  208. package/src/interactive/cost-overlay.ts +31 -3
  209. package/src/interactive/council-dispatch.ts +30 -0
  210. package/src/interactive/council-grid.ts +213 -0
  211. package/src/interactive/council.ts +99 -0
  212. package/src/interactive/dispatch-board.ts +260 -16
  213. package/src/interactive/fleet-run-preview.ts +307 -0
  214. package/src/interactive/footer/notifications.ts +219 -0
  215. package/src/interactive/handoff-round.ts +56 -0
  216. package/src/interactive/interactive-application.ts +43 -1
  217. package/src/interactive/interactive-event-projection.ts +9 -1
  218. package/src/interactive/interactive-slash-runtime.ts +52 -2
  219. package/src/interactive/interactive-subscriptions.ts +14 -2
  220. package/src/interactive/oracle.ts +179 -0
  221. package/src/interactive/overlay-ask-user-lifecycle.ts +6 -0
  222. package/src/interactive/overlay-general-openers.ts +190 -1
  223. package/src/interactive/overlay-key-routing.ts +17 -1
  224. package/src/interactive/overlay-lifecycle.ts +41 -1
  225. package/src/interactive/overlay-permission-lifecycle.ts +10 -0
  226. package/src/interactive/overlay-resource-openers.ts +11 -3
  227. package/src/interactive/overlay-session-lifecycle.ts +234 -2
  228. package/src/interactive/overlays/fleet-run-approval.ts +208 -0
  229. package/src/interactive/overlays/handoff-review.ts +185 -0
  230. package/src/interactive/overlays/library-install-confirm.ts +151 -0
  231. package/src/interactive/overlays/list-overlay.ts +168 -2
  232. package/src/interactive/overlays/settings.ts +101 -4
  233. package/src/interactive/overlays/side-question.ts +139 -0
  234. package/src/interactive/overlays/skills-hub.ts +401 -15
  235. package/src/interactive/side-question.ts +171 -0
  236. package/src/interactive/slash-commands.ts +432 -5
  237. package/src/interactive/slash-spec.ts +19 -6
  238. package/src/interactive/theme/tokens.ts +30 -0
  239. package/src/interactive/turn-middleware.ts +15 -1
  240. package/src/interactive/watchdog-run.ts +75 -0
  241. package/src/interactive/worker-share.ts +56 -1
  242. package/src/interactive/worker-stream.ts +7 -0
  243. package/src/tools/bootstrap.ts +3 -0
  244. package/src/tools/compete-worktrees.ts +13 -79
  245. package/src/tools/dispatch-admission.ts +242 -8
  246. package/src/tools/dispatch-arguments.ts +57 -1
  247. package/src/tools/dispatch-plan.ts +136 -6
  248. package/src/tools/dispatch-runner.ts +319 -13
  249. package/src/tools/dispatch-types.ts +20 -1
  250. package/src/tools/dispatch.ts +72 -2
  251. package/src/tools/monitor.ts +16 -0
  252. package/src/tools/profiles.ts +18 -4
  253. package/src/tools/task-worktree.ts +238 -0
  254. package/src/tools/verify/authoring.ts +61 -1
  255. package/src/tools/verify/scripts.ts +62 -0
  256. package/src/tools/worker-evidence.ts +2 -1
  257. package/src/worker/spec-contract.ts +1 -0
  258. package/dist/chunk-HC4CLZ2Y.js +0 -68
@@ -1,9 +1,9 @@
1
1
  # Evidence Corpus and Long-Term Memory
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive memory lifecycle dashboard and simulator is located at [docs/html/memory_blueprint.html](html/memory_blueprint.html) (Version: 0.3.6). Use it to design, validate, and simulate memory proposals, approval loops, pruning rules, and token budgets.
4
+ > **Interactive Spec Available:** An interactive memory lifecycle dashboard and simulator is located at [docs/html/memory_blueprint.html](html/memory_blueprint.html) (Version: 0.3.7). Use it to design, validate, and simulate memory proposals, approval loops, pruning rules, and token budgets.
5
5
 
6
- Clio Coder treats run claims and agent lessons as structured artifacts to support reproducibility and scientific provenance. In evaluations such as [SWE-bench](https://www.swebench.com), capturing granular execution evidence is essential for validating agent claims. Evidence corpora are deterministic directories built from run ledgers, receipts, sessions, audits, and eval artifacts. In v0.3.6, forensic evidence auto-builds on dispatch run completion: when a run finalizes, the observability domain automatically compiles the evidence bundle under `<dataDir>/evidence/run-<id>/` and updates a compact sidecar index row in `<stateDir>/evidence-index.json`. Long-term memory records are local, evidence-linked, and only injected after explicit approval. Use the TUI [`/view`](observability.md) command for interactive inspection of receipts, dispatch output, durable tool output, compaction summaries, and session accountability before building or citing evidence.
6
+ Clio Coder treats run claims and agent lessons as structured artifacts to support reproducibility and scientific provenance. In evaluations such as [SWE-bench](https://www.swebench.com), capturing granular execution evidence is essential for validating agent claims. Evidence corpora are deterministic directories built from run ledgers, receipts, sessions, audits, and eval artifacts. In v0.3.7, forensic evidence auto-builds on dispatch run completion: when a run finalizes, the observability domain automatically compiles the evidence bundle under `<dataDir>/evidence/run-<id>/` and updates a compact sidecar index row in `<stateDir>/evidence-index.json`. Long-term memory records are local, evidence-linked, and only injected after explicit approval. Use the TUI [`/view`](observability.md) command for interactive inspection of receipts, dispatch output, durable tool output, compaction summaries, and session accountability before building or citing evidence.
7
7
 
8
8
  Source of truth: `src/domains/evidence/**`, `src/domains/memory/**`, `src/cli/evidence.ts`, and `src/cli/memory.ts`.
9
9
 
@@ -148,11 +148,11 @@ Each run receipt (persisted under `<stateDir>/receipts/<runId>.json`) carries an
148
148
  ### Computation and Lifecycle
149
149
  - **Circular Dependency Prevention**: To prevent circular dependencies, `findingsSummary` is calculated **cheaply in-memory** at receipt-record time using the draft envelope and tool statistics (in `src/domains/dispatch/receipt-findings.ts`). It never reads from disk or calls `buildEvidence`.
150
150
  - **First-Pass Success**: Calculated as `true` only if the terminal outcome was `"succeeded"`, the lineage attempt was `0` (no dispatch retries), the tool stats confirm at least one successful validation tool was executed, and no failure-cause tags were detected.
151
- - **Cryptographic Coverage**: Current receipts use strict v15 and authenticate every current receipt field, including briefing and steering provenance, routing intent and decision, route quality, worker identity, execution role, and result-contract conformance, against the reconstructed ledger. Every version other than v15 is rejected; there is no historical receipt reader.
151
+ - **Cryptographic Coverage**: Current receipts use strict v19 and authenticate every current receipt field, including briefing and steering provenance, routing intent and decision, route quality, worker identity, execution role, result-contract conformance, council provenance, and fleet gate provenance, against the reconstructed ledger. Every version other than v19 is rejected; there is no historical receipt reader.
152
152
 
153
153
  | Version | Verification policy | Compatibility policy |
154
154
  |---|---|---|
155
- | v15 | Current canonical projection; every current receipt and reconstructible ledger field is authenticated | Accepted |
155
+ | v19 | Current canonical projection; every current receipt and reconstructible ledger field is authenticated | Accepted |
156
156
  | Any other version | No reader | Rejected; remove or archive the incompatible state rather than expecting migration |
157
157
 
158
158
  Receipt integrity and evidence verification answer different questions. The
@@ -227,7 +227,7 @@ finish-contract records without changing receipt-owned axes. Findings such as
227
227
  domain artifacts remain in the receipt, gate, audit, and trace files.
228
228
 
229
229
  The canonical aggregate is an additive projection for downstream work. Receipt
230
- integrity remains version 15, evidence bundles remain version 1, gate decisions
230
+ integrity remains version 18, evidence bundles remain version 1, gate decisions
231
231
  remain version 2, and no persisted receipt field or cryptographic algorithm
232
232
  changes.
233
233
 
package/docs/evolution.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Evolution and Change Manifests
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive change manifest editor, authority risk assessor, and checklist workspace is located at [docs/html/evolution_blueprint.html](html/evolution_blueprint.html) (Version: 0.3.6).
4
+ > **Interactive Spec Available:** An interactive change manifest editor, authority risk assessor, and checklist workspace is located at [docs/html/evolution_blueprint.html](html/evolution_blueprint.html) (Version: 0.3.7).
5
5
 
6
6
  Clio Coder uses change manifests to make harness changes reviewable, falsifiable, and rollback-friendly. CLIO stands for Context Layer for Input/Output, named for the Greek muse of history. A manifest is JSON, generated or checked with `clio-coder evolve manifest`, and should describe what changed, why, what evidence supports it, what could regress, how to validate it, and how to roll it back.
7
7
 
@@ -1,6 +1,6 @@
1
1
  # Exit Codes & Machine-Readable Output Contracts
2
2
 
3
- This document specifies the process exit codes, machine-readable JSON streaming formats, standard I/O separation rules, and `--help` conventions across all Clio Coder CLI commands in `v0.3.6`.
3
+ This document specifies the process exit codes, machine-readable JSON streaming formats, standard I/O separation rules, and `--help` conventions across all Clio Coder CLI commands in `v0.3.7`.
4
4
 
5
5
  Source implementations: `src/cli/` and `src/entry/`.
6
6
 
@@ -66,6 +66,9 @@ Many Clio CLI subcommands provide structured JSON output for integration with sc
66
66
  | `clio-coder targets` | `--json` | JSON object containing the configured `targets` array. |
67
67
  | `clio-coder models` | `--json` | JSON array of catalog models with capability flags. |
68
68
  | `clio-coder fleet status` | `--json` | JSON snapshot object with `generatedAt`, `admission` (`open` or `draining`), `running`, `retrying`, and `totals`. Each run row carries its `node`, defaulting to `local`. |
69
+ | `clio-coder fleet validate` | `--json` | JSON report with `valid`, `fleet`, and either successful `checks` plus `planHash` or failure `diagnostics`. Validation failures exit `1`; usage errors exit `2`. |
70
+ | `clio-coder fleet graph` | `--json` | JSON object with `fleet`, `planHash`, compiled `waves`, and expanded `loops`. Contract failures exit `1`; usage errors exit `2`. |
71
+ | `clio-coder fleet run --resume` | `--json` | NDJSON step records include `status: "replayed"` and the original receipt reference for replayed prefix steps. Plan or variable mismatches exit `1`. |
69
72
  | `clio-coder trace runs` | `--json` | JSON array of trace run records. |
70
73
  | `clio-coder trace sql` | Positional query | JSON array of rows returned by the read-only SQLite query. A single `SELECT` or read-only `WITH` statement is accepted; multiple statements and mutating keywords are refused with exit code 2. |
71
74
  | `clio-coder paths` | `--json` | JSON object mapping platform directory names to absolute paths. |
@@ -1,7 +1,7 @@
1
1
  # Extensions, Prompt Templates, Skills, and Share Archives
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive dashboard is located at [docs/html/extensions_blueprint.html](html/extensions_blueprint.html) (Version: 0.3.6).
4
+ > **Interactive Spec Available:** An interactive dashboard is located at [docs/html/extensions_blueprint.html](html/extensions_blueprint.html) (Version: 0.3.7).
5
5
 
6
6
  Clio Coder has lightweight community-oriented resource packaging. Extensions are filesystem bundles that contribute prompts and skills. Share archives are portable JSON files for moving project/user Clio resources between machines or collaborators. Themes are built into the engine and are no longer loaded from extensions.
7
7
 
@@ -251,7 +251,7 @@ Share archives are single JSON files:
251
251
  "formatVersion": 1,
252
252
  "manifest": {
253
253
  "format": "clio.share.v1",
254
- "clioVersion": "0.3.6",
254
+ "clioVersion": "0.3.7",
255
255
  "createdAt": "...",
256
256
  "files": []
257
257
  },
@@ -280,6 +280,8 @@ Options:
280
280
  | `--skills` | Include skills. |
281
281
  | `--settings` | Include non-secret settings fragment. |
282
282
  | `--extensions` | Include extension bundle files, excluding extension `state.json`. |
283
+ | `--agents` | Include agent recipe files. |
284
+ | `--fleets` | Include fleet contract files. |
283
285
  | `--all` | Include every supported resource class. |
284
286
 
285
287
  If no include flags are supplied, export includes all supported classes for the selected scope.
@@ -296,6 +298,8 @@ clio-coder share import project.clio-coder-share.json --force
296
298
 
297
299
  Dry-run imports produce a plan and report conflicts without writing. Without `--force`, conflicting destination files block writes. With `--force`, conflicting files are overwritten and supported settings-fragment keys are merged into the current settings file.
298
300
 
301
+ Archives accept `agent` and `fleet` file entry types alongside prompts and skills. Agent entries import into the user agent root and must pass the recipe parser and policy checks. Fleet entries import into the user fleet root and must pass `parseFleetContract` before any write. Dry-run plans report both types by kind.
302
+
299
303
  Aliases:
300
304
 
301
305
  ```bash
@@ -136,7 +136,7 @@ clio-coder evidence inspect <evidenceId>
136
136
  run ledger; a tampered or mismatched receipt fails the build with the field
137
137
  that diverged. The receipts of the remote runs verify on the orchestrator host because the
138
138
  ledger and receipts live on the shared filesystem. Current receipts use strict
139
- v15 and authenticate every current receipt and reconstructed-ledger field.
139
+ v16 and authenticate every current receipt and reconstructed-ledger field.
140
140
  Every other receipt version is rejected rather than reported as partial; the
141
141
  current binary has no historical receipt reader.
142
142
 
@@ -168,7 +168,7 @@ reconstruct:
168
168
  complete receipt schema and its stable ledger row. `clio-coder evidence build
169
169
  --run <id>` recomputes and cross-checks it; `verifyReceiptIntegrity` in
170
170
  `src/domains/dispatch/receipt-integrity.ts` is the reference
171
- implementation. Current receipts use v15 and every other version fails
171
+ implementation. Current receipts use v16 and every other version fails
172
172
  verification. Incompatible state must be archived or removed; it is never
173
173
  read as evidence through a compatibility verifier.
174
174
 
@@ -1,6 +1,6 @@
1
1
  # Fleet Dispatch
2
2
 
3
- > **Interactive Spec Available:** An interactive fleet node topology planner, scout router, receipt verifier, and failure taxonomy simulator is located at [docs/html/fleet_dispatch_blueprint.html](html/fleet_dispatch_blueprint.html) (Version: 0.3.6).
3
+ > **Interactive Spec Available:** An interactive fleet node topology planner, scout router, receipt verifier, and failure taxonomy simulator is located at [docs/html/fleet_dispatch_blueprint.html](html/fleet_dispatch_blueprint.html) (Version: 0.3.7).
4
4
 
5
5
  Clio Coder dispatches bounded worker agents. With a fleet configured, those
6
6
  workers run on remote machines over SSH while the orchestrator keeps every
@@ -160,7 +160,7 @@ Use `clio-coder fleet resume [--json]` to reopen admission early. Detailed drain
160
160
 
161
161
  With no fleet configured and nothing requested, placement resolves to the
162
162
  implicit local path and optional fleet-node provenance may remain absent.
163
- Every new receipt uses strict integrity v15; older receipt formats are not
163
+ Every new receipt uses strict integrity v19; older receipt formats are not
164
164
  accepted by the current reader.
165
165
 
166
166
  ## Failure semantics
@@ -202,8 +202,92 @@ request-level `autonomy` can only narrow the level (reviewers and judges run
202
202
  | Detached | `detach: true` | Return logical assignment ids and a batch id immediately; collect later. |
203
203
  | Review gate | `review: {reviewer?, max_cycles?}` | Builder, read-only reviewer verdict, bounded revise loop. |
204
204
  | Compete | `mode: "compete", candidates: 2..4` | N candidates in scratch worktrees, read-only judge, winner applied or preserved. |
205
+ | Council | `mode: "council", roster: "design"` | Two to five read-only members answer the same task, with optional vote or judge synthesis. |
205
206
  | Agent automation | `agent: "auto"` | Baselines candidate agent from task shape via shared classifier (`coder`, `tester`, `documenter`, `verifier`, `researcher`, `scout`); advisory unless activated. |
206
207
 
208
+ ### Single-writer token
209
+
210
+ A parallel batch may declare `writers: 1`. One is the only accepted value in
211
+ this release, and omission retains ordinary parallel admission. The scheduler
212
+ admits at most one write-scope step at a time. An agent step with a nonempty
213
+ `writes` allowlist is a writer, as is a workspace-scope step that may mutate
214
+ the checkout. Read-scope steps and agent steps with `writes: []` remain
215
+ concurrent. Waiting writers follow the plan's declared step order and then the
216
+ request order. Agent ledger claims remain advisory and do not enforce the
217
+ token.
218
+
219
+ The first checkout writer acquires a process-owned lease under the Clio state
220
+ directory. Its key is the canonical checkout path, and its record contains the
221
+ owner pid, process birth token, and acquisition time. A live sibling process
222
+ causes admission to fail with `checkout_writer_lease_held` and the holder pid.
223
+ A dead owner or reused pid is reclaimed. The lease remains held until the last
224
+ writer settles, including writers collected from detached batches. Read-only
225
+ runs never acquire it.
226
+
227
+ ### Worktree per task
228
+
229
+ A singular writer or an item in `tasks` may declare `worktree: true` and
230
+ `apply: "merge" | "preserve"`. The default is `merge`. Clio creates
231
+ `.clio-coder/worktrees/<runId>/` on `clio/task/<runId>`, maps the worker cwd and
232
+ protected artifacts into that checkout, and runs declared host verification
233
+ there. The approved execution snapshot renders both fields and freezes the
234
+ parent checkout as the merge destination.
235
+
236
+ After a successful worker and successful host verification, merge application
237
+ commits the task branch, rechecks protected paths, and uses the same guarded
238
+ merge path as compete. A conflict fails closed with
239
+ `worktree_merge_conflict` and preserves the branch and worktree. Preserve
240
+ application never merges and reports the branch. A detached task applies when its run finalizes, so `monitor(mode="collect")` returns the sealed application receipt.
241
+ Admission refuses a non-git checkout, a read-only agent, compete mode, or an
242
+ explicit cwd outside the parent checkout with a named reason.
243
+
244
+ ### Typed intent and host-run verification
245
+
246
+ The singular request and every object in `tasks` accept an optional `intent`:
247
+
248
+ ```json
249
+ {
250
+ "read_roots": ["src/domains/dispatch"],
251
+ "write_roots": ["src/tools"],
252
+ "relevant_paths": ["docs/fleet-dispatch.md"],
253
+ "expected_outputs": ["dist/cli.js"],
254
+ "verification": [{ "check": "test", "timeout_ms": 600000 }]
255
+ }
256
+ ```
257
+
258
+ A top-level intent is inherited by batch items unless an item supplies its own
259
+ intent. `gate: "test"` is exact shorthand for
260
+ `intent.verification: [{check: "test"}]`; supplying both spellings is refused.
261
+ Every path is normalized into a sorted, duplicate-free repository-relative
262
+ POSIX path list before approval. Absolute paths, empty paths, root escapes,
263
+ malformed entries, and values beyond the documented caps fail admission.
264
+ Normalized `intent.writeRoots` feeds the existing worker write-boundary
265
+ enforcement when no legacy `JobSpec.writeRoots` exists. Conflicting declarations
266
+ are refused as `intent_write_roots_contradiction`.
267
+
268
+ Verification values are declared check ids, never shell commands. Admission
269
+ resolves each id from a package script or `.clio-coder/verifiers.yaml`, clamps
270
+ the requested timeout to the declaration, and freezes the exact argv, cwd,
271
+ timeout, and normalized intent into the execution snapshot and plan hash. A
272
+ later catalog edit cannot change the approved command. Undeclared ids fail
273
+ before approval with `verification_check_undeclared` and declaration guidance.
274
+
275
+ After a successful worker attempt, the orchestrator runs the frozen checks with
276
+ no shell, a fixed cwd, and the code-step environment allowlist. Logs are written
277
+ under the run artifact directory. Successful evidence is memoized by the
278
+ workspace fingerprint, resolved argv, cwd, and allowed environment values. A
279
+ memo hit names the run that produced the original evidence. A changed tree is a
280
+ miss. An unsuccessful worker records `hostVerification.status="skipped"` with
281
+ `reason="worker_not_successful"`; a failed host check records `rejected` with
282
+ its exit code, bounded output tail, and artifact path. Worker-reported command
283
+ success never populates this status.
284
+
285
+ Host checks are supported for singular, parallel, sequential, pipeline, and
286
+ detached native runs. Review and compete accept intent paths and outputs but
287
+ refuse verification entries with `verification_unsupported_for_mode`.
288
+ Claude Code subprocess routes refuse them with
289
+ `verification_unsupported_runtime`.
290
+
207
291
  ### Agent ledger
208
292
 
209
293
  Every topology that runs more than one worker at once opens an agent ledger, the
@@ -321,6 +405,32 @@ the workers are quiesced but the candidates remain until that output is bound
321
405
  to an integrity-verified judge receipt; a recovered winner is preserved for
322
406
  operator inspection rather than silently auto-applied after restart.
323
407
 
408
+ ### Council
409
+
410
+ Council is the read-only sibling of compete. Two to five members run the same
411
+ singular task concurrently on local HTTP or native targets. A request selects
412
+ exactly one configured `workers.rosters` entry or supplies inline `members`.
413
+ Admission pins every member to `read-only` autonomy and to the `read`, `grep`,
414
+ `find`, `ls`, `code_nav`, and `context` tool surface. A route that resolves to
415
+ an SSH fleet node is refused before approval. Council never creates a worktree
416
+ and never mutates the workspace.
417
+
418
+ Council supports one to three rounds. The first round gives every member the
419
+ same task and briefing. A later round gives each member the other members'
420
+ prior answers as labelled, untrusted briefing data. The member never receives
421
+ its own prior answer. Each briefing is limited to 8 KiB and carries an explicit
422
+ truncation marker when necessary. A failed peer contributes a labelled failure
423
+ marker and no answer text.
424
+
425
+ `synthesis: "none"` returns the final member answers directly. `vote` performs
426
+ a deterministic majority tally over structured `verdict` fields without a
427
+ model call. A vote with no majority reports `no_majority`, and a vote with no
428
+ verdict fields reports `no_verdict_field`. `judge` runs one additional read-only judge against all final
429
+ answers. Every member run seals a receipt. A judge receipt points backward to
430
+ every final member receipt through gate provenance. The approval artifact names
431
+ each member's label, target, model, thinking level, node, color, round count,
432
+ and synthesis mode, so the plan hash binds the whole council contract.
433
+
324
434
  ### ExecutionPlan and plan approval
325
435
 
326
436
  Every orchestration shape compiles to one strict ExecutionPlan v2 DAG with
@@ -367,11 +477,36 @@ rejected.
367
477
 
368
478
  Clio ships three builtin fleet contracts under `src/domains/agents/fleets/`: `build-test`, `build-review`, and `sdlc`. Projects can declare custom fleet contracts or shadow builtin fleets by placing Markdown files under `.clio-coder/fleets/<name>.md`. A file named `.clio-coder/fleets/<name>.md` shadows a builtin fleet of the same name.
369
479
 
370
- Fleet contracts support schema versions 1 through 4:
480
+ Fleet contracts support schema versions 1 through 5:
371
481
  - Version 1: Supports agent steps only.
372
482
  - Version 2: Introduces deterministic code steps.
373
483
  - Version 3: Adds bounded check/repair loops and commit steps with `commitFrom` message sources.
374
484
  - Version 4 (`FLEET_WRITE_BOUNDARY_VERSION = 4`): Introduces per-step declared write boundaries (`writes`) and orchestrator post-step enforcement.
485
+ - Version 5 (`FLEET_DYNAMIC_STEP_VERSION = 5`): Adds plan steps, executable gate steps, per-step target or worker-profile defaults, and the optional single-writer declaration.
486
+
487
+ #### Contract v5: plan, gate, and per-step target
488
+
489
+ A version 5 agent step, including an agent loop check or repair, may declare either `target: <targetId>` or `profile: <workers.profiles key>`. It may never declare both. Fleet preflight resolves these values through the same worker routing used by `/run --target` and `/run --agent-profile`. An unknown value refuses before approval and names the target or profile. Versions 1 through 4 continue to refuse both fields.
490
+
491
+ A `kind: gate` step asks its validator agent to write exactly one repository-relative `path`. The contract derives the step's write boundary from that path, so a separate `writes` property is refused. Its `run` property names a command whose argv contains one whole-token `{{path}}` placeholder. After the agent writes the executable acceptance check, the coordinator runs it without a shell against the otherwise untouched tree. A red result admits the gate. A green result refuses the run as `gate_not_discriminating`. The fleet ledger records the gate path hash. A loop may use `check: {kind: gate, gate: <stepId>}`. Only the bounded output lines beginning with `FAIL` cross that failed check edge into the repair agent.
492
+
493
+ A `kind: plan` step defaults to the builtin `architect`. It declares `roster`, `maxTasks` from 1 through 16, an optional `proposals: true`, its own scope and write boundary, and an optional target or profile default. The architect returns a `delegation-plan` object whose tasks contain `id`, `agent`, `description`, `depends_on`, `writes`, and an optional `mode` of `sequential` or `parallel`. The coordinator admits only roster agents, unique and acyclic task ids, resolvable dependencies, the declared task count, and task writes contained by the plan step boundary. Successful tasks carry lineage to the plan step and inherit its target or profile. A contract with `writers: 1` serializes write tasks through the existing single-writer token.
494
+
495
+ When `proposals: true`, every roster member first runs with read-only autonomy against the same task. Their answers reach the architect as labelled, bounded briefing data. Proposal agents do not choose targets for generated work. The plan step's contract default remains authoritative for every admitted task.
496
+
497
+ ### Fleet authoring
498
+
499
+ The fleet CLI provides five authoring and inspection operations:
500
+
501
+ - `clio-coder fleet new <name> --from <builtin>` copies one of `build-review`, `build-test`, or `sdlc` into `.clio-coder/fleets/<name>.md`. The command requires a safe file stem and refuses to replace an existing contract.
502
+ - `clio-coder fleet validate <name> [--json]` parses the contract, validates its graph and command bindings, resolves every agent, and compiles the execution plan. It creates no state directory, ledger row, reservation, worker, or receipt.
503
+ - `clio-coder fleet graph <name> [--json]` renders the compiled waves with each step kind, agent or command, scope, and write boundary. Bounded loops also show their check and repair nodes beneath the loop identifier.
504
+ - `clio-coder fleet commands init` discovers declared package scripts, just recipes, Makefile targets, and supported `pyproject.toml` script and tool entries. It writes a fully commented `.clio-coder/fleets/commands.yaml` draft. Uncommenting an entry confirms its exact argument vector, and an existing registry is never replaced.
505
+ - `clio-coder fleet run <name> --resume <runId>` starts a new fleet run after replaying the successful, integrity-valid prefix recorded for the named prior fleet run.
506
+
507
+ Run resumption is separate from `clio-coder fleet resume`, which continues to reopen dispatch admission after an operator drain. A resumable fleet run records its contract name, rendered plan hash, ordered step identifiers, variables, and receipt references in the durable fleet ledger. Runs started from the TUI through `/fleet run` use the same durable record and can be resumed by the authoring CLI. The new run records the prior fleet run as its resume parent. Replayed steps are reported as `replayed`, retain their original receipt or code-report references, and do not create new receipts.
508
+
509
+ The current contract must compile to the same plan hash. A mismatch refuses before execution and prints the changed positions in the ordered step list. Variables must exactly match the original run. A different value, an added value, or an omitted value is refused even when the resulting task text would otherwise be similar.
375
510
 
376
511
  ### Per-step write boundaries (Contract v4)
377
512
 
@@ -432,7 +567,10 @@ commands:
432
567
  argv: ["npm", "run", "build"]
433
568
  timeoutMs: 600000
434
569
  commit:
435
- argv: ["git", "commit", "-m"]
570
+ argv: ["git", "commit", "-m", "{{commitMessage}}"]
571
+ timeoutMs: 60000
572
+ acceptance:
573
+ argv: ["node", "{{path}}"]
436
574
  timeoutMs: 60000
437
575
  ```
438
576
 
@@ -443,6 +581,8 @@ Each command entry supports:
443
581
  - `env` (optional): Array of extra environment variable names to pass through on top of `FLEET_COMMAND_BASE_ENV` (`PATH`, `HOME`, `LANG`, `LC_ALL`, `TZ`, `TMPDIR`).
444
582
  - `description` (optional): Human-readable description.
445
583
 
584
+ The whole-token `{{commitMessage}}` substitution is available to commit steps. The whole-token `{{path}}` substitution is available to version 5 gate commands. Each substitution becomes exactly one argv element and never passes through a shell.
585
+
446
586
 
447
587
  ## Measured route selection and agent automation
448
588
 
@@ -526,7 +666,7 @@ assignment failed, reports the reason on stderr, and records it in the
526
666
  assignment's `outcomeDetail`.
527
667
 
528
668
  Assignment status, attempt ids, and terminal run id are stored separately in
529
- `assignments.json` while each attempt keeps its own strict v15 receipt.
669
+ `assignments.json` while each attempt keeps its own strict v19 receipt.
530
670
  Pipelines and batches await assignment terminals, so downstream stages consume
531
671
  the successful fallback output rather than an earlier failed attempt.
532
672
 
@@ -540,7 +680,7 @@ closed while a winner remains unapplied.
540
680
 
541
681
  ## Receipts
542
682
 
543
- Receipts carry exactly one integrity version (`RUN_RECEIPT_INTEGRITY_VERSION = 15`), which authenticates the complete receipt and reconstructible ledger provenance surface. There is no historical verification path: any other version is invalid, and a receipt that fails verification is never read as evidence. The fleet provenance fields covered by the digest
683
+ Receipts carry exactly one integrity version (`RUN_RECEIPT_INTEGRITY_VERSION = 19`), which authenticates the complete receipt and reconstructible ledger provenance surface. There is no historical verification path: any other version is invalid, and a receipt that fails verification is never read as evidence. The fleet provenance fields covered by the digest
544
684
  include:
545
685
 
546
686
  - `node`: the fleet node the worker ran on (`id`, `kind`, `host`). The `node.id` explicitly identifies the worker process host executing the task, not the model host (which is represented by the `target` id). This behavior tracks issue #120.
@@ -551,11 +691,22 @@ include:
551
691
  approval kind, and the registry approval identity when supervised).
552
692
  - `briefing`: byte count and SHA-256 of the exact canonical parent briefing;
553
693
  the prose is not retained and is distinct from bounded project context.
694
+ - `intent`: the normalized typed path, expected-output, and verification
695
+ declaration that admission sealed for the run.
696
+ - `verification`: the existing evidence state and basis observed from worker
697
+ tool execution.
698
+ - `hostVerification`: host-run status and the resolved check evidence, including
699
+ argv, cwd, exit code, duration, memo provenance, bounded output tail, and
700
+ optional artifact path.
701
+ - `worktree`: task worktree path, branch, diff hash, requested application,
702
+ applied status, and an optional closed failure reason.
554
703
  - `steering`: ordered byte/hash/timestamp and acknowledgement provenance for
555
704
  successfully written steers; steering prose is never stored.
556
705
  - `outcomeCode`: the stable terminal classifier, including
557
706
  `worker_final_output_missing` when an otherwise successful worker exits
558
- without a nonempty receipt-sealed final answer.
707
+ without a nonempty receipt-sealed final answer and
708
+ `host_verification_rejected` when a declared host check rejects the settled
709
+ tree. Both suppress automatic retry.
559
710
  - `routingIntent`, `routeDecision`, and `quality`: the normalized hard bounds,
560
711
  complete current-policy decision, exact execution role, route estimate and
561
712
  readiness evidence, and authenticated quality sources.
@@ -575,11 +726,14 @@ retained only as `state: "partial"` diagnostics and automatic retry is
575
726
  suppressed. Dispatch, monitor, ledger, receipt, terminal bus event, and retry
576
727
  policy all consume that same final classification.
577
728
 
578
- Receipt integrity and evidence verification are separate axes. Integrity says
729
+ Receipt integrity, host verification, and evidence verification are separate axes. Integrity says
579
730
  that the sealed receipt matches its ledger envelope; evidence verification
580
731
  reports whether Clio observed an applicable validation tool (or marks the
581
- basis unknown/not applicable). A read-only Scout can therefore report `receipt_integrity=verified/v15/sha256` alongside
582
- `evidence_verification=not_applicable/read-only-agent`. Briefing provenance and
732
+ basis unknown/not applicable). A read-only Scout can therefore report `receipt_integrity=verified/v19/sha256` alongside
733
+ `evidence_verification=not_applicable/read-only-agent`. Host verification is
734
+ rendered independently as `host_verification=verified|rejected|skipped|not_requested`.
735
+ A host-executed successful check projects onto canonical validation grounding as
736
+ authenticated validator evidence. Briefing provenance and
583
737
  bounded `project_context` provenance are also rendered independently; neither
584
738
  hash substitutes for the other.
585
739
 
@@ -689,6 +843,39 @@ hard block.
689
843
  - `/fleet` opens Settings → Fleet: profiles (with the node pin), bindings,
690
844
  and read-only node rows (state, capacity, and last-seen). Running and
691
845
  retrying runs, with their node, live in the `Alt+W` Fleet Runs board.
846
+ - `/fleet run <name> [--var k=v ...]` compiles the contract's plan and opens
847
+ the approval overlay before anything dispatches. The overlay lists the steps
848
+ grouped by wave, and for each step its kind, its agent and resolved target
849
+ (or its command id and the exact argv from `commands.yaml` for a code step),
850
+ its scope, and its declared write boundary, followed by the budget ceiling
851
+ the run would be admitted under. Enter dispatches the plan through the same
852
+ path `clio-coder fleet run` uses, so admission, autonomy, receipts, and the
853
+ durable ledger are identical. Esc cancels with nothing dispatched and nothing
854
+ written. A contract that fails preflight opens the same overlay with its
855
+ diagnostics and no accept key. A turn in flight refuses the command with a
856
+ notice rather than queueing it: an approved plan describes the workspace as
857
+ it stands.
858
+ - A council is one question asked of several members, so its rows render as one
859
+ card rather than as three to five unrelated neighbours. On the `Alt+W` board the
860
+ members sit side by side, one column each, as long as every column keeps at
861
+ least 34 cells; below that the whole group stacks one member under another
862
+ rather than squeezing some columns and not others. Each column carries the
863
+ member label in its roster color (a member with no color takes the accent), the
864
+ target and model, the round, the status, and the same bounded answer tail the
865
+ run's own card would show. The synthesis run takes the full width under the
866
+ members, because it is the council's answer rather than one voice in it. A
867
+ council that ran several rounds still shows one column per member: each label
868
+ keeps its newest round, so the card describes the council rather than its
869
+ history.
870
+ - The compact Fleet Runs island shows a council as one card naming the group, how
871
+ many members are seated, and which round they are on. The grid belongs to the
872
+ board, where there is width to read an answer in. `/share` is what moves a
873
+ council answer into the main agent's context; the card moves nothing.
874
+ - Board rows a fleet plan dispatched carry a phase column naming the step's
875
+ wave index and step id (`w2 build`). A run that is not a fleet step renders
876
+ the column empty. The compact Fleet Runs island keeps its fixed width, so it
877
+ shows the column only when the row can still hold a readable agent label;
878
+ otherwise the phase appears on the expanded card.
692
879
  - The monitor tool reports the node and reroute lineage on `status`, `list`,
693
880
  and `collect`.
694
881
  - `clio-coder fleet status [--json]` shows the durable ledger view cross-process.
@@ -49,11 +49,11 @@ Co-authored-by: Clio Coder <clio-coder@iowarp.ai>
49
49
  Existing human trailers stay in place. A Clio trailer already present in any
50
50
  letter case is respected rather than repeated, line endings are normalized only
51
51
  while attribution is enabled, and repeated processing is idempotent. When a directly relevant
52
- receipt-v15 digest passes integrity verification, Clio may additionally add the
52
+ receipt-v19 digest passes integrity verification, Clio may additionally add the
53
53
  full digest:
54
54
 
55
55
  ```text
56
- Clio-Evidence: receipt-v15/sha256:<64-character digest>
56
+ Clio-Evidence: receipt-v19/sha256:<64-character digest>
57
57
  ```
58
58
 
59
59
  Clio does not invent, shorten, or add an unrelated digest. The role trailers do
package/docs/glossary.md CHANGED
@@ -28,7 +28,7 @@ This document defines the 45 core architectural concepts and terminology used th
28
28
 
29
29
  ### 6. Receipt
30
30
  - **Definition**: An immutable, cryptographically sealed record of a completed run containing full execution facts, tool telemetry, token accounting, validation grounding, and outcome codes.
31
- - **Owning Type**: `RunReceipt` in `src/domains/dispatch/types.ts` (`RUN_RECEIPT_INTEGRITY_VERSION = 15`).
31
+ - **Owning Type**: `RunReceipt` in `src/domains/dispatch/types.ts` (`RUN_RECEIPT_INTEGRITY_VERSION = 19`).
32
32
 
33
33
  ### 7. Envelope
34
34
  - **Definition**: A bounded container enforcing byte-length limits and truncation indicators on a dynamic payload. Tool output carries shown and total byte counts plus a continuation fragment; a parent briefing carries byte count and SHA-256 content hash instead.
@@ -3,7 +3,7 @@
3
3
  Clio Coder is designed to be self-contained and platform-compliant. This document outlines the default directory paths, file purposes, permission levels, and lifecycle commands (`install`, `reset`, `upgrade`, and `uninstall`). Clio Coder installs from npm as `@iowarp/clio-coder` (`npm install -g @iowarp/clio-coder`, published since v0.3.0) or from a source checkout with a deterministic local symlink; the CLI classifies both install kinds and `clio-coder upgrade` handles each.
4
4
 
5
5
  > [!TIP]
6
- > **Interactive Spec Available:** An interactive dashboard with a path simulator and visual flowcharts is located at [docs/html/lifecycle_blueprint.html](html/lifecycle_blueprint.html) (Version: 0.3.6). You can open it directly in any web browser to view details dynamically.
6
+ > **Interactive Spec Available:** An interactive dashboard with a path simulator and visual flowcharts is located at [docs/html/lifecycle_blueprint.html](html/lifecycle_blueprint.html) (Version: 0.3.7). You can open it directly in any web browser to view details dynamically.
7
7
 
8
8
  ---
9
9
 
@@ -229,7 +229,7 @@ Upgrading from 0.3.1 to 0.3.3 is automated:
229
229
  clio-coder upgrade
230
230
  ```
231
231
 
232
- Key lifecycle and operational updates in v0.3.6:
232
+ Key lifecycle and operational updates in v0.3.7:
233
233
  - Upgraded the underlying engine SDK libraries to 0.84.0 with signal-aware OAuth cancellation.
234
234
  - Hardened migration resilience: damaged `credentials.yaml` files no longer block upgrades when no renames are needed (#121); `--skip-migrations` is available as a recovery override.
235
235
  - Fullscreen TUI mode (`terminal.tuiMode`, `terminal.fullscreenScrollbar`) is available via Settings → Terminal (restart required). Adaptive presentation pacing is the live `terminal.smoothStreaming` setting; 0.3.3 defaults it to `off`, with conservative `auto` and explicit `on` available from the same section.
@@ -1,7 +1,7 @@
1
1
  # Middleware and Component Registry
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive dashboard with an interactive component scanner and a dynamic hook-and-effect pipeline is located at [docs/html/middleware_blueprint.html](html/middleware_blueprint.html) (Version: 0.3.6).
4
+ > **Interactive Spec Available:** An interactive dashboard with an interactive component scanner and a dynamic hook-and-effect pipeline is located at [docs/html/middleware_blueprint.html](html/middleware_blueprint.html) (Version: 0.3.7).
5
5
 
6
6
  Clio Coder has two related but separate surfaces:
7
7
 
@@ -129,6 +129,7 @@ These ship in every interactive session. Each is one bounded behavior with a vis
129
129
  | `nudge.detached-dispatch` | `turn_end` | A settled turn that ends while a detached dispatch batch has every run terminal and uncollected is continued once, naming the ready batches; `monitor mode="collect"` clears it, including across resume. Batches with runs still in flight, and surfaces without `monitor`, do not trigger. |
130
130
  | `nudge.read-only-exploration` | `after_tool`, `turn_end` | After nine or more read-only calls (`read`, `grep`, `find`, `ls`, `code_nav`, read-only shell) in one user turn without a successful Scout dispatch, injects one advisory to delegate broad reconnaissance to Scout. One advisory per user turn, and only on surfaces that have `dispatch`. |
131
131
  | `rail.unbacked-worker-claim` | `after_tool`, `turn_end` | A reply that reports worker or Scout results in a turn with no `dispatch` call gets one warning that the claim is not backed by a receipt. A `[worker result]` note the operator shared is receipt-backed and exempt. No continuation: the operator decides. |
132
+ | `observer.watchdog` | `after_tool`, `turn_end` | Opt-in through `watchdog.enabled` (default off). A turn that changed the tree is reviewed by one read-only `verifier` dispatch briefed with the turn's coalesced diff (per-path last-write-wins, bounded to 12 KiB) and the task board's current scope. Its failed checks become one transcript notice naming the count and the first three; a passing report emits nothing. `watchdog.cadenceToolCalls: N` also fires it every N tool calls inside the turn. One run in flight at a time; an overlapping trigger is dropped and counted. It emits no middleware effects, never continues a turn, and never mutates. Turns with no file mutations, headless runs, and ACP runs never fire it. |
132
133
  | `observer.memory-intervention` | `after_tool` | Every `memory.intervention.everyNTools` tool calls, asks a background model for a bounded reflection over the recent window and injects it as a reminder when it arrives. Governed by the `memory.intervention` settings block. |
133
134
 
134
135
  Two coded controls sit beside the registrations rather than among them. `tool-choice-control` turns `require_tool` and `lock_tools` effects into the provider's tool-choice field for the next round: a required tool clears when that tool starts, a lock lasts until the next submitted turn and outranks later requirements. `hook-receipts` is the durable ring (200 entries, throttled to one write per two seconds) of user-defined hook executions that `clio-coder config inspect` reads.
@@ -1,7 +1,7 @@
1
1
  # Model Catalog, Runtime Refresh, and Field Notes
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive dashboard mapping capabilities, probe discovery, and target resolution is located at [docs/html/models_blueprint.html](html/models_blueprint.html) (Version: 0.3.6).
4
+ > **Interactive Spec Available:** An interactive dashboard mapping capabilities, probe discovery, and target resolution is located at [docs/html/models_blueprint.html](html/models_blueprint.html) (Version: 0.3.7).
5
5
 
6
6
  Clio Coder treats a selectable model as the intersection of three sources:
7
7
 
@@ -1,7 +1,7 @@
1
1
  # Observability Viewer
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive dashboard is located at [docs/html/observability_blueprint.html](html/observability_blueprint.html) (Version: 0.3.6).
4
+ > **Interactive Spec Available:** An interactive dashboard is located at [docs/html/observability_blueprint.html](html/observability_blueprint.html) (Version: 0.3.7).
5
5
 
6
6
  `/view` is the interactive artifact viewer for a Clio session. It keeps the live transcript compact while preserving a full inspection path for durable artifacts, task ledgers, and successful workspace outputs.
7
7
 
@@ -57,6 +57,53 @@ An `EvidenceIndexRow` has the following schema:
57
57
 
58
58
  ---
59
59
 
60
+ ## Cross-Session Usage Facts
61
+
62
+ `clio-coder usage report` folds the local archive into one window of facts. Its token and cost facts come from two inputs: the per-session ledgers, folded through the session domain's `ledgerUsageCalls`, and the out-of-turn usage store described below. Both the text report and `--json` carry the same fields.
63
+
64
+ | Field | Where it appears | Meaning |
65
+ | --- | --- | --- |
66
+ | `apiCalls` | `tokens in window: <total> over <n> model calls` and the `tokens` JSON fact | Provider calls folded in the window, out-of-turn rounds included. |
67
+ | `input`, `output`, `cacheRead`, `cacheWrite`, `reasoningTokens`, `totalTokens` | the same line and fact | Provider-reported token breakdown for those calls. |
68
+ | `costUsd` | `provider-reported cost in window` and the `tokens` fact | Provider-reported cost. Never estimated. |
69
+ | `turns` | `turns in window` and the `tokens` fact | Folded calls that were turns, so labelled calls are subtracted exactly as `/cost` subtracts them. |
70
+ | `sideQuestions` | `side questions in window` and the `tokens` fact | `/btw` rounds in the window. |
71
+ | `handoffs` | `handoffs in window` and the `tokens` fact | `/handoff` extraction rounds in the window. |
72
+
73
+ The last three fields appear only when at least one labelled call falls in the window. An archive with no `/btw` or `/handoff` round in it renders exactly as it did before those fields existed, so their presence is itself the signal that money was spent beside a session.
74
+
75
+ ### The Out-of-Turn Usage Store
76
+
77
+ A `/btw` side question and a `/handoff` extraction round are real provider calls that append nothing to the session JSONL, by design: a fleet run briefs its workers from the transcript, and a question the operator asked to orient themselves must not become context those workers inherit. The spend still has to be recorded somewhere durable, so it goes to `<stateDir>/usage/out-of-turn.jsonl`, one JSON line per priced call, written by the chat loop at the same moment it reports the call to `/cost`.
78
+
79
+ The file is append-only NDJSON kept as a bounded ring (capped at 1000 rows, rewritten atomically under the shared state-file lock when it grows past the cap). Reads are tolerant: a malformed line is reported as a diagnostic on stderr and skipped.
80
+
81
+ A row has the following schema:
82
+ ```json
83
+ {
84
+ "label": "side-question",
85
+ "sessionId": "01JQ2K7V8W",
86
+ "repoIdentity": "9f2c1b4ea77d0c31",
87
+ "timestamp": "2026-06-25T14:30:00.000Z",
88
+ "target": "dynamo",
89
+ "attributedModelId": "Nemo-3.5",
90
+ "usage": {
91
+ "input": 120,
92
+ "output": 8,
93
+ "cacheRead": 4,
94
+ "cacheWrite": 0,
95
+ "reasoning": 2,
96
+ "totalTokens": 132,
97
+ "costUsd": 0.0004,
98
+ "costProvenance": "known"
99
+ }
100
+ }
101
+ ```
102
+
103
+ `repoIdentity` is the same cwd hash the session ledger is filed under, which is what lets `usage report --repo <path>` select these rows with the hash it already computes for the ledgers.
104
+
105
+ ---
106
+
60
107
  ## Artifact Categories and Path Layouts
61
108
 
62
109
  Clio resolves directories under platform-specific XDG defaults (on Linux, these default to `~/.config/clio-coder/`, `~/.local/share/clio-coder/`, and `~/.local/state/clio-coder/`).
@@ -109,17 +156,17 @@ Pressing `v` on a selected receipt or running `/view verify <runId>` performs cr
109
156
 
110
157
  1. **Read Receipt**: Reads the receipt JSON from `<stateDir>/receipts/<runId>.json`.
111
158
  2. **Resolve Ledger**: Looks up the run envelope inside `<stateDir>/runs.json`.
112
- 3. **Verify Integrity**: Recomputes the SHA-256 digest over the strict v15 receipt and reconstructible ledger fields. The digest covers every current field, including steering, routing intent and decision, route quality, worker identity, execution role, and result-contract conformance. Every version other than 15 fails verification; there is no historical receipt reader.
159
+ 3. **Verify Integrity**: Recomputes the SHA-256 digest over the strict v19 receipt and reconstructible ledger fields. The digest covers every current field, including steering, routing intent and decision, route quality, worker identity, execution role, result-contract conformance, council provenance, and fleet gate provenance. Every version other than 19 fails verification; there is no historical receipt reader.
113
160
  4. **Report Result**: The viewer reports `ok` or the verification failure reason. It does not rename or delete the receipt. Startup orphan recovery may quarantine corrupt orphan receipt files as `<name>.json.corrupt`, but `/view verify` is read-only.
114
161
 
115
162
  ---
116
163
 
117
164
  ## Receipt Fields for Dispatch Provenance
118
165
 
119
- A receipt carries optional provenance and context blocks that answer "what happened" for a chained (pipeline), composed (persona override), escalated, briefed, steered, or external run. Those optional blocks remain absent when unused. Current receipts carry strict integrity v15 and an explicit `outcomeCode: null` when no classified deterministic failure occurred. Automation consumers must treat the optional blocks below as absent by default and `outcomeCode` as nullable; older receipt versions are invalid.
166
+ A receipt carries optional provenance and context blocks that answer "what happened" for a chained (pipeline), composed (persona override), escalated, briefed, steered, council, or external run. Those optional blocks remain absent when unused. Current receipts carry strict integrity v19 and an explicit `outcomeCode: null` when no classified deterministic failure occurred. Automation consumers must treat the optional blocks below as absent by default and `outcomeCode` as nullable; older receipt versions are invalid.
120
167
 
121
168
  Receipt integrity verification and evidence verification are independent.
122
- `receipt_integrity=verified/v15/sha256` means Clio called the receipt verifier
169
+ `receipt_integrity=verified/v19/sha256` means Clio called the receipt verifier
123
170
  against the ledger envelope; merely finding an embedded digest is not enough.
124
171
  `evidence_verification=<verified|unverified|not_applicable|unknown>/<basis>`
125
172
  describes validation evidence inside that verified receipt. Likewise,
@@ -130,7 +177,7 @@ separately and never substitute one hash for another.
130
177
 
131
178
  The evidence bundle renders these sets in `transcript.md` (human sentences) and `trace.cleaned.jsonl` (structured run rows), `clio-coder evidence inspect` prints them as a `provenance <runId>:` block, and the `dispatch` tool appends a compact suffix to each run line plus additive keys on `details.runs[]`. A timed-out or denied escalation also raises an `escalation` finding in the bundle.
132
179
 
133
- The base provenance sets, steering, routing, quality, worker identity, and result-conformance coverage all enter in v0.2.9. These fields are labeled `experimental`: their strict v15 shape is frozen for the release, but the labels stay experimental until the schema is promoted post-1.0. For the complete version registry and migration contract across all artifacts, see [artifact-versions.md](artifact-versions.md).
180
+ The base provenance sets, steering, routing, quality, worker identity, result-conformance, council provenance, and fleet gate provenance use the strict v19 shape frozen for the release. These fields are labeled `experimental` until the schema is promoted post-1.0. For the complete version registry and migration contract across all artifacts, see [artifact-versions.md](artifact-versions.md).
134
181
 
135
182
  | Field path | Type | When present | Meaning | Status |
136
183
  | --- | --- | --- | --- | --- |
@@ -149,7 +196,7 @@ The base provenance sets, steering, routing, quality, worker identity, and resul
149
196
  | `steering[].sentAt` | `string` | A steer was successfully written | Write timestamp | experimental |
150
197
  | `steering[].acknowledged` | `boolean` | A steer was successfully written | Whether a worker acknowledgement was actually observed | experimental |
151
198
  | `steering[].acknowledgedAt` | `string` | Acknowledgement was observed | Acknowledgement timestamp | experimental |
152
- | `outcomeCode` | five-value stable string union or `null` | Every v15 terminal receipt | Non-null for `vram_capacity_fit_failure`, `worker_tool_call_cap_exhausted`, `loop_guard_tools_disabled_exhausted`, `result_contract_exhausted`, or `worker_final_output_missing`; otherwise `null`. Each non-null code denotes terminal deterministic failure and is incompatible with `outcome: "succeeded"`. Dispatch retry policy consumes this code only, never diagnostic prose. | experimental |
199
+ | `outcomeCode` | six-value stable string union or `null` | Every v19 terminal receipt | Non-null for `vram_capacity_fit_failure`, `worker_tool_call_cap_exhausted`, `loop_guard_tools_disabled_exhausted`, `result_contract_exhausted`, `worker_final_output_missing`, or `host_verification_rejected`; otherwise `null`. Each non-null code denotes terminal deterministic failure and is incompatible with `outcome: "succeeded"`. Dispatch retry policy consumes this code only, never diagnostic prose. | experimental |
153
200
  | `personaOverride.promptHash` | `string` | Ad-hoc specialist whose persona replaced the recipe body | Hash of the composed static prompt; equals `staticCompositionHash` for the run | experimental |
154
201
  | `safety.decisions.escalationRequested` | `number` | Run saw at least one permission escalation | Parked permission asks handed to the operator | experimental |
155
202
  | `safety.decisions.escalationApproved` | `number` | Run saw at least one permission escalation | Escalations the operator approved | experimental |
@@ -159,8 +206,8 @@ The base provenance sets, steering, routing, quality, worker identity, and resul
159
206
  | `safety.toolTelemetry.ingestionErrors` | `number` | Current dispatch receipts | Malformed or lost frames, event-fold/source errors, and drain timeouts that make otherwise mediated telemetry incomplete | experimental |
160
207
  | `safety.toolTelemetry.unfinished` | `{ tool, count }[]` | Current dispatch receipts | Tool starts that had no matching finish when the receipt sealed | experimental |
161
208
  | `safety.toolTelemetry.workspaceMutationPossible` | `boolean` | Current dispatch receipts | Whether incomplete or unavailable telemetry could conceal a shared-workspace mutation; retry admission fails closed when true | experimental |
162
- | `autonomyEnforcement.grade` | `string` | Always in v0.3.6 | The autonomy grade level enforced for the run | experimental |
163
- | `autonomyEnforcement.autonomy` | `string` | Always in v0.3.6 | The effective autonomy level name (e.g. auto-edit, suggest, read-only, full-auto) | experimental |
209
+ | `autonomyEnforcement.grade` | `string` | Always in v0.3.7 | The autonomy grade level enforced for the run | experimental |
210
+ | `autonomyEnforcement.autonomy` | `string` | Always in v0.3.7 | The effective autonomy level name (e.g. auto-edit, suggest, read-only, full-auto) | experimental |
164
211
  | `autonomyEnforcement.externalMode` | `string` | When running external worker | The execution mode of the external worker runtime | experimental |
165
212
  | `autonomyEnforcement.dangerousBypass` | `boolean` | When running external worker | Whether a safety bypass was explicitly activated | experimental |
166
213
  | `validationGrounding.claimed` | `number` | Validation grounding evaluated | Count of validations claimed by worker | experimental |