@iowarp/clio-coder 0.3.3 → 0.3.6

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 (370) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/CONTRIBUTING.md +7 -7
  3. package/README.md +3 -3
  4. package/dist/{acp-P2AQILE2.js → acp-2BEHC4DL.js} +9 -8
  5. package/dist/{agents-72W3BI7I.js → agents-LNNFTM53.js} +29 -24
  6. package/dist/assets/codewiki.json +1 -1
  7. package/dist/{auth-5TWEIYDN.js → auth-KXXFI2VS.js} +14 -10
  8. package/dist/{chunk-GGXXDWE4.js → chunk-22NAGB7X.js} +2 -2
  9. package/dist/{chunk-YCWGATWI.js → chunk-24I7BN55.js} +2 -2
  10. package/dist/{chunk-EKMEHE4H.js → chunk-33YXPOE3.js} +2 -3
  11. package/dist/chunk-3BPUFZDL.js +37 -0
  12. package/dist/chunk-43AOLP7E.js +375 -0
  13. package/dist/{chunk-ZDOOVTXZ.js → chunk-4OC57DA6.js} +27 -4
  14. package/dist/{chunk-6SGHMWE3.js → chunk-5JGRAMKL.js} +5 -5
  15. package/dist/{chunk-V6RTAOC2.js → chunk-6US73PDB.js} +572 -51
  16. package/dist/{chunk-5UFT4SUX.js → chunk-6XXKFVSN.js} +3 -3
  17. package/dist/{chunk-A3CYT5EX.js → chunk-AD2SYQYC.js} +55 -2
  18. package/dist/chunk-AOCYTWAV.js +449 -0
  19. package/dist/chunk-CFGTUFWB.js +67 -0
  20. package/dist/chunk-CJUB2JJ2.js +1478 -0
  21. package/dist/{chunk-FNTMWMX5.js → chunk-CKXWIANG.js} +14 -12
  22. package/dist/{chunk-PIWWS5BL.js → chunk-CYQKWTG3.js} +63 -78
  23. package/dist/{chunk-LZSJBIVT.js → chunk-DJVECN66.js} +271 -762
  24. package/dist/{chunk-CBCAPZAA.js → chunk-E25LMLRW.js} +2 -2
  25. package/dist/{chunk-ZWMF7253.js → chunk-E2ER4LJF.js} +304 -9
  26. package/dist/{chunk-STBPMHSX.js → chunk-EKY57CSP.js} +51 -84
  27. package/dist/{chunk-DUYJ5IO6.js → chunk-EYPA3EGJ.js} +12 -4
  28. package/dist/{chunk-M6SHUN7Q.js → chunk-FO5ZOVUY.js} +2 -2
  29. package/dist/chunk-FYYLNIL5.js +313 -0
  30. package/dist/{chunk-OQ33BKR3.js → chunk-G7MUEIGA.js} +3 -60
  31. package/dist/chunk-GEYXPTRF.js +613 -0
  32. package/dist/chunk-GOXNB3AO.js +261 -0
  33. package/dist/{chunk-G4BMMOKF.js → chunk-HVDIIIQW.js} +2 -2
  34. package/dist/chunk-HWUFFB6L.js +83 -0
  35. package/dist/{chunk-4XUGQOHA.js → chunk-K7T3E2SR.js} +15 -8
  36. package/dist/chunk-K7VKOLQQ.js +15 -0
  37. package/dist/{chunk-UFIIWP2H.js → chunk-KHSFENX2.js} +8 -8
  38. package/dist/{chunk-BMEMKKIT.js → chunk-KOHPCX4K.js} +2 -2
  39. package/dist/chunk-LCGCVYZ4.js +57 -0
  40. package/dist/chunk-LL4KHSZI.js +22 -0
  41. package/dist/{chunk-PAJK6MAQ.js → chunk-LYF7OHWH.js} +42 -15
  42. package/dist/{chunk-POHLU5DW.js → chunk-M6L6IDJG.js} +3 -3
  43. package/dist/{chunk-5UUP6MWO.js → chunk-MV3K5QF2.js} +5 -436
  44. package/dist/{chunk-X4RCMKVQ.js → chunk-NDINPTJ4.js} +2 -2
  45. package/dist/{chunk-TZK7PACC.js → chunk-NILBFAPG.js} +14 -8
  46. package/dist/chunk-ODFEOB4F.js +1082 -0
  47. package/dist/{chunk-AGYYIBLL.js → chunk-OH3TOQTB.js} +6 -2
  48. package/dist/chunk-OZNBF4L3.js +23 -0
  49. package/dist/{chunk-DSELYM6W.js → chunk-PBTHKCPN.js} +30 -10
  50. package/dist/{verify-375KUB3Y.js → chunk-PCZJO5TI.js} +127 -42
  51. package/dist/{chunk-ED4KHGC3.js → chunk-PPAMZ32Z.js} +9 -2
  52. package/dist/{chunk-SRDMMSEP.js → chunk-QM3F2GKX.js} +1063 -1645
  53. package/dist/{chunk-X6IAEBZR.js → chunk-QNQHSOLF.js} +7 -7
  54. package/dist/{chunk-OC7FIQPC.js → chunk-R46L2BIR.js} +10 -7
  55. package/dist/{chunk-2TLUCQVG.js → chunk-RD5U66HV.js} +3 -3
  56. package/dist/{chunk-6N5PTWMY.js → chunk-RY3LY4J5.js} +50 -13
  57. package/dist/{chunk-OKGUZO2U.js → chunk-SPULKLCF.js} +4 -3
  58. package/dist/{chunk-OOJYHWRB.js → chunk-TSHXZTOQ.js} +6 -5
  59. package/dist/chunk-TZSKNMZG.js +434 -0
  60. package/dist/{chunk-7MNJORFF.js → chunk-UL3WSD3F.js} +6 -1
  61. package/dist/{chunk-VJWL6YS5.js → chunk-UUVG37B4.js} +2 -2
  62. package/dist/{chunk-COU2UHX6.js → chunk-VEZEGCGW.js} +170 -2
  63. package/dist/chunk-W6GROXXM.js +69 -0
  64. package/dist/{chunk-OAO4GE4M.js → chunk-WHGPSPT5.js} +2 -2
  65. package/dist/chunk-WHJYKASB.js +677 -0
  66. package/dist/{chunk-ORBHGJC5.js → chunk-WR67VIZY.js} +3 -3
  67. package/dist/{chunk-YHZX5GEU.js → chunk-XAKHZX5N.js} +2 -2
  68. package/dist/{chunk-TZTZS7QK.js → chunk-XE2VEJHX.js} +5 -3
  69. package/dist/{chunk-LM5TQCJZ.js → chunk-XF5N4U5A.js} +8 -7
  70. package/dist/{chunk-LWLEKMDQ.js → chunk-XXQNGV4M.js} +1073 -552
  71. package/dist/{chunk-KZWTDYJF.js → chunk-XYDYPRZI.js} +7 -7
  72. package/dist/chunk-ZGVHUX3M.js +66 -0
  73. package/dist/{chunk-LW6DSM3M.js → chunk-ZRGEBJ4T.js} +1192 -1119
  74. package/dist/{chunk-2DJ2KNFG.js → chunk-ZXF4XRKW.js} +202 -40
  75. package/dist/chunk-ZZMN5OM4.js +122 -0
  76. package/dist/cli/index.js +34 -30
  77. package/dist/{clio-JOU4FXVA.js → clio-M2KGYUFZ.js} +7 -6
  78. package/dist/{code-nav-7AX6FYE6.js → code-nav-GQNL7XA6.js} +8 -6
  79. package/dist/codewiki/build-worker.js +4 -4
  80. package/dist/{components-KELWS457.js → components-5TTYYX6G.js} +3 -3
  81. package/dist/{config-XCDVKR23.js → config-XUUYQIWO.js} +47 -35
  82. package/dist/{configure-4GAP54ZW.js → configure-IHJ7YOMV.js} +18 -15
  83. package/dist/{context-77FM5DV5.js → context-74JLXAWD.js} +18 -10
  84. package/dist/{context-4UOGGLQ5.js → context-75MIWW3U.js} +41 -29
  85. package/dist/{context-5VKGUVJJ.js → context-ZQ7SIFJV.js} +85 -9
  86. package/dist/{context-clear-XXJRLCJJ.js → context-clear-GYKWNUML.js} +41 -29
  87. package/dist/{context-index-BZ4UYMTC.js → context-index-SSR5ECNE.js} +3 -3
  88. package/dist/context-working-set-UX5KEP4J.js +1553 -0
  89. package/dist/{dispatch-runner-QPRDDBDX.js → dispatch-runner-GIJBHNFL.js} +47 -32
  90. package/dist/{docs-2C2LTVT2.js → docs-6FZSCG5B.js} +3 -3
  91. package/dist/{doctor-HR46URBJ.js → doctor-SVJ5BZCW.js} +12 -12
  92. package/dist/{eval-XSSNATB4.js → eval-CG6LLBLD.js} +54 -238
  93. package/dist/{evidence-6HG2PY2B.js → evidence-ZYFIEN42.js} +57 -28
  94. package/dist/{evolve-K7YU3NCY.js → evolve-QGEXEMDW.js} +36 -25
  95. package/dist/{extensions-QVDOHDGJ.js → extensions-ADGNCJJD.js} +3 -3
  96. package/dist/{fleet-VY3HHKN6.js → fleet-S5R4ZOQY.js} +73 -44
  97. package/dist/{fleet-preflight-DDN536IT.js → fleet-preflight-BHSNPBMH.js} +3 -3
  98. package/dist/{init-JYGXI3FK.js → init-5DRU55YR.js} +49 -37
  99. package/dist/memory-7YKKR6UC.js +467 -0
  100. package/dist/{models-I5QWSEOM.js → models-ZPOLRU2C.js} +24 -21
  101. package/dist/{monitor-GE4ID3IA.js → monitor-US5F5YGZ.js} +73 -46
  102. package/dist/{orchestrator-EM5MC3HM.js → orchestrator-E2AL4T5N.js} +1624 -1007
  103. package/dist/{paths-UXLN5YYZ.js → paths-E7KYAQWE.js} +3 -3
  104. package/dist/{reset-L2FQEE3E.js → reset-KZ652EK6.js} +6 -5
  105. package/dist/{run-ZU3QMZPZ.js → run-SRNBKDWD.js} +76 -54
  106. package/dist/{share-S5BZQC5I.js → share-CGZE33UP.js} +7 -6
  107. package/dist/{skills-X5VXCRNQ.js → skills-S2X4DLY5.js} +4 -4
  108. package/dist/{skills-eval-WKIHWTHR.js → skills-eval-W2GGIC4R.js} +40 -29
  109. package/dist/{targets-SNCPI2NR.js → targets-54SWINWB.js} +28 -23
  110. package/dist/{terminal-lease-BNAHVHBS.js → terminal-lease-SAIF2OGY.js} +6 -4
  111. package/dist/{uninstall-FZCQCDKC.js → uninstall-BVLWXKBT.js} +3 -3
  112. package/dist/{upgrade-JQHHPQ4K.js → upgrade-JKAR27XC.js} +20 -19
  113. package/dist/{usage-OR4O5SMZ.js → usage-MSAWCLX4.js} +79 -36
  114. package/dist/verifiers-NCBTHHN2.js +1220 -0
  115. package/dist/verify-X5HDROLA.js +25 -0
  116. package/dist/{wiki-generate-UEXP2ARI.js → wiki-generate-GUSOQ6ZP.js} +50 -37
  117. package/dist/worker/entry.js +90 -70
  118. package/dist/{workspace-G4ZWUIPR.js → workspace-ZJ6BFM3Q.js} +4 -4
  119. package/docs/README.md +8 -7
  120. package/docs/acp.md +1 -1
  121. package/docs/alcf-provider.md +1 -1
  122. package/docs/architecture.md +2 -2
  123. package/docs/artifact-placement.md +1 -2
  124. package/docs/artifact-versions.md +1 -1
  125. package/docs/built-in-agents.md +1 -1
  126. package/docs/capacity-and-scheduling.md +1 -1
  127. package/docs/commands-and-modes.md +60 -26
  128. package/docs/config-knobs-audit.md +1 -2
  129. package/docs/configuration-and-targets.md +26 -1
  130. package/docs/context-engine.md +67 -13
  131. package/docs/context-working-set.md +194 -0
  132. package/docs/development-pipeline.md +1 -1
  133. package/docs/documentation-coverage.md +6 -6
  134. package/docs/documentation-guide.md +7 -6
  135. package/docs/environment-variables.md +2 -1
  136. package/docs/eval-runner.md +1 -1
  137. package/docs/evals-internal.md +4 -32
  138. package/docs/evidence-and-memory.md +139 -7
  139. package/docs/evolution.md +1 -1
  140. package/docs/exit-codes-and-output.md +1 -1
  141. package/docs/extensions-and-sharing.md +2 -2
  142. package/docs/fleet-dispatch.md +49 -8
  143. package/docs/glossary.md +21 -1
  144. package/docs/installation-and-lifecycle.md +2 -2
  145. package/docs/middleware-and-components.md +19 -2
  146. package/docs/model-catalog.md +7 -9
  147. package/docs/observability.md +4 -4
  148. package/docs/proactive-memory.md +26 -16
  149. package/docs/prompt-envelope-and-tools.md +7 -5
  150. package/docs/provider-adapter-cookbook.md +1 -1
  151. package/docs/release-cut-checklist.md +43 -40
  152. package/docs/safety-model.md +49 -8
  153. package/docs/scientific-validation.md +21 -3
  154. package/docs/session-lifecycle.md +3 -3
  155. package/docs/skills-marketplace.md +1 -1
  156. package/docs/tool-usage.md +79 -12
  157. package/docs/trace-store.md +1 -1
  158. package/docs/troubleshooting.md +1 -1
  159. package/docs/tui-design.md +38 -4
  160. package/docs/worker-dispatch-mechanics.md +11 -1
  161. package/package.json +13 -13
  162. package/skills/meta/clio-test/SKILL.md +20 -17
  163. package/skills/meta/clio-test/evals.md +3 -3
  164. package/skills/meta/clio-test/references/harness.md +35 -6
  165. package/skills/meta/clio-test/references/test-map.md +20 -10
  166. package/skills/registry.yaml +2 -2
  167. package/skills/skill-marketplace.json +1 -1
  168. package/src/cli/agents.ts +2 -3
  169. package/src/cli/argv.ts +14 -1
  170. package/src/cli/context-working-set.ts +513 -0
  171. package/src/cli/context.ts +8 -0
  172. package/src/cli/evidence.ts +20 -2
  173. package/src/cli/fleet.ts +15 -0
  174. package/src/cli/index.ts +5 -1
  175. package/src/cli/memory.ts +272 -10
  176. package/src/cli/modes/json-stream.ts +2 -2
  177. package/src/cli/modes/print.ts +12 -1
  178. package/src/cli/run.ts +22 -2
  179. package/src/cli/targets.ts +12 -3
  180. package/src/cli/usage.ts +55 -7
  181. package/src/cli/verifiers.ts +325 -0
  182. package/src/core/bash-exec.ts +39 -14
  183. package/src/core/bus-events.ts +22 -4
  184. package/src/core/config.ts +54 -0
  185. package/src/core/defaults.ts +50 -3
  186. package/src/core/response-model-id.ts +134 -0
  187. package/src/core/toml.ts +62 -0
  188. package/src/core/verification-scripts.ts +6 -0
  189. package/src/core/workspace-files.ts +0 -1
  190. package/src/domains/agents/builtins/architect.md +1 -1
  191. package/src/domains/agents/builtins/verifier.md +3 -0
  192. package/src/domains/agents/catalog.ts +5 -4
  193. package/src/domains/agents/recipe.ts +54 -14
  194. package/src/domains/agents/result-contract.ts +7 -4
  195. package/src/domains/config/classify.ts +1 -0
  196. package/src/domains/context/bootstrap.ts +36 -27
  197. package/src/domains/context/project-metadata.ts +19 -63
  198. package/src/domains/context/prompt-context.ts +8 -0
  199. package/src/domains/context/working-set/contract.ts +161 -0
  200. package/src/domains/context/working-set/defaults.ts +28 -0
  201. package/src/domains/context/working-set/engine.ts +203 -0
  202. package/src/domains/context/working-set/fold.ts +62 -0
  203. package/src/domains/context/working-set/horizon.ts +38 -0
  204. package/src/domains/context/working-set/marker.ts +103 -0
  205. package/src/domains/context/working-set/path-index.ts +436 -0
  206. package/src/domains/context/working-set/payload.ts +152 -0
  207. package/src/domains/context/working-set/policies/age-horizon.ts +55 -0
  208. package/src/domains/context/working-set/policies/index.ts +20 -0
  209. package/src/domains/context/working-set/policies/structural.ts +160 -0
  210. package/src/domains/context/working-set/project.ts +132 -0
  211. package/src/domains/context/working-set/protect.ts +109 -0
  212. package/src/domains/context/working-set/recall.ts +177 -0
  213. package/src/domains/context/working-set/replay/controls.ts +112 -0
  214. package/src/domains/context/working-set/replay/load-clio.ts +199 -0
  215. package/src/domains/context/working-set/replay/metrics.ts +185 -0
  216. package/src/domains/context/working-set/replay/reference-graph.ts +79 -0
  217. package/src/domains/context/working-set/replay/report.ts +139 -0
  218. package/src/domains/context/working-set/replay/runner.ts +325 -0
  219. package/src/domains/context/working-set/replay/synthetic.ts +422 -0
  220. package/src/domains/context/working-set/replay/trace.ts +21 -0
  221. package/src/domains/context/working-set/visible.ts +54 -0
  222. package/src/domains/dispatch/budget-envelope.ts +396 -0
  223. package/src/domains/dispatch/contract.ts +2 -0
  224. package/src/domains/dispatch/extension.ts +81 -27
  225. package/src/domains/dispatch/orphan-recovery.ts +1 -0
  226. package/src/domains/dispatch/receipt-integrity.ts +4 -0
  227. package/src/domains/dispatch/state.ts +1 -0
  228. package/src/domains/dispatch/types.ts +10 -3
  229. package/src/domains/dispatch/validation.ts +14 -0
  230. package/src/domains/dispatch/worker-spawn.ts +14 -3
  231. package/src/domains/eval/metrics/evidence.ts +0 -116
  232. package/src/domains/eval/metrics/invariants.ts +1 -1
  233. package/src/domains/eval/runners/clio-run.ts +1 -10
  234. package/src/domains/eval/runners/external-command.ts +2 -29
  235. package/src/domains/eval/schema/suite.ts +0 -7
  236. package/src/domains/eval/suites/run.ts +1 -7
  237. package/src/domains/evidence/build.ts +112 -45
  238. package/src/domains/evidence/eval.ts +24 -7
  239. package/src/domains/evidence/index.ts +53 -0
  240. package/src/domains/evidence/ordering.ts +12 -0
  241. package/src/domains/evidence/run-trust.ts +221 -0
  242. package/src/domains/evidence/store.ts +46 -6
  243. package/src/domains/evidence/trust-status.ts +854 -0
  244. package/src/domains/evidence/types.ts +26 -0
  245. package/src/domains/memory/index.ts +22 -0
  246. package/src/domains/memory/operations.ts +58 -1
  247. package/src/domains/memory/promotion.ts +281 -0
  248. package/src/domains/memory/prompt-section.ts +25 -5
  249. package/src/domains/memory/proposal.ts +51 -7
  250. package/src/domains/memory/task-bank.ts +3 -2
  251. package/src/domains/memory/task-memory-handoff.ts +181 -24
  252. package/src/domains/memory/task-memory-policy.ts +3 -1
  253. package/src/domains/memory/types.ts +37 -0
  254. package/src/domains/memory/validate.ts +178 -0
  255. package/src/domains/middleware/memory-intervention.ts +38 -25
  256. package/src/domains/middleware/runtime.ts +6 -0
  257. package/src/domains/middleware/skills-reminder.ts +19 -4
  258. package/src/domains/middleware/stalled-turn.ts +208 -5
  259. package/src/domains/middleware/types.ts +10 -0
  260. package/src/domains/observability/contract.ts +6 -1
  261. package/src/domains/observability/cost.ts +20 -4
  262. package/src/domains/observability/extension.ts +2 -2
  263. package/src/domains/providers/index.ts +3 -0
  264. package/src/domains/providers/model-discovery.ts +9 -0
  265. package/src/domains/providers/runtime-resolution.ts +38 -1
  266. package/src/domains/providers/runtimes/common/probe-helpers.ts +97 -16
  267. package/src/domains/providers/types/context-window-slots.ts +18 -0
  268. package/src/domains/providers/types/runtime-descriptor.ts +3 -1
  269. package/src/domains/safety/autonomy.ts +1 -1
  270. package/src/domains/safety/call-target.ts +211 -14
  271. package/src/domains/safety/decision-presentation.ts +268 -0
  272. package/src/domains/safety/default-path-policy.ts +8 -0
  273. package/src/domains/safety/finish-contract.ts +4 -3
  274. package/src/domains/safety/policy-engine.ts +48 -6
  275. package/src/domains/safety/redaction.ts +73 -0
  276. package/src/domains/session/compaction/compact.ts +23 -1
  277. package/src/domains/session/compaction/cut-point.ts +2 -0
  278. package/src/domains/session/compaction/tokens.ts +16 -1
  279. package/src/domains/session/context-ledger.ts +12 -1
  280. package/src/domains/session/decision-board.ts +4 -0
  281. package/src/domains/session/entries.ts +110 -1
  282. package/src/domains/session/history.ts +68 -19
  283. package/src/domains/session/manager.ts +9 -2
  284. package/src/domains/session/migrations/index.ts +22 -3
  285. package/src/domains/session/usage.ts +24 -7
  286. package/src/engine/acp/event-mapper.ts +7 -0
  287. package/src/engine/acp/server.ts +32 -2
  288. package/src/engine/agent.ts +18 -1
  289. package/src/engine/apis/lmstudio.ts +25 -4
  290. package/src/engine/apis/openai-completions.ts +147 -22
  291. package/src/engine/claude/sdk-runtime.ts +8 -2
  292. package/src/engine/claude/tool-safety.ts +13 -0
  293. package/src/engine/loop-guard.ts +27 -3
  294. package/src/engine/session.ts +9 -3
  295. package/src/engine/worker-events.ts +4 -3
  296. package/src/engine/worker-runtime.ts +59 -54
  297. package/src/entry/orchestrator.ts +34 -5
  298. package/src/interactive/chat-loop-messages.ts +40 -6
  299. package/src/interactive/chat-loop.ts +13 -0
  300. package/src/interactive/chat-panel.ts +17 -1
  301. package/src/interactive/chat-renderer.ts +49 -24
  302. package/src/interactive/clio-editor.ts +44 -7
  303. package/src/interactive/context-meter.ts +10 -0
  304. package/src/interactive/context-overlay.ts +120 -7
  305. package/src/interactive/context-recall-command.ts +110 -0
  306. package/src/interactive/cost-overlay.ts +39 -8
  307. package/src/interactive/dispatch-board.ts +212 -35
  308. package/src/interactive/footer/widgets.ts +13 -0
  309. package/src/interactive/interactive-application.ts +6 -1
  310. package/src/interactive/interactive-input-runtime.ts +11 -1
  311. package/src/interactive/interactive-presentation.ts +11 -1
  312. package/src/interactive/interactive-slash-runtime.ts +37 -1
  313. package/src/interactive/memory-overlay.ts +89 -4
  314. package/src/interactive/model-session-replay.ts +21 -0
  315. package/src/interactive/overlay-ask-user-lifecycle.ts +1 -1
  316. package/src/interactive/overlay-frame.ts +5 -2
  317. package/src/interactive/overlay-general-openers.ts +46 -1
  318. package/src/interactive/overlay-key-routing.ts +41 -1
  319. package/src/interactive/overlay-lifecycle.ts +11 -4
  320. package/src/interactive/overlay-permission-lifecycle.ts +23 -8
  321. package/src/interactive/overlay-session-lifecycle.ts +8 -4
  322. package/src/interactive/overlay-transitions.ts +11 -0
  323. package/src/interactive/overlays/ask-user.ts +74 -30
  324. package/src/interactive/overlays/decisions.ts +3 -1
  325. package/src/interactive/permission-hint.ts +35 -0
  326. package/src/interactive/permission-overlay.ts +95 -45
  327. package/src/interactive/renderers/tool-execution.ts +37 -51
  328. package/src/interactive/session-last-turn.ts +8 -1
  329. package/src/interactive/session-transcript.ts +2 -2
  330. package/src/interactive/session-usage-reseed.ts +36 -10
  331. package/src/interactive/slash-commands.ts +31 -4
  332. package/src/interactive/status/summary.ts +5 -0
  333. package/src/interactive/status/types.ts +5 -0
  334. package/src/interactive/terminal-lease.ts +1 -0
  335. package/src/interactive/turn-context.ts +333 -110
  336. package/src/interactive/turn-middleware.ts +7 -6
  337. package/src/interactive/turn-runtime.ts +37 -8
  338. package/src/interactive/turn-state.ts +3 -0
  339. package/src/interactive/worker-progress.ts +440 -0
  340. package/src/interactive/worker-stream.ts +51 -110
  341. package/src/tools/agent-tools.ts +39 -7
  342. package/src/tools/ask-user.ts +21 -1
  343. package/src/tools/bash.ts +144 -82
  344. package/src/tools/builtin-tool-catalog.ts +11 -5
  345. package/src/tools/context/index.ts +107 -5
  346. package/src/tools/context/surface.ts +3 -2
  347. package/src/tools/core-bootstrap.ts +21 -0
  348. package/src/tools/dispatch-arguments.ts +8 -0
  349. package/src/tools/dispatch-event-text.ts +19 -0
  350. package/src/tools/dispatch-runner.ts +9 -7
  351. package/src/tools/dispatch.ts +24 -1
  352. package/src/tools/monitor.ts +43 -20
  353. package/src/tools/registry.ts +72 -10
  354. package/src/tools/result-disposition.ts +706 -0
  355. package/src/tools/result-shaping.ts +321 -20
  356. package/src/tools/safe-exec.ts +2 -0
  357. package/src/tools/verify/authoring.ts +1120 -0
  358. package/src/tools/verify/catalog.ts +346 -0
  359. package/src/tools/verify/index.ts +13 -3
  360. package/src/tools/verify/scripts.ts +135 -37
  361. package/src/tools/verify/surface.ts +9 -5
  362. package/src/tools/worker-evidence.ts +54 -12
  363. package/src/worker/spec-contract.ts +43 -3
  364. package/dist/chunk-J7CWMCQD.js +0 -255
  365. package/dist/chunk-T6YILFSB.js +0 -80
  366. package/dist/chunk-VAKQQHWR.js +0 -434
  367. package/dist/chunk-VPAYEGVX.js +0 -184
  368. package/dist/chunk-XBXAASKX.js +0 -18
  369. package/dist/memory-WFZMGYHX.js +0 -236
  370. package/src/domains/eval/metrics/chaos-stream.ts +0 -93
