@iowarp/clio-coder 0.3.7 → 0.3.9

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 (400) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +13 -4
  3. package/dist/{acp-SK4MD6MM.js → acp-7LOELQFP.js} +13 -13
  4. package/dist/{agents-2FN2K6ME.js → agents-FIBG2SHA.js} +41 -37
  5. package/dist/assets/codewiki.json +1 -1
  6. package/dist/{auth-QIYZWM5I.js → auth-OI4LIH2I.js} +31 -24
  7. package/dist/builtins-AD25UL3C.js +17 -0
  8. package/dist/{chunk-5FR74PWO.js → chunk-2JDWVJND.js} +2 -2
  9. package/dist/chunk-3DPEIQKN.js +113 -0
  10. package/dist/{chunk-EOOQZZDE.js → chunk-3DUR4WUA.js} +19 -19
  11. package/dist/{chunk-WHJYKASB.js → chunk-3MRC2YSQ.js} +2 -2
  12. package/dist/{chunk-EBEFWSGL.js → chunk-3UUY7R3Z.js} +14 -10
  13. package/dist/{chunk-LADCF22A.js → chunk-3V5AYSEQ.js} +113 -54
  14. package/dist/{chunk-BMWK7ZIZ.js → chunk-465CC7FK.js} +16 -13
  15. package/dist/{chunk-5WIGXA4T.js → chunk-47CMYGET.js} +111 -4
  16. package/dist/{chunk-CEYBNUGC.js → chunk-4H6ULJ3H.js} +378 -36
  17. package/dist/{chunk-YTYFXUI3.js → chunk-4LJX2PUC.js} +9 -9
  18. package/dist/{chunk-DOOEX22V.js → chunk-56KB5IJP.js} +5 -5
  19. package/dist/{chunk-SPULKLCF.js → chunk-5DQRIYDZ.js} +2 -2
  20. package/dist/{chunk-TSHXZTOQ.js → chunk-5HFBWUMU.js} +23 -11
  21. package/dist/{chunk-5UJ6ECTS.js → chunk-5PVQ4SRS.js} +80 -8
  22. package/dist/{chunk-ZWLZP4ZT.js → chunk-5QKCQQ3E.js} +359 -17
  23. package/dist/{chunk-6M7VS3J3.js → chunk-5T7RBWN2.js} +111 -5
  24. package/dist/chunk-774ILSRL.js +172 -0
  25. package/dist/chunk-7C6RYZGQ.js +391 -0
  26. package/dist/{chunk-GH5622CP.js → chunk-A2NJGIB3.js} +2 -2
  27. package/dist/{chunk-C4JBQ5SR.js → chunk-AD7Y7STJ.js} +6 -6
  28. package/dist/{chunk-GEYXPTRF.js → chunk-AEYBF3TB.js} +33 -12
  29. package/dist/{chunk-2SFS6XQE.js → chunk-AMKHQW3C.js} +3 -2
  30. package/dist/{chunk-D4MDIG46.js → chunk-B5CSFE7B.js} +7 -7
  31. package/dist/{chunk-MXI6J5JF.js → chunk-B5XRQOLB.js} +10 -10
  32. package/dist/{chunk-X2KV5FXT.js → chunk-BVDVID7E.js} +2 -2
  33. package/dist/{chunk-JNXPYBB4.js → chunk-CA42X6KT.js} +3 -3
  34. package/dist/{chunk-VREKEFLL.js → chunk-D73KXYPF.js} +3 -3
  35. package/dist/{chunk-JTSEDYVQ.js → chunk-DG4M6ZUE.js} +7 -7
  36. package/dist/{chunk-DQA7QLMD.js → chunk-EBOC7MT3.js} +10 -25
  37. package/dist/{chunk-KZ2H5X4G.js → chunk-ECUO3KDP.js} +129 -14
  38. package/dist/{chunk-JRIO5UD2.js → chunk-EQ63NRB7.js} +5 -5
  39. package/dist/{chunk-YD734TPH.js → chunk-FALJGAWU.js} +2 -2
  40. package/dist/{chunk-GWS3VEIW.js → chunk-FWDFM5ZU.js} +24 -3
  41. package/dist/{chunk-XEGB6BCN.js → chunk-GAYUJ7LE.js} +68 -14
  42. package/dist/{chunk-UND3GU2L.js → chunk-H7IXIC72.js} +2 -2
  43. package/dist/{chunk-IR4CFBFN.js → chunk-HAY4ZE2P.js} +12 -12
  44. package/dist/{chunk-UVDSQ6LW.js → chunk-HCBCAYZU.js} +74 -147
  45. package/dist/{chunk-4DWFMQDR.js → chunk-HJB5IUKP.js} +89 -145
  46. package/dist/{chunk-M4AKACEO.js → chunk-HKO36JWF.js} +33 -5
  47. package/dist/{chunk-KCMKRQX4.js → chunk-HPCTNZM2.js} +45 -82
  48. package/dist/{chunk-465YSENW.js → chunk-IFBNV6H6.js} +3 -3
  49. package/dist/{chunk-FJ3H4MN5.js → chunk-IHKBWSXF.js} +2 -2
  50. package/dist/chunk-JEQQR47K.js +3025 -0
  51. package/dist/{chunk-FO5ZOVUY.js → chunk-KV2AOLDF.js} +27 -7
  52. package/dist/chunk-LU7P4LHA.js +33 -0
  53. package/dist/{chunk-6TUKSZVF.js → chunk-LXPJXFM5.js} +11 -11
  54. package/dist/{chunk-VQNODYQ4.js → chunk-MIX5N5AC.js} +488 -3668
  55. package/dist/chunk-MLOK6ZOS.js +2888 -0
  56. package/dist/{chunk-ZZMN5OM4.js → chunk-MV2VUEJC.js} +2 -2
  57. package/dist/{chunk-MVVUPGPW.js → chunk-MXHC5QYU.js} +6 -6
  58. package/dist/{chunk-OBMAI2DP.js → chunk-N3PBVRTZ.js} +12 -388
  59. package/dist/{chunk-WJHBC77E.js → chunk-N5XKWMDW.js} +17 -7
  60. package/dist/{chunk-5C3AQNDW.js → chunk-NNNWO6F2.js} +124 -36
  61. package/dist/{chunk-UFQ3F4FW.js → chunk-NQ6UCCOD.js} +4 -4
  62. package/dist/chunk-NUGM5KR6.js +165 -0
  63. package/dist/{chunk-DMD2AGVS.js → chunk-NZU6YDNV.js} +20 -18
  64. package/dist/{chunk-WHGPSPT5.js → chunk-O6I4CIEU.js} +151 -13
  65. package/dist/{chunk-XN3L4EYL.js → chunk-OEDBCISO.js} +2 -2
  66. package/dist/{chunk-PD3MESLB.js → chunk-P3JGPQFL.js} +4 -4
  67. package/dist/{chunk-UHXRNZ2J.js → chunk-PNY46YEY.js} +23 -6
  68. package/dist/{chunk-THKY7CD7.js → chunk-PZ4I4JE2.js} +134 -29
  69. package/dist/{chunk-SROCI7ZU.js → chunk-QQ7EKM72.js} +5 -5
  70. package/dist/{chunk-QCTRSGHQ.js → chunk-R7LNVMCS.js} +91 -53
  71. package/dist/{chunk-GOXNB3AO.js → chunk-RAPCMZL4.js} +75 -4
  72. package/dist/chunk-RKKLTLYB.js +45 -0
  73. package/dist/{chunk-OB5HIGJY.js → chunk-RKRLDWD3.js} +4 -1
  74. package/dist/{chunk-DJNLUABN.js → chunk-S4COXYBG.js} +588 -32
  75. package/dist/{chunk-3HAPLH5M.js → chunk-T3Z6VAAF.js} +172 -11
  76. package/dist/{chunk-FOT2FX5J.js → chunk-TD7UE2L5.js} +12 -10
  77. package/dist/{chunk-UUANF5CR.js → chunk-TEO2TLVN.js} +856 -967
  78. package/dist/{chunk-FCSXB6T2.js → chunk-UOSL25KY.js} +14 -2
  79. package/dist/{chunk-EELBMBT6.js → chunk-VKBMFOYV.js} +74 -15
  80. package/dist/chunk-VO2LKSTM.js +165 -0
  81. package/dist/{chunk-5C77SEEY.js → chunk-VPTUJU4P.js} +3 -3
  82. package/dist/{chunk-WEH5XRJQ.js → chunk-WIE7ZOSW.js} +2 -2
  83. package/dist/{chunk-J7PIKKWC.js → chunk-WXCJ7VME.js} +8 -8
  84. package/dist/{chunk-4DGYLA73.js → chunk-XDOQXGFO.js} +22 -7
  85. package/dist/{chunk-PPAMZ32Z.js → chunk-XK56QHLX.js} +6 -1
  86. package/dist/{chunk-AB4XIIVB.js → chunk-YKOFT37S.js} +6 -6
  87. package/dist/chunk-YSEHGPCT.js +127 -0
  88. package/dist/{chunk-HFSBBKSQ.js → chunk-YW7UVM5V.js} +138 -3
  89. package/dist/cli/index.js +32 -32
  90. package/dist/{clio-WBVQEBKO.js → clio-LT5V7SSZ.js} +9 -9
  91. package/dist/{code-nav-FGGFIE7L.js → code-nav-LMW275PA.js} +5 -5
  92. package/dist/codewiki/build-worker.js +4 -4
  93. package/dist/{components-F7OEATSO.js → components-ZFA3SAER.js} +8 -8
  94. package/dist/{config-TRBL3RCF.js → config-RXS5T3JT.js} +98 -65
  95. package/dist/{configure-OLCVPHNM.js → configure-2WYWSCSD.js} +26 -22
  96. package/dist/{context-MJIJ6GOX.js → context-I3BTOTCS.js} +12 -12
  97. package/dist/{context-XEWE3MOJ.js → context-MVOORGMF.js} +54 -47
  98. package/dist/{context-WFPKQSM6.js → context-PALKKQYL.js} +28 -28
  99. package/dist/{context-clear-KNOS2JPB.js → context-clear-N2WOYZ2K.js} +53 -46
  100. package/dist/{context-index-SSR5ECNE.js → context-index-HNG3MOME.js} +6 -6
  101. package/dist/{context-working-set-EUXAZI6N.js → context-working-set-MIEVECVZ.js} +17 -18
  102. package/dist/{dispatch-runner-B7MTOVKL.js → dispatch-runner-VVA4SRRH.js} +90 -61
  103. package/dist/{docs-FLJTIDSE.js → docs-7LQ23DLM.js} +8 -8
  104. package/dist/doctor-TWBWFK5V.js +165 -0
  105. package/dist/eval-IJ5VEZDJ.js +4483 -0
  106. package/dist/{evidence-JZNBUOQZ.js → evidence-L5APPXNV.js} +68 -61
  107. package/dist/{evolve-FJVC4KKI.js → evolve-RGNKFJ52.js} +47 -40
  108. package/dist/{extensions-IQL36S7K.js → extensions-7WYWUX5A.js} +13 -7
  109. package/dist/{fleet-BDKYJFCP.js → fleet-6CNVBZZP.js} +113 -76
  110. package/dist/{fleet-commands-ZFIWZSB3.js → fleet-commands-L2SXSYEI.js} +10 -10
  111. package/dist/{fleet-graph-Y6HPXIVF.js → fleet-graph-2J3OOIPO.js} +17 -15
  112. package/dist/{fleet-preflight-BHSNPBMH.js → fleet-preflight-CZRJ4JP5.js} +5 -6
  113. package/dist/{fleet-validate-BIYREGIK.js → fleet-validate-C5RI6DP7.js} +20 -19
  114. package/dist/{init-LQUB5COQ.js → init-VBN2ACVA.js} +70 -63
  115. package/dist/{library-NJAHIGG4.js → library-JHGUMLY2.js} +22 -20
  116. package/dist/{memory-OG6HOYKM.js → memory-K4OQIYWG.js} +49 -42
  117. package/dist/{models-5ZG5XY7J.js → models-2NCZUWDD.js} +35 -29
  118. package/dist/{monitor-TJ7AMTGB.js → monitor-MMVTJABD.js} +64 -45
  119. package/dist/{orchestrator-WZYB54DM.js → orchestrator-ZKBPCHW6.js} +1971 -520
  120. package/dist/{paths-XUC7GS6E.js → paths-DBXMZMDU.js} +5 -5
  121. package/dist/registry-LG64LTF4.js +11 -0
  122. package/dist/{reset-PXQT45IY.js → reset-DD5JGOY3.js} +11 -11
  123. package/dist/{run-FQ74YF62.js → run-QEGNX7FL.js} +89 -83
  124. package/dist/{share-FW7SVCL3.js → share-JKD3BQMW.js} +20 -18
  125. package/dist/{skills-7E7IRB3R.js → skills-LMQIKDOZ.js} +23 -21
  126. package/dist/{skills-eval-LI75W6OK.js → skills-eval-I7X2774U.js} +59 -52
  127. package/dist/{steer-GGWFUJUD.js → steer-CF5TDANS.js} +3 -3
  128. package/dist/support-I7LOJLIF.js +38 -0
  129. package/dist/{targets-4CIFKCTW.js → targets-RUSR6B5Z.js} +77 -42
  130. package/dist/{terminal-lease-WUZY7ZV5.js → terminal-lease-QYVORFR4.js} +6 -4
  131. package/dist/{trace-PNCASAXC.js → trace-ODOQIVIW.js} +61 -6
  132. package/dist/{uninstall-7FV7IP4E.js → uninstall-ZJF5H5ZN.js} +8 -8
  133. package/dist/{upgrade-K2HVIVMQ.js → upgrade-XANW3FXB.js} +29 -26
  134. package/dist/{usage-GTZELZQX.js → usage-4H7ZRXQT.js} +110 -61
  135. package/dist/{verifiers-RLAHT27O.js → verifiers-UZXNBZEB.js} +13 -13
  136. package/dist/{verify-BX3BRKH5.js → verify-BVKWTNDL.js} +9 -9
  137. package/dist/{wiki-generate-ASIFASCN.js → wiki-generate-MY7WV2QI.js} +76 -69
  138. package/dist/worker/entry.js +69 -66
  139. package/docs/alcf-provider.md +1 -1
  140. package/docs/architecture.md +1 -1
  141. package/docs/artifact-versions.md +11 -5
  142. package/docs/built-in-agents.md +1 -1
  143. package/docs/capacity-and-scheduling.md +23 -2
  144. package/docs/commands-and-modes.md +2 -2
  145. package/docs/configuration-and-targets.md +37 -5
  146. package/docs/context-engine.md +63 -4
  147. package/docs/documentation-coverage.md +3 -3
  148. package/docs/documentation-guide.md +1 -1
  149. package/docs/environment-variables.md +2 -0
  150. package/docs/eval-runner.md +262 -11
  151. package/docs/evals-internal.md +72 -2
  152. package/docs/evidence-and-memory.md +77 -12
  153. package/docs/evolution.md +1 -1
  154. package/docs/extensions-and-sharing.md +3 -1
  155. package/docs/fleet-dispatch.md +34 -9
  156. package/docs/glossary.md +21 -1
  157. package/docs/installation-and-lifecycle.md +1 -1
  158. package/docs/middleware-and-components.md +1 -1
  159. package/docs/model-catalog.md +1 -1
  160. package/docs/observability.md +54 -3
  161. package/docs/proactive-memory.md +127 -14
  162. package/docs/prompt-envelope-and-tools.md +22 -2
  163. package/docs/provider-adapter-cookbook.md +1 -1
  164. package/docs/release-cut-checklist.md +60 -41
  165. package/docs/safety-model.md +1 -1
  166. package/docs/scientific-validation.md +1 -1
  167. package/docs/skills-marketplace.md +1 -1
  168. package/docs/tool-usage.md +1 -1
  169. package/docs/trace-store.md +1 -1
  170. package/docs/troubleshooting.md +87 -0
  171. package/docs/tui-design.md +1 -1
  172. package/docs/worker-dispatch-mechanics.md +1 -1
  173. package/package.json +2 -2
  174. package/src/cli/agents.ts +1 -1
  175. package/src/cli/argv.ts +5 -0
  176. package/src/cli/config-inspect.ts +33 -6
  177. package/src/cli/config.ts +1 -1
  178. package/src/cli/configure.ts +107 -23
  179. package/src/cli/doctor-state-size.ts +82 -0
  180. package/src/cli/doctor.ts +7 -1
  181. package/src/cli/eval.ts +80 -16
  182. package/src/cli/evidence.ts +30 -25
  183. package/src/cli/extensions.ts +5 -1
  184. package/src/cli/fleet-preflight.ts +2 -12
  185. package/src/cli/fleet.ts +32 -3
  186. package/src/cli/shared.ts +1 -0
  187. package/src/cli/targets.ts +45 -11
  188. package/src/cli/trace.ts +63 -4
  189. package/src/cli/usage.ts +63 -14
  190. package/src/cli/validate-model.ts +60 -5
  191. package/src/core/bus-events.ts +54 -1
  192. package/src/core/cache-telemetry.ts +42 -0
  193. package/src/core/commit-attribution.ts +4 -4
  194. package/src/core/config.ts +18 -0
  195. package/src/core/defaults.ts +36 -6
  196. package/src/core/endpoint-key.ts +27 -0
  197. package/src/core/path-boundary.ts +100 -0
  198. package/src/core/residency-target-key.ts +25 -0
  199. package/src/core/response-schema.ts +36 -2
  200. package/src/domains/agents/extension.ts +2 -11
  201. package/src/domains/agents/fleet-contract.ts +30 -12
  202. package/src/domains/agents/recipe.ts +7 -1
  203. package/src/domains/agents/registry.ts +73 -5
  204. package/src/domains/agents/result-contract.ts +128 -17
  205. package/src/domains/agents/write-boundary.ts +15 -50
  206. package/src/domains/config/classify.ts +3 -0
  207. package/src/domains/context/codewiki/coordinator.ts +12 -4
  208. package/src/domains/context/project-rules.ts +51 -1
  209. package/src/domains/dispatch/admission.ts +40 -3
  210. package/src/domains/dispatch/assignment-reconcile.ts +22 -5
  211. package/src/domains/dispatch/assignment-store.ts +151 -14
  212. package/src/domains/dispatch/capacity-lease.ts +98 -9
  213. package/src/domains/dispatch/contract.ts +26 -1
  214. package/src/domains/dispatch/delegation-plan.ts +2 -5
  215. package/src/domains/dispatch/execution-plan.ts +44 -4
  216. package/src/domains/dispatch/execution-role.ts +9 -1
  217. package/src/domains/dispatch/extension.ts +309 -96
  218. package/src/domains/dispatch/fleet-run.ts +78 -4
  219. package/src/domains/dispatch/gate-role-prompts.ts +38 -0
  220. package/src/domains/dispatch/heartbeat.ts +32 -8
  221. package/src/domains/dispatch/index.ts +6 -1
  222. package/src/domains/dispatch/intent-requirements.ts +40 -0
  223. package/src/domains/dispatch/intent.ts +84 -8
  224. package/src/domains/dispatch/orphan-recovery.ts +5 -0
  225. package/src/domains/dispatch/path-scope.ts +370 -0
  226. package/src/domains/dispatch/receipt-integrity.ts +2 -1
  227. package/src/domains/dispatch/reservation-store.ts +116 -8
  228. package/src/domains/dispatch/state.ts +4 -0
  229. package/src/domains/dispatch/types.ts +14 -7
  230. package/src/domains/dispatch/validation.ts +6 -3
  231. package/src/domains/dispatch/worker-spawn.ts +25 -11
  232. package/src/domains/dispatch/write-boundary-enforcer.ts +62 -0
  233. package/src/domains/dispatch/write-boundary.ts +262 -22
  234. package/src/domains/eval/artifacts/store.ts +62 -0
  235. package/src/domains/eval/compare/behavioral.ts +224 -0
  236. package/src/domains/eval/compare/compare.ts +355 -2
  237. package/src/domains/eval/compare/envelope.ts +128 -0
  238. package/src/domains/eval/compare/gates.ts +24 -6
  239. package/src/domains/eval/compare/thresholds.ts +30 -3
  240. package/src/domains/eval/execution-provenance.ts +240 -0
  241. package/src/domains/eval/metrics/aggregate.ts +136 -0
  242. package/src/domains/eval/metrics/call-ledger-stream.ts +112 -0
  243. package/src/domains/eval/metrics/evidence.ts +79 -2
  244. package/src/domains/eval/metrics/tracked.ts +413 -0
  245. package/src/domains/eval/provenance.ts +117 -0
  246. package/src/domains/eval/reports/comparison.ts +128 -0
  247. package/src/domains/eval/reports/junit.ts +17 -3
  248. package/src/domains/eval/reports/markdown.ts +3 -3
  249. package/src/domains/eval/reports/text.ts +14 -0
  250. package/src/domains/eval/run-compare.ts +20 -0
  251. package/src/domains/eval/runners/clio-run.ts +139 -2
  252. package/src/domains/eval/runners/external-command.ts +28 -3
  253. package/src/domains/eval/schema/adapter.ts +111 -0
  254. package/src/domains/eval/schema/artifact.ts +20 -0
  255. package/src/domains/eval/schema/behavioral-metrics.ts +204 -0
  256. package/src/domains/eval/schema/behavioral.ts +520 -0
  257. package/src/domains/eval/schema/execution-envelope.ts +194 -0
  258. package/src/domains/eval/schema/serving.ts +74 -0
  259. package/src/domains/eval/schema/suite.ts +38 -8
  260. package/src/domains/eval/schema/validate.ts +58 -3
  261. package/src/domains/eval/schema/verdict.ts +237 -0
  262. package/src/domains/eval/suites/resolve.ts +2 -0
  263. package/src/domains/eval/suites/run.ts +264 -33
  264. package/src/domains/eval/verifiers/command.ts +2 -1
  265. package/src/domains/eval/workspaces/temp-copy.ts +145 -13
  266. package/src/domains/evidence/build.ts +68 -21
  267. package/src/domains/evidence/eval.ts +2 -12
  268. package/src/domains/evidence/findings-markdown.ts +33 -0
  269. package/src/domains/evidence/index.ts +21 -0
  270. package/src/domains/evidence/provenance.ts +46 -11
  271. package/src/domains/evidence/run-trust.ts +7 -113
  272. package/src/domains/evidence/trust-projection.ts +274 -0
  273. package/src/domains/evidence/trust-status.ts +145 -17
  274. package/src/domains/evidence/types.ts +4 -0
  275. package/src/domains/extensions/compatibility.ts +285 -0
  276. package/src/domains/extensions/discovery.ts +126 -4
  277. package/src/domains/extensions/resources.ts +21 -9
  278. package/src/domains/extensions/state.ts +18 -5
  279. package/src/domains/extensions/types.ts +6 -1
  280. package/src/domains/lifecycle/doctor.ts +209 -2
  281. package/src/domains/memory/index.ts +14 -0
  282. package/src/domains/memory/task-bank-promotion.ts +64 -0
  283. package/src/domains/memory/task-memory-policy.ts +77 -8
  284. package/src/domains/memory/task-memory-spend.ts +131 -0
  285. package/src/domains/memory/task-memory-status.ts +7 -0
  286. package/src/domains/memory/task-memory-telemetry.ts +2 -0
  287. package/src/domains/middleware/index.ts +1 -0
  288. package/src/domains/middleware/memory-intervention.ts +69 -5
  289. package/src/domains/middleware/memory-step-endpoint.ts +71 -0
  290. package/src/domains/observability/background-memory-usage.ts +140 -0
  291. package/src/domains/observability/cost.ts +1 -1
  292. package/src/domains/observability/index.ts +7 -0
  293. package/src/domains/observability/out-of-turn-usage.ts +51 -2
  294. package/src/domains/observability/trace-store.ts +192 -2
  295. package/src/domains/prompts/compiler.ts +100 -13
  296. package/src/domains/prompts/contract.ts +3 -5
  297. package/src/domains/providers/endpoint-capacity.ts +96 -0
  298. package/src/domains/providers/extension.ts +30 -2
  299. package/src/domains/providers/index.ts +10 -0
  300. package/src/domains/providers/models/local-models/clio-local-coding-targets.yaml +243 -1
  301. package/src/domains/providers/runtime-resolution.ts +8 -1
  302. package/src/domains/providers/runtimes/common/probe-helpers.ts +31 -9
  303. package/src/domains/providers/runtimes/local-native/llamacpp-anthropic.ts +1 -1
  304. package/src/domains/providers/runtimes/local-native/llamacpp-completion.ts +1 -1
  305. package/src/domains/providers/runtimes/local-native/llamacpp-embed.ts +1 -1
  306. package/src/domains/providers/runtimes/local-native/llamacpp-rerank.ts +1 -1
  307. package/src/domains/providers/runtimes/local-native/llamacpp.ts +4 -1
  308. package/src/domains/providers/runtimes/local-native/lmstudio.ts +4 -1
  309. package/src/domains/providers/runtimes/local-native/ollama-native.ts +6 -1
  310. package/src/domains/providers/types/capability-flags.ts +2 -0
  311. package/src/domains/providers/types/target-descriptor.ts +2 -0
  312. package/src/domains/resources/common-loader.ts +3 -0
  313. package/src/domains/resources/prompts/loader.ts +184 -17
  314. package/src/domains/safety/call-target.ts +52 -0
  315. package/src/domains/safety/policy-engine.ts +5 -5
  316. package/src/domains/safety/run-effects.ts +96 -2
  317. package/src/domains/safety/scope.ts +7 -12
  318. package/src/domains/session/context-accounting.ts +52 -1
  319. package/src/domains/session/context-ledger.ts +37 -13
  320. package/src/domains/session/index.ts +6 -0
  321. package/src/domains/session/prompt-cache.ts +140 -0
  322. package/src/domains/session/prompt-manifest.ts +42 -0
  323. package/src/engine/acp/adapter.ts +18 -3
  324. package/src/engine/acp/server.ts +4 -1
  325. package/src/engine/ai.ts +35 -0
  326. package/src/engine/apis/llamacpp-residency.ts +55 -3
  327. package/src/engine/apis/lmstudio.ts +25 -5
  328. package/src/engine/apis/ollama-native.ts +2 -1
  329. package/src/engine/apis/openai-completions.ts +80 -17
  330. package/src/engine/apis/residency-lock.ts +3 -1
  331. package/src/engine/apis/residency.ts +34 -1
  332. package/src/engine/prompt-templates.ts +18 -1
  333. package/src/engine/provider-payload.ts +29 -1
  334. package/src/engine/worker-runtime.ts +6 -3
  335. package/src/entry/orchestrator.ts +176 -30
  336. package/src/interactive/chat-loop-messages.ts +26 -7
  337. package/src/interactive/chat-loop.ts +318 -41
  338. package/src/interactive/chat-panel.ts +62 -8
  339. package/src/interactive/clio-editor.ts +45 -8
  340. package/src/interactive/context-activity.ts +5 -1
  341. package/src/interactive/context-meter.ts +1 -1
  342. package/src/interactive/context-overlay.ts +40 -10
  343. package/src/interactive/cost-overlay.ts +64 -6
  344. package/src/interactive/dispatch-board.ts +127 -5
  345. package/src/interactive/fleet-run-preview.ts +41 -15
  346. package/src/interactive/handoff-round.ts +41 -2
  347. package/src/interactive/interactive-application.ts +24 -1
  348. package/src/interactive/interactive-event-projection.ts +14 -0
  349. package/src/interactive/interactive-input-runtime.ts +8 -0
  350. package/src/interactive/interactive-presentation.ts +4 -0
  351. package/src/interactive/interactive-shell.ts +20 -17
  352. package/src/interactive/interactive-slash-runtime.ts +27 -4
  353. package/src/interactive/memory-overlay.ts +8 -0
  354. package/src/interactive/mutation-preview.ts +295 -0
  355. package/src/interactive/overlay-general-openers.ts +16 -0
  356. package/src/interactive/overlay-key-routing.ts +38 -0
  357. package/src/interactive/overlay-lifecycle.ts +38 -5
  358. package/src/interactive/overlay-permission-lifecycle.ts +22 -2
  359. package/src/interactive/overlay-session-lifecycle.ts +73 -9
  360. package/src/interactive/overlays/ask-user.ts +91 -19
  361. package/src/interactive/overlays/help-reference.ts +4 -0
  362. package/src/interactive/overlays/prompts.ts +11 -1
  363. package/src/interactive/overlays/settings.ts +176 -48
  364. package/src/interactive/permission-hint.ts +34 -2
  365. package/src/interactive/permission-overlay.ts +159 -9
  366. package/src/interactive/prewarm.ts +197 -0
  367. package/src/interactive/render-trace.ts +162 -15
  368. package/src/interactive/renderers/tool-execution.ts +4 -0
  369. package/src/interactive/side-question.ts +58 -1
  370. package/src/interactive/slash-commands.ts +7 -2
  371. package/src/interactive/status/controller.ts +11 -0
  372. package/src/interactive/status/state-machine.ts +54 -2
  373. package/src/interactive/status/types.ts +7 -0
  374. package/src/interactive/terminal-lease.ts +2 -0
  375. package/src/interactive/turn-context.ts +299 -31
  376. package/src/interactive/turn-persistence.ts +14 -4
  377. package/src/interactive/turn-prewarm.ts +364 -0
  378. package/src/interactive/turn-queues.ts +7 -4
  379. package/src/interactive/turn-runtime.ts +8 -1
  380. package/src/interactive/turn-state.ts +23 -0
  381. package/src/interactive/view/artifacts.ts +42 -9
  382. package/src/interactive/view/view-overlay.ts +43 -6
  383. package/src/interactive/worker-receipts.ts +14 -2
  384. package/src/interactive/worker-stream.ts +8 -0
  385. package/src/tools/ask-user.ts +43 -2
  386. package/src/tools/dispatch-admission.ts +12 -13
  387. package/src/tools/dispatch-arguments.ts +27 -0
  388. package/src/tools/dispatch-plan.ts +46 -9
  389. package/src/tools/dispatch-runner.ts +48 -13
  390. package/src/tools/dispatch-scout.ts +1 -1
  391. package/src/tools/monitor.ts +13 -0
  392. package/src/tools/registry.ts +16 -0
  393. package/src/tools/worker-evidence.ts +19 -13
  394. package/src/worker/spec-contract.ts +2 -1
  395. package/dist/chunk-AOCYTWAV.js +0 -449
  396. package/dist/chunk-HWUFFB6L.js +0 -83
  397. package/dist/chunk-R346GLFC.js +0 -31
  398. package/dist/chunk-ZGH7FGS5.js +0 -1079
  399. package/dist/doctor-RN4YKO2X.js +0 -87
  400. package/dist/eval-RUBJVSNQ.js +0 -2557
