carthagent 0.0.0-stage → 1.1.0-preview.12

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 (591) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +220 -2
  3. package/bin/ctg.mjs +18 -0
  4. package/docs/budgets.md +72 -0
  5. package/docs/compaction.md +34 -0
  6. package/docs/context-efficiency-plan.md +24 -0
  7. package/docs/context-efficiency-review.md +27 -0
  8. package/docs/context-efficiency.md +49 -0
  9. package/docs/deepseek-jev-benchmark-plan.md +70 -0
  10. package/docs/deepseek-jev-benchmark-repair-plan.md +20 -0
  11. package/docs/deepseek-jev-benchmark-restart.md +9 -0
  12. package/docs/deepseek-jev-benchmark-results.md +77 -0
  13. package/docs/deepseek-jev-benchmark-running.md +60 -0
  14. package/docs/deepseek-jev-benchmark-v3-results.md +41 -0
  15. package/docs/deepseek-jev-benchmark-v4-protocol.md +15 -0
  16. package/docs/deepseek-jev-benchmark-v4-results.md +119 -0
  17. package/docs/deepseek-jev-http400-diagnosis.md +45 -0
  18. package/docs/delivery-review-evidence.md +53 -0
  19. package/docs/delivery-timeout-repair-plan.md +51 -0
  20. package/docs/evaluation-readiness.md +31 -0
  21. package/docs/evaluation.md +70 -0
  22. package/docs/extending.md +354 -0
  23. package/docs/glm-pilot-execution.md +9 -0
  24. package/docs/glm-pilot-plan.md +15 -0
  25. package/docs/glm-pilot-results.md +71 -0
  26. package/docs/glyph-review/host-chrome-glyph-compatibility-v4.md +83 -0
  27. package/docs/glyph-review/test-isolation-v1.md +26 -0
  28. package/docs/glyph-review/typecheck-base.log +1 -0
  29. package/docs/glyph-review/typecheck-v4.log +1 -0
  30. package/docs/glyph-review/unicode-inventory-v4.csv +402 -0
  31. package/docs/graph-context-optimization.md +15 -0
  32. package/docs/help-dispatch-review.md +69 -0
  33. package/docs/jev-repository-pilot-plan.md +25 -0
  34. package/docs/jev-repository-pilot-protocol.md +39 -0
  35. package/docs/jev-repository-pilot-restart.md +7 -0
  36. package/docs/jev-repository-pilot-results.md +79 -0
  37. package/docs/jev.md +32 -0
  38. package/docs/legacy-cli.md +150 -0
  39. package/docs/live-theme-plugin-api.md +18 -0
  40. package/docs/model-registry.md +25 -0
  41. package/docs/native-cli.md +102 -0
  42. package/docs/native-compatibility.md +133 -0
  43. package/docs/native-daily-quests.md +132 -0
  44. package/docs/native-glyph-pty.md +59 -0
  45. package/docs/native-manual-testing.md +314 -0
  46. package/docs/native-slash-acceptance-handoff.md +49 -0
  47. package/docs/native-terminal-paired-failure-2026-10-17.md +40 -0
  48. package/docs/native-terminal-performance.md +310 -0
  49. package/docs/native-terminal-semantics-evidence/README.md +25 -0
  50. package/docs/native-terminal-semantics-evidence/controlled-host-model-selftest.json +16 -0
  51. package/docs/native-terminal-semantics-evidence/current-acceptance-status.json +59 -0
  52. package/docs/native-terminal-semantics-evidence/final-binary-focused-85bb44a.json +154 -0
  53. package/docs/native-terminal-semantics-evidence/final-binary-full-incomplete-85bb44a.json +160 -0
  54. package/docs/native-terminal-semantics-evidence/final-binary-layout-85bb44a.json +149 -0
  55. package/docs/native-terminal-semantics-evidence/final-binary-layout-interactive-85bb44a.json +159 -0
  56. package/docs/native-terminal-semantics-evidence/final-binary-model-picker-escape-unchanged-85bb44a.json +44 -0
  57. package/docs/native-terminal-semantics-evidence/final-binary-model-picker-exact-identity-85bb44a.json +47 -0
  58. package/docs/native-terminal-semantics-evidence/final-binary-model-picker-unchanged-model-incomplete-85bb44a.json +58 -0
  59. package/docs/native-terminal-semantics-evidence/final-binary-model-selftest.json +16 -0
  60. package/docs/native-terminal-semantics-evidence/final-binary-picker-cancel-incomplete-85bb44a.json +62 -0
  61. package/docs/native-terminal-semantics-evidence/focused-clipboard-title-stale-binary.json +161 -0
  62. package/docs/native-terminal-semantics-evidence/layout-stale-binary-observation-not-accepted.json +153 -0
  63. package/docs/native-terminal-semantics-evidence/picker-latest-incomplete-attempt.json +62 -0
  64. package/docs/native-terminal-semantics-evidence/picker-previous-probe-pass.json +61 -0
  65. package/docs/native-terminal-semantics.md +89 -0
  66. package/docs/native-upgrade.md +177 -0
  67. package/docs/opencode-archive.md +9 -0
  68. package/docs/opencode-composed-source-review.md +89 -0
  69. package/docs/opencode-migration.md +331 -0
  70. package/docs/opencode-owned-runtime.md +241 -0
  71. package/docs/opencode-runtime.md +106 -0
  72. package/docs/opencode-theme-provider-proof/README.md +55 -0
  73. package/docs/opencode-theme-provider-proof/live-theme-api-base.patch +122 -0
  74. package/docs/opencode-theme-provider-proof/plugin-theme-provider.patch +107 -0
  75. package/docs/opencode-theme-provider-proof/session-ui-base.patch +1217 -0
  76. package/docs/opencode-workspace.md +31 -0
  77. package/docs/owned-host-controls-proof.md +39 -0
  78. package/docs/owned-runtime-release-manifest.md +42 -0
  79. package/docs/owned-runtime-workflow-registration.md +17 -0
  80. package/docs/owned-visual-clear-proof.md +40 -0
  81. package/docs/patches/opencode-v2.0.32-glyph-spinner-test-isolation-v1.patch +50 -0
  82. package/docs/patches/opencode-v2.0.32-glyphs.patch +3670 -0
  83. package/docs/patches/opencode-v2.0.32-help-dispatch.patch +156 -0
  84. package/docs/patches/opencode-v2.0.32-live-theme-api.patch +122 -0
  85. package/docs/patches/opencode-v2.0.32-session-ui-combined-v1.patch +5272 -0
  86. package/docs/patches/opencode-v2.0.32-session-ui-combined-v2.patch +6052 -0
  87. package/docs/patches/opencode-v2.0.32-session-ui-combined-v3.patch +8657 -0
  88. package/docs/patches/opencode-v2.0.32-session-ui-combined-v4.patch +9928 -0
  89. package/docs/patches/opencode-v2.0.32-session-ui.patch +5137 -0
  90. package/docs/plan-advisor-evaluation.md +38 -0
  91. package/docs/planning-startup-fix-plan.md +23 -0
  92. package/docs/planning-startup-fix-review.md +24 -0
  93. package/docs/planning.md +118 -0
  94. package/docs/production-merge-review.md +23 -0
  95. package/docs/quality.md +35 -0
  96. package/docs/release-notes-native-draft.md +73 -0
  97. package/docs/release-notes-preview.10.md +121 -0
  98. package/docs/release-notes-preview.11.md +76 -0
  99. package/docs/release-notes-preview.12.md +55 -0
  100. package/docs/release-notes-preview.9.md +130 -0
  101. package/docs/repository-benchmark-design.md +111 -0
  102. package/docs/review-assurance.md +9 -0
  103. package/docs/review-experiment-results.md +59 -0
  104. package/docs/tested-planning-roadmap.md +58 -0
  105. package/docs/tested-planning.md +58 -0
  106. package/docs/tui-pickers.md +9 -0
  107. package/docs/webdriver.md +83 -0
  108. package/docs/workflow-modes.md +26 -0
  109. package/docs/workflow.d2 +17 -0
  110. package/docs/workflow.svg +149 -0
  111. package/docs/workspace-coordination.md +9 -0
  112. package/evaluate.mjs +276 -0
  113. package/extensions/codegraph.ts +36 -0
  114. package/extensions/delivery.ts +819 -0
  115. package/extensions/experiential.ts +21 -0
  116. package/extensions/subscriptions.ts +21 -0
  117. package/guidance/profiles/authenticated-web.json +24 -0
  118. package/guidance/profiles/data-visualization.json +25 -0
  119. package/guidance/profiles/database-change.json +24 -0
  120. package/guidance/profiles/external-api.json +24 -0
  121. package/guidance/profiles/transactional-data.json +25 -0
  122. package/guidance/profiles/web-application.json +26 -0
  123. package/lib/acceptance-review.mjs +4 -0
  124. package/lib/browser-bin.mjs +160 -0
  125. package/lib/browser-errors.mjs +54 -0
  126. package/lib/browser.mjs +219 -0
  127. package/lib/budget.mjs +37 -0
  128. package/lib/cdp.mjs +221 -0
  129. package/lib/cloud/client.mjs +275 -0
  130. package/lib/cloud/control-plane.mjs +350 -0
  131. package/lib/cloud/gateway.mjs +380 -0
  132. package/lib/cloud/http.mjs +135 -0
  133. package/lib/cloud/ledger.mjs +215 -0
  134. package/lib/codegraph-query.mjs +60 -0
  135. package/lib/codegraph.mjs +378 -0
  136. package/lib/context-archive.mjs +18 -0
  137. package/lib/delivery-context.mjs +132 -0
  138. package/lib/delivery-guidance.mjs +9 -0
  139. package/lib/delivery-review.mjs +94 -0
  140. package/lib/delivery.mjs +611 -0
  141. package/lib/engine.mjs +137 -0
  142. package/lib/environment.mjs +8 -0
  143. package/lib/guidance.mjs +71 -0
  144. package/lib/jev-advisor.mjs +47 -0
  145. package/lib/opencode/archive.mjs +122 -0
  146. package/lib/opencode/cli-runtime.mjs +1171 -0
  147. package/lib/opencode/cli.mjs +252 -0
  148. package/lib/opencode/compatibility.mjs +19 -0
  149. package/lib/opencode/credentials.mjs +260 -0
  150. package/lib/opencode/demo.mjs +53 -0
  151. package/lib/opencode/evaluation-budget-plugin/index.ts +150 -0
  152. package/lib/opencode/evaluation.mjs +262 -0
  153. package/lib/opencode/file-lock.mjs +86 -0
  154. package/lib/opencode/headless.mjs +204 -0
  155. package/lib/opencode/provider-policy.mjs +23 -0
  156. package/lib/opencode/review.mjs +234 -0
  157. package/lib/opencode/runtime-artifact.mjs +335 -0
  158. package/lib/opencode/runtime-github-transport.mjs +121 -0
  159. package/lib/opencode/runtime-release.json +36 -0
  160. package/lib/opencode/runtime.mjs +524 -0
  161. package/lib/opencode/service.mjs +291 -0
  162. package/lib/opencode/session-options.mjs +64 -0
  163. package/lib/opencode/update.mjs +222 -0
  164. package/lib/opencode/workspace.mjs +133 -0
  165. package/lib/openrouter-jev.mjs +37 -0
  166. package/lib/outcome-contract.mjs +21 -0
  167. package/lib/plan-advisor.mjs +38 -0
  168. package/lib/planning-access.mjs +7 -0
  169. package/lib/planning-advice.mjs +28 -0
  170. package/lib/planning-discovery.mjs +14 -0
  171. package/lib/planning-guide.mjs +34 -0
  172. package/lib/planning-view.mjs +57 -0
  173. package/lib/planning.mjs +155 -0
  174. package/lib/probe-diagnostics.mjs +13 -0
  175. package/lib/providers/experiential.mjs +292 -0
  176. package/lib/providers/model-catalog.json +700 -0
  177. package/lib/providers/model-catalog.mjs +7 -0
  178. package/lib/providers/names.mjs +13 -0
  179. package/lib/providers/subscription-models.mjs +483 -0
  180. package/lib/reports.mjs +80 -0
  181. package/lib/review-state.mjs +49 -0
  182. package/lib/review.mjs +114 -0
  183. package/lib/scenarios.mjs +99 -0
  184. package/lib/ship-auth.mjs +44 -0
  185. package/lib/ship-jev.mjs +59 -0
  186. package/lib/ship-telemetry.mjs +183 -0
  187. package/lib/tui/ansi.mjs +255 -0
  188. package/lib/tui/app.mjs +2445 -0
  189. package/lib/tui/auth.mjs +249 -0
  190. package/lib/tui/carthage.mjs +109 -0
  191. package/lib/tui/clipboard.mjs +122 -0
  192. package/lib/tui/d2.mjs +431 -0
  193. package/lib/tui/feed.mjs +467 -0
  194. package/lib/tui/framing.mjs +1 -0
  195. package/lib/tui/glyphs.mjs +172 -0
  196. package/lib/tui/hash-worker.mjs +11 -0
  197. package/lib/tui/mock-engine.mjs +222 -0
  198. package/lib/tui/models.mjs +73 -0
  199. package/lib/tui/picker.mjs +18 -0
  200. package/lib/tui/theme.mjs +663 -0
  201. package/lib/tui/title.mjs +7 -0
  202. package/lib/update-channel.mjs +62 -0
  203. package/lib/update.mjs +239 -0
  204. package/lib/webdriver.mjs +82 -0
  205. package/lib/workflow.mjs +88 -0
  206. package/lib/workspace.mjs +39 -0
  207. package/metadata.json +8 -0
  208. package/package.json +120 -4
  209. package/plugins/carthagent/README.md +23 -0
  210. package/plugins/carthagent/index.ts +3 -0
  211. package/plugins/carthagent/package.json +28 -0
  212. package/plugins/carthagent/src/archive-rpc.ts +46 -0
  213. package/plugins/carthagent/src/bootstrap.ts +38 -0
  214. package/plugins/carthagent/src/daily-evidence.mjs +57 -0
  215. package/plugins/carthagent/src/daily-quests-rpc.ts +50 -0
  216. package/plugins/carthagent/src/daily-source-rpc.ts +52 -0
  217. package/plugins/carthagent/src/index.ts +109 -0
  218. package/plugins/carthagent/src/pull-request-rpc.ts +54 -0
  219. package/plugins/carthagent/src/rpc.ts +121 -0
  220. package/plugins/carthagent/src/server/archive-rpc.ts +327 -0
  221. package/plugins/carthagent/src/server/budgets.ts +21 -0
  222. package/plugins/carthagent/src/server/codegraph.ts +53 -0
  223. package/plugins/carthagent/src/server/daily-quests-rpc.ts +277 -0
  224. package/plugins/carthagent/src/server/daily-source-rpc.ts +197 -0
  225. package/plugins/carthagent/src/server/delivery.ts +599 -0
  226. package/plugins/carthagent/src/server/device-auth.ts +91 -0
  227. package/plugins/carthagent/src/server/framing.mjs +80 -0
  228. package/plugins/carthagent/src/server/native-delivery.ts +26 -0
  229. package/plugins/carthagent/src/server/orchestration.ts +56 -0
  230. package/plugins/carthagent/src/server/policy.ts +24 -0
  231. package/plugins/carthagent/src/server/providers.ts +452 -0
  232. package/plugins/carthagent/src/server/pull-request-rpc.ts +387 -0
  233. package/plugins/carthagent/src/server/session-controls.ts +84 -0
  234. package/plugins/carthagent/src/server/ship-agents.ts +77 -0
  235. package/plugins/carthagent/src/server/ship-context.mjs +60 -0
  236. package/plugins/carthagent/src/server/ship-guidance.ts +39 -0
  237. package/plugins/carthagent/src/server/ship-rpc.ts +69 -0
  238. package/plugins/carthagent/src/server/telemetry.ts +92 -0
  239. package/plugins/carthagent/src/server/voyages-rpc.ts +223 -0
  240. package/plugins/carthagent/src/server/workspace-rpc.ts +349 -0
  241. package/plugins/carthagent/src/session-rpc.ts +31 -0
  242. package/plugins/carthagent/src/testing.ts +90 -0
  243. package/plugins/carthagent/src/tui.tsx +492 -0
  244. package/plugins/carthagent/src/ui/client.ts +125 -0
  245. package/plugins/carthagent/src/ui/commands.ts +70 -0
  246. package/plugins/carthagent/src/ui/daily-editor-focus.mjs +52 -0
  247. package/plugins/carthagent/src/ui/daily-editor.mjs +4 -0
  248. package/plugins/carthagent/src/ui/daily-quests-events.mjs +18 -0
  249. package/plugins/carthagent/src/ui/daily-quests-state.mjs +218 -0
  250. package/plugins/carthagent/src/ui/daily-quests.tsx +232 -0
  251. package/plugins/carthagent/src/ui/host-state.ts +42 -0
  252. package/plugins/carthagent/src/ui/native-navigation.ts +23 -0
  253. package/plugins/carthagent/src/ui/native-review.d.mts +31 -0
  254. package/plugins/carthagent/src/ui/native-review.mjs +154 -0
  255. package/plugins/carthagent/src/ui/resume-session.mjs +34 -0
  256. package/plugins/carthagent/src/ui/session-preferences.d.mts +7 -0
  257. package/plugins/carthagent/src/ui/session-preferences.mjs +14 -0
  258. package/plugins/carthagent/src/ui/theme-provision.d.mts +3 -0
  259. package/plugins/carthagent/src/ui/theme-provision.mjs +134 -0
  260. package/plugins/carthagent/src/ui/voyages-navigation-state.mjs +56 -0
  261. package/plugins/carthagent/src/ui/voyages-navigation.tsx +122 -0
  262. package/plugins/carthagent/src/ui/voyages-state.mjs +142 -0
  263. package/plugins/carthagent/src/ui/voyages.tsx +127 -0
  264. package/plugins/carthagent/src/ui/workspace-live.ts +61 -0
  265. package/plugins/carthagent/src/ui/workspace.tsx +379 -0
  266. package/plugins/carthagent/src/voyages-rpc.ts +60 -0
  267. package/plugins/carthagent/src/workspace-rpc.ts +169 -0
  268. package/plugins/carthagent/test-plugin/index.ts +4 -0
  269. package/plugins/carthagent/test-plugin/package.json +1 -0
  270. package/plugins/carthagent/tests/commands.test.ts +107 -0
  271. package/plugins/carthagent/tests/session-preferences.test.mjs +41 -0
  272. package/plugins/carthagent/tests/voyages-navigation.test.tsx +258 -0
  273. package/plugins/carthagent/themes/carthage.json +67 -0
  274. package/plugins/carthagent/tsconfig.json +19 -0
  275. package/plugins/carthagent/tui.ts +26 -0
  276. package/prompts/delivery.md +7 -0
  277. package/public/index.html +983 -0
  278. package/scenarios/cli/grade_cli.py +69 -0
  279. package/scenarios/cli/scenario.json +21 -0
  280. package/scenarios/game/baseline/minecraft.py +193 -0
  281. package/scenarios/game/context.md +1 -0
  282. package/scenarios/game/grade_minecraft_clone.py +603 -0
  283. package/scenarios/game/requirements.txt +2 -0
  284. package/scenarios/game/scenario.json +33 -0
  285. package/script/ctg/build-owned-runtime.sh +166 -0
  286. package/server.mjs +341 -0
  287. package/skills/game-development/SKILL.md +36 -0
  288. package/skills/game-development/assets/ursina_starter.py +98 -0
  289. package/skills/game-development/scripts/verify_ursina.py +80 -0
  290. package/skills/software-delivery/SKILL.md +50 -0
  291. package/skills/typescript-delivery/SKILL.md +69 -0
  292. package/tests/acceptance-review.test.mjs +13 -0
  293. package/tests/auth.test.mjs +234 -0
  294. package/tests/bounded-summary.test.mjs +68 -0
  295. package/tests/browser-bin.test.mjs +91 -0
  296. package/tests/browser.test.mjs +96 -0
  297. package/tests/budget-engine.test.mjs +111 -0
  298. package/tests/budget.test.mjs +23 -0
  299. package/tests/cli.test.mjs +201 -0
  300. package/tests/clipboard.test.mjs +79 -0
  301. package/tests/cloud-client.test.mjs +129 -0
  302. package/tests/cloud-control-plane.test.mjs +144 -0
  303. package/tests/cloud-gateway.test.mjs +147 -0
  304. package/tests/cloud-http.test.mjs +102 -0
  305. package/tests/cloud-ledger.test.mjs +75 -0
  306. package/tests/codegraph-query.test.mjs +66 -0
  307. package/tests/codegraph.test.mjs +142 -0
  308. package/tests/daily-evidence.test.mjs +62 -0
  309. package/tests/delivery-context.test.mjs +66 -0
  310. package/tests/delivery-review.test.mjs +139 -0
  311. package/tests/delivery.test.mjs +364 -0
  312. package/tests/engine-api.mjs +24 -0
  313. package/tests/experiential-extension.test.mjs +37 -0
  314. package/tests/experiential.test.mjs +300 -0
  315. package/tests/extension.test.mjs +921 -0
  316. package/tests/fixtures/archive-plugin/index.ts +10 -0
  317. package/tests/fixtures/native-discovery-plugin/server.ts +15 -0
  318. package/tests/generate-owned-runtime-release.test.mjs +354 -0
  319. package/tests/guidance.test.mjs +78 -0
  320. package/tests/installed-runtime-contract.test.mjs +43 -0
  321. package/tests/model-registry.test.mjs +68 -0
  322. package/tests/models.test.mjs +70 -0
  323. package/tests/native-cli-host-smoke.mjs +457 -0
  324. package/tests/native-daily-editor-focus.test.mjs +213 -0
  325. package/tests/native-daily-editor.test.mjs +43 -0
  326. package/tests/native-daily-quests-layout.test.mjs +53 -0
  327. package/tests/native-daily-quests-rpc.test.mjs +456 -0
  328. package/tests/native-daily-quests-ui.test.mjs +778 -0
  329. package/tests/native-daily-source.test.mjs +426 -0
  330. package/tests/native-demo-ui.test.mjs +48 -0
  331. package/tests/native-evaluation-admission.test.mjs +24 -0
  332. package/tests/native-fixture-browser-cleanup.test.mjs +65 -0
  333. package/tests/native-fixture-runtime.test.mjs +111 -0
  334. package/tests/native-fixture-stop-diagnostics.test.mjs +67 -0
  335. package/tests/native-glyph-pty.test.mjs +107 -0
  336. package/tests/native-manual-projects.test.mjs +170 -0
  337. package/tests/native-owned-runtime-env.test.mjs +140 -0
  338. package/tests/native-paired-guards.test.mjs +464 -0
  339. package/tests/native-provider-policy.test.mjs +31 -0
  340. package/tests/native-pty-invocation.test.mjs +114 -0
  341. package/tests/native-pty-runtime.test.mjs +45 -0
  342. package/tests/native-resume-session.test.mjs +46 -0
  343. package/tests/native-review-consumer.test.mjs +267 -0
  344. package/tests/native-runtime-identity.test.mjs +214 -0
  345. package/tests/native-ship-parity.test.mjs +526 -0
  346. package/tests/native-ship-plan.test.mjs +75 -0
  347. package/tests/native-ship-rpc.test.mjs +71 -0
  348. package/tests/native-ui-commands.test.mjs +6 -0
  349. package/tests/native-voyages-layout.test.mjs +28 -0
  350. package/tests/native-voyages-navigation.test.mjs +169 -0
  351. package/tests/native-voyages-rpc.test.mjs +395 -0
  352. package/tests/native-voyages-ui.test.mjs +277 -0
  353. package/tests/openai-idempotency.test.mjs +99 -0
  354. package/tests/opencode-archive-rpc.test.mjs +82 -0
  355. package/tests/opencode-atomic-write.test.mjs +55 -0
  356. package/tests/opencode-cli.test.mjs +1312 -0
  357. package/tests/opencode-codegraph-plugin.test.mjs +47 -0
  358. package/tests/opencode-delivery.test.mjs +231 -0
  359. package/tests/opencode-providers.test.mjs +641 -0
  360. package/tests/opencode-runtime.test.mjs +993 -0
  361. package/tests/opencode-session-controls.test.mjs +130 -0
  362. package/tests/opencode-session-options.test.mjs +26 -0
  363. package/tests/opencode-ship-rpc.test.mjs +71 -0
  364. package/tests/opencode-update.test.mjs +475 -0
  365. package/tests/opencode-workspace.test.mjs +388 -0
  366. package/tests/outcome-contract.test.mjs +17 -0
  367. package/tests/owned-runtime-publish-workflow.test.mjs +477 -0
  368. package/tests/picker.test.mjs +34 -0
  369. package/tests/plan-advisor.test.mjs +88 -0
  370. package/tests/plan-review-loop.test.mjs +53 -0
  371. package/tests/planning-advice.test.mjs +27 -0
  372. package/tests/planning-contract.test.mjs +65 -0
  373. package/tests/planning-startup.test.mjs +38 -0
  374. package/tests/planning-view.test.mjs +33 -0
  375. package/tests/planning.test.mjs +223 -0
  376. package/tests/probe-diagnostics.test.mjs +21 -0
  377. package/tests/pull-request-rpc.test.mjs +366 -0
  378. package/tests/release-workflow.test.mjs +46 -0
  379. package/tests/review-state.test.mjs +32 -0
  380. package/tests/review.test.mjs +127 -0
  381. package/tests/runtime-artifact.test.mjs +269 -0
  382. package/tests/runtime-development-trust.test.mjs +230 -0
  383. package/tests/runtime-github-transport.test.mjs +132 -0
  384. package/tests/runtime-token-env.test.mjs +23 -0
  385. package/tests/server.test.mjs +252 -0
  386. package/tests/ship-jev.test.mjs +77 -0
  387. package/tests/ship-telemetry.test.mjs +333 -0
  388. package/tests/standard-workflow.test.mjs +28 -0
  389. package/tests/subscription-models.test.mjs +416 -0
  390. package/tests/subscriptions-extension.test.mjs +27 -0
  391. package/tests/terminal-title.test.mjs +13 -0
  392. package/tests/test_grade_minecraft_clone.py +199 -0
  393. package/tests/test_native_terminal_probe.py +76 -0
  394. package/tests/test_native_terminal_semantics.py +232 -0
  395. package/tests/test_starter.py +78 -0
  396. package/tests/theme.test.mjs +175 -0
  397. package/tests/tui-copy-paste.test.mjs +54 -0
  398. package/tests/tui.test.mjs +808 -0
  399. package/tests/update-channels.test.mjs +129 -0
  400. package/tests/update.test.mjs +211 -0
  401. package/tests/verify-draft-runtime-gate.test.mjs +280 -0
  402. package/tests/verify-owned-runtime-release.test.mjs +371 -0
  403. package/tests/webdriver.test.mjs +31 -0
  404. package/tests/workflow.test.mjs +47 -0
  405. package/tests/workspace-live.test.mjs +127 -0
  406. package/tests/workspace-rpc.test.mjs +236 -0
  407. package/tests/workspace.test.mjs +24 -0
  408. package/tools/benchmark/advisor.test.mjs +7 -0
  409. package/tools/benchmark/advisor.ts +27 -0
  410. package/tools/benchmark/campaign.mjs +45 -0
  411. package/tools/benchmark/diagnose-request.mjs +63 -0
  412. package/tools/benchmark/eval-common.mjs +32 -0
  413. package/tools/benchmark/eval-ledger.mjs +22 -0
  414. package/tools/benchmark/eval-shop.mjs +26 -0
  415. package/tools/benchmark/eval-voxel.mjs +20 -0
  416. package/tools/benchmark/evaluate.mjs +24 -0
  417. package/tools/benchmark/evaluators.test.mjs +13 -0
  418. package/tools/benchmark/fixtures/shop/server.mjs +18 -0
  419. package/tools/benchmark/fixtures/shop/ui.html +8 -0
  420. package/tools/benchmark/freeze.mjs +30 -0
  421. package/tools/benchmark/gateway.mjs +91 -0
  422. package/tools/benchmark/gateway.test.mjs +38 -0
  423. package/tools/benchmark/generator.mjs +11 -0
  424. package/tools/benchmark/generator.test.mjs +26 -0
  425. package/tools/benchmark/guard.test.mjs +166 -0
  426. package/tools/benchmark/guard.ts +149 -0
  427. package/tools/benchmark/native-plugin/index.ts +24 -0
  428. package/tools/benchmark/planning-startup.test.mjs +43 -0
  429. package/tools/benchmark/preflight-live.mjs +31 -0
  430. package/tools/benchmark/preflight.mjs +22 -0
  431. package/tools/benchmark/replay-diagnostic.mjs +23 -0
  432. package/tools/benchmark/runner.mjs +146 -0
  433. package/tools/benchmark/runner.test.mjs +109 -0
  434. package/tools/benchmark/runtime.mjs +23 -0
  435. package/tools/benchmark/selftest.mjs +47 -0
  436. package/tools/benchmark/smoke-jev.mjs +5 -0
  437. package/tools/benchmark/tasks.mjs +20 -0
  438. package/tools/benchmark/transport.mjs +65 -0
  439. package/tools/benchmark/transport.test.mjs +44 -0
  440. package/tools/benchmark/upstream-error.mjs +18 -0
  441. package/tools/benchmark/upstream-error.test.mjs +24 -0
  442. package/tools/browser-check.mjs +109 -0
  443. package/tools/check-syntax.mjs +27 -0
  444. package/tools/evaluate-plan-advisor.mjs +20 -0
  445. package/tools/generate-owned-runtime-release.mjs +217 -0
  446. package/tools/installed-runtime-contract.mjs +16 -0
  447. package/tools/manual-runtime-manifest.mjs +39 -0
  448. package/tools/native-fixture-browser-cleanup.mjs +59 -0
  449. package/tools/native-fixture-stop-diagnostics.mjs +43 -0
  450. package/tools/native-fixture.mjs +353 -0
  451. package/tools/native-glyph-helpers.py +127 -0
  452. package/tools/native-glyph-pty.py +144 -0
  453. package/tools/native-manual-projects.mjs +259 -0
  454. package/tools/native-manual.mjs +338 -0
  455. package/tools/native-model-picker-acceptance.py +306 -0
  456. package/tools/native-owned-runtime-env.sh +47 -0
  457. package/tools/native-paired-guards.mjs +282 -0
  458. package/tools/native-paired-manifest.mjs +72 -0
  459. package/tools/native-paired-orchestration.sh +51 -0
  460. package/tools/native-plugin-readiness.mjs +33 -0
  461. package/tools/native-plugin-readiness.test.mjs +53 -0
  462. package/tools/native-pty-invocation.mjs +26 -0
  463. package/tools/native-pty-runtime.mjs +83 -0
  464. package/tools/native-pty-smoke.py +231 -0
  465. package/tools/native-public-repo-shell-result.mjs +13 -0
  466. package/tools/native-public-repo-shell-result.test.mjs +28 -0
  467. package/tools/native-report-plugin/index.ts +50 -0
  468. package/tools/native-report-plugin/package.json +7 -0
  469. package/tools/native-runtime-identity.mjs +201 -0
  470. package/tools/native-slash-acceptance-env.py +38 -0
  471. package/tools/native-terminal-semantics.py +876 -0
  472. package/tools/owned-shell-observer/index.ts +16 -0
  473. package/tools/owned-shell-observer/package.json +1 -0
  474. package/tools/owned-visual-clear-env.py +48 -0
  475. package/tools/owned-visual-clear-model.py +21 -0
  476. package/tools/patch-compaction.mjs +24 -0
  477. package/tools/patch-model-catalog.mjs +12 -0
  478. package/tools/patch-print-shutdown.mjs +39 -0
  479. package/tools/pinned-owned-runtime-inputs.mjs +46 -0
  480. package/tools/prepare-native-manual.mjs +122 -0
  481. package/tools/repo-pilot/evaluator.cjs +32 -0
  482. package/tools/repo-pilot/reference.mjs +43 -0
  483. package/tools/repo-pilot/runner.mjs +85 -0
  484. package/tools/repo-pilot/sandbox-entry.mjs +12 -0
  485. package/tools/repo-pilot/tasks.mjs +20 -0
  486. package/tools/repo-pilot/type-evaluator.cjs +6 -0
  487. package/tools/run-native-terminal-paired.sh +403 -0
  488. package/tools/runtime-token-env.mjs +8 -0
  489. package/tools/seed-native-switch-fixture.mjs +79 -0
  490. package/tools/test-native-controls.mjs +86 -0
  491. package/tools/test-native-daily-quests.mjs +65 -0
  492. package/tools/test-native-default-cli.mjs +106 -0
  493. package/tools/test-native-delivery-host.mjs +389 -0
  494. package/tools/test-native-evaluation.mjs +50 -0
  495. package/tools/test-native-glyph-pty.mjs +94 -0
  496. package/tools/test-native-host.mjs +407 -0
  497. package/tools/test-native-outcomes.mjs +75 -0
  498. package/tools/test-native-package.mjs +238 -0
  499. package/tools/test-native-performance.mjs +26 -0
  500. package/tools/test-native-product.mjs +90 -0
  501. package/tools/test-native-pty.mjs +45 -0
  502. package/tools/test-native-public-repo.mjs +224 -0
  503. package/tools/test-native-refresh-reentry.mjs +106 -0
  504. package/tools/test-native-report.mjs +95 -0
  505. package/tools/test-native-review.mjs +75 -0
  506. package/tools/test-native-runtime.mjs +120 -0
  507. package/tools/test-native-ship-models.mjs +176 -0
  508. package/tools/test-native-ship-walkthrough.mjs +96 -0
  509. package/tools/test-native-slash-commands.mjs +125 -0
  510. package/tools/test-native-slash-commands.py +242 -0
  511. package/tools/test-native-swe-host.mjs +301 -0
  512. package/tools/test-native-swe.mjs +122 -0
  513. package/tools/test-native-tasks.mjs +77 -0
  514. package/tools/test-native-terminal-performance.py +887 -0
  515. package/tools/test-native-terminal-readiness.sh +85 -0
  516. package/tools/test-native-terminal-semantics-installed.mjs +38 -0
  517. package/tools/test-native-visual-clear-installed.mjs +48 -0
  518. package/tools/test-owned-host-controls.mjs +238 -0
  519. package/tools/test-owned-opencode-runtime.mjs +35 -0
  520. package/tools/test-owned-visual-clear-env.py +120 -0
  521. package/tools/test-owned-visual-clear.py +373 -0
  522. package/tools/test-picker-pty.py +45 -0
  523. package/tools/test-python.mjs +29 -0
  524. package/tools/test-webdriver.mjs +54 -0
  525. package/tools/verify-draft-runtime-gate.mjs +138 -0
  526. package/tools/verify-owned-runtime-release.mjs +114 -0
  527. package/tools/verify-release-version.mjs +57 -0
  528. package/tools/webdriver-check.mjs +52 -0
  529. package/vendor/agent/bounded-summary.mjs +88 -0
  530. package/vendor/agent/chunks/anthropic-messages-VWZZOSJQ.js +6 -0
  531. package/vendor/agent/chunks/anthropic.js +75 -0
  532. package/vendor/agent/chunks/azure-openai-responses-BJLAM6CD.js +2 -0
  533. package/vendor/agent/chunks/bedrock-converse-stream.js +74 -0
  534. package/vendor/agent/chunks/chord-context.js +96 -0
  535. package/vendor/agent/chunks/chunk-4L3WN2XY.js +2 -0
  536. package/vendor/agent/chunks/chunk-6CYCI3EJ.js +12 -0
  537. package/vendor/agent/chunks/chunk-6R7UI4IY.js +2 -0
  538. package/vendor/agent/chunks/chunk-7ZC4UXSL.js +2 -0
  539. package/vendor/agent/chunks/chunk-AXIIZGTV.js +2 -0
  540. package/vendor/agent/chunks/chunk-CLNPYIDP.js +42 -0
  541. package/vendor/agent/chunks/chunk-DRQDKNXA.js +2 -0
  542. package/vendor/agent/chunks/chunk-GMWCTUPB.js +2 -0
  543. package/vendor/agent/chunks/chunk-IDDQWTHI.js +2 -0
  544. package/vendor/agent/chunks/chunk-JVUZSMYM.js +1548 -0
  545. package/vendor/agent/chunks/chunk-L2ZPNLYD.js +2 -0
  546. package/vendor/agent/chunks/chunk-NUHFSC37.js +25 -0
  547. package/vendor/agent/chunks/chunk-OUXLLA64.js +11 -0
  548. package/vendor/agent/chunks/chunk-PGXDEOVV.js +2 -0
  549. package/vendor/agent/chunks/chunk-PJACZCIR.js +2 -0
  550. package/vendor/agent/chunks/chunk-PRRNXB7S.js +2 -0
  551. package/vendor/agent/chunks/chunk-TEPMHNKQ.js +2 -0
  552. package/vendor/agent/chunks/chunk-TRDNDS6A.js +4 -0
  553. package/vendor/agent/chunks/chunk-U6ZMQKGD.js +50 -0
  554. package/vendor/agent/chunks/chunk-UAQELI3K.js +2 -0
  555. package/vendor/agent/chunks/chunk-USJZMAIR.js +2 -0
  556. package/vendor/agent/chunks/chunk-XDUWOHPL.js +6 -0
  557. package/vendor/agent/chunks/chunk-XNGRGP62.js +2 -0
  558. package/vendor/agent/chunks/github-copilot.js +2 -0
  559. package/vendor/agent/chunks/google-generative-ai-Q2K7FBDI.js +2 -0
  560. package/vendor/agent/chunks/google-vertex-7UJBF4S7.js +2 -0
  561. package/vendor/agent/chunks/https-proxy-agent-2VXB7436.js +13 -0
  562. package/vendor/agent/chunks/image-resize-worker.js +2 -0
  563. package/vendor/agent/chunks/kimi-coding.js +2 -0
  564. package/vendor/agent/chunks/lib-HGQMNYVT.js +9 -0
  565. package/vendor/agent/chunks/mistral-conversations-4M6BZBX6.js +5 -0
  566. package/vendor/agent/chunks/multipart-parser-SQ6GDJL7.js +3 -0
  567. package/vendor/agent/chunks/node-KG362ECQ.js +16 -0
  568. package/vendor/agent/chunks/node-TWVVAGPO.js +2 -0
  569. package/vendor/agent/chunks/openai-codex-responses-R6VYZTVY.js +10 -0
  570. package/vendor/agent/chunks/openai-codex.js +75 -0
  571. package/vendor/agent/chunks/openai-completions-EKZT2IH2.js +7 -0
  572. package/vendor/agent/chunks/openai-responses-TFDINO6W.js +2 -0
  573. package/vendor/agent/chunks/openrouter-images-N4XVVFSD.js +2 -0
  574. package/vendor/agent/chunks/openrouter.js +75 -0
  575. package/vendor/agent/chunks/pi-messages-PML4SPVJ.js +8 -0
  576. package/vendor/agent/chunks/radius.js +75 -0
  577. package/vendor/agent/chunks/src-UK77SYZE.js +4 -0
  578. package/vendor/agent/chunks/xai.js +2 -0
  579. package/vendor/agent/cli.js +3 -0
  580. package/vendor/agent/dist/modes/interactive/theme/dark.json +91 -0
  581. package/vendor/agent/dist/modes/interactive/theme/light.json +90 -0
  582. package/vendor/agent/dist/modes/interactive/theme/theme-schema.json +356 -0
  583. package/vendor/agent/index.js +2 -0
  584. package/vendor/agent/modes/interactive/theme/dark.json +91 -0
  585. package/vendor/agent/modes/interactive/theme/light.json +90 -0
  586. package/vendor/agent/modes/interactive/theme/theme-schema.json +356 -0
  587. package/vendor/agent/package.json +14 -0
  588. package/vendor/agent/rpc-entry.js +3 -0
  589. package/vendor/agent/theme/dark.json +91 -0
  590. package/vendor/agent/theme/light.json +90 -0
  591. package/vendor/agent/theme/theme-schema.json +356 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 B-icy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,221 @@