@@ -11,37 +11,38 @@ import {
11
11
  loadEvalTaskFile,
12
12
  verifyReceiptIntegrity,
13
13
  writeEvalArtifactV4
14
- } from "./chunk-AGYYIBLL.js";
14
+ } from "./chunk-OH3TOQTB.js";
15
15
  import {
16
16
  shellQuote
17
17
  } from "./chunk-TXOTCRLG.js";
18
- import "./chunk-GGXXDWE4.js";
19
- import "./chunk-5UUP6MWO.js";
20
- import "./chunk-7MNJORFF.js";
18
+ import "./chunk-22NAGB7X.js";
19
+ import "./chunk-AOCYTWAV.js";
20
+ import "./chunk-MV3K5QF2.js";
21
+ import "./chunk-UL3WSD3F.js";
21
22
  import "./chunk-ECH6PKUQ.js";
22
23
  import "./chunk-CGKSTWHD.js";
23
24
  import {
24
25
  detectProjectProfile
25
- } from "./chunk-YHZX5GEU.js";
26
+ } from "./chunk-XAKHZX5N.js";
26
27
  import {
27
28
  readCodewiki,
28
29
  structuralCodewikiHash
29
30
  } from "./chunk-LBMZMYH2.js";
30
31
  import {
31
32
  enumerateWorkspaceFiles
32
- } from "./chunk-EKMEHE4H.js";
33
- import "./chunk-YCWGATWI.js";
33
+ } from "./chunk-33YXPOE3.js";
34
+ import "./chunk-24I7BN55.js";
34
35
  import {
35
36
  printError
36
- } from "./chunk-ED4KHGC3.js";
37
+ } from "./chunk-PPAMZ32Z.js";
37
38
  import "./chunk-5TSRNF4G.js";