@@ -1,6 +1,6 @@
1
1
  # Proactive task memory
2
2
 
3
- > **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).
3
+ > **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.9).
4
4
 
5
5
  Clio's proactive task memory protects long-running work from behavioral state
6
6
  decay: a requirement, environment fact, failed attempt, or diagnosis can still
@@ -120,7 +120,7 @@ malformed response, or telemetry failure is silent and never blocks a tool.
120
120
  - `memory.intervention.everyNTools` (default `10`): Minimum completed-tool interval between background interventions.
121
121
  - `memory.intervention.windowSteps` (default `8`): Completed tool-trajectory window analyzed during background evaluation.
122
122
  - `memory.intervention.maxTokens` (default `400`): Bounds the rendered memory-bank and reminder context budget; the policy model output cap is a separate fixed `4,000`-token contract in `task-memory-policy.ts`, sized so that a model which reasons anyway still reaches its envelope.
123
- - `memory.intervention.timeoutMs` (default `180000`): Wall-clock limit for one background memory-policy request. The step is detached, so this deadline never delays a turn; set it above the observed step time for your route or finished work is discarded as a timeout. Step latency on a small local route is long-tailed rather than tightly clustered, so size this off a high percentile and not off a median.
123
+ - `memory.intervention.timeoutMs` (default `30000`): Wall-clock limit for one background memory-policy request. The step is detached, so this deadline never delays a turn, but it does hold a request slot on a real inference endpoint that your own turns and your dispatched workers queue against. The default is what a turn boundary can wait for rather than what a long-tailed route eventually answers in: on the reference route below, 23 of 60 steps ran past 30 seconds and 531 of the measured 1,666 seconds were spent beyond that mark. Raise it only if you have measured that your route's slow steps are the ones producing reminders, and read the trade in "Cost and the default decision" first.
124
124
 