1
- # Temporary Holding Version
1
+ # Carthagent
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Carthagent checks software work against real acceptance tests and re-proves it whenever source changes.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ curl -fsSL https://carthagent.xyz/install | sh
9
+ irm https://carthagent.xyz/install.ps1 | iex
10
+ npm install -g carthagent
11
+ ```
12
+
13
+ Node.js 22.19+ is required for the npm install. From source: `npm install -g --install-links=true github:B-icy/Carthagent#vX.Y.Z` (replace with a published tag).
14
+
15
+ See [workflow.svg](docs/workflow.svg) for the flow and [evaluation history](docs/evaluation.md) for trials, including failures.
16
+
17
+ ## Native CLI
18
+
19
+ ```sh
20
+ ctg
21
+ ctg --help
22
+ ctg native # compatibility alias
23
+ ```
24
+
25
+ The old `CTG_NATIVE` toggle no longer changes routing. The native route launches the checksum-pinned CTG-owned runtime (compatibility 2.0.32) and uses a separate Carthagent-owned profile beneath `~/.carthagent/opencode/` (override with `CTG_OPENCODE_HOME`). Its config, database, sessions, auth, state, and cache are separate from other coding-tool profiles. It does not install, upgrade, or reuse credentials from other coding-tool profiles. Project files and native task metadata/worktrees are separate again: task records live in each project’s `.harness/opencode-tasks.json`.
26
+
27
+ Native projects use the native project/session model. CTG task creation associates a task with an independent native session and native worktree; task relations are CTG metadata, not parent/child native sessions. Native session resume/continue is scoped to the active workspace. Legacy Pi transcripts can be listed, searched, read, and exported with `ctg archive`; they are **read-only archives** and cannot be resumed or imported as native sessions. See the [native upgrade and migration guide](docs/native-upgrade.md) before switching workflows.
28
+
29
+ The native TUI exposes CTG workspace/task actions such as `/ctg-workspace`, `/ctg-open`, `/ctg-worktree`, and `/ctg-task`, alongside delivery and session commands. The native runtime owns the terminal renderer and lifecycle. Do not assume a listed command overrides a built-in host command: submitted `/help` precedence is a known unresolved acceptance gate.
30
+
31
+ ```sh
32
+ node bin/ctg.mjs # native interactive TUI
33
+ node bin/ctg.mjs "Build a task CLI" # task in the TUI
34
+ node bin/ctg.mjs resume # native session picker
35
+ node bin/ctg.mjs continue # latest native session here
36
+ node bin/ctg.mjs -p "Summarize this repo" # headless text
37
+ node bin/ctg.mjs --json -p "Run checks" # native lifecycle JSONL
38
+ node bin/ctg.mjs status --json # delivery status JSON
39
+ node bin/ctg.mjs archive list # legacy archive (read-only)
40
+ ```
41
+
42
+ The native CLI retains command aliases such as `ui`/`interactive`, `sessions`, `s`, `c`, `fingerprint`, `auth`, `cloud`, `web`, `start`, and `upgrade`. `--json` with a headless prompt emits JSONL records for native tool start/end, assistant message completion, and terminal outcome; it is not the text `-p` stream. Headless success requires the native completed assistant turn and successful terminal outcome. Options whose enforcement is not advertised by the active native plugin fail closed; in particular `--bash-cap` and `--isolate` are currently unsupported. Refer to [native CLI compatibility details](docs/native-cli.md).
43
+
44
+ ### Voyages in the native TUI
45
+
46
+ `/voyages` opens the account's live Voyages profile, coin wallet, equipment and
47
+ shop. Use the normal `/login` browser device approval and choose Carthagent;
48
+ Voyages uses the approving browser user's existing player, not a separate CLI
49
+ wallet. Older account-only Ship sessions may require a new device sign-in.
50
+ Voyages does not require a paid model call or award coins for coding.
51
+
52
+ Customization and equipment changes require confirmation. Paid items require a
53
+ server quote showing the coin price and expiry, followed by explicit purchase
54
+ confirmation. Cancel does not purchase. The server validates funds, ownership,
55
+ eligibility and profile version; refresh after a conflict rather than silently
56
+ overwriting another client. Equip a purchased item separately.
57
+
58
+ If a purchase response is lost, the TUI keeps a pending request across restart.
59
+ Use its recovery action to retry the same quote and request key, not to create
60
+ a second purchase. Do not delete profile state to resolve an uncertain debit.
61
+ The server remains authoritative; unavailable or signed-out state must not be
62
+ treated as a saved balance. Browser cookies are never imported into CLI auth.
63
+
64
+ Native Voyages landed in PR #225. Live development-runtime testing exercised
65
+ browser device approval, name cancel/save, owned Beanie equip, restart and web
66
+ persistence, expiry recovery, and revocation. The approving web player remains
67
+ authoritative. The tested wallet had 10 coins and no affordable paid quote:
68
+ no live paid debit or replay was proven. These are historical, bounded source/runtime
69
+ results, not preview.10 installed-package acceptance. Subsequent development-runtime
70
+ testing completed one explicitly authorized 40-coin purchase and restart
71
+ persistence; see the [preview.10 candidate notes](docs/release-notes-preview.10.md)
72
+ for its limits. Published preview.9 remains immutable and does not acquire
73
+ changes from current main.
74
+
75
+ ## Install and update
76
+
77
+ The installer selects an exact published release and acquires its pinned native runtime; it never falls back to an unrelated system binary. See the [native upgrade guide](docs/native-upgrade.md) for source-checkout and profile-preservation instructions, or [legacy CLI instructions](docs/legacy-cli.md) for stable 1.0.7.
78
+
79
+ `ctg update --check` checks for a published release without installing. Select `--channel experimental` to include published previews; drafts are never installed. The legacy stable updater can update a clean source clone. The native updater differs: it refuses to check out a release into any active source clone, including a clean one; it installs package releases only from an npm installation. Preserve local changes and use the manual exact-tag checkout procedure in the [native upgrade guide](docs/native-upgrade.md) when updating a development checkout. Published previews are immutable. See the [preview.11 release notes](docs/release-notes-preview.11.md); the older [native migration draft](docs/release-notes-native-draft.md) is historical, not current installation guidance.
80
+
81
+ ## Update channels
82
+
83
+ Starting with 1.0.7, update channels are an explicit opt-in:
84
+
85
+ ```sh
86
+ ctg update --channel experimental --check # preview; installs/persists nothing
87
+ ctg update --channel experimental # install and remember the experimental channel
88
+ ctg update --channel beta # stable + beta/RC releases only
89
+ ctg update --channel stable # leave previews; downgrade to stable if necessary
90
+ ctg update # follow the channel you last installed successfully
91
+ ```
92
+
93
+ Stable is the default and never selects a prerelease, even if a remote manifest
94
+ mislabels it. Beta accepts published `-beta` and `-rc` tags; experimental also
95
+ accepts alpha, preview, and other published prerelease tags. Both opt-in channels
96
+ include stable releases. Selection uses semantic version order, not release date;
97
+ drafts are never installable. Prereleases are read directly from GitHub and never
98
+ advance the stable control-plane pointer.
99
+
100
+ A successful explicit switch is saved in `~/.carthagent/update-channel.json`;
101
+ `--check` and failed installs do not change it. `CARTHAGENT_UPDATE_CHANNEL_FILE`
102
+ can isolate this preference for testing. `--channel stable` explicitly authorizes
103
+ a downgrade, so recovery from an experimental build does not require `--force`.
104
+ Your sessions and provider credentials are not deleted by switching channels.
105
+ Experimental software may still contain bugs; read its release notes first.
106
+
107
+ ## Release status
108
+
109
+ 1.1.0-preview.12 is the current experimental release. It republishes
110
+ preview.11 with an npm package that keeps the `ctg` command, plus a release
111
+ check that blocks manifests npm would rewrite. Preview.11 added a Projects /
112
+ Voyages mode switch to the native left rail, with read-only Voyages profile and
113
+ daily assignment summaries, on top of preview.10's native daily coding quests
114
+ (selected evidence, exact-payload preview, fresh per-submission consent, and
115
+ durable recovery; assessments do not award rewards). Native remains the default
116
+ `ctg` interface. Ship retains approval, checks, review, repair, recovery, and
117
+ resume; Lite remains direct execution. Published previews are immutable.
118
+ Experimental installation is explicit and selects published releases only;
119
+ stable 1.0.7 retains the legacy console.
120
+
121
+ Each experimental release must pass its exact installed-package gate before
122
+ publication. See the [preview.12 release notes](docs/release-notes-preview.12.md),
123
+ [preview.11 notes](docs/release-notes-preview.11.md), and [preview.10 notes](docs/release-notes-preview.10.md); earlier migration findings and remaining platform caveats
124
+ are in the [Native migration ledger](docs/opencode-migration.md#delivery-ledger),
125
+ [native compatibility matrix](docs/native-compatibility.md), and [terminal
126
+ evidence status](docs/native-terminal-semantics.md#evidence-status-pr-162).
127
+
128
+ ## Regular CLI
129
+
130
+ The split-terminal console remains available in stable 1.0.7, not as an alternate route inside the native-default experimental package. To return to stable, use `ctg update --channel stable`. Its legacy data and provider setup remain distinct from the native profile; existing transcripts remain available through the read-only archive commands.
131
+
132
+ ## Delivery engine and existing CLI
133
+
134
+ The following delivery-engine documentation describes Carthagent's shared delivery concepts and the existing CLI behavior. Native-preview coverage and compatibility are tracked separately in the [native CLI guide](docs/native-cli.md) and [migration ledger](docs/opencode-migration.md); feature parity must not be inferred from the presence of a shared delivery module.
135
+
136
+ ## How it works
137
+
138
+ `extensions/delivery.ts` wires eight tools into the engine (`lib/delivery.mjs` has the mechanics):
139
+
140
+ | Tool | What it does |
141
+ |---|---|
142
+ | `delivery_plan` | Goal, steps, artifact roots, acceptance criteria → check mapping; `verification: required|advisory|none`; writes `plan.d2` |
143
+ | `delivery_design` | Validate SRP/DI contracts and scenarios, record adversarial review, approve the exact revision/snapshot before code |
144
+ | `delivery_revise` | Reason + partial plan patch; preserves valid evidence and stable progress, records revision history |
145
+ | `delivery_check` | Runs check argv with deadlines; `all` collects ordinary failures across suites; records exit codes, logs, workspace SHA-256 |
146
+ | `delivery_status` | Contract + evidence state (missing/failed/stale) |
147
+ | `delivery_progress` | Step progress for the plan panel |
148
+ | `delivery_review` | Captures the actual diff; records per-requirement assertions, boundary probes and limitations against the unchanged snapshot |
149
+ | `delivery_finish` | `verified` requires fresh checks, new-requirement executions, existing artifacts/output files, completed structured steps and a review receipt; otherwise `blocked` |
150
+
151
+ The discipline: evidence is bound to the run, contract revision, executable check definition and workspace source fingerprint. Source edits invalidate evidence; dependency, cache and generated-output exclusions mean this is not a hash of every file. `verified` means declared required checks passed with current evidence—not independent proof of task completeness or correctness. Checks are real subprocesses (`argv`, no implicit shell), FIFO-queued, 1–300 s deadlines, logs under `.harness/`. Failed or missing checks get at most two automatic repair nudges per prompt. This is a workflow guardrail, not a security sandbox — for untrusted code use a container.
152
+
153
+ `extensions/codegraph.ts` adds a `code_nav` tool: a deterministic tree-sitter index of the workspace (JS/TS/Python/Rust) with ops `definition`, `symbols`, `callers`, `callees`, `imports`, `importers`, `outline`, `status`. It parses lazily on first call and re-parses only files whose mtime changed; `--codegraph-max-files N` caps the scan (default 8000).
154
+
155
+ Structural navigation is available before plan approval. Results report total/returned matches, `nextOffset` pagination and current coverage; `path`/`container` narrow candidates. Call matches are name-based, not resolved runtime bindings. Use graph discovery followed by targeted source reads. Delivery guidance is phase-specific and recovery uses exact-obligation checkpoints plus current evidence; see [graph/context optimization](docs/graph-context-optimization.md) for behavior and pilot limitations.
156
+
157
+ **Choose the workflow.** The CLI defaults to `--workflow standard`: declare a complete acceptance contract and executable checks, implement, then run fresh checks and record a final snapshot review before finishing. `--workflow strict` additionally requires architecture/injection contracts, scenarios and tested-design approval before implementation; revisions relock that mode. Existing sessions keep their recorded mode, and direct extension hosts default to strict for compatibility. `delivery_probe` offers bounded Node/npm version discovery. This is a participating-tool boundary, not an OS sandbox. See [workflow modes and benchmark findings](docs/workflow-modes.md) and [strict design contracts](docs/tested-planning.md).
158
+
159
+ **Optional advisory research.** A dependency-injected Jev adapter and shadow evaluator are available off the normal delivery path. No credentials or provider call are required; classifier outputs cannot approve plans. See [measured fixture results and live-evaluation limits](docs/plan-advisor-evaluation.md).
160
+
161
+ **Adaptive plans.** Steps can be legacy strings or `{id,title,dependsOn:[],checks:[]}`. Structured steps use stable IDs, enforce dependency order, and require mapped checks before completion. `delivery_revise({reason,patch})` keeps omitted fields and replaces supplied arrays; unchanged checks retain fresh evidence only on unchanged source. New/remapped requirements still need new suite executions; old command evidence cannot automatically cover newly stated behavior. Intentionally-red regression milestones use `kind:"regression",checks:[]`, keeping green suites on final acceptance. Structured required plans must inspect/record a final diff-linked review. Changed source still invalidates all workspace evidence. Revisions preserve failure history and acceptance criteria rather than resetting the contract. See [medium/large-codebase workflows and limits](docs/planning.md).
162
+
163
+ **Headless monitoring.** `ctg --json -p "task"` streams engine JSONL events, including tool activity; `ctg status --json` returns a versioned report/fingerprint/completion snapshot. Text `-p` alone is not a live tool stream. Review receipts are traceable self-reports, not independent correctness proof.
164
+
165
+ **Informational vs delivery asks.** Every plan declares a verification classification. `required` (the default) is the delivery contract above. `advisory` retains optional informational evidence without a repair loop; it does not authorize new arbitrary command execution. New commands require a tested, approved `required` plan. `none` is a pure question/explanation with no checks at all. Informational plans finish with `delivery_finish` once (recorded as `advisory: true`) and never receive repair nudges; user-owned required validators always force `required`, and a `required` plan can only be reclassified before any check has run.
166
+
167
+ ## Self-review
168
+
169
+ When a run finishes a substantial change (a verified delivery or file edits), Carthagent can offer a review loop: the agent pushes a branch, opens a PR, and a **detached fresh-context reviewer** (`ctg review <pr>` — a separate engine process with no shared context) inspects it. Findings come back to the working agent, which fixes, pushes, and re-reviews — stopping after 3 admitted attempts per PR in this workspace or `VERDICT: APPROVE`. The CLI persists round admission and structured snapshot-bound findings, excludes concurrent reviewers, and escalates exhausted attempts. Review commands reject malformed verdicts and changed source/PR-head snapshots, but read-only behavior is an instruction, not isolation. See [review guarantees and limits](docs/review-assurance.md).
170
+
171
+ It's opt-in and tri-state, resolved as `--review <mode>` flag → `~/.carthagent/config.json` → `ask`:
172
+
173
+ | Mode | Behavior |
174
+ |---|---|
175
+ | `ask` (default) | Offer the loop at the end of a major change (`^y` accepts, `esc` skips) |
176
+ | `yes` | Start the loop automatically — no prompt |
177
+ | `no` | Never offer |
178
+
179
+ ```sh
180
+ ctg review # show the effective default
181
+ ctg review yes # persist a default for all sessions
182
+ ctg review 14 # run the fresh-context reviewer over a PR directly
183
+ ctg --review no # per-launch override
184
+ ```
185
+
186
+ Inside a session, `/review` starts a loop immediately and `/review ask|yes|no|status` manages the same default. The loop needs `git` + an authenticated `gh` — without them the agent reports and skips instead of simulating a review.
187
+
188
+ ## Make it yours
189
+
190
+ Everything below is config, not code:
191
+
192
+ - **Required validators** — your tests, not the model's. `.carthagent/delivery.json` (trusted project) or `--validators file.json`: `{"version":1,"checks":[{"id":"acceptance","kind":"test","argv":["pytest","-q"],"timeoutSeconds":90}]}`. They can't be omitted or overridden.
193
+ - **Domain guidance** — add a JSON profile to `guidance/profiles/` (keywords/deps → planning/check/review requirements) and matching requests pick it up automatically.
194
+ - **Extra context** — `--delivery-context notes.md` injects project/benchmark-specific instructions.
195
+ - **Scenarios** — `scenarios/<name>/scenario.json` defines an evaluation domain; `node evaluate.mjs --task <name> --allow-live` runs it (dry-run with `--dry-run`; spends API credit otherwise).
196
+
197
+ See [extending Carthagent](docs/extending.md) for how to author guidance profiles, prompt templates, skills, providers, and extensions.
198
+
199
+ ## Bounded runs and browser evidence
200
+
201
+ ```sh
202
+ ctg -p --max-tools 100 --max-seconds 900 --max-repairs 2 "Implement the requested change"
203
+ ```
204
+
205
+ Limits are opt-in, session-persistent cooperative controls—not dollar/token caps or hard process deadlines. Inspect with `/delivery-budget-status`; only an explicit `/delivery-budget-reset` starts a fresh allowance in the same session. See [session budgets](docs/budgets.md).
206
+
207
+ Browser evidence has two tiers: jsdom for DOM/unit checks (module scripts are rejected when execution is requested), and a real headless browser (bundled `chrome-headless-shell` over CDP, or an external WebDriver endpoint) for application modules and interactions. Browser checks subscribe to console errors before navigation and fail on unexpected console errors, exceptions and rejected promises. Screenshots are evidence to inspect, not automatic visual approval. See [browser setup and checks](docs/webdriver.md).
208
+
209
+ ## Development
210
+
211
+ ```sh
212
+ npm ci && npm run quality # lint, typecheck, build and tests; no model calls
213
+ npm run test:browser # bundled headless browser (auto-downloads on first use)
214
+ python3 -m pip install -r scenarios/game/requirements.txt && npm run test:python # game graders
215
+ # Only with explicit spending authorization and a cap:
216
+ node evaluate.mjs --task cli --mode both --allow-live # live A/B eval — spends API credit
217
+ ```
218
+
219
+ Tests cover contract validation, stale evidence, required validators, timeouts/cancellation, compaction, actual-engine session budgets, report conflicts, and dashboard auth. Native CI covers Windows/macOS/Linux on Node 22/24; a separate Linux job runs the bundled real-browser suite. WSL JS/browser evidence is local and separate; WSL Python validation remains unperformed successfully. This does not establish all terminals or browsers as supported/tested. `PI_CLI` points the suite at a non-standard engine location.
220
+
221
+ See [repository quality gates](docs/quality.md) and [controlled evaluation readiness](docs/evaluation-readiness.md). Review admission is persistently bounded locally; delivery operations now share a workspace lock and explicit active-run pointer with same-run live reconciliation. See [coordination and recovery](docs/workspace-coordination.md) for limits and interrupted-lock handling. No controlled paid comparison yet establishes lower cost or fewer interventions for complete web deliveries.
package/bin/ctg.mjs ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import { readFile } from 'node:fs/promises';
3
+ import { runOpenCodeCli } from '../lib/opencode/cli.mjs';
4
+ import { createOpenCodeCliRuntime } from '../lib/opencode/cli-runtime.mjs';
5
+
6
+ const argv = process.argv.slice(2);
7
+ if (argv[0] === 'native') argv.shift();
8
+ process.env.CTG_NODE_EXECUTABLE ??= process.execPath;
9
+
10
+ try {
11
+ const { version } = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8'));
12
+ const runtime = await createOpenCodeCliRuntime();
13
+ const code = await runOpenCodeCli({ argv, runtime, version, stdoutIsTTY: Boolean(process.stdout.isTTY) });
14
+ process.exitCode = Number.isInteger(code) ? code : 0;
15
+ } catch (error) {
16
+ console.error(error.message);
17
+ process.exitCode = Number.isInteger(error.exitCode) ? error.exitCode : 1;
18
+ }
@@ -0,0 +1,72 @@
1
+ # Session delivery budgets
2
+
3
+ The delivery extension supports opt-in execution limits on Windows, macOS,
4
+ Linux and WSL. These are agent orchestration controls, not a security sandbox
5
+ or a dollar/token billing cap.
6
+
7
+ Normal `ctg` launches accept `--max-tools`, `--max-seconds`, and `--max-repairs`
8
+ for both TUI and headless mode. For example:
9
+
10
+ ```text
11
+ node bin/ctg.mjs -p --max-tools 100 --max-seconds 900 --max-repairs 2 "Implement the requested change"
12
+ ```
13
+
14
+ Invalid or missing values, and budget options combined with `--no-delivery`,
15
+ fail before launching the engine. Use `/delivery-budget-status` to inspect
16
+ usage, remaining allowance (null means unlimited), and stop reason without
17
+ spending a tool call. The command displays a JSON status message.
18
+
19
+ Alternatively launch the bundled engine directly with the extension and flags
20
+ (from the repository root; works in PowerShell and POSIX shells):
21
+
22
+ ```text
23
+ node vendor/agent/cli.js -e extensions/delivery.ts --delivery-max-tools 100 --delivery-max-seconds 900 --delivery-max-repairs 2
24
+ ```
25
+
26
+ Each flag accepts an integer from 0 to 1000000. Zero disables that dimension;
27
+ all default to zero. The existing maximum of two automatic repair nudges per
28
+ user input still applies. The new repair limit additionally caps nudges over
29
+ the entire budget, including across user follow-ups.
30
+
31
+ - Tool calls count at admission, including status calls and subsequently blocked
32
+ calls. Exactly N calls may be admitted; the next attempt stops the agent.
33
+ - Seconds measure wall time from budget creation, including idle time and time
34
+ while the process is closed. An active turn has a timer that requests abort
35
+ even if no tools are invoked. An idle expired session stops on its next run.
36
+ - Repair rounds count automatic delivery follow-ups, not arbitrary model turns.
37
+ - Limits and counters are stored as session entries independently of plans.
38
+ Replanning, input, compaction and same-session tree navigation do not reset
39
+ them. Restoration reads all session entries, not only the selected branch.
40
+ Existing saved limits remain authoritative until reset.
41
+
42
+ When exhausted, the extension blocks tools, requests engine abort, suppresses
43
+ repair follow-ups, and emits a `delivery-budget-stop` JSON message containing
44
+ its reason, counters, requirements and last recorded evidence. That evidence
45
+ is a snapshot, **not a fresh verification**. The delivery report is not falsely
46
+ marked verified or overwritten; unfinished work remains unfinished.
47
+
48
+ To authorize more work, explicitly run `/delivery-budget-reset` while the agent
49
+ is idle. In headless mode a command-only invocation on a previously failed
50
+ session may still exit 1 because the engine prints its last assistant error;
51
+ the command's persisted reset is applied. Our offline subprocess regression
52
+ checks the saved reset and subsequent tool execution rather than treating that
53
+ exit code as proof that reset failed. It creates a fresh budget using the current launch flags. This is a
54
+ user command, not a model tool. A genuinely new session also starts a new budget.
55
+ Separate processes/sessions do not share a workspace-wide quota, and deliberate
56
+ session-file edits or extension removal can bypass the limits.
57
+
58
+ Cancellation is cooperative: engine/provider/tools must honor abort signals.
59
+ Detached subprocesses, uninterruptible synchronous code, and requests already
60
+ billed by a provider cannot be undone. Time limits are not hard OS process
61
+ termination deadlines. No paid-provider cancellation guarantee is implied.
62
+
63
+ The bundled engine's headless print-mode finalizer also destroys its captured
64
+ Undici dispatcher, but only if that dispatcher is still the process-global
65
+ dispatcher. This releases sockets left open by aborted provider requests without
66
+ destroying a dispatcher that another runtime installed later. After refreshing the
67
+ vendored engine, run `node tools/patch-print-shutdown.mjs`; the patcher fails
68
+ closed if the expected print-mode anchors have changed.
69
+
70
+ Native Windows/macOS/Linux CI runs the regression suite on Node 22 and 24;
71
+ WSL is validated separately locally. This does not establish every terminal,
72
+ OS version, browser or processor architecture as tested.
@@ -0,0 +1,34 @@
1
+ # Bounded context compaction
2
+
3
+ Both vendored engine compaction paths use `vendor/agent/bounded-summary.mjs`.
4
+ After refreshing the engine bundle, run `node tools/patch-compaction.mjs`. The
5
+ patcher validates its anchors and fails rather than guessing at changed code.
6
+
7
+ Compaction starts at the earlier of 70% of the context window or the configured
8
+ reserve boundary. Context estimates take the maximum of usage-based tokens and
9
+ serialized UTF-8 bytes divided by four, including when cache usage is available.
10
+ This is conservative for the managed gateway, whose current catalog advertises
11
+ its serialized byte cap divided by four as the usable context window.
12
+
13
+ Summary requests use half the catalog-derived byte cap (or half an explicit
14
+ `maxRequestBytes`, if stricter), measured against their serialized context.
15
+ The remaining space allows for transport encoding, provider fields, and output.
16
+ This is a conservative bound, not an exact tokenizer or wire-payload measurement.
17
+ Provider size rejections halve the budget and retry with smaller fragments.
18
+
19
+ Oversized history is split at Unicode-safe boundaries. Every fragment includes
20
+ instructions to preserve constraints, paths, unresolved failures, and next steps.
21
+ Ordered fragment summaries are recursively combined into one checkpoint. No raw
22
+ history is silently truncated. Prior summaries and custom instructions are part
23
+ of the input being reduced. Each subrequest has a distinct session/operation seed;
24
+ all returned usage is accumulated. Output is capped at 4096 tokens per request.
25
+
26
+ Aborts, non-size failures, empty/tool-call/truncated responses, non-converging
27
+ reduction, and the 128-request/eight-level limits fail compaction rather than
28
+ persisting an incomplete checkpoint. The UI labels this as a failure, not success.
29
+ There is no guarantee of lossless semantic compression: summaries remain model
30
+ generated. Tests use deterministic transports and cover bytes, chunk coverage,
31
+ adaptive rejection recovery, cancellation, failure states, and UI notices.
32
+
33
+ Restart CTG after updating to load the new engine and UI. Existing session logs
34
+ and working files are not rewritten by this update.
@@ -0,0 +1,24 @@
1
+ # Context efficiency implementation plan
2
+
3
+ Saved before implementation. Based on nine-cell v4 evidence: five harness cells exceeded the local input-byte envelope; one hit output length. Preserve all v1–v4 evidence. No paid benchmark rerun or production repository change is authorized by this implementation stage.
4
+
5
+ ## Boundaries and invariants
6
+
7
+ 1. `lib/delivery-context.mjs` pure projections own compact recovery/status/review receipts, byte accounting and conservative history selection. They cannot mutate lifecycle, acceptance, checks, evidence or approval. Exact active acceptance text, validator argv, outputs, progress and all unresolved blockers remain in recovery; size is measured, never silently trimmed to a hard cap.
8
+ 2. Extension owns archive persistence and event integration. Superseded successful **delivery-only, fully paired** tool turns can become archive receipts in outbound context; original session/report are untouched. Failed results, user messages, mixed coding batches, incomplete pairing, and recent delivery turns remain verbatim. Do not archive captures during pending design review. Receipts link to immutable content-addressed archives; archive failure retains original messages.
9
+ 3. Compact normal status and review responses stop serializing nested planning history/capture/revisions. Inspection must remain available in full; large inspection output must have a real complete artifact, not the current misleading generic truncation notice. Reading/semantic review remains model-authored. Any paging is explicit, with digest/source/capture identity retained; large captures are not considered read because a pointer exists.
10
+ 4. Compaction integration uses pi's documented lifecycle, not a second summarizer. Refresh active run before restoring a deterministic recovery record. No model summary can create approval, erase blockers or certify freshness. Do not silently enable paid compaction or override user settings. Add explicit pressure advice/telemetry and document conservative native compaction settings; automatic byte-triggered compaction remains gated on tested engine support.
11
+ 5. Metrics contain numeric category byte counts (system/schema/messages/reasoning/tool classes), no message bodies. Token estimates are labeled estimates, not tokenizer guarantees. A useful large-fixture test must show meaningful reduction while retaining exact obligations.
12
+
13
+ ## Challenges and validation before delivery
14
+
15
+ - Restore after compaction, revision, source edits and branch switching: approval still locked when stale; exact validators/acceptance/outputs and failed evidence remain visible.
16
+ - Old tool-call batches: never orphan IDs or merge tool results across user messages; preserve every failed result. Retained provider reasoning signatures untouched; archived whole turns remove their replay metadata together.
17
+ - Full capture >48KB: parseable response, real retrievable archive, no mutation of capture, missing sections explicitly disclosed. Small-capture compatibility retained.
18
+ - Archive corruption/symlinks/write failure fail conservatively; do not prune data without a verified archive. Session files and reports remain unchanged by projection.
19
+ - Metric category totals, multibyte strings, no prompt/key leakage. Context pressure must not initiate paid retries/compaction unexpectedly.
20
+ - Pure tests + real extension integration + repository quality; benchmark manifests and historic result documents remain preserved. No benchmark superiority claim from synthetic byte savings.
21
+
22
+ ## Subsequent repository benchmark design
23
+
24
+ After implementation, design a preregistered suite, not tasks selected because baseline pi failed. Use realistic feature additions across pinned existing repositories: authorization/migrations, cross-layer optimistic updates, third-party API integration, background jobs and compatibility changes. Separate offline hermetic and authorized online documentation tracks. Specify pristine base SHAs, dependencies/services, network rules, protected tests, held-out probes, paired budgets, common compaction settings and >=3 repetitions. Include old/new harness ablation and Jev separately. Publish development pilots separately from untouched test tasks. Actual expensive runs require a separate frozen manifest and cost authorization.
@@ -0,0 +1,27 @@
1
+ # Context-efficiency author review and validation
2
+
3
+ This is an **author review**, not independent approval.
4
+
5
+ ## Challenged risks and dispositions
6
+
7
+ 1. **Summaries laundering authorization:** recovery is a read-only projection with explicit non-authority text; existing `planningStatus`/tool gate still fingerprints source and binds run/revision/digest. Extension regression changes source after approval and emits compaction notification: mutation remains blocked.
8
+ 2. **Losing exact requirements or negative evidence:** recovery retains acceptance/check argv/outputs, open blockers, validation and review findings, review limitations, failed check status and excerpt. Pure regression asserts exact equality and unchanged durable state across projection/revision. Original evidence/history remain in report/session. Extremely large status/finding responses still encounter the existing presentation limit; not represented as universally bounded lossless responses.
9
+ 3. **Provider-invalid orphan tool results or altered reasoning signatures:** only a complete contiguous assistant plus all its matching unique successful delivery-only results is replaceable. Never alter an assistant's reasoning field in place; preserve mixed code turns, failures and the newest eligible exchanges. No claim of compatibility with every provider cache/continuation API; live provider smoke remains needed for a new campaign.
10
+ 4. **Pointer pretending inspection occurred:** oversized captures include explicit full paged-read instruction and immutable identity, with full artifact on disk. A pointer is not a reading certificate. Existing review capture match/scenario requirements remain in effect; actual comprehension still unprovable. Trusted advisor receives full capture through tool details.
11
+ 5. **Archive corruption/write failure:** verify stored bytes on every archive substitution. Any storage failure conservatively retains original history. Tests cover corrupt artifact and symlinked root rejection. Atomic content-addressed create is not an OS sandbox or crash-proof disk guarantee.
12
+ 6. **Compaction resetting budgets or selecting another run:** compaction hook refreshes the same selected run only; it does not call session restore, reset timers or clear counters. Branch/session restore retains existing behavior. No automatic paid summarizer is introduced.
13
+ 7. **Telemetry leaking source:** only numerical sizes/categories/growth/time written. No prompt snippets or content hashes that imply semantic reading. Categories are coarse wire-JSON attribution; bytes/4 explicitly heuristic.
14
+ 8. **Overclaiming savings:** offline historical potential message savings 26–51% assume archive eligibility and simulated references. Not proof of better live completion, not actual serialized-provider request savings. Full design remains retrievable and exact obligations can still be large.
15
+ 9. **Benchmark integrity:** no historical candidate/evaluator/receipt edited. Adapter source change requires a new manifest/root; old freeze no longer validates this changed checkout and must not be overwritten.
16
+ 10. **Research claims:** repository API/README retrieved directly; identify unstable branches, licensing boundaries and unresolved Cal.com/Cal.diy identity. No claim that proposed tickets or containers are ready.
17
+
18
+ ## Results
19
+
20
+ - `npm run quality`: lint, typecheck, build, **352/352 tests passed**; log `/tmp/context-quality-final.log`.
21
+ - `node --test tools/benchmark/advisor.test.mjs tools/benchmark/runner.test.mjs`: **5/5 passed**, including actual installed pi offline discovery/guard and advisor integration; log `/tmp/context-installed-engine.log`.
22
+ - `git diff --check`: clean.
23
+ - No new paid model calls, no browser/Python suite run in this change, no independent review, no remote CI/PR/merge claimed.
24
+
25
+ ## Follow-ups, not implemented claims
26
+
27
+ Byte-triggered automatic native-compaction scheduling; incremental section/patch design tools; pagination for every unusually large findings/status response; live context+compaction completion validation; new repository containers/reference patches/held-out evaluators; repeated online/offline paid comparisons. Native compaction is user-configured, with deterministic recovery already integrated.
@@ -0,0 +1,49 @@
1
+ # Delivery context: compact projections, durable obligations
2
+
3
+ ## Implemented
4
+
5
+ `lib/delivery-context.mjs` owns pure recovery/status/review projections, context byte metrics and conservative archival selection. `lib/context-archive.mjs` owns immutable content-addressed storage. The extension composes these without changing approval or verification policy.
6
+
7
+ - `delivery_status` no longer echoes full `state.plan.design`, capture, planning history or revision snapshots. It returns exact active acceptance, checks (including argv), outputs, progress, current findings and compact evidence, plus report location and freshness/next-action fields.
8
+ - Successful plan-review responses return counts instead of repeating every walkthrough/challenge. Findings, limitations, identity and provenance stay visible; full reviews remain in reports/session entries.
9
+ - Large `delivery_design inspect` responses return a **complete capture archive path**, ID/digest/source identity and explicit instruction to read the entire artifact in pages. Small captures retain the previous shape. Full large capture remains in tool `details.deliveryCapture` for trusted advisor consumers; it is not automatically placed into model text.
10
+ - After recorded approval, older successful **delivery-only** paired exchanges can become outbound archive references. Keep the two newest eligible exchanges. Failed tool results, reported blocking findings/failed checks, user messages, mixed/code tool turns, unmatched pairs and pending unapproved review contexts stay verbatim. Original session messages and full report history are not rewritten. Archive originals are verified before any replacement; failure retains messages.
11
+ - Context rebuild injects a deterministic recovery record. It preserves exact acceptance, required check definitions, outputs, progress, all persistent open blockers and failed check status. It is explicitly **not authority**. Source freshness, approval and completion remain checked by existing policy immediately before execution/finish.
12
+ - Native `session_compact` refreshes the same selected run without resetting timers, budget, repair counts or planning state. Branch/session restoration continues through the existing reconciliation logic. A generated summary cannot revive approval.
13
+ - `before_provider_request` records numeric category bytes, growth, and labeled bytes/4 token estimate to `.harness/.../context-metrics.jsonl`. No message text is copied. Categories: system, schemas, planning calls, tool results, code calls, reasoning fields, remaining conversation, serialization envelope. Wire formats without messages are conservatively measured as envelope; this is not universal provider tokenizer accounting.
14
+ - Above 240KB in the previously observed payload, inject a pressure warning to reserve room for verification/handoff. It does not silently trigger paid calls or change acceptance.
15
+
16
+ ## Compaction: explicit configuration, not a hidden new model call
17
+
18
+ Native pi compaction remains controlled by the user's engine settings. **This change does not turn it on behind the user's back**, and does not add a second summarizing model. Future comparison runs must enable the same native policy in all arms and charge summarization tokens/time to each cell.
19
+
20
+ For a 100k-token engine configuration, an initial development setting to validate is:
21
+
22
+ ```json
23
+ {"compaction":{"enabled":true,"reserveTokens":40000,"keepRecentTokens":12000}}
24
+ ```
25
+
26
+ That requests native compaction around 60k estimated tokens while keeping recent work. These are tuning starting points, **not** a guarantee against a 400KB byte ceiling: escaping, schemas, reasoning metadata and long Unicode/tool results can break bytes/token heuristics. Use the numeric metrics and a preflight that exercises real tool history and compaction before freezing a paid test. A byte-triggered automatic compaction scheduler and incremental plan-authoring APIs remain follow-up work; no implementation or success claim for them is made here.
27
+
28
+ ## Measured offline savings
29
+
30
+ Applying eligible archive substitutions to the final saved v4 message histories (assuming approved state, with simulated compact archive references) reduced serialized **message-history** bytes by:
31
+
32
+ | Task | Carthagent | Carthagent + Jev |
33
+ |---|---:|---:|
34
+ | Voxel | 26.4% | 27.6% |
35
+ | Shop | 29.6% | 38.7% |
36
+ | Ledger | 48.4% | 50.9% |
37
+
38
+ Artifact `/home/baissi/benchmarks/context-efficiency/historical-projection.json`. This is an offline potential-savings measurement, not replayed paid runs, live provider tokens, improved correctness, or proof that the old runs would have finished. Post-revision pending review disables archival, so the final-history eligibility assumption can overestimate savings in an actual state. The smaller status/review responses are additional unquantified changes.
39
+
40
+ ## Limits and compatibility
41
+
42
+ - Exact requirements/checks/blockers are not silently trimmed to a fixed recovery size. A huge contract can still be huge.
43
+ - Archive files and reports may contain secrets already present in planning/tool data; no default redaction or zero retention. Archives use 0600 for new files. Same-user access and symlink races against a hostile host are outside the participating-tool boundary.
44
+ - Archive pointer/read receipts never certify actual reading or semantic review. The model must explicitly retrieve large captures; all review and approval obligations remain unchanged.
45
+ - The ordinary response truncation helper still applies to extremely large non-inspection responses; this change fixes large inspection retrieval specifically, not every possible result. Review/validation finding-list pagination is future work.
46
+ - Benchmark advisor now accepts large captures from trusted tool details as well as small capture text. This invalidates historic source manifests for rerun; existing freezes/results remain unchanged evidence.
47
+ - No code/test output or user messages are compressed by the deterministic archive selection. Native compaction handles general conversation growth, with the recovery record protecting harness obligations.
48
+
49
+ Validation includes pure size/invariant tests, real extension gate/restore tests, large-capture retrieval, failure-preserving history projection, numeric telemetry redaction-by-design and repository quality. Native compaction's model-generated summary quality and a paid completion-rate improvement remain unmeasured.
@@ -0,0 +1,70 @@
1
+ # Three-task DeepSeek / Jev benchmark — protocol v1
2
+
3
+ Status: design challenged before benchmark implementation; candidates have not run.
4
+
5
+ ## Question and experimental arms
6
+
7
+ Does Carthagent improve externally measured task delivery over plain pi, and does advisory Jev add value above the same harness? All arms use the same installed pi engine and pinned `deepseek/deepseek-v4.1-flash` via OpenRouter, high reasoning, identical task text, initial workspace, tool availability and resource ceilings. The harness arms explicitly load this repository's delivery extension/skill; the plain arm has no extensions, skills, context files or prompt templates. This controls engine version rather than conflating vendored-engine differences with harness value. Record exact engine and harness versions.
8
+
9
+ A: plain pi. B: pi + Carthagent, no Jev. C: pi + Carthagent + Jev advisory feedback on the first successful design inspection per revision (at most 3 calls/run). No Jev router: it could choose a different generator and confound the ablation. Jev cannot approve or weaken deterministic gates. Probabilities >=0.5 flag review topics, not proven defects. Use OpenRouter `typesafe/jev-1.13` Decisions API, preserving returned snapshot/provider/cost.
10
+
11
+ Initial exploratory matrix: **3 tasks × 3 arms × 1 independent run = 9 runs**. Balanced task-specific arm order; no selective retries or supervisor repairs. One replicate per cell is exploratory, not statistically conclusive. Infrastructure smoke tests are separate and are never counted as task successes. If infrastructure fails, preserve results and explicitly document any protocol revision before restarting any affected comparisons.
12
+
13
+ ## Tasks and external acceptance
14
+
15
+ 1. **Rust voxel sandbox (small Minecraft-like clone)**: actual Rust gameplay/voxel state and software-rendered first-person view, deterministic terrain, collision/gravity, block remove/place with bounded reach, save/reload and malformed-save rejection. Browser input/display may be a thin JS frontend to the Rust server. Test Rust compilation and headless scenarios, then real browser controls/rendering and screenshot. Not a Minecraft-complete game: no crafting, mobs, infinite streaming or multiplayer.
16
+ 2. **Sales website**: responsive local outdoor-products storefront, search/category/sort, stock-aware persistent cart, exact-cent totals, discount/shipping rules, validated checkout, idempotent order submission, persisted orders and stock, accessible status/error UI. Evaluate API contracts and real browser add/update/reload/checkout at desktop/mobile widths. No real payments/deployment.
17
+ 3. **Exact-money transfer ledger**: Node JSONL service/CLI, signed decimal parsing without float rounding, integer-cent balance invariants at large magnitudes, atomic insufficient-funds rejection, idempotent retries/conflict rejection, persistence/restart and malformed log handling. Evaluate ordinary, adversarial and deterministic seeded metamorphic cases. This targets defects that screenshots and agent-owned tests miss.
18
+
19
+ Each task gets a frozen public prompt with observable interfaces and detailed requirements. External tests are written and hashed before candidates start; evaluator files are outside candidate workspaces and never sent to models. They are **withheld, not OS-isolated secrets**: same-host shell access is not a security sandbox. Do not claim blind testing if a trace shows evaluator access. Public API specifications are not hidden-test leakage. No candidate receives external scores or repairs during its initial run.
20
+
21
+ Score separate behavioral categories; report missing/unbuildable/unlaunchable as failures, not missing rows. Collect agent-authored tests separately. Capture visual artifacts but do not pretend pixel existence proves playability or subjective design quality. Report browser/runtime infrastructure failures separately from candidate failures.
22
+
23
+ ## Budgets and measurement
24
+
25
+ - Per candidate: 15 minutes wall time, 120 observed tool starts, at most 100 paid generation requests, 16,384 generated tokens per request, 100,000-token engine context setting and 402,000-byte serialized request cap (conservative <=412,000-token reservation envelope including protocol overhead; actual token count is recorded).
26
+ - Provider proxy enforces max input/output prices of $0.30/$1.20 per million for DeepSeek, $0.15 generation-request reservation (covering <=412k input tokens and 16,384 output tokens at these rates) and **$3 maximum reserved spend per candidate**. Stop on unknown/invalid billing instead of interpreting missing cost as free; reconcile `usage.cost` when available. Jev max 3 requests, <=64KB request, $0.01 reservation each, included in candidate ceiling. Overall candidate ceiling $27; smoke/provisioning API calls separately capped at $0.10. No automatic escalation.
27
+ - Track external score, completion/false-completion, all failures, wall time, requests/tool calls, input/output/cache/reasoning token usage, actual provider cost, Jev latency/probabilities and model snapshots. Local provisioning/build time is recorded separately. Missing cost is unknown, not zero.
28
+ - One bounded infrastructure retry only for connection failure before generation, never candidate retries that erase failures. Sequential paid requests per candidate; overlapping tasks may be scheduled for practicality, with hardware contention disclosed.
29
+
30
+ ## SRP / DI design
31
+
32
+ - Frozen protocol/task specs: own task meaning and scoring weights, no execution.
33
+ - `gateway`: owns outbound model authentication, model allowlist, bounded requests and spend reservation, sanitized usage receipts. Inject fetch/key/clock; candidates receive a dummy local credential, never the real key. Never log authorization headers. Restrict listening to loopback.
34
+ - `runner`: owns workspace/process lifecycle, resource deadline, JSON event logging, immutable invocation/results; no scoring or model-written repairs. Inject engine path, process environment and gateway address.
35
+ - `advisor`: owns extracting an inspection result, typed Jev rubric and attaching advisory feedback to the corresponding generator tool result; no approval or execution permission. Exactly the same Carthagent policy in B/C.
36
+ - `evaluators`: own independently specified functional oracles and browser checks, no candidate prompts or automatic repair. Real subprocess/HTTP/browser boundaries, not fake-only tests.
37
+ - `report`: joins immutable receipts and scores; missing data stays missing; no synthetic statistical certainty.
38
+
39
+ ## Preimplementation challenges / scenario walkthroughs
40
+
41
+ - Availability: OpenRouter's ordinary chat catalog lists DeepSeek and Jev Router, but Jev itself is a separate Decisions API. Verified primary Jev docs before choosing endpoint; never substitute router results for a Jev ablation.
42
+ - Key confidentiality: parent reads only OpenRouter auth; child uses dummy proxy credential and a clean config/environment. Shell can still read host files absent OS isolation, so never represent this as protection against a malicious candidate. No real secrets in prompts, saved configs or request logs.
43
+ - Fairness: same engine/tool set/settings and unmodified public task prompts. Harness guidance and Jev feedback are intentional treatment differences. Tool-budget overhead is part of harness cost; also report generation/request/time overhead so quality is not cherry-picked.
44
+ - Failure: invalid model response, no billing, timeout, exhausted budget, compiler failure and no rendered UI stay visible. Missing Jev is an unavailable treatment, not a successful Jev run.
45
+ - Oracle adequacy: test mutant behaviors (float money, duplicate application, ignored stock, no voxel change) to show evaluators detect meaningful failures before running candidates. Real browser checks complement API/headless checks.
46
+ - Persistence: restart after state changes, then retry same operation; require exactly-once state. Malformed state must reject without overwriting valid state.
47
+ - Visual scope: require a rendered scene plus controls/state transitions; do not award a playable-clone score to only a data structure or screenshot.
48
+ - Environment: Rust is not installed on PATH; provision an isolated toolchain before candidates. Firefox exists but snap cannot use /tmp worktrees; use benchmark runtime under the home directory with an explicit writable profile root.
49
+ - Provenance: generative/model-authored planning reviews are not independent; external tests are supervisor-authored with published limitations. Historical earlier trials remain untouched.
50
+
51
+ Outcome: protocol ready for tooling/evaluator implementation. Freeze implementation hashes before any task candidate. Adjustments needed after infrastructure probes must be logged, not silently retrofitted to favor an arm.
52
+
53
+ ## Pre-candidate infrastructure findings and protocol v1.1
54
+
55
+ - Rust 1.98.1/cargo 1.98.1 were already installed under `~/.cargo/bin`; only PATH composition was needed.
56
+ - The first plain smoke preserved a genuine budget-stop: its $0.05 total could not reserve a second $0.05 generation request after the first bill. A separate harness smoke with $0.08 total completed tool use and `SMOKE_OK`. No task candidate ran during these corrections. Paid smoke actual costs: $0.0007059 + $0.0041763 + $0.000019278 (Jev) = $0.004901478, below the $0.10 ceiling.
57
+ - Real Firefox initially exposed two supervisor fixture defects (missing HTML content type; missing WebDriver return). Both were repaired before candidate evaluation and original failing logs retained. Native click + screenshot now pass under home-directory profiles.
58
+ - Jev live endpoint smoke returned valid typed answers and billing. Inspection of the real delivery tool showed an outer `{result,planningStatus}` wrapper; the benchmark adapter now reads `result`. A real loopback integration test reproduces this exact envelope, verifies once-per-revision feedback and proves the adapter leaves the original tool result unchanged. The initial synthetic smoke did not use the real wrapper; it established API connectivity, not end-to-end harness integration.
59
+ - Initial 95KB generation body cap would unnecessarily truncate longer coding contexts. Before all candidates, increased to 402KB after serialization, with $0.15 reservation rather than $0.05. Reservation uses a deliberately conservative byte/token envelope, not a claim that bytes/4 is a guaranteed tokenizer bound. Provider billing remains the external source of truth; unexpected billing stops further requests, not a vendor-enforced account cap.
60
+ - Gateway buffers bounded upstream SSE until billing arrives; all arms have the same buffering and 180-second per-request transport deadline. This delays visible token streaming, not the model's generation. There are no automatic gateway retries. No OS sandbox or absolute account-level spending guarantee is claimed.
61
+ - Evaluator self-tests include a separately authored ledger reference process and float/idempotency mutant processes. Shop quote and voxel-state/change oracles have component-level mutant assertions, not complete reference applications; their full candidate HTTP/browser suites have not been validated against independently built passing apps. Report that limitation. Browser infrastructure uses actual Firefox and native input.
62
+ - Scores are unweighted category pass counts with the complete assertions published afterward; categories are not equal complexity. Visual screenshots support inspection but there is no invented quantitative aesthetic score.
63
+
64
+ ## Verified primary references
65
+
66
+ - https://openrouter.ai/api/v1/models (retrieved 2026-09-28): DeepSeek model ID and $0.30/M input, $1.20/M output, $0.006/M cache-read listing.
67
+ - https://openrouter.ai/docs/guides/community/jev : Jev available with OpenRouter key, distinct Decisions/System One endpoints.
68
+ - https://openrouter.ai/docs/guides/community/jev-tutorial : typed answers and `usage.cost`, pinned `typesafe/jev-1.13` resolving to dated snapshot.
69
+
70
+ The full API catalog and primary documentation snapshots were retained under `/tmp/ctg-benchmark-discovery/`. Search snippets were discovery aids, not the basis for endpoint selection.
@@ -0,0 +1,20 @@
1
+ # Benchmark readiness repair (v3)
2
+
3
+ User requested all fixes needed to make the tests runnable. Preserve v1/v2 and their reports. Do not change candidate code or interpret transport failures as model failures.
4
+
5
+ ## Design before implementation
6
+
7
+ 1. Transport adapter owns HTTPS/process I/O only: use a fresh system-curl process (system OpenSSL, HTTP/1.1, no shared TLS session/pool) per upstream request, with normal certificate/hostname validation. No `-k`, relaxed ciphers, credential argv, redirects, implicit curl config, or automatic POST retry. Fixed gateway endpoints remain authoritative. Bound body, deadline and subprocess lifetime. Return a fetch-compatible buffered response; gateway owns envelope and billing. TLS root cause remains unproven; this is a separately tested avoidance path.
8
+ 2. Shared runtime adapter owns explicit sanitized environment, copied offline fd/rg binaries, process cleanup and engine paths. Verify actual pi read/ls/find/grep in an empty isolated config, not merely `--version`. Same tool/guard setup for every arm; planning gates unchanged.
9
+ 3. Durable campaign accounting owns exclusive locking, atomic snapshots, reservation before process/request dispatch and conservative crash recovery (holds remain). Seed previous candidate spending plus unresolved holds and smoke spending. No automatic retries, reset, or account-level cap claim.
10
+ 4. Freeze owns source/engine/tool hashes and readiness receipts. Runner verifies actual hashes before any candidate, rejects existing directories, classifies terminal assistant errors separately from exit status, records tool attempts/admitted calls and structured infrastructure failures. Pre-execution extension blocks beyond 120 attempts; observed `tool_execution_start` may include blocked calls and is not execution proof.
11
+ 5. Evaluation keeps original contracts, sanitizes child environments, bounds process groups and browser waits, uses fresh output directories. Browser waits honor the public 2s UI update allowance rather than fixed subsecond assumptions; reference fixtures and mutants exercise the real HTTP/browser paths. Old evaluator hashes/results remain historical; v3 changes require a new freeze.
12
+
13
+ ## Challenges / tests
14
+
15
+ - Malformed HTTP/SSE, wrong model, split Unicode, stalled/chunked/oversized response, TLS self-signed rejection, trusted local TLS, redirects, abort, missing curl, secret-in-argv/log and concurrent body-read races.
16
+ - Unknown billing is not replay-safe: retain reservation and stop campaign rather than retry a paid POST. Reconciled invalid response can stop without labeling its cost unknown.
17
+ - Concurrent processes cannot both spend the same campaign balance; crash leaves a hold. Existing state cannot be silently reset. Freeze modification blocks before paid calls.
18
+ - Installed pi scripted local provider completes discovery, sees missing tools as failure, reaches real plan validation/inspection and Jev hook, respects preapproval mutation lock and preventive tool budget. Exit 0 + terminal error must fail readiness.
19
+ - Reference shop real API/native Firefox controls must pass, deliberate pricing/idempotency mutants must fail. Voxel previous candidate is a retained regression fixture only, not an independent reference; evaluator logic invariants/mutants complement it. Do not fix candidates to satisfy evaluators.
20
+ - No paid candidate matrix until offline readiness and bounded TLS/live connectivity checks pass. Live readiness expenses share the remaining original smoke allowance. A finite soak is evidence, not proof TLS can never fail.
@@ -0,0 +1,9 @@
1
+ # Uniform infrastructure restart (v2)
2
+
3
+ Original frozen tasks and evaluators: original-freeze.json, commit 7087423. No task/evaluator changes between attempts. All v1 runs are retained at ../deepseek-jev-v1, including the partial plain voxel candidate and eight zero-tool failures. The initial gateway hid the root cause behind its sanitized generic failure. Separate tiny diagnostic requests succeeded afterward; no candidate repair or external scores were returned to a generator.
4
+
5
+ Restart announced to user before beginning. Changes are runner root v2, candidate ceiling $2.84 (was $3), extra sanitized error class/code/stage receipts, and stop-the-matrix on the first gateway stopped condition instead of spending startup requests on the remaining arms. Full matrix order is unchanged. The first v2 run is launched individually for early diagnosis; subsequent runs only proceed if infrastructure remains healthy. No copying v1 candidate files into v2.
6
+
7
+ Worst-case accounting for v1: known actual $0.048990234 plus 9 unresolved $0.15 reservations = $1.398990234. Nine v2 ceilings of $2.84 = $25.56. Combined $26.958990234 <= original $27 candidate ceiling. Tiny diagnostic calls are separate smoke expense, within the original $0.10 allowance. Reservations are conservative local limits, not an OpenRouter account-level cap.
8
+
9
+ This is a transparent all-arm infrastructure restart, not another statistically independent replicate or a discarded bad model result. Retain both attempts and report v1 failures. No further automatic restarts authorized by this protocol.