38
39
  import "./chunk-4VP4KH3K.js";
39
- import {
40
- InvalidIdError
41
- } from "./chunk-R346GLFC.js";
42
40
  import "./chunk-IKCO5N3L.js";
43
41
  import "./chunk-3I7MS7N2.js";
44
42
  import "./chunk-SST6Z5JA.js";
43
+ import {
44
+ InvalidIdError
45
+ } from "./chunk-R346GLFC.js";
45
46
  import {
46
47
  require_dist
47
48
  } from "./chunk-APJ265NV.js";
@@ -1322,100 +1323,6 @@ function evidenceMetricsFromReceipt(receipt) {
1322
1323
  ...typeof receipt.costUsd === "number" && Number.isFinite(receipt.costUsd) ? { "cost.usd": receipt.costUsd } : {}
1323
1324
  };
1324
1325
  }
1325
- function dispatchCountFromJsonl(stdout) {
1326
- let executionEnds = 0;
1327
- let canonicalFinishes = 0;
1328
- const seenExecutionEnds = /* @__PURE__ */ new Set();
1329
- const seenCanonicalFinishes = /* @__PURE__ */ new Set();
1330
- let sawCanonicalFinishEvent = false;
1331
- for (const event of jsonlEvents(stdout)) {
1332
- if (event.type === "tool_execution_end") {
1333
- if (stringField(event, "toolName") !== "dispatch") continue;
1334
- const callId2 = stringField(event, "toolCallId");
1335
- if (callId2 !== void 0) {
1336
- if (seenExecutionEnds.has(callId2)) continue;
1337
- seenExecutionEnds.add(callId2);
1338
- }
1339
- executionEnds += 1;
1340
- continue;
1341
- }
1342
- if (event.type !== "clio_tool_finish" || !isRecord5(event.payload)) continue;
1343
- sawCanonicalFinishEvent = true;
1344
- if (stringField(event.payload, "tool") !== "dispatch") continue;
1345
- const callId = stringField(event.payload, "toolCallId") ?? stringField(event, "toolCallId");
1346
- if (callId !== void 0) {
1347
- if (seenCanonicalFinishes.has(callId)) continue;
1348
- seenCanonicalFinishes.add(callId);
1349
- }
1350
- canonicalFinishes += 1;
1351
- }
1352
- return sawCanonicalFinishEvent ? canonicalFinishes : executionEnds;
1353
- }
1354
- function scoutDispatchCountFromJsonl(stdout) {
1355
- const seen = /* @__PURE__ */ new Set();
1356
- let count = 0;
1357
- for (const event of jsonlEvents(stdout)) {
1358
- if (event.type !== "tool_execution_start" || stringField(event, "toolName") !== "dispatch") continue;
1359
- if (!isRecord5(event.args) || !dispatchArgsIncludeAgent(event.args, "scout")) continue;
1360
- const callId = stringField(event, "toolCallId");
1361
- if (callId !== void 0) {
1362
- if (seen.has(callId)) continue;
1363
- seen.add(callId);
1364
- }
1365
- count += 1;
1366
- }
1367
- return count;
1368
- }
1369
- function dispatchArgsIncludeAgent(args, expectedAgent) {
1370
- const sharedAgent = stringField(args, "agent") ?? stringField(args, "agent_id") ?? stringField(args, "agentId");
1371
- let tasks = args.tasks;
1372
- if (typeof tasks === "string") {
1373
- const trimmed = tasks.trim();
1374
- if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
1375
- try {
1376
- tasks = JSON.parse(trimmed);
1377
- } catch {
1378
- }
1379
- }
1380
- }
1381
- const taskList = Array.isArray(tasks) ? tasks : tasks === void 0 ? [{ task: args.task }] : [tasks];
1382
- return taskList.some((task) => {
1383
- if (typeof task === "string") return sharedAgent?.toLowerCase() === expectedAgent;
1384
- if (!isRecord5(task)) return false;
1385
- const agent = stringField(task, "agent") ?? stringField(task, "agent_id") ?? stringField(task, "agentId") ?? sharedAgent;
1386
- return agent?.toLowerCase() === expectedAgent;
1387
- });
1388
- }
1389
- function wikiStaleAcknowledgedFromJsonl(stdout) {
1390
- let sawWikiLookup = false;
1391
- for (const event of jsonlEvents(stdout)) {
1392
- if (event.type !== "tool_execution_start") continue;
1393
- const toolName = stringField(event, "toolName");
1394
- if (toolName === "code_nav" && isRecord5(event.args) && event.args.mode === "wiki") {
1395
- sawWikiLookup = true;
1396
- continue;
1397
- }
1398
- if (sawWikiLookup && (toolName === "read" || toolName === "grep")) return true;
1399
- }
1400
- return false;
1401
- }
1402
- function* jsonlEvents(stdout) {
1403
- for (const line of stdout.split(/\r?\n/)) {
1404
- if (line.trim().length === 0) continue;
1405
- try {
1406
- const parsed = JSON.parse(line);
1407
- if (isRecord5(parsed)) yield parsed;
1408
- } catch {
1409
- }
1410
- }
1411
- }
1412
- function stringField(record, field) {
1413
- const value = record[field];
1414
- return typeof value === "string" && value.length > 0 ? value : void 0;
1415
- }
1416
- function isRecord5(value) {
1417
- return typeof value === "object" && value !== null && !Array.isArray(value);
1418
- }
1419
1326
 