125
125
  ## Trigger semantics
126
126
 
@@ -203,6 +203,88 @@ Thus `last` remains `injected` across such continuations until a later
203
203
  tool-bearing or explicitly triggered memory step produces a new outcome (e.g.,
204
204
  a healthy tool leading to `silent`).
205
205
 
206
+ ## Cost and the default decision
207
+
208
+ The LLM tier costs real tokens, real seconds of model time, and a request slot on
209
+ a server that is usually the same machine the operator's own turns run on. Every
210
+ step is therefore accounted for the way a `/btw` side question is: one cost entry
211
+ under the `background-memory` label, which `/cost` shows as its own `memory steps`
212
+ row, and one durable row in `<stateDir>/usage/out-of-turn.jsonl` carrying the
213
+ usage, the call's duration, and the backend's prefill facts, which
214
+ `clio-coder usage report` folds after the process exits. `/memory` shows the
215
+ lifetime figures folded from `steps.jsonl`: steps, tokens, model time, and the
216
+ hit rate.
217
+
218
+ ### The measurement
219
+
220
+ From one operator's `steps.jsonl`, 274 rows spanning 2026-08-14 to 2026-08-29 on
221
+ a small local background route:
222
+
223
+ | Figure | Value |
224
+ | --- | --- |
225
+ | Model-tier steps | 60 |
226
+ | Tokens | 137,205 |
227
+ | Model time | 1,666.6 s |
228
+ | Step latency | median 18.7 s, p90 70.2 s, max 102.5 s |
229
+ | Injections produced by the model tier | 6 |
230
+ | Hit rate | 10.0 percent |
231
+ | Cost per injection | 22,868 tokens and 278 s of model time |
232
+ | Model-tier injections in the last 5 days | 0 of 4 steps |
233
+
234
+ Four further injections in the same window came from the free rules tier, so the
235
+ lifetime total of 10 injections is not the model tier's score. Rules-tier
236
+ injections cost nothing.
237
+
238
+ ### The decision
239
+
240
+ The default does not change, and it is a deliberate default rather than an
241
+ unexamined one:
242
+
243
+ - `memory.intervention.enabled` stays `true`. It runs the rules tier, which makes
244
+ no model calls, spends no tokens, and produced 4 of the 10 injections.
245
+ - The LLM tier stays opt-in through `background.target` and `background.model`,
246
+ which is already the case: an unset background role never resolves a client.
247
+ A 10 percent hit rate at 22,868 tokens per injection does not earn a default-on
248
+ position, and it is not so poor that it earns removal from an operator who has
249
+ measured their own route and wants it.
250
+ - The step deadline drops from 180 s to 30 s. This is the one behavioral change,
251
+ and it is a genuine trade: at 30 s, two of the six observed injections, at
252
+ 53.6 s and 57.7 s, would have been cut, while 531 s of the 1,666 s spent would
253
+ not have been spent at all. The deadline is the bound on what one optional call
254
+ may hold a shared local server for, not a prediction of when a route answers.
255
+ - A step that would run on the endpoint the chat target is streaming against is
256
+ skipped with reason `endpoint_busy`, and the skip is recorded. On a single-slot
257
+ llama.cpp router the alternative is queueing behind the operator's own decoding
258
+ or evicting the resident model, and neither is a cost an optional call may
259
+ impose.
260
+
261
+ ### What a background target costs on a shared local server
262
+
263
+ If `background.target` names the same server as `orchestrator.target`, that
264
+ server's slots are shared. On a llama.cpp router started with `--parallel 1`
265
+ there is exactly one, and the memory step and the operator's turn contend for it.
266
+
267
+ The consequence is worth stating plainly: a shared endpoint suppresses the model
268
+ tier rather than merely delaying it. A step is started from the `turn_end` hook,
269
+ which fires inside the streaming run at `agent_end`
270
+ (`src/interactive/turn-runtime.ts`), while the chat loop still holds its
271
+ foreground registration on that endpoint; the loop releases the hold afterwards,
272
+ in the `finally` around the run (`src/interactive/chat-loop.ts`). Every boundary
273
+ therefore finds the endpoint busy and records `dropped`/`endpoint_busy`. That is
274
+ the intended trade: an optional call may not take the one slot the operator's own
275
+ turn is using, and it may not make the server swap the resident model out. The
276
+ `/memory` step list and `steps.jsonl` say so on every boundary, so the tier is
277
+ visibly declining rather than quietly idle.
278
+
279
+ The second mechanism is an `expected cold` stamp, for the case where a step did
280
+ run on the chat endpoint. Its prompt is a trajectory rather than the chat prefix,
281
+ so the next turn's prefill is expected to be cold; `/context` names
282
+ `background_memory` as the reason instead of reporting an unexplained cold
283
+ prefix.
284
+
285
+ Pointing the background role at a second machine avoids both effects and is the
286
+ arrangement the tier is designed for.
287
+
206
288
  ## Choosing a background model
207
289
 
208
290
  Memory reads a trajectory and writes a fixed envelope. It does not plan, and it
@@ -257,7 +339,7 @@ memory:
257
339
  everyNTools: 10
258
340
  windowSteps: 8
259
341
  maxTokens: 400
260
- timeoutMs: 180000
342
+ timeoutMs: 30000
261
343
  ```
262
344
 
263
345
  With `background.target` and `background.model` unset, Clio stays in the
@@ -289,12 +371,12 @@ percentile of 79.9, and a 95th of 131.6. Capability is not the constraint;
289
371
  latency is, its spread is wide, and the detached step above is what makes the
290
372
  tier usable anyway.
291
373
 
292
- Size `timeoutMs` off that tail rather than off the median. The shipped 180000
293
- captures roughly the whole distribution on this route. A 20000 setting looks
294
- generous against an 18.6-second median and in practice discarded about half of
295
- all steps, since the request is aborted on timeout and its work is thrown
296
- away. A route whose steps mostly record `timeout` is a misconfigured deadline
297
- before it is a slow model.
374
+ The deadline is a bound on what an optional call may hold that server for, not a
375
+ figure sized to capture the tail. The shipped 30000 sits above the median and
376
+ below the tail deliberately, and a step that exceeds it records `timeout` with
377
+ its work discarded. A route whose steps mostly record `timeout` is a
378
+ misconfigured deadline before it is a slow model, so read the ledger before
379
+ raising it: `/memory` shows the hit rate the raise would be buying.
298
380
 
299
381
  The target ID is not hard-coded. Any configured orchestrator-eligible local
300
382
  target and wire model can fill the background role. Before enabling it, use the
@@ -316,6 +398,25 @@ For an immediate kill switch, set `memory.intervention.enabled` to `false` in
316
398
  `/settings`. Removing the background target instead returns to rules-only
317
399
  operation while leaving deterministic protection active.
318
400
 
401
+ ## Where what the tier writes ends up
402
+
403
+ A bank entry lives and dies with its session. When a reminder actually reaches
404
+ the operator, the entries it cited are also proposed into the durable store at
405
+ `<dataDir>/memory/records.json`, unapproved, scoped to the repository the session
406
+ is working in, with provenance naming the session and the source entry. That is
407
+ the one automatic writer of that file; everything else about it is unchanged.
408
+ `/memory` and `clio-coder memory list` show the proposal, and
409
+ `clio-coder memory approve <id>` is still a separate operator action, so nothing
410
+ the background plane produced reaches a system prompt without review. A step with
411
+ no session, or one running outside a canonical repository, proposes nothing:
412
+ global scope broadens applicability to every future session and is not a claim a
413
+ background step may make on the operator's behalf.
414
+
415
+ Rules-tier reminders are not proposed. Their entries are this middleware's own
416
+ one-line records of a repeated tool failure, and filing each one as a durable
417
+ lesson would fill the review queue with rows nobody asked for. They remain
418
+ promotable by hand from `/memory`.
419
+
319
420
  ## What the LLM tier actually writes
320
421
 
321
422
  Measured on the shipped prompt against `google/gemma-4-26b-a4b-qat`, across ten
@@ -392,11 +493,23 @@ keeps one previous generation as `steps.jsonl.1`. Every exact-schema record has:
392
493
  - `silent`, `injected`, `gated`, `timeout`, `malformed`, or `dropped` decision;
393
494
  - count of cited entries, input/output/total memory-model tokens, and latency.
394
495
 
395
- `dropped` is the one outcome that ran no step: the boundary triggered while an
396
- earlier step still held the single in-flight slot. It costs no tokens and no
397
- latency, its triggers survive to the next free boundary, and it does not replace
398
- the operator-visible last decision. Counting `dropped` rows against `llm` rows
399
- over a session is how a starved cadence becomes visible.
496
+ The same steps are also billed. See "Cost and the default decision" for the
497
+ `/cost` row, the durable out-of-turn usage row, and the lifetime figures `/memory`
498
+ folds out of this file.
499
+
500
+ `dropped` is the one outcome that ran no step. It has two causes, separated by
501
+ the row's reason: `step_in_flight` means the boundary triggered while an earlier
502
+ step still held the single in-flight slot, and `endpoint_busy` means the step
503
+ would have called the endpoint the chat target was streaming against. Both cost
504
+ no tokens and no latency, both leave their triggers pending for the next free
505
+ boundary, and neither replaces the operator-visible last decision. Counting
506
+ `dropped` rows against `llm` rows over a session is how a starved cadence becomes
507
+ visible.
508
+
509
+ A step that exceeds the deadline records `timeout`, never `silent`: reason
510
+ `deadline` when the policy's own race fired first, and `timed_out` when the
511
+ transport aborted at its deadline. Both are distinct from `client_error`, which
512
+ is a route that refused rather than a route that was slow.
400
513
 
401
514
  The log contains no task, trajectory, bank, error, or reminder text. File creation,
402
515
  rotation, serialization, and injected sinks are all best effort; a read-only
@@ -1,7 +1,7 @@
1
1
  # Prompt Envelope and Tools
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive dashboard is located at [docs/html/tools_blueprint.html](html/tools_blueprint.html) (Version: 0.3.7).
4
+ > **Interactive Spec Available:** An interactive dashboard is located at [docs/html/tools_blueprint.html](html/tools_blueprint.html) (Version: 0.3.9).
5
5
 
6
6
  Clio Coder keeps the model-facing envelope stable and moves enforcement into the runtime registry and safety policy.
7
7
 
@@ -13,6 +13,24 @@ The chat loop compiles one provider-facing system prompt for a session. The comp
13
13
 
14
14
  The compiled prompt is reused byte-for-byte on ordinary submits. It recompiles only when that key changes or when config hot-reload invalidates the prompt cache. Path-scoped project rules can therefore recompile the prompt when a matching file enters working context. When recompilation changes the text, the session ledger records a `promptRecompiled` entry with the previous hash, new hash, and token estimate.
15
15
 
16
+ ## Section order: stable prefix first
17
+
18
+ The compiled prompt lays its sections down in `SESSION_PROMPT_SECTION_ORDER` (`src/domains/prompts/compiler.ts`): identity, operating contract, delegation, skills, safety, tool contract, fleet, retrieval hints, project context, memory, runtime, then the operator-editable tail fragments (workspace root, Clio repo awareness, project rules, operator profile) in their own order.
19
+
20
+ One rule fixes that list. A section goes as late as its volatility, and anything that reads a clock, a probe, or a mutable store goes after everything that does not. Every backend Clio targets caches by exact prefix and re-prefills from the earliest changed byte, so a section that can change between two turns must not sit ahead of sections that cannot. The runtime block is last of the compiled sections because its `Context window: N` moves when the backend reloads a model or a co-residency clamp lands; memory sits just ahead of it because an approved memory record rewrites that section mid-session; project rules are dead last because path-scoped rules join the prompt when a matching file enters working context.
21
+
22
+ `Context window: N` is the window the backend will actually serve. A recorded loaded window outranks a probe, which reports a figure the target advertises without saying it is what is open, so a resumed session states the window its ledger measured rather than a re-probed server-wide number. Each prompt-manifest record carries that window and the layer that answered it (`contextWindow`, `contextWindowSource`) alongside a `version` for the prompt layout itself, so a recompile whose only cause was the window moving is explained by the record rather than inferred.
23
+
24
+ `PROMPT_MANIFEST_VERSION` (`src/domains/session/prompt-manifest.ts`) is `2` as of this release, and the reordering above is what moved it. The field is additive: a record written by 0.3.8 carries no `version` and reads back as version 1, so a `prompt-manifest.jsonl` from an older session still parses. The rule for the field is that it tracks the layout rather than the inputs. Bump it when the compiled text moves for a reason other than a changed fragment, a changed tool surface, or a changed setting, so that a resumed session has the version in hand to explain the single `promptRecompiled` entry its first compile writes.
25
+
26
+ ### What not to add to the prefix
27
+
28
+ Two additions look free and are not.
29
+
30
+ The first is a terseness rule. It is tempting to cap the prose a model emits between tool calls, because that text is generated tokens on every hop of a long turn. Anthropic measured that exact change on Claude Code and reported a 3 percent quality regression, so a word-count or verbosity limit on inter-tool text is a bad trade: the tokens it saves are the cheapest ones in the turn, and the model's own narration of what it is about to do is load-bearing for what it then does. Bound tool results instead, where a single `grep` can cost thousands of tokens and the envelope caps already do the work.
31
+
32
+ The second is anything that varies with the wall clock or the working tree. No timestamp, no `git status`, no branch name, no session id, and no run id belongs anywhere in the compiled prefix. Every backend Clio targets caches by exact prefix and re-prefills from the earliest changed byte, so one such field turns the whole prompt into a cache miss on every turn for no information the model could not have asked a tool for. On the sprint's measurement server that is a whole 2,778-token prompt re-prefilled at 2.6 s where the same change behind the stable sections cost 516 tokens and 0.72 s. Volatile facts belong in the user message, in a tool result, or in the runtime block, which is last for this reason.
33
+
16
34
  The disk fragments under `src/domains/prompts/fragments/` are layered by who reads them. `identity.clio` and `operating.contract` are constitutional: they render for every reader, name no tool, and state what is always true about Clio and her harness. `operating.delegation` (fleet coordination, receipts, spot-checks, shared `[worker result]` notes) renders only when `dispatch` is on the session's tool surface, and `operating.skills` (skill-shaped tasks, `/skill <name>` suggestions) only when `context` is; a fragment that teaches a tool is absent when the tool is, the same rule the Fleet block follows. `identity.docs-routing`, the directive to call `context(scope="docs")` before answering a question about Clio herself, follows the `context` gate too, while `identity.self-awareness` (installed paths, code outranks docs, configuration locations) names no tool and is unconditional. `operating.worker` (the assigned-task contract) renders only for dispatched workers, which never see the coordinator fragments. `safety.<level>` states what runs, what is approval-required, and what is blocked at the effective autonomy, in the safety net's action-class vocabulary (read, write, command, `system_modify`, `git_destructive`) and never by tool name, so the same body is true on every surface; the session and every worker read that one body, and what "approval-required" resolves to is the only role text (one operator confirmation for the session, the worker's `onPermission` routing for a worker).
17
35
 
18
36
  Prompt extensions can add dynamic fragments for project rules, the operator profile, and Clio source-tree awareness. Pending skill requests and middleware reminders are visible text in the user message, not hidden prompt machinery.
@@ -21,7 +39,9 @@ Prompt extensions can add dynamic fragments for project rules, the operator prof
21
39
 
22
40
  Prompt templates expand into the operator's user message before submission. They do not alter the compiled system prompt or bypass the trust check on project-scope compatibility roots. The prompt-root locations, frontmatter fields, and trust rules are documented in [extensions-and-sharing.md](extensions-and-sharing.md#prompt-templates).
23
41
 
24
- Arguments after `/template-name` use shell-style command argument parsing. Single or double quotes keep spaces inside one argument. The template body may use `$1` through `$9` for positional arguments, `$@`, and `$ARGUMENTS` for every parsed argument joined with spaces, as well as argument slices. A positional placeholder with no matching argument expands to an empty string. Template names that collide with built-in slash commands fail closed with a diagnostic and are excluded from `/prompts`.
42
+ The first whitespace character after `/template-name` is the command delimiter; CRLF counts as one delimiter. Leading whitespace before the slash is also command framing. Every byte after that delimiter is the argument payload, including leading or trailing whitespace, repeated spaces, tabs, quotes, and line breaks.
43
+
44
+ The template body may use `$ARGUMENTS` to insert that raw payload byte-for-byte. Raw insertion is not recursively substituted, so placeholder-like text such as `$1` remains data. `$1` through `$9`, `$@`, `${@:N}`, and `${@:N:L}` retain shell-style parsing: single or double quotes group spaces within one argument, `$@` joins all parsed arguments with single spaces, `${@:N}` selects parsed arguments from one-based position `N`, and `${@:N:L}` selects `L` arguments beginning there. A positional placeholder with no matching argument expands to an empty string. Template names that collide with built-in slash commands fail closed with a diagnostic and are excluded from `/prompts`.
25
45
 
26
46
  ## Directory-scoped handbook overrides
27
47
 
@@ -1,7 +1,7 @@
1
1
  # Provider Adapter Cookbook
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive runtime adapter descriptor builder and probe sequence capability checklist is located at [docs/html/provider_adapter_blueprint.html](html/provider_adapter_blueprint.html) (Version: 0.3.7).
4
+ > **Interactive Spec Available:** An interactive runtime adapter descriptor builder and probe sequence capability checklist is located at [docs/html/provider_adapter_blueprint.html](html/provider_adapter_blueprint.html) (Version: 0.3.9).
5
5
 
6
6
  This cookbook guides developers through implementing custom model runtimes and inference server integrations within Clio Coder. It explains the runtime descriptor interfaces, probing protocols, model synthesis, and how to configure reasoning and thinking behaviors.
7
7
 
@@ -1,6 +1,6 @@
1
- # v0.3.7 Release-Cut Checklist
1
+ # v0.3.8 Release-Cut Checklist
2
2
 
3
- The ordered steps that turn the prepared `v0.3.7` branch into a published
3
+ The ordered steps that turn the prepared `v0.3.8` branch into a published
4
4
  release. Everything above the line marked **AUTHORIZATION BOUNDARY** is
5
5
  repeatable and reversible and is run locally before the cut. Everything below
6
6
  it is external or irreversible and needs an explicit decision from the
@@ -11,16 +11,17 @@ state of every step.
11
11
 
12
12
  | Item | State |
13
13
  | --- | --- |
14
- | Branch | `v0.3.7`, pushed to `origin` under the explicit refspec `refs/heads/v0.3.7`; sixteen feature and docs commits, the version-bump commit, and the fix commits the interactive release testing produced, ahead of `main` |
15
- | `package.json` version | `0.3.7`; the top `CHANGELOG.md` heading is `## 0.3.7 - 2026-08-24` |
16
- | `main` | `9b54219d`, the v0.3.6 release SHA; it is an ancestor of `v0.3.7` and moves only at Part 4 |
17
- | `origin/main` | `9b54219d`, matching `main` |
18
- | Tags | `v0.3.6` exists on `9b54219d`; none for 0.3.7, local or remote |
19
- | GitHub Release | `v0.3.6` published 2026-08-24; none for 0.3.7 |
20
- | npm registry | `@iowarp/clio-coder@0.3.7` absent; `latest` is `0.3.6` |
21
- | npm history | Published versions 0.3.0 through 0.3.4 and 0.3.6. Version 0.3.5 was published and withdrawn and can never be reused. |
22
- | Milestone | `v0.3.7` holds the thirteen issues this branch closes (#155, #204, #206 through #216); the ten off-map items (#156, #158 through #164, #198, #199) moved to `v0.3.8` on 2026-08-24 |
23
- | Commit provenance identity | Post-release maintainer follow-up, not a gate: verifying `clio-coder@iowarp.ai` on IOWarp-controlled GitHub and GitLab identities (such as `clio-coder-bot` or `iowarp-clio`, with `assets/clio-coder-avatar-512.png` as the avatar) only changes how those platforms render the trailers. |
14
+ | Branch | After the release-cut evidence commit, `v0.3.8` is 30 commits ahead of `main`: the 29-commit candidate through `9b7b80cc` plus the final documentation and verification-evidence commit. The candidate includes the original implementation, the four release-test fixes (#233, #235, #238, #239), the WTF-P extension-resource merge, the `$ARGUMENTS` fidelity fix (#240), and the extension-agent resolution fix (#241). `origin/v0.3.8` remains at `af6546b2`, 17 commits behind the final local tip. |
15
+ | `package.json` version | `0.3.8`; `package-lock.json` agrees at both version fields; the top changelog heading is `## 0.3.8 - 2026-08-29`. |
16
+ | `main` | `598be99c`, the v0.3.7 release SHA; it is an ancestor of the final `v0.3.8` candidate and moves only at Part 4. |
17
+ | `origin/main` | `598be99c`, matching local `main` and still an ancestor of the final candidate. |
18
+ | Tags | `v0.3.7` exists on `598be99c`; no `v0.3.8` tag exists locally or remotely. The redundant `wtfp-safety` tag was deleted. The eight local `tmp-032-*` recovery tags remain and must never be pushed. |
19
+ | GitHub Release | `v0.3.7` is published; no GitHub Release exists for `v0.3.8`. |
20
+ | npm registry | `@iowarp/clio-coder@0.3.8` is absent; `latest` is `0.3.7`; the 0.3.8 dist-tag is undecided. |
21
+ | npm history | Published versions are 0.3.0 through 0.3.4, 0.3.6, and 0.3.7. Version 0.3.5 was published and withdrawn and can never be reused. |
22
+ | Milestone | `v0.3.8` has six open issues, all fixed on the branch: #233, #235, #238, #239, #240, and #241. They close from their `Fixes` trailers when the final candidate reaches `main`. |
23
+ | Interactive release test | The original three-round report is `docs/release-notes/v0.3.8-release-test.md` (57 PASS / 8 FAIL / 3 PARTIAL / 6 OBSERVATION / 2 NOT RUN). The continuation is `docs/release-notes/v0.3.8-verification.md` (44 PASS / 6 non-blocking FAIL / 7 OBSERVATION / 1 NOT RUN), which closes the blocker, verifies the three later merges, and carries the final `CUT` verdict. |
24
+ | Commit provenance identity | Still a post-release maintainer follow-up rather than a release gate; unchanged from 0.3.7. |
24
25
 
25
26
  ---
26
27
 
@@ -38,8 +39,14 @@ Run against the exact final candidate with `NO_COLOR` unset and
38
39
  7. `npm run ci` (runs 1 through 6)
39
40
  8. `npm run ci:release` (7 plus `scripts/check-release.mjs`: dist shebang
40
41
  integrity, version coherence between `package.json` and the top
41
- `CHANGELOG.md` heading, the forbidden-file list, the required runtime
42
- resources, and the tarball and unpacked size budgets)
42
+ `CHANGELOG.md` heading, the deterministic 26-scenario behavioral machinery
43
+ corpus against its checked baseline, the forbidden-file list, the required
44
+ runtime resources, and the tarball and unpacked size budgets). A baseline
45
+ mismatch prints reviewable evidence and names prompt- or recipe-affected
46
+ corpus results. For an intentional change, inspect that diff, run
47
+ `node benchmarks/eval/check-behavioral-release.mjs --update` (with `TMPDIR` on a disk-backed path if `/tmp` is a small tmpfs),
48
+ review `benchmarks/eval/behavioral-machinery-baseline.json`, and commit it
49
+ with the change.
43
50
  9. Optional: step 8 again under Node 24. Hosted CI gates on Node 22 alone,
44
51
  the `engines` floor; the weekly `flake-hunt` workflow carries Node 24.
45
52
  Repeat locally only when the cut touches runtime-sensitive code.
@@ -57,7 +64,17 @@ Run against the exact final candidate with `NO_COLOR` unset and
57
64
  12. Install that tarball into a clean temporary prefix with an empty
58
65
  `CLIO_CODER_HOME` and verify `--version`, `--help`, an empty-state non-TTY
59
66
  launch, `doctor`, and `uninstall --dry-run` without developer-local state.
60
- 13. Interactive release testing, which this cut added because the release is
67
+ 13. Before interactive release testing, run the model-required public
68
+ behavioral corpus manually against the release target and built CLI:
69
+ `node dist/cli/index.js eval run --suite benchmarks/eval/behavioral-model.yaml --target mini --clio-coder-entry dist/cli/index.js`
70
+ and
71
+ `node dist/cli/index.js eval run --suite benchmarks/eval/behavioral-model-negative-control.yaml --target mini --clio-coder-entry dist/cli/index.js`.
72
+ Retain both Artifact v4 files as release evidence. The positive corpus must
73
+ report its scenario and role rows without an undeclared envelope mismatch;
74
+ the negative control must still record violated exploration and safety
75
+ labels. These model-dependent runs are manual and are never required by
76
+ ordinary deterministic CI. Continue with interactive release testing,
77
+ which this cut added because the release is
61
78
  almost entirely interactive surface: a tester agent drives the step-12
62
79
  install through real TUI sessions in a throwaway repository, one session
63
80
  per shipped feature, against local targets for the main session and a
@@ -69,35 +86,37 @@ Run against the exact final candidate with `NO_COLOR` unset and
69
86
  ## Part 2: version and notes (repeatable)
70
87
 
71
88
  14. Files carrying a version reference, to update together if the number
72
- changes: `package.json` and `package-lock.json`, the `## 0.3.7 - <date>`
73
- heading in `CHANGELOG.md`, the `(Version: 0.3.7)` markers in `docs/*.md`,
74
- the `Blueprint (v0.3.7)` titles in `docs/html/*.html`, the `--branch`
89
+ changes: `package.json` and `package-lock.json`, the `## 0.3.8 - <date>`
90
+ heading in `CHANGELOG.md`, the `(Version: 0.3.8)` markers in `docs/*.md`,
91
+ the `Blueprint (v0.3.8)` titles in `docs/html/*.html`, the `--branch`
75
92
  pin in the README install block (the hygiene lint checks it), and the
76
93
  measured-at figures in `scripts/check-release.mjs` if the package size
77
94
  moved materially. For 0.3.7 the tarball measured 6.5 MB packed and
78
- 37.9 MB unpacked, inside the 10 MB and 50 MB ceilings set for 0.3.6.
79
- 15. Confirm the `## 0.3.7` section of `CHANGELOG.md` describes every
95
+ 37.9 MB unpacked; re-measure for 0.3.8, inside the 10 MB and 50 MB ceilings set for 0.3.6.
96
+ 15. Confirm the `## 0.3.8` section of `CHANGELOG.md` describes every
80
97
  user-visible behavior change under `### Added`, and every change to an
81
98
  existing behavior under `### Changed`, and carries no Workbench release
82
99
  narrative. The release workflow uses this section verbatim as the GitHub
83
100
  Release body.
84
101
  16. `docs/artifact-versions.md` lists every persisted artifact this release
85
- added or re-versioned: run receipt integrity v19, fleet contract v5, the
86
- fleet run record, the checkout writer lease, the out-of-turn usage ledger,
87
- and the library pin file.
102
+ added or re-versioned. For 0.3.8 that is run receipt integrity v20, which
103
+ adds `pathProvenance` on dispatch intent and the resolved `pathScope`, and
104
+ whose entry must also record that a receipt below v20 is reported as
105
+ retired rather than invalid, and the durable assignment record, which now
106
+ carries its owner pid, process birth token, and acquisition time.
88
107
  17. Re-run `npm run ci:release` after any version edit and commit as one
89
- commit on `v0.3.7`.
108
+ commit on `v0.3.8`.
90
109
 
91
110
  ## Part 3: present the gate
92
111
 
93
- 18. Report to the operator before touching `main`: the exact final `v0.3.7`
112
+ 18. Report to the operator before touching `main`: the exact final `v0.3.8`
94
113
  SHA and clean status, the commits added since the handoff SHA, the gate
95
114
  commands with pass/fail totals, the package version and changelog heading,
96
115
  the tarball audit, the clean-install results, the interactive test table,
97
116
  and any deferred live check, confirmation that no tag, GitHub Release, or
98
117
  npm version exists yet, the proposed commands for Parts 4 through 6, and
99
118
  the npm dist-tag. The dist-tag is the operator's call; for 0.3.7 the
100
- operator chose `latest` on 2026-08-24.
119
+ operator chose `latest` on 2026-08-24; 0.3.8's dist-tag is undecided.
101
120
 
102
121
  ---
103
122
 
@@ -110,35 +129,35 @@ confirming the exact SHA and the commands.
110
129
  ## Part 4: fast-forward `main`
111
130
 
112
131
  19. `git fetch origin` immediately before integrating; require `origin/main`
113
- to be an ancestor of the reviewed `v0.3.7` tip and confirm no other
132
+ to be an ancestor of the reviewed `v0.3.8` tip and confirm no other
114
133
  worktree has `main` checked out.
115
- 20. `git checkout main && git merge --ff-only v0.3.7`. No merge commit, no
134
+ 20. `git checkout main && git merge --ff-only v0.3.8`. No merge commit, no
116
135
  rebase, no reset. Verify `main` equals the reviewed SHA and is clean.
117
136
  21. `git fetch origin` once more; stop on any unexpected remote movement. Then
118
137
  `git push origin main`. Never `--force` or `--force-with-lease`. The push
119
- closes the thirteen milestone issues through their `Fixes` trailers.
138
+ closes the six milestone issues through their `Fixes` trailers.
120
139
 
121
140
  ## Part 5: exact-SHA CI, tag, GitHub Release
122
141
 
123
- 22. The `main` push triggers the `ci` workflow. It is a useful signal but not
124
- a gate on tagging, because `release.yml` runs the same gate on the tagged
125
- tree itself. A red run still blocks the cut; investigate it rather than
142
+ 22. The `main` push triggers the `ci` workflow. Require that exact-SHA run to
143
+ finish green before tagging; `release.yml` then runs the same gate again on
144
+ the tagged tree itself. A red run blocks the cut: investigate it rather than
126
145
  tagging around it, and never silence a flake with an unrelated change.
127
- 23. Reconfirm that tag `v0.3.7` and the GitHub Release do not exist, then
128
- `git tag -a v0.3.7 -m "Clio Coder 0.3.7"` on the green SHA and
129
- `git push origin refs/tags/v0.3.7`.
146
+ 23. Reconfirm that tag `v0.3.8` and the GitHub Release do not exist, then
147
+ `git tag -a v0.3.8 -m "Clio Coder 0.3.8"` on the green SHA and
148
+ `git push origin refs/tags/v0.3.8`.
130
149
  24. The tag push triggers `.github/workflows/release.yml`, which verifies the
131
150
  tag matches `package.json`, runs `npm run ci:release` on the tagged tree,
132
- extracts the `## 0.3.7` section of `CHANGELOG.md` as the release body, and
151
+ extracts the `## 0.3.8` section of `CHANGELOG.md` as the release body, and
133
152
  attaches the tarball. Do not create a release by hand. Verify the run's
134
153
  SHA, the notes, the attached tarball, and the URL.
135
154
 
136
155
  ## Part 6: npm publication (irreversible)
137
156
 
138
157
  25. `npm whoami` and confirm the registry and account; reconfirm
139
- `@iowarp/clio-coder@0.3.7` is still absent.
158
+ `@iowarp/clio-coder@0.3.8` is still absent.
140
159
  26. Obtain the operator's explicit dist-tag decision. `latest` makes this the
141
- default install for every user; `--tag next` keeps `0.3.6` as the default.
160
+ default install for every user; `--tag next` keeps `0.3.7` as the default.
142
161
  27. Run `npm publish` once. `prepublishOnly` re-runs `ci:release` as a safety
143
162
  net; it is not a substitute for Part 1.
144
163
  28. A published version cannot be replaced. `npm unpublish` is restricted and
@@ -146,13 +165,13 @@ confirming the exact SHA and the commands.
146
165
 
147
166
  ## Part 7: post-publish verification and follow-ups
148
167
 
149
- 29. `npm view @iowarp/clio-coder@0.3.7` and the selected dist-tag.
168
+ 29. `npm view @iowarp/clio-coder@0.3.8` and the selected dist-tag.
150
169
  30. On a clean machine, `npm install -g @iowarp/clio-coder` from the registry
151
170
  rather than from a local tarball, then repeat step 12 against it, plus
152
171
  `configure` to a real target and one real turn when one is authorized.
153
172
  This is the only step that tests what users actually receive.
154
- 31. From an installation of 0.3.6, verify `clio-coder upgrade` finds and
155
- applies 0.3.7.
173
+ 31. From an installation of 0.3.7, verify `clio-coder upgrade` finds and
174
+ applies 0.3.8.
156
175
  32. Record the SHA, CI URL, tag, GitHub Release URL, npm version and dist-tag,
157
176
  tarball evidence, and the post-publish verification in the release report.
158
177
  33. Maintainer follow-up, independent of the release: verify the commit
@@ -1,7 +1,7 @@
1
1
  # Clio Coder Safety Model
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive dashboard is located at [docs/html/safety_blueprint.html](html/safety_blueprint.html) (Version: 0.3.7).
4
+ > **Interactive Spec Available:** An interactive dashboard is located at [docs/html/safety_blueprint.html](html/safety_blueprint.html) (Version: 0.3.9).
5
5
 
6
6
  Clio Coder's safety posture is code-enforced, not prompt-only. As the orchestrator coding agent in the [IOWarp](https://iowarp.ai) ecosystem developed by the [Gnosis Research Center](https://grc.iit.edu) at Illinois Tech under NSF Award [#2411318](https://www.nsf.gov/awardsearch/showAward?AWD_ID=2411318), Clio gates execution by target capabilities, the tool registry, the safety policy engine, project policies, protected-artifact checks, and audit receipts.
7
7
 
@@ -1,7 +1,7 @@
1
1
  # Clio Coder Scientific Validation Contracts
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive numerical tolerance calculator and HPC queue execution simulator is located at [docs/html/validation_blueprint.html](html/validation_blueprint.html) (Version: 0.3.7).
4
+ > **Interactive Spec Available:** An interactive numerical tolerance calculator and HPC queue execution simulator is located at [docs/html/validation_blueprint.html](html/validation_blueprint.html) (Version: 0.3.9).
5
5
 
6
6
  Scientific software development cannot treat simple file presence as proof of correctness. A simulation script that crashes on rank 48, or writes out NetCDF arrays filled with `NaN`s, may still successfully write a file to the disk.
7
7
 
@@ -1,7 +1,7 @@
1
1
  # Skills Marketplace
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive dashboard is located at [docs/html/skills_blueprint.html](html/skills_blueprint.html) (Version: 0.3.7).
4
+ > **Interactive Spec Available:** An interactive dashboard is located at [docs/html/skills_blueprint.html](html/skills_blueprint.html) (Version: 0.3.9).
5
5
 
6
6
  The Skills Hub (`/skill`) shows project skills, user skills, and the marketplace. Every marketplace row comes from the same local lookup that `clio-coder skills install <name>` and `/skill <name>` resolve through, so the hub lists nothing it cannot install.
7
7
 
@@ -1,7 +1,7 @@
1
1
  # Tool Usage Reference
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive seven-plane tool atlas and observation envelope truncation/offload calculator is located at [docs/html/tool_usage_blueprint.html](html/tool_usage_blueprint.html) (Version: 0.3.7).
4
+ > **Interactive Spec Available:** An interactive seven-plane tool atlas and observation envelope truncation/offload calculator is located at [docs/html/tool_usage_blueprint.html](html/tool_usage_blueprint.html) (Version: 0.3.9).
5
5
 
6
6
  This is the deep usage reference behind the deliberately terse tool descriptions in the prompt envelope. Toolkit v2 keeps rich guidance out of tool descriptions and puts it here, where `context(scope="docs", query=...)` retrieves it section by section. Each tool below has its own self-contained `##` section covering the argument surface, defaults, truncation and continuation behavior, and concrete calls. Source of truth is `src/tools/`.
7
7
 
@@ -1,7 +1,7 @@
1
1
  # Trace store contract
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive trace database viewer, schema inspector, and SQL query validator simulator is located at [docs/html/trace_blueprint.html](html/trace_blueprint.html) (Version: 0.3.7).
4
+ > **Interactive Spec Available:** An interactive trace database viewer, schema inspector, and SQL query validator simulator is located at [docs/html/trace_blueprint.html](html/trace_blueprint.html) (Version: 0.3.9).
5
5
 
6
6
  Clio's trace database is a rebuildable, queryable mirror. Receipts, session
7
7
  ledgers, gate artifacts, and evidence remain the source of truth. Removing
@@ -26,6 +26,93 @@ This guide provides concrete, actionable remediation procedures for operational
26
26
 
27
27
  ---
28
28
 
29
+ ## Reading a cold cache
30
+
31
+ On a local server prefill is most of what a turn costs, so a cold prefix cache is the difference between a first token in under a second and one in fifty. This is how to find out why a turn went cold, starting from what the TUI shows.
32
+
33
+ **1. Read the `/context` cache lines.** Two lines answer different questions. The prompt-cache line says what the provider reported and whether the compiled prompt shell was reused. The prefill line says what the server itself did:
34
+
35
+ ```text
36
+ prefill: 34,951 uncached · 0 cached · 48,617 ms
37
+ ```
38
+
39
+ Those are the server's own numbers, not Clio's estimate. `server does not report cache reads` in place of the cached figure means the backend gave no `cache_n` at all, which is LM Studio 2.29.0's OpenAI-compatible port today; on that target the verdict comes from the provider's `cached_tokens` instead and the prefill line reports only total prompt work and milliseconds.
40
+
41
+ **2. Look for the expected-cold line.** When the last settled run came back `cold` and Clio had recorded a cause, `/context` names it rather than warning:
42
+
43
+ ```text
44
+ last cold turn: working-set eviction (expected)
45
+ ```
46
+
47
+ The eight causes and what stamps each one are in [context-engine.md](context-engine.md#cache-divergence-honesty). `background_memory` renders in prose as `last cold turn: background memory step (expected)`.
48
+
49
+ **3. Confirm it in the ledger.** The reasons are durable, so a finished session answers the same question without the TUI. Open `current.jsonl` under the session directory `clio-coder paths` reports and read the run's first assistant entry:
50
+
51
+ ```json
52
+ {
53
+ "timing": { "ttftMs": 53194, "apiMs": 56770 },
54
+ "promptCache": {
55
+ "input": 34951, "cacheRead": 0, "cacheWrite": 0,
56
+ "backendVerdict": "cold",
57
+ "expectedColdReasons": ["dispatch", "residency"],
58
+ "backend": {
59
+ "promptTokens": 34951, "cachedTokens": 0, "predictedTokens": 24,
60
+ "promptMs": 48617, "predictedMs": 373, "source": "llamacpp-timings"
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ `expectedColdReasons` is stamped once per run, on its first persisted call, so a turn with several model calls carries it on the first one only. `clio-coder doctor` folds the latest session for you and prints the verdict counts plus the most frequent reason, and `clio-coder usage report` gives per-session uncached prefill and verdict counts across the window.
67
+
68
+ **4. When there is no reason, the warning is the finding.** A cold backend with a reused prompt shell and no recorded reason is a real disagreement: Clio kept the bytes stable and the server re-prefilled anyway. `/context` leaves the warning in place for exactly that case. Four causes are worth checking in order, and none of them is a Clio bug:
69
+
70
+ - **The server slept.** A llama.cpp router started with `--sleep-idle-seconds N` drops the slot's prefix cache when it sleeps, and `--cache-ram` does not reliably restore a large state. A gap longer than that setting between two turns explains a cold turn completely. Raise the flag, or accept that a session left idle pays for its first turn back.
71
+ - **Something else used the endpoint.** A worker, a second Clio session, or another client on the same server evicts the slot. Clio stamps `dispatch`, `residency`, and `background_memory` only for work it can attribute to itself on that endpoint; a foreign process leaves no stamp. `clio-coder targets --probe` reports the endpoint's slot count, and `/fleet` settings show active slots per endpoint.
72
+ - **The model was swapped.** A router serving one model at a time reloads on a residency change, and everything the previous model had cached is gone. This normally does stamp `residency`, but only when the mutation went through Clio.
73
+ - **The prompt moved for a reason Clio did not classify.** Compare the run's `promptHash` and `toolSignature` in `context-snapshots.jsonl` against the previous run's. Equal hashes with a cold backend point at the server; different hashes with no `prompt_recompiled` or `tool_surface_change` stamp is worth an issue.
74
+
75
+ One case is expected on hybrid architectures and looks like a bug. Qwen3.8 keeps recurrent state that llama.cpp cannot roll back to an arbitrary token, so a change anywhere inside a cached prefix re-prefills from the last context checkpoint rather than from the changed byte. A small edit to old history can therefore cost thousands of tokens of prefill with the prompt hash otherwise stable. The server's checkpoint count and its `--checkpoint-min-step` are the levers; see the `qwen3.8-27b` family's `serving` and `measuredUnder` notes in `src/domains/providers/models/local-models/clio-local-coding-targets.yaml` for the measured figures and the exact argv they were taken under.
76
+
77
+ ---
78
+
79
+ ## A TUI that stops answering the keyboard
80
+
81
+ When an interactive session stops responding to typing, the question worth
82
+ answering before anything else is which half of the input pipeline stopped: the
83
+ stdin reader that hands bytes to the application, or the renderer that turns
84
+ them into a frame on stdout. Clio keeps that evidence without being asked. Every
85
+ interactive process holds a bounded in-memory ring of the last 256 input-ingress
86
+ records and the last 256 committed frames, and writes it out when the process
87
+ receives `SIGTERM`, which is the signal a `kill` of the stuck pane sends.
88
+
89
+ The dump lands in the state directory `clio-coder paths` reports:
90
+
91
+ ```text
92
+ <stateDir>/input-wedge/<ISO timestamp>-<pid>.json
93
+ ```
94
+
95
+ The five newest dumps are kept and older ones are removed as new ones land.
96
+ Read `classification` first:
97
+
98
+ | `classification` | What it means |
99
+ | :--- | :--- |
100
+ | `input-not-committed` | Bytes reached the application and no frame carrying them ever reached stdout. The renderer is the stuck half. |
101
+ | `no-input-recorded` | Nothing was delivered at all. If the operator was typing, the stdin reader is the stuck half. |
102
+ | `input-committed` | Both halves were moving. Whatever the session was doing, it was not this pipeline. |
103
+
104
+ `msSinceLastInputIngress` and `msSinceLastCommittedFrame` say how long each half
105
+ had been quiet when the signal arrived, and the `inputIngress` and `frames`
106
+ arrays carry the records themselves. Frames are kept only when they reached
107
+ stdout, so an empty `frames` array is itself a finding.
108
+
109
+ For a full session trace rather than the tail, set `CLIO_CODER_RENDER_TRACE` to
110
+ a file path before starting the session. That writes every record, including
111
+ provider deltas and terminal writes, as JSONL. The ring is the always-on subset
112
+ of the same records, for the case where nobody armed the trace first.
113
+
114
+ ---
115
+
29
116
  ## Diagnostic Commands
30
117
 
31
118
  When encountering unexpected system behavior:
@@ -1,7 +1,7 @@
1
1
  # Clio TUI Design System
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive color/glyph token laboratory and terminal transcript preview renderer is located at [docs/html/tui_design_blueprint.html](html/tui_design_blueprint.html) (Version: 0.3.7).
4
+ > **Interactive Spec Available:** An interactive color/glyph token laboratory and terminal transcript preview renderer is located at [docs/html/tui_design_blueprint.html](html/tui_design_blueprint.html) (Version: 0.3.9).
5
5
 
6
6
  This document is the reference specification for the Clio Coder TUI visual layout, styling, and behavior. It describes color semantics, the glyph vocabulary, structural recipes, and state choreography for all surfaces under [src/interactive/](../src/interactive/).
7
7
 
@@ -1,7 +1,7 @@
1
1
  # Worker Dispatch Mechanics
2
2
 
3
3
  > [!TIP]
4
- > **Interactive Spec Available:** An interactive NDJSON protocol timeline stream and heartbeat watchdog simulator is located at [docs/html/worker_dispatch_blueprint.html](html/worker_dispatch_blueprint.html) (Version: 0.3.7).
4
+ > **Interactive Spec Available:** An interactive NDJSON protocol timeline stream and heartbeat watchdog simulator is located at [docs/html/worker_dispatch_blueprint.html](html/worker_dispatch_blueprint.html) (Version: 0.3.9).
5
5
 
6
6
  This document describes the design and lifecycle of Clio Coder dispatched workers, focusing on the spawning sequence, execution isolation, the standard input/output NDJSON communication loop, and permission escalation routing.
7
7