1420
1327
  // src/domains/eval/metrics/token-stream.ts
1421
1328
  init_esm_shims();
@@ -1437,10 +1344,10 @@ function createTokenUsageFold() {
1437
1344
  } catch {
1438
1345
  return;
1439
1346
  }
1440
- if (!isRecord6(event) || event.type !== "message_end") return;
1441
- const message = isRecord6(event.message) ? event.message : void 0;
1347
+ if (!isRecord5(event) || event.type !== "message_end") return;
1348
+ const message = isRecord5(event.message) ? event.message : void 0;
1442
1349
  if (message === void 0 || message.role !== "assistant") return;
1443
- const usage = isRecord6(message.usage) ? message.usage : void 0;
1350
+ const usage = isRecord5(message.usage) ? message.usage : void 0;
1444
1351
  if (usage === void 0) return;
1445
1352
  measured = true;
1446
1353
  const input = numberField2(usage, "input");
@@ -1453,7 +1360,7 @@ function createTokenUsageFold() {
1453
1360
  tokens.cacheRead += cacheRead;
1454
1361
  tokens.cacheWrite += cacheWrite;
1455
1362
  tokens.total += totalTokens > 0 ? totalTokens : input + output + cacheRead + cacheWrite;
1456
- if (isRecord6(usage.cost)) costUsd += numberField2(usage.cost, "total");
1363
+ if (isRecord5(usage.cost)) costUsd += numberField2(usage.cost, "total");
1457
1364
  };
1458
1365
  return {
1459
1366
  push(chunk) {
@@ -1503,7 +1410,7 @@ function numberField2(record, field) {
1503
1410
  const value = record[field];
1504
1411
  return typeof value === "number" && Number.isFinite(value) ? value : 0;
1505
1412
  }
1506
- function isRecord6(value) {
1413
+ function isRecord5(value) {
1507
1414
  return typeof value === "object" && value !== null && !Array.isArray(value);
1508
1415
  }
1509
1416
 
@@ -1511,76 +1418,6 @@ function isRecord6(value) {
1511
1418
  init_esm_shims();
1512
1419
  import { spawn } from "node:child_process";
1513
1420
  import { performance } from "node:perf_hooks";
1514
-
1515
- // src/domains/eval/metrics/chaos-stream.ts
1516
- init_esm_shims();
1517
- var EMPTY_CHAOS_OBSERVATION = { markerCount: 0, marker: null };
1518
- function createChaosFold() {
1519
- let markerCount = 0;
1520
- let marker = null;
1521
- let pending = "";
1522
- const consume = (line) => {
1523
- if (line.trim().length === 0) return;
1524
- let parsed;
1525
- try {
1526
- parsed = JSON.parse(line);
1527
- } catch {
1528
- return;
1529
- }
1530
- if (!isRecord7(parsed) || parsed.type !== "clio_soak_chaos") return;
1531
- markerCount += 1;
1532
- marker = parseChaosMarker(parsed);
1533
- };
1534
- return {
1535
- push(chunk) {
1536
- pending += chunk;
1537
- for (; ; ) {
1538
- const newline = pending.indexOf("\n");
1539
- if (newline === -1) break;
1540
- consume(pending.slice(0, newline).replace(/\r$/u, ""));
1541
- pending = pending.slice(newline + 1);
1542
- }
1543
- },
1544
- observation() {
1545
- if (pending.length > 0) {
1546
- consume(pending.replace(/\r$/u, ""));
1547
- pending = "";
1548
- }
1549
- return { markerCount, marker: marker === null ? null : { ...marker } };
1550
- }
1551
- };
1552
- }
1553
- function addChaosObservations(left, right) {
1554
- const markerCount = left.markerCount + right.markerCount;
1555
- return {
1556
- markerCount,
1557
- marker: markerCount === 1 ? left.marker ?? right.marker : null
1558
- };
1559
- }
1560
- function chaosMetricEntries(observation) {
1561
- if (observation.markerCount !== 1 || observation.marker === null) return {};
1562
- return {
1563
- "chaos.seed": observation.marker.seed,
1564
- "chaos.faultInjected": observation.marker.faultInjected,
1565
- "chaos.exitCode": observation.marker.exitCode,
1566
- "process.orphanedChildren": observation.marker.orphanedChildren
1567
- };
1568
- }
1569
- function parseChaosMarker(event) {
1570
- if (event.type !== "clio_soak_chaos") return null;
1571
- const { seed, faultInjected, exitCode, orphanedChildren } = event;
1572
- if (!isFiniteInteger2(seed) || typeof faultInjected !== "boolean" || !isFiniteInteger2(exitCode)) return null;
1573
- if (!isFiniteInteger2(orphanedChildren) || orphanedChildren < 0) return null;
1574
- return { seed, faultInjected, exitCode, orphanedChildren };
1575
- }
1576
- function isFiniteInteger2(value) {
1577
- return typeof value === "number" && Number.isFinite(value) && Number.isInteger(value);
1578
- }
1579
- function isRecord7(value) {
1580
- return typeof value === "object" && value !== null && !Array.isArray(value);
1581
- }
1582
-
1583
- // src/domains/eval/runners/external-command.ts
1584
1421
  var OUTPUT_LIMIT = 2e5;
1585
1422
  var OUTPUT_HEAD_LIMIT = 2e4;
1586
1423
  var OUTPUT_TRUNCATION_MARKER = "\n[output middle truncated; tail preserved]\n";
@@ -1594,7 +1431,6 @@ async function runExternalCommandRunner(runner, cwd, timeoutMs, env) {
1594
1431
  let wallTimeMs = 0;
1595
1432
  let usage = UNMEASURED_TOKEN_USAGE;
1596
1433
  let streamInvariants = EMPTY_STREAM_INVARIANTS;
1597
- let chaos = EMPTY_CHAOS_OBSERVATION;
1598
1434
  let fleetLoops = EMPTY_FLEET_LOOP_OBSERVATION;
1599
1435
  for (const command of commands) {
1600
1436
  const result = await runShellCommand(command, cwd, runner.timeoutMs ?? timeoutMs, env);
@@ -1603,7 +1439,6 @@ async function runExternalCommandRunner(runner, cwd, timeoutMs, env) {
1603
1439
  wallTimeMs += result.wallTimeMs;
1604
1440
  usage = addTokenStreamUsage(usage, result.usage);
1605
1441
  streamInvariants = addStreamInvariants(streamInvariants, result.streamInvariants);
1606
- chaos = addChaosObservations(chaos, result.chaos);
1607
1442
  fleetLoops = addFleetLoopObservations(fleetLoops, result.fleetLoops);
1608
1443
  if (result.exitCode !== 0) {
1609
1444
  return {
@@ -1617,11 +1452,10 @@ async function runExternalCommandRunner(runner, cwd, timeoutMs, env) {
1617
1452
  "latency.wallMs": wallTimeMs,
1618
1453
  ...tokenMetricEntries(usage),
1619
1454
  ...streamInvariantMetrics(streamInvariants),
1620
- ...chaosMetricEntries(chaos),
1621
1455
  ...fleetLoopMetricEntries(fleetLoops),
1622
1456
  "verifier.exitCode": result.exitCode
1623
1457
  },
1624
- artifacts: chaosArtifacts(chaos)
1458
+ artifacts: {}
1625
1459
  };
1626
1460
  }
1627
1461
  }
@@ -1636,11 +1470,10 @@ async function runExternalCommandRunner(runner, cwd, timeoutMs, env) {
1636
1470
  "latency.wallMs": wallTimeMs,
1637
1471
  ...tokenMetricEntries(usage),
1638
1472
  ...streamInvariantMetrics(streamInvariants),
1639
- ...chaosMetricEntries(chaos),
1640
1473
  ...fleetLoopMetricEntries(fleetLoops),
1641
1474
  "verifier.exitCode": 0
1642
1475
  },
1643
- artifacts: chaosArtifacts(chaos)
1476
+ artifacts: {}
1644
1477
  };
1645
1478
  }
1646
1479
  function runShellCommand(command, cwd, timeoutMs, env) {
@@ -1651,7 +1484,6 @@ function runShellCommand(command, cwd, timeoutMs, env) {
1651
1484
  const metricCapture = createJsonlMetricCapture();
1652
1485
  const usageFold = createTokenUsageFold();
1653
1486
  const streamFold = createStreamInvariantFold();
1654
- const chaosFold = createChaosFold();
1655
1487
  const fleetLoopFold = createFleetLoopFold();
1656
1488
  let timedOut = false;
1657
1489
  let settled = false;
@@ -1670,7 +1502,6 @@ function runShellCommand(command, cwd, timeoutMs, env) {
1670
1502
  metricCapture.push(chunk);
1671
1503
  usageFold.push(chunk);
1672
1504
  streamFold.push(chunk);
1673
- chaosFold.push(chunk);
1674
1505
  fleetLoopFold.push(chunk);
1675
1506
  });
1676
1507
  child.stderr.on("data", (chunk) => {
@@ -1692,7 +1523,6 @@ function runShellCommand(command, cwd, timeoutMs, env) {
1692
1523
  metricJsonl: metricCapture.finish(),
1693
1524
  usage: usageFold.usage(),
1694
1525
  streamInvariants: streamFold.invariants(),
1695
- chaos: chaosFold.observation(),
1696
1526
  fleetLoops: fleetLoopFold.observation(),
1697
1527
  stderr,
1698
1528
  wallTimeMs: Math.round(performance.now() - started),
@@ -1727,7 +1557,7 @@ function createJsonlMetricCapture() {
1727
1557
  } catch {
1728
1558
  return;
1729
1559
  }
1730
- if (!isRecord8(parsed)) return;
1560
+ if (!isRecord6(parsed)) return;
1731
1561
  const compact = compactMetricEvent(parsed);
1732
1562
  if (compact === null) return;
1733
1563
  const encoded = JSON.stringify(compact);
@@ -1772,48 +1602,41 @@ function createJsonlMetricCapture() {
1772
1602
  }
1773
1603
  function compactMetricEvent(event) {
1774
1604
  const type = event.type;
1775
- if (type === "clio_soak_chaos") {
1776
- const marker = parseChaosMarker(event);
1777
- return marker === null ? null : { type, ...marker };
1778
- }
1779
1605
  if (type === "tool_execution_start") {
1780
- const toolName = stringField2(event, "toolName");
1606
+ const toolName = stringField(event, "toolName");
1781
1607
  if (toolName !== "dispatch" && toolName !== "code_nav" && toolName !== "read" && toolName !== "grep") {
1782
1608
  return null;
1783
1609
  }
1784
1610
  return {
1785
1611
  type,
1786
- ...stringField2(event, "toolCallId") !== void 0 ? { toolCallId: stringField2(event, "toolCallId") } : {},
1612
+ ...stringField(event, "toolCallId") !== void 0 ? { toolCallId: stringField(event, "toolCallId") } : {},
1787
1613
  toolName,
1788
- ...toolName === "dispatch" && isRecord8(event.args) ? { args: event.args } : toolName === "code_nav" && isRecord8(event.args) ? { args: { mode: event.args.mode } } : {}
1614
+ ...toolName === "dispatch" && isRecord6(event.args) ? { args: event.args } : toolName === "code_nav" && isRecord6(event.args) ? { args: { mode: event.args.mode } } : {}
1789
1615
  };
1790
1616
  }
1791
1617
  if (type === "tool_execution_end") {
1792
1618
  return {
1793
1619
  type,
1794
- ...stringField2(event, "toolCallId") !== void 0 ? { toolCallId: stringField2(event, "toolCallId") } : {},
1795
- ...stringField2(event, "toolName") !== void 0 ? { toolName: stringField2(event, "toolName") } : {},
1620
+ ...stringField(event, "toolCallId") !== void 0 ? { toolCallId: stringField(event, "toolCallId") } : {},
1621
+ ...stringField(event, "toolName") !== void 0 ? { toolName: stringField(event, "toolName") } : {},
1796
1622
  ...event.isError === true ? { isError: true } : {},
1797
- ...stringField2(event, "outcome") !== void 0 ? { outcome: stringField2(event, "outcome") } : {}
1623
+ ...stringField(event, "outcome") !== void 0 ? { outcome: stringField(event, "outcome") } : {}
1798
1624
  };
1799
1625
  }
1800
- if (type !== "clio_tool_finish" || !isRecord8(event.payload)) return null;
1626
+ if (type !== "clio_tool_finish" || !isRecord6(event.payload)) return null;
1801
1627
  return {
1802
1628
  type,
1803
1629
  payload: {
1804
- ...stringField2(event.payload, "tool") !== void 0 ? { tool: stringField2(event.payload, "tool") } : {},
1805
- ...stringField2(event.payload, "toolCallId") !== void 0 ? { toolCallId: stringField2(event.payload, "toolCallId") } : stringField2(event, "toolCallId") !== void 0 ? { toolCallId: stringField2(event, "toolCallId") } : {},
1806
- ...stringField2(event.payload, "outcome") !== void 0 ? { outcome: stringField2(event.payload, "outcome") } : {}
1630
+ ...stringField(event.payload, "tool") !== void 0 ? { tool: stringField(event.payload, "tool") } : {},
1631
+ ...stringField(event.payload, "toolCallId") !== void 0 ? { toolCallId: stringField(event.payload, "toolCallId") } : stringField(event, "toolCallId") !== void 0 ? { toolCallId: stringField(event, "toolCallId") } : {},
1632
+ ...stringField(event.payload, "outcome") !== void 0 ? { outcome: stringField(event.payload, "outcome") } : {}
1807
1633
  }
1808
1634
  };
1809
1635
  }
1810
- function chaosArtifacts(observation) {
1811
- return observation.markerCount === 1 && observation.marker !== null ? { chaosSeed: String(observation.marker.seed) } : {};
1812
- }
1813
- function isRecord8(value) {
1636
+ function isRecord6(value) {
1814
1637
  return typeof value === "object" && value !== null && !Array.isArray(value);
1815
1638
  }
1816
- function stringField2(record, field) {
1639
+ function stringField(record, field) {
1817
1640
  const value = record[field];
1818
1641
  return typeof value === "string" && value.length > 0 ? value : void 0;
1819
1642
  }
@@ -1854,9 +1677,6 @@ async function runClioRunRunner(runner, cwd, clioEntry, timeoutMs, target, env)
1854
1677
  "tools.failed": tools.failed,
1855
1678
  "tools.blocked": tools.blocked,
1856
1679
  "verifier.exitCode": result.exitCode,
1857
- "dispatch.count": dispatchCountFromJsonl(toolMetricStream),
1858
- "dispatch.scoutCount": scoutDispatchCountFromJsonl(toolMetricStream),
1859
- "wiki.staleAcknowledged": wikiStaleAcknowledgedFromJsonl(toolMetricStream),
1860
1680
  ...receipt === null ? {} : evidenceMetricsFromReceipt(receipt),
1861
1681
  ...receipt === null ? {} : { "evidence.qualityLabel": receipt.quality.typedValidations.length > 0 ? "measured" : "unmeasured" }
1862
1682
  },
@@ -1877,13 +1697,13 @@ function toolCallMetricsFromJsonl(stdout) {
1877
1697
  let event;
1878
1698
  try {
1879
1699
  const parsed = JSON.parse(line);
1880
- if (!isRecord9(parsed)) continue;
1700
+ if (!isRecord7(parsed)) continue;
1881
1701
  event = parsed;
1882
1702
  } catch {
1883
1703
  continue;
1884
1704
  }
1885
1705
  if (event.type === "tool_execution_end") {
1886
- const callId2 = stringField3(event, "toolCallId");
1706
+ const callId2 = stringField2(event, "toolCallId");
1887
1707
  if (callId2 !== void 0) {
1888
1708
  if (seenExecutionEnds.has(callId2)) continue;
1889
1709
  seenExecutionEnds.add(callId2);
@@ -1891,10 +1711,10 @@ function toolCallMetricsFromJsonl(stdout) {
1891
1711
  recordToolOutcome(executionEnds, toolOutcome(event) ?? (event.isError === true ? "error" : "ok"));
1892
1712
  continue;
1893
1713
  }
1894
- if (event.type !== "clio_tool_finish" || !isRecord9(event.payload)) continue;
1714
+ if (event.type !== "clio_tool_finish" || !isRecord7(event.payload)) continue;
1895
1715
  const outcome = toolOutcome(event.payload);
1896
1716
  if (outcome === void 0) continue;
1897
- const callId = stringField3(event.payload, "toolCallId") ?? stringField3(event, "toolCallId");
1717
+ const callId = stringField2(event.payload, "toolCallId") ?? stringField2(event, "toolCallId");
1898
1718
  if (callId !== void 0) {
1899
1719
  if (seenCanonicalFinishes.has(callId)) continue;
1900
1720
  seenCanonicalFinishes.add(callId);
@@ -1912,11 +1732,11 @@ function toolOutcome(record) {
1912
1732
  const outcome = record.outcome;
1913
1733
  return outcome === "ok" || outcome === "error" || outcome === "blocked" ? outcome : void 0;
1914
1734
  }
1915
- function stringField3(record, field) {
1735
+ function stringField2(record, field) {
1916
1736
  const value = record[field];
1917
1737
  return typeof value === "string" && value.length > 0 ? value : void 0;
1918
1738
  }
1919
- function isRecord9(value) {
1739
+ function isRecord7(value) {
1920
1740
  return typeof value === "object" && value !== null && !Array.isArray(value);
1921
1741
  }
1922
1742
 
@@ -1994,12 +1814,12 @@ async function runContextInitRunner(runner, cwd, clioEntry, timeoutMs, target, e
1994
1814
  ` : result.stderr;
1995
1815
  const run = recordField(generation, "run");
1996
1816
  const tokens = recordField(run, "tokens");
1997
- const effectiveTarget = stringField4(run, "targetId");
1998
- const effectiveModel = stringField4(run, "wireModelId");
1999
- const effectiveRuntime = stringField4(run, "runtimeId");
2000
- const effectiveRuntimeKind = stringField4(run, "runtimeKind");
2001
- const effectiveThinking = stringField4(run, "thinkingLevel");
2002
- const structuredOutputMode = stringField4(run, "structuredOutputMode");
1817
+ const effectiveTarget = stringField3(run, "targetId");
1818
+ const effectiveModel = stringField3(run, "wireModelId");
1819
+ const effectiveRuntime = stringField3(run, "runtimeId");
1820
+ const effectiveRuntimeKind = stringField3(run, "runtimeKind");
1821
+ const effectiveThinking = stringField3(run, "thinkingLevel");
1822
+ const structuredOutputMode = stringField3(run, "structuredOutputMode");
2003
1823
  const clioMdPath = join2(cwd, "CLIO-CODER.md");
2004
1824
  const clioMdBytes = existsSync2(clioMdPath) ? statSync(clioMdPath).size : 0;
2005
1825
  return {
@@ -2021,9 +1841,9 @@ async function runContextInitRunner(runner, cwd, clioEntry, timeoutMs, target, e
2021
1841
  "tools.failed": numberField3(run, "toolFailures"),
2022
1842
  "tools.blocked": numberField3(run, "toolBlocked"),
2023
1843
  "context.clioMdBytes": clioMdBytes,
2024
- "context.initMode": stringField4(generation, "mode") ?? "unknown",
2025
- "context.initParserOutcome": stringField4(generation, "parserOutcome") ?? "unknown",
2026
- "context.initFallback": stringField4(generation, "fallbackReason") !== null,
1844
+ "context.initMode": stringField3(generation, "mode") ?? "unknown",
1845
+ "context.initParserOutcome": stringField3(generation, "parserOutcome") ?? "unknown",
1846
+ "context.initFallback": stringField3(generation, "fallbackReason") !== null,
2027
1847
  "context.initPromptBytes": numberField3(run, "promptBytes"),
2028
1848
  "context.initOutputBytes": numberField3(run, "outputBytes"),
2029
1849
  "context.initTargetId": effectiveTarget,
@@ -2044,7 +1864,7 @@ async function runContextInitRunner(runner, cwd, clioEntry, timeoutMs, target, e
2044
1864
  effectiveModel,
2045
1865
  effectiveRuntime,
2046
1866
  effectiveThinking,
2047
- bootstrapRunId: stringField4(run, "runId")
1867
+ bootstrapRunId: stringField3(run, "runId")
2048
1868
  }
2049
1869
  };
2050
1870
  }
@@ -2098,9 +1918,9 @@ function isValidGenerationPayload(payload, generation) {
2098
1918
  function generationRouteError(generation, target) {
2099
1919
  const run = recordField(generation, "run");
2100
1920
  if (!run) return null;
2101
- const actualTarget = stringField4(run, "targetId");
2102
- const actualModel = stringField4(run, "wireModelId");
2103
- const actualThinking = stringField4(run, "thinkingLevel");
1921
+ const actualTarget = stringField3(run, "targetId");
1922
+ const actualModel = stringField3(run, "wireModelId");
1923
+ const actualThinking = stringField3(run, "thinkingLevel");
2104
1924
  if (actualTarget !== null && actualTarget !== target.id) {
2105
1925
  return `context-init runner requested target '${target.id}' but the bootstrap receipt used '${actualTarget}'`;
2106
1926
  }
@@ -2129,7 +1949,7 @@ function numberField3(value, field) {
2129
1949
  const selected = record?.[field];
2130
1950
  return typeof selected === "number" && Number.isFinite(selected) ? selected : null;
2131
1951
  }
2132
- function stringField4(value, field) {
1952
+ function stringField3(value, field) {
2133
1953
  const record = recordField(value);
2134
1954
  const selected = record?.[field];
2135
1955
  return typeof selected === "string" && selected.length > 0 ? selected : null;
@@ -2324,7 +2144,7 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry) {
2324
2144
  CLIO_CODER_ENTRY: clioEntry
2325
2145
  });
2326
2146
  const patch = collectPatchMetrics(workspace.dir);
2327
- const receiptExitCode = receiptProcessExitCode(runner);
2147
+ const receiptExitCode = runner.exitCode;
2328
2148
  const journalMetrics = invariantMetrics(stateDir, receiptExitCode);
2329
2149
  const metrics = {
2330
2150
  ...zeroToolCallMetrics(),
@@ -2387,10 +2207,6 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry) {
2387
2207
  await rm3(stateDir, { recursive: true, force: true });
2388
2208
  }
2389
2209
  }
2390
- function receiptProcessExitCode(runner) {
2391
- const chaosExitCode = runner.metrics["chaos.exitCode"];
2392
- return typeof chaosExitCode === "number" && Number.isInteger(chaosExitCode) ? chaosExitCode : runner.exitCode;
2393
- }
2394
2210
  function invariantMetrics(stateDir, runnerExitCode) {
2395
2211
  const journal = readRunJournal(stateDir);
2396
2212
  return {
@@ -2737,4 +2553,4 @@ function reportFormat(value) {
2737
2553
  export {
2738
2554
  runEvalCommand
2739
2555
  };
2740
- //# sourceMappingURL=eval-XSSNATB4.js.map
2556
+ //# sourceMappingURL=eval-CG6LLBLD.js.map
@@ -7,52 +7,62 @@ import {
7
7
  listEvidenceOverviews,
8
8
  loadEvidenceRunProvenance,
9
9
  provenanceTranscriptLines
10
- } from "./chunk-SRDMMSEP.js";
11
- import "./chunk-4BJ5BYCE.js";
10
+ } from "./chunk-QM3F2GKX.js";
11
+ import "./chunk-CJUB2JJ2.js";
12
12
  import "./chunk-QKMUKYO7.js";
13
- import "./chunk-AGYYIBLL.js";
14
- import "./chunk-OOJYHWRB.js";
13
+ import "./chunk-OH3TOQTB.js";
14
+ import "./chunk-TSHXZTOQ.js";
15
15
  import "./chunk-TXOTCRLG.js";
16
- import "./chunk-G4BMMOKF.js";
17
- import "./chunk-LWLEKMDQ.js";
18
- import "./chunk-STBPMHSX.js";
19
- import "./chunk-GGXXDWE4.js";
20
- import "./chunk-5UUP6MWO.js";
16
+ import "./chunk-HVDIIIQW.js";
17
+ import "./chunk-W6GROXXM.js";
18
+ import "./chunk-XXQNGV4M.js";
19
+ import "./chunk-43AOLP7E.js";
20
+ import "./chunk-EKY57CSP.js";
21
+ import "./chunk-22NAGB7X.js";
22
+ import "./chunk-AOCYTWAV.js";
23
+ import "./chunk-MV3K5QF2.js";
21
24
  import "./chunk-CMZWFGD2.js";
22
25
  import "./chunk-I4HZDVNP.js";
23
- import "./chunk-7MNJORFF.js";
26
+ import "./chunk-FYYLNIL5.js";
27
+ import "./chunk-UL3WSD3F.js";
24
28
  import "./chunk-OQE5J4C6.js";
25
29
  import "./chunk-ECH6PKUQ.js";
26
- import "./chunk-T6YILFSB.js";
27
- import "./chunk-VAKQQHWR.js";
30
+ import "./chunk-GOXNB3AO.js";
31
+ import "./chunk-HWUFFB6L.js";
32
+ import "./chunk-ODFEOB4F.js";
33
+ import "./chunk-OZNBF4L3.js";
34
+ import "./chunk-4BJ5BYCE.js";
28
35
  import "./chunk-6XLNIQDB.js";
29
36
  import "./chunk-5B2AEOW5.js";
30
37
  import "./chunk-CGKSTWHD.js";
31
- import "./chunk-YHZX5GEU.js";
32
- import "./chunk-EKMEHE4H.js";
33
- import "./chunk-YCWGATWI.js";
38
+ import "./chunk-XAKHZX5N.js";
39
+ import "./chunk-33YXPOE3.js";
40
+ import "./chunk-24I7BN55.js";
34
41
  import {
35
42
  printError,
36
43
  printOk
37
- } from "./chunk-ED4KHGC3.js";
44
+ } from "./chunk-PPAMZ32Z.js";
38
45
  import "./chunk-5TSRNF4G.js";
39
- import "./chunk-LZSJBIVT.js";
40
- import "./chunk-A3CYT5EX.js";
41
- import "./chunk-ZDOOVTXZ.js";
46
+ import "./chunk-DJVECN66.js";
47
+ import "./chunk-CFGTUFWB.js";
48
+ import "./chunk-AD2SYQYC.js";
49
+ import "./chunk-4OC57DA6.js";
50
+ import "./chunk-LL4KHSZI.js";
42
51
  import "./chunk-4VP4KH3K.js";
43
- import "./chunk-M6SHUN7Q.js";
44
- import {
45
- InvalidIdError
46
- } from "./chunk-R346GLFC.js";
47
- import "./chunk-COU2UHX6.js";
52
+ import "./chunk-VEZEGCGW.js";
48
53
  import "./chunk-FQ4SKYE4.js";
49
54
  import "./chunk-IKCO5N3L.js";
50
55
  import "./chunk-3I7MS7N2.js";
51
56
  import "./chunk-IHXBNWMM.js";
57
+ import "./chunk-GEYXPTRF.js";
52
58
  import "./chunk-SST6Z5JA.js";
59
+ import "./chunk-FO5ZOVUY.js";
60
+ import {
61
+ InvalidIdError
62
+ } from "./chunk-R346GLFC.js";
53
63
  import "./chunk-4ZG3XFUR.js";
54
- import "./chunk-APJ265NV.js";
55
64
  import "./chunk-FCSXB6T2.js";
65
+ import "./chunk-APJ265NV.js";
56
66
  import "./chunk-YXLYO42X.js";
57
67
  import {
58
68
  clioDataDir,
@@ -60,7 +70,8 @@ import {
60
70
  } from "./chunk-BNAZZHFG.js";
61
71
  import "./chunk-6EJMN2Y3.js";
62
72
  import "./chunk-WEPFGWHJ.js";
63
- import "./chunk-OQ33BKR3.js";
73
+ import "./chunk-ZGVHUX3M.js";
74
+ import "./chunk-G7MUEIGA.js";
64
75
  import "./chunk-7CR24IG7.js";
65
76
  import "./chunk-IWHMRKLL.js";
66
77
  import {
@@ -202,7 +213,7 @@ async function runEvidenceCommand(args) {
202
213
  }
203
214
  }
204
215
  function renderEvidence(input, provenance = []) {
205
- const { overview, findings } = input;
216
+ const { overview, findings, trustStatus } = input;
206
217
  process.stdout.write(`evidence: ${overview.evidenceId}
207
218
  `);
208
219
  process.stdout.write(`source: ${formatSource(overview)}
@@ -221,6 +232,14 @@ function renderEvidence(input, provenance = []) {
221
232
  `);
222
233
  process.stdout.write(`findings: ${findings.length}
223
234
  `);
235
+ if (trustStatus.projection === "historical_format") {
236
+ process.stdout.write("trust status: unavailable (historical bundle without canonical projection)\n");
237
+ } else {
238
+ for (const run of trustStatus.runs) {
239
+ process.stdout.write(`trust ${run.runId}: ${formatTrustStatus(run.status)}
240
+ `);
241
+ }
242
+ }
224
243
  for (const { runId, view } of provenance) {
225
244
  process.stdout.write(`provenance ${runId}:
226
245
  `);
@@ -230,6 +249,16 @@ function renderEvidence(input, provenance = []) {
230
249
  process.stdout.write(`files: ${formatList(overview.files)}
231
250
  `);
232
251
  }
252
+ function formatTrustStatus(status) {
253
+ return [
254
+ `artifactIntegrity=${status.artifactIntegrity.state}`,
255
+ `validationGrounding=${status.validationGrounding.state}`,
256
+ `independentReview=${status.independentReview.state}`,
257
+ `contextProvenance=${status.contextProvenance.state}`,
258
+ `autonomyEnforcement=${status.autonomyEnforcement.state}`,
259
+ `completionEvidence=${status.completionEvidence.state}`
260
+ ].join(" ");
261
+ }
233
262
  function renderEvidenceList(overviews) {
234
263
  process.stdout.write(`${overviews.length} evidence artifacts
235
264
  `);
@@ -258,4 +287,4 @@ function formatList(values) {
258
287
  export {
259
288
  runEvidenceCommand
260
289
  };
261
- //# sourceMappingURL=evidence-6HG2PY2B.js.map
290
+ //# sourceMappingURL=evidence-ZYFIEN42.js.map