carthagent 0.0.0-stage → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +219 -2
  3. package/bin/ctg.mjs +736 -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/graph-context-optimization.md +15 -0
  27. package/docs/jev-repository-pilot-plan.md +25 -0
  28. package/docs/jev-repository-pilot-protocol.md +39 -0
  29. package/docs/jev-repository-pilot-restart.md +7 -0
  30. package/docs/jev-repository-pilot-results.md +79 -0
  31. package/docs/jev.md +32 -0
  32. package/docs/model-registry.md +25 -0
  33. package/docs/native-compatibility.md +117 -0
  34. package/docs/opencode-archive.md +9 -0
  35. package/docs/opencode-migration.md +115 -0
  36. package/docs/opencode-runtime.md +94 -0
  37. package/docs/opencode-workspace.md +31 -0
  38. package/docs/owned-runtime-workflow-registration.md +17 -0
  39. package/docs/plan-advisor-evaluation.md +38 -0
  40. package/docs/planning-startup-fix-plan.md +23 -0
  41. package/docs/planning-startup-fix-review.md +24 -0
  42. package/docs/planning.md +118 -0
  43. package/docs/production-merge-review.md +23 -0
  44. package/docs/quality.md +35 -0
  45. package/docs/repository-benchmark-design.md +111 -0
  46. package/docs/review-assurance.md +9 -0
  47. package/docs/review-experiment-results.md +59 -0
  48. package/docs/tested-planning-roadmap.md +58 -0
  49. package/docs/tested-planning.md +58 -0
  50. package/docs/tui-pickers.md +9 -0
  51. package/docs/webdriver.md +83 -0
  52. package/docs/workflow-modes.md +26 -0
  53. package/docs/workflow.d2 +17 -0
  54. package/docs/workflow.svg +149 -0
  55. package/docs/workspace-coordination.md +9 -0
  56. package/evaluate.mjs +249 -0
  57. package/extensions/codegraph.ts +36 -0
  58. package/extensions/delivery.ts +819 -0
  59. package/extensions/experiential.ts +21 -0
  60. package/extensions/subscriptions.ts +21 -0
  61. package/guidance/profiles/authenticated-web.json +24 -0
  62. package/guidance/profiles/data-visualization.json +25 -0
  63. package/guidance/profiles/database-change.json +24 -0
  64. package/guidance/profiles/external-api.json +24 -0
  65. package/guidance/profiles/transactional-data.json +25 -0
  66. package/guidance/profiles/web-application.json +26 -0
  67. package/lib/acceptance-review.mjs +4 -0
  68. package/lib/browser-bin.mjs +160 -0
  69. package/lib/browser-errors.mjs +54 -0
  70. package/lib/browser.mjs +219 -0
  71. package/lib/budget.mjs +37 -0
  72. package/lib/cdp.mjs +221 -0
  73. package/lib/cloud/client.mjs +275 -0
  74. package/lib/cloud/control-plane.mjs +350 -0
  75. package/lib/cloud/gateway.mjs +380 -0
  76. package/lib/cloud/http.mjs +135 -0
  77. package/lib/cloud/ledger.mjs +215 -0
  78. package/lib/codegraph-query.mjs +60 -0
  79. package/lib/codegraph.mjs +378 -0
  80. package/lib/context-archive.mjs +18 -0
  81. package/lib/delivery-context.mjs +132 -0
  82. package/lib/delivery-guidance.mjs +9 -0
  83. package/lib/delivery-review.mjs +94 -0
  84. package/lib/delivery.mjs +610 -0
  85. package/lib/engine.mjs +137 -0
  86. package/lib/guidance.mjs +71 -0
  87. package/lib/jev-advisor.mjs +47 -0
  88. package/lib/opencode/archive.mjs +122 -0
  89. package/lib/opencode/compatibility.mjs +19 -0
  90. package/lib/opencode/credentials.mjs +205 -0
  91. package/lib/opencode/evaluation-budget-plugin/index.ts +147 -0
  92. package/lib/opencode/evaluation.mjs +242 -0
  93. package/lib/opencode/file-lock.mjs +86 -0
  94. package/lib/opencode/headless.mjs +200 -0
  95. package/lib/opencode/review.mjs +213 -0
  96. package/lib/opencode/runtime.mjs +246 -0
  97. package/lib/opencode/service.mjs +249 -0
  98. package/lib/opencode/session-options.mjs +60 -0
  99. package/lib/opencode/workspace.mjs +133 -0
  100. package/lib/openrouter-jev.mjs +37 -0
  101. package/lib/outcome-contract.mjs +21 -0
  102. package/lib/plan-advisor.mjs +38 -0
  103. package/lib/planning-access.mjs +7 -0
  104. package/lib/planning-advice.mjs +28 -0
  105. package/lib/planning-discovery.mjs +14 -0
  106. package/lib/planning-guide.mjs +34 -0
  107. package/lib/planning-view.mjs +57 -0
  108. package/lib/planning.mjs +155 -0
  109. package/lib/probe-diagnostics.mjs +13 -0
  110. package/lib/providers/experiential.mjs +292 -0
  111. package/lib/providers/model-catalog.json +700 -0
  112. package/lib/providers/model-catalog.mjs +7 -0
  113. package/lib/providers/names.mjs +13 -0
  114. package/lib/providers/subscription-models.mjs +483 -0
  115. package/lib/reports.mjs +80 -0
  116. package/lib/review-state.mjs +49 -0
  117. package/lib/review.mjs +114 -0
  118. package/lib/scenarios.mjs +99 -0
  119. package/lib/ship-auth.mjs +44 -0
  120. package/lib/ship-jev.mjs +59 -0
  121. package/lib/ship-telemetry.mjs +183 -0
  122. package/lib/tui/ansi.mjs +255 -0
  123. package/lib/tui/app.mjs +2445 -0
  124. package/lib/tui/auth.mjs +249 -0
  125. package/lib/tui/carthage.mjs +109 -0
  126. package/lib/tui/clipboard.mjs +122 -0
  127. package/lib/tui/d2.mjs +431 -0
  128. package/lib/tui/feed.mjs +467 -0
  129. package/lib/tui/framing.mjs +80 -0
  130. package/lib/tui/glyphs.mjs +172 -0
  131. package/lib/tui/hash-worker.mjs +11 -0
  132. package/lib/tui/mock-engine.mjs +222 -0
  133. package/lib/tui/models.mjs +73 -0
  134. package/lib/tui/picker.mjs +18 -0
  135. package/lib/tui/theme.mjs +663 -0
  136. package/lib/tui/title.mjs +7 -0
  137. package/lib/update-channel.mjs +62 -0
  138. package/lib/update.mjs +230 -0
  139. package/lib/webdriver.mjs +82 -0
  140. package/lib/workflow.mjs +88 -0
  141. package/lib/workspace.mjs +39 -0
  142. package/metadata.json +8 -0
  143. package/package.json +94 -4
  144. package/plugins/carthagent/index.ts +3 -0
  145. package/plugins/carthagent/package.json +28 -0
  146. package/plugins/carthagent/src/archive-rpc.ts +46 -0
  147. package/plugins/carthagent/src/bootstrap.ts +38 -0
  148. package/plugins/carthagent/src/index.ts +62 -0
  149. package/plugins/carthagent/src/pull-request-rpc.ts +54 -0
  150. package/plugins/carthagent/src/rpc.ts +76 -0
  151. package/plugins/carthagent/src/server/archive-rpc.ts +327 -0
  152. package/plugins/carthagent/src/server/budgets.ts +21 -0
  153. package/plugins/carthagent/src/server/codegraph.ts +46 -0
  154. package/plugins/carthagent/src/server/delivery.ts +488 -0
  155. package/plugins/carthagent/src/server/device-auth.ts +91 -0
  156. package/plugins/carthagent/src/server/native-delivery.ts +26 -0
  157. package/plugins/carthagent/src/server/orchestration.ts +56 -0
  158. package/plugins/carthagent/src/server/policy.ts +24 -0
  159. package/plugins/carthagent/src/server/providers.ts +424 -0
  160. package/plugins/carthagent/src/server/pull-request-rpc.ts +387 -0
  161. package/plugins/carthagent/src/server/session-controls.ts +82 -0
  162. package/plugins/carthagent/src/server/telemetry.ts +92 -0
  163. package/plugins/carthagent/src/server/workspace-rpc.ts +349 -0
  164. package/plugins/carthagent/src/session-rpc.ts +31 -0
  165. package/plugins/carthagent/src/testing.ts +85 -0
  166. package/plugins/carthagent/src/workspace-rpc.ts +133 -0
  167. package/plugins/carthagent/test-plugin/index.ts +4 -0
  168. package/plugins/carthagent/test-plugin/package.json +1 -0
  169. package/plugins/carthagent/tsconfig.json +19 -0
  170. package/plugins/carthagent/tui.ts +1 -0
  171. package/prompts/delivery.md +7 -0
  172. package/public/index.html +983 -0
  173. package/scenarios/cli/grade_cli.py +69 -0
  174. package/scenarios/cli/scenario.json +21 -0
  175. package/scenarios/game/baseline/minecraft.py +193 -0
  176. package/scenarios/game/context.md +1 -0
  177. package/scenarios/game/grade_minecraft_clone.py +603 -0
  178. package/scenarios/game/requirements.txt +2 -0
  179. package/scenarios/game/scenario.json +33 -0
  180. package/server.mjs +341 -0
  181. package/skills/game-development/SKILL.md +36 -0
  182. package/skills/game-development/assets/ursina_starter.py +98 -0
  183. package/skills/game-development/scripts/verify_ursina.py +80 -0
  184. package/skills/software-delivery/SKILL.md +50 -0
  185. package/skills/typescript-delivery/SKILL.md +69 -0
  186. package/tests/acceptance-review.test.mjs +13 -0
  187. package/tests/auth.test.mjs +234 -0
  188. package/tests/bounded-summary.test.mjs +68 -0
  189. package/tests/browser-bin.test.mjs +91 -0
  190. package/tests/browser.test.mjs +96 -0
  191. package/tests/budget-engine.test.mjs +110 -0
  192. package/tests/budget.test.mjs +23 -0
  193. package/tests/cli.test.mjs +245 -0
  194. package/tests/clipboard.test.mjs +79 -0
  195. package/tests/cloud-client.test.mjs +129 -0
  196. package/tests/cloud-control-plane.test.mjs +144 -0
  197. package/tests/cloud-gateway.test.mjs +147 -0
  198. package/tests/cloud-http.test.mjs +102 -0
  199. package/tests/cloud-ledger.test.mjs +75 -0
  200. package/tests/codegraph-query.test.mjs +66 -0
  201. package/tests/codegraph.test.mjs +142 -0
  202. package/tests/delivery-context.test.mjs +66 -0
  203. package/tests/delivery-review.test.mjs +139 -0
  204. package/tests/delivery.test.mjs +343 -0
  205. package/tests/engine-api.mjs +24 -0
  206. package/tests/experiential-extension.test.mjs +37 -0
  207. package/tests/experiential.test.mjs +300 -0
  208. package/tests/extension.test.mjs +921 -0
  209. package/tests/fixtures/archive-plugin/index.ts +10 -0
  210. package/tests/guidance.test.mjs +78 -0
  211. package/tests/model-registry.test.mjs +68 -0
  212. package/tests/models.test.mjs +70 -0
  213. package/tests/openai-idempotency.test.mjs +99 -0
  214. package/tests/opencode-archive-rpc.test.mjs +82 -0
  215. package/tests/opencode-delivery.test.mjs +231 -0
  216. package/tests/opencode-providers.test.mjs +414 -0
  217. package/tests/opencode-runtime.test.mjs +455 -0
  218. package/tests/opencode-session-controls.test.mjs +115 -0
  219. package/tests/opencode-session-options.test.mjs +26 -0
  220. package/tests/opencode-workspace.test.mjs +339 -0
  221. package/tests/outcome-contract.test.mjs +17 -0
  222. package/tests/picker.test.mjs +34 -0
  223. package/tests/plan-advisor.test.mjs +88 -0
  224. package/tests/plan-review-loop.test.mjs +53 -0
  225. package/tests/planning-advice.test.mjs +27 -0
  226. package/tests/planning-contract.test.mjs +65 -0
  227. package/tests/planning-startup.test.mjs +38 -0
  228. package/tests/planning-view.test.mjs +33 -0
  229. package/tests/planning.test.mjs +223 -0
  230. package/tests/probe-diagnostics.test.mjs +21 -0
  231. package/tests/pull-request-rpc.test.mjs +366 -0
  232. package/tests/review-state.test.mjs +32 -0
  233. package/tests/review.test.mjs +127 -0
  234. package/tests/server.test.mjs +252 -0
  235. package/tests/ship-jev.test.mjs +77 -0
  236. package/tests/ship-telemetry.test.mjs +333 -0
  237. package/tests/standard-workflow.test.mjs +28 -0
  238. package/tests/subscription-models.test.mjs +416 -0
  239. package/tests/subscriptions-extension.test.mjs +27 -0
  240. package/tests/terminal-title.test.mjs +13 -0
  241. package/tests/test_grade_minecraft_clone.py +199 -0
  242. package/tests/test_starter.py +78 -0
  243. package/tests/theme.test.mjs +175 -0
  244. package/tests/tui-copy-paste.test.mjs +54 -0
  245. package/tests/tui.test.mjs +808 -0
  246. package/tests/update-channels.test.mjs +129 -0
  247. package/tests/update.test.mjs +175 -0
  248. package/tests/webdriver.test.mjs +31 -0
  249. package/tests/workflow.test.mjs +47 -0
  250. package/tests/workspace-rpc.test.mjs +236 -0
  251. package/tests/workspace.test.mjs +24 -0
  252. package/tools/benchmark/advisor.test.mjs +7 -0
  253. package/tools/benchmark/advisor.ts +27 -0
  254. package/tools/benchmark/campaign.mjs +45 -0
  255. package/tools/benchmark/diagnose-request.mjs +40 -0
  256. package/tools/benchmark/eval-common.mjs +32 -0
  257. package/tools/benchmark/eval-ledger.mjs +22 -0
  258. package/tools/benchmark/eval-shop.mjs +26 -0
  259. package/tools/benchmark/eval-voxel.mjs +20 -0
  260. package/tools/benchmark/evaluate.mjs +24 -0
  261. package/tools/benchmark/evaluators.test.mjs +13 -0
  262. package/tools/benchmark/fixtures/shop/server.mjs +18 -0
  263. package/tools/benchmark/fixtures/shop/ui.html +8 -0
  264. package/tools/benchmark/freeze.mjs +30 -0
  265. package/tools/benchmark/gateway.mjs +91 -0
  266. package/tools/benchmark/gateway.test.mjs +38 -0
  267. package/tools/benchmark/generator.mjs +11 -0
  268. package/tools/benchmark/generator.test.mjs +26 -0
  269. package/tools/benchmark/guard.test.mjs +133 -0
  270. package/tools/benchmark/guard.ts +136 -0
  271. package/tools/benchmark/native-plugin/index.ts +24 -0
  272. package/tools/benchmark/planning-startup.test.mjs +47 -0
  273. package/tools/benchmark/preflight-live.mjs +31 -0
  274. package/tools/benchmark/preflight.mjs +22 -0
  275. package/tools/benchmark/replay-diagnostic.mjs +23 -0
  276. package/tools/benchmark/runner.mjs +141 -0
  277. package/tools/benchmark/runner.test.mjs +93 -0
  278. package/tools/benchmark/runtime.mjs +23 -0
  279. package/tools/benchmark/selftest.mjs +47 -0
  280. package/tools/benchmark/smoke-jev.mjs +5 -0
  281. package/tools/benchmark/tasks.mjs +20 -0
  282. package/tools/benchmark/transport.mjs +65 -0
  283. package/tools/benchmark/transport.test.mjs +44 -0
  284. package/tools/benchmark/upstream-error.mjs +18 -0
  285. package/tools/benchmark/upstream-error.test.mjs +10 -0
  286. package/tools/browser-check.mjs +109 -0
  287. package/tools/check-syntax.mjs +27 -0
  288. package/tools/evaluate-plan-advisor.mjs +20 -0
  289. package/tools/native-fixture.mjs +194 -0
  290. package/tools/native-pty-smoke.py +108 -0
  291. package/tools/native-report-plugin/index.ts +50 -0
  292. package/tools/native-report-plugin/package.json +7 -0
  293. package/tools/patch-compaction.mjs +24 -0
  294. package/tools/patch-model-catalog.mjs +12 -0
  295. package/tools/patch-print-shutdown.mjs +39 -0
  296. package/tools/repo-pilot/evaluator.cjs +32 -0
  297. package/tools/repo-pilot/reference.mjs +43 -0
  298. package/tools/repo-pilot/runner.mjs +85 -0
  299. package/tools/repo-pilot/sandbox-entry.mjs +12 -0
  300. package/tools/repo-pilot/tasks.mjs +20 -0
  301. package/tools/repo-pilot/type-evaluator.cjs +6 -0
  302. package/tools/test-native-controls.mjs +84 -0
  303. package/tools/test-native-delivery-host.mjs +307 -0
  304. package/tools/test-native-evaluation.mjs +46 -0
  305. package/tools/test-native-host.mjs +385 -0
  306. package/tools/test-native-outcomes.mjs +73 -0
  307. package/tools/test-native-package.mjs +70 -0
  308. package/tools/test-native-pty.mjs +20 -0
  309. package/tools/test-native-report.mjs +88 -0
  310. package/tools/test-native-swe-host.mjs +132 -0
  311. package/tools/test-native-swe.mjs +122 -0
  312. package/tools/test-picker-pty.py +45 -0
  313. package/tools/test-python.mjs +29 -0
  314. package/tools/test-webdriver.mjs +54 -0
  315. package/tools/verify-release-version.mjs +37 -0
  316. package/tools/webdriver-check.mjs +52 -0
  317. package/vendor/agent/bounded-summary.mjs +88 -0
  318. package/vendor/agent/chunks/anthropic-messages-VWZZOSJQ.js +6 -0
  319. package/vendor/agent/chunks/anthropic.js +75 -0
  320. package/vendor/agent/chunks/azure-openai-responses-BJLAM6CD.js +2 -0
  321. package/vendor/agent/chunks/bedrock-converse-stream.js +74 -0
  322. package/vendor/agent/chunks/chord-context.js +96 -0
  323. package/vendor/agent/chunks/chunk-4L3WN2XY.js +2 -0
  324. package/vendor/agent/chunks/chunk-6CYCI3EJ.js +12 -0
  325. package/vendor/agent/chunks/chunk-6R7UI4IY.js +2 -0
  326. package/vendor/agent/chunks/chunk-7ZC4UXSL.js +2 -0
  327. package/vendor/agent/chunks/chunk-AXIIZGTV.js +2 -0
  328. package/vendor/agent/chunks/chunk-CLNPYIDP.js +42 -0
  329. package/vendor/agent/chunks/chunk-DRQDKNXA.js +2 -0
  330. package/vendor/agent/chunks/chunk-GMWCTUPB.js +2 -0
  331. package/vendor/agent/chunks/chunk-IDDQWTHI.js +2 -0
  332. package/vendor/agent/chunks/chunk-JVUZSMYM.js +1548 -0
  333. package/vendor/agent/chunks/chunk-L2ZPNLYD.js +2 -0
  334. package/vendor/agent/chunks/chunk-NUHFSC37.js +25 -0
  335. package/vendor/agent/chunks/chunk-OUXLLA64.js +11 -0
  336. package/vendor/agent/chunks/chunk-PGXDEOVV.js +2 -0
  337. package/vendor/agent/chunks/chunk-PJACZCIR.js +2 -0
  338. package/vendor/agent/chunks/chunk-PRRNXB7S.js +2 -0
  339. package/vendor/agent/chunks/chunk-TEPMHNKQ.js +2 -0
  340. package/vendor/agent/chunks/chunk-TRDNDS6A.js +4 -0
  341. package/vendor/agent/chunks/chunk-U6ZMQKGD.js +50 -0
  342. package/vendor/agent/chunks/chunk-UAQELI3K.js +2 -0
  343. package/vendor/agent/chunks/chunk-USJZMAIR.js +2 -0
  344. package/vendor/agent/chunks/chunk-XDUWOHPL.js +6 -0
  345. package/vendor/agent/chunks/chunk-XNGRGP62.js +2 -0
  346. package/vendor/agent/chunks/github-copilot.js +2 -0
  347. package/vendor/agent/chunks/google-generative-ai-Q2K7FBDI.js +2 -0
  348. package/vendor/agent/chunks/google-vertex-7UJBF4S7.js +2 -0
  349. package/vendor/agent/chunks/https-proxy-agent-2VXB7436.js +13 -0
  350. package/vendor/agent/chunks/image-resize-worker.js +2 -0
  351. package/vendor/agent/chunks/kimi-coding.js +2 -0
  352. package/vendor/agent/chunks/lib-HGQMNYVT.js +9 -0
  353. package/vendor/agent/chunks/mistral-conversations-4M6BZBX6.js +5 -0
  354. package/vendor/agent/chunks/multipart-parser-SQ6GDJL7.js +3 -0
  355. package/vendor/agent/chunks/node-KG362ECQ.js +16 -0
  356. package/vendor/agent/chunks/node-TWVVAGPO.js +2 -0
  357. package/vendor/agent/chunks/openai-codex-responses-R6VYZTVY.js +10 -0
  358. package/vendor/agent/chunks/openai-codex.js +75 -0
  359. package/vendor/agent/chunks/openai-completions-EKZT2IH2.js +7 -0
  360. package/vendor/agent/chunks/openai-responses-TFDINO6W.js +2 -0
  361. package/vendor/agent/chunks/openrouter-images-N4XVVFSD.js +2 -0
  362. package/vendor/agent/chunks/openrouter.js +75 -0
  363. package/vendor/agent/chunks/pi-messages-PML4SPVJ.js +8 -0
  364. package/vendor/agent/chunks/radius.js +75 -0
  365. package/vendor/agent/chunks/src-UK77SYZE.js +4 -0
  366. package/vendor/agent/chunks/xai.js +2 -0
  367. package/vendor/agent/cli.js +3 -0
  368. package/vendor/agent/dist/modes/interactive/theme/dark.json +91 -0
  369. package/vendor/agent/dist/modes/interactive/theme/light.json +90 -0
  370. package/vendor/agent/dist/modes/interactive/theme/theme-schema.json +356 -0
  371. package/vendor/agent/index.js +2 -0
  372. package/vendor/agent/modes/interactive/theme/dark.json +91 -0
  373. package/vendor/agent/modes/interactive/theme/light.json +90 -0
  374. package/vendor/agent/modes/interactive/theme/theme-schema.json +356 -0
  375. package/vendor/agent/package.json +14 -0
  376. package/vendor/agent/rpc-entry.js +3 -0
  377. package/vendor/agent/theme/dark.json +91 -0
  378. package/vendor/agent/theme/light.json +90 -0
  379. package/vendor/agent/theme/theme-schema.json +356 -0
@@ -0,0 +1,24 @@
1
+ # Planning startup repair — author review and results
2
+
3
+ ## Implemented
4
+
5
+ On-demand `delivery_design action=guide` works before a plan without source fingerprint, workspace mutation, or advice call. Compact tested example explains actual component/port/scenario/review fields, requirements and check references; no automatic boilerplate insertion or approval.
6
+
7
+ Discovery checkpoint at8 built-in discovery results or2 blocked implementation attempts, with stronger wording at16 results. It asks for the first accurate plan or one missing fact. Reads stay available; existing execution gates unchanged. Numeric-only metadata is bounded on restoration and loaded from selected branch. New input resets it, successful plan suppresses it, informational asks are excluded heuristically. Context injection is outbound, not a repeated persistent prompt message.
8
+
9
+ Unknown IDs/requirement text include invalid values and valid references. Findings remain blocking. Error presentation handles malformed non-array design sections instead of throwing while explaining validation.
10
+
11
+ Both built-in Jev adapters now transmit check definitions/argv, outputs and assumptions alongside prior semantic input. Test question distinguishes declared commands from execution evidence. Validation precedes optional advice: invalid inspect sends zero calls and reserves zero attempts. Same caps/timeouts, opt-in and no authority; expanded external disclosure documented.
12
+
13
+ ## Tests and challenges
14
+
15
+ - `npm run quality`: lint/typecheck/build and **360/360 tests pass** (`/tmp/ctg-startup-quality-final.log`).
16
+ - `node --test tools/benchmark/planning-startup.test.mjs`: **1/1 installed-engine offline scripted test passes** (`/tmp/ctg-startup-engine-final.log`),20 tool starts:8 reads -> checkpoint -> guide -> plan/validate/inspect/self-review/approve -> actual file write -> real assertion subprocess -> progress/final diff review -> verified.21 zero-cost mocked provider responses. No actual external provider or credentials used.
17
+ - Extension loop test adds invalid check reference -> rejected inspect/zero advice -> preserving revision -> real loopback mock Jev returning a flagged tests topic -> ordinary review/approval/edit/check/final review. Schema guide itself passes production structural validators.
18
+ - Branch navigation restores only selected checkpoint; compaction notification and session restoration preserve counters. Questions and terminal plans suppress reminders. Existing stale-source, user-validator and persistent-blocker suites pass.
19
+ - Both adapter payload/bounds tests verify extra fields unchanged, no plan mutation, and oversized check argv rejected.
20
+ - `git diff --check`: clean.
21
+
22
+ This is **author review**, not independent approval. Scripted plumbing proves the workflow is traversable, not that DeepSeek will stop discovery sooner. No new native model-generated compaction test/paid call or benchmark rerun here. Provider180s deadlines and CURL_56 are not fixed by these changes; no timeout increases, automatic paid retries, token-limit changes or new spending authorization introduced. No browser/Python suite or remote CI/merge claimed.
23
+
24
+ The old `/tmp/ctg-tested-planning` checkout disappeared between turns. Committed history/artifacts survived; reconstructed edits are now under `/home/baissi/ctg-planning-startup`, branch `fix/planning-startup`, based on93c3693. Primary checkout untouched. Historical benchmark source manifests correctly will not validate this changed implementation; their artifacts are not rewritten.
@@ -0,0 +1,118 @@
1
+ # Adaptive delivery planning
2
+
3
+ > Read [tested planning before code](tested-planning.md) first. The approval gate is mandatory before code, tests or commands, including legacy-report resumes. This page describes the subsequent adaptive delivery/evidence layer. See the [rollout ledger](tested-planning-roadmap.md) for stage status.
4
+
5
+ The plan is a revisable acceptance contract, not a one-time list of edits. Its job is to retain requirements, discoveries, progress and verification obligations as understanding changes. It cannot establish that the model understood every requirement or wrote adequate tests.
6
+
7
+ ## Tools and lifecycle
8
+
9
+ - `delivery_plan` starts a task. For compatibility, replacing an active plan is a revision; it no longer erases verification history. After a terminal `verified`/`blocked` report, it creates a distinct task with fresh evidence.
10
+ - `delivery_revise({reason, patch})` changes the **same task**, including resuming blocked/verified work. Omitted fields are preserved; arrays supplied in the patch replace the entire field. Keep original acceptance text and promised outputs. A reason records what discovery changed the approach; it does not authorize dropping requirements.
11
+ - Revisions keep the run ID, increment revision, clear the old handoff and persist snapshots of prior plans, evidence and progress in `report.json`. Status returns compact revision metadata; compaction context includes assumptions, step progress, revision and the latest reason.
12
+ - Unchanged commands, kinds, IDs and deadlines retain fresh evidence only when the full workspace fingerprint and old evidence identity still match. Rebinding records `originRevision` and `executedRevision` and retains the actual log. New/remapped acceptance criteria retain truthful old command results but appear in `unverifiedRequirements` until their mapped suites execute at or after the requirement's introduction. Repeated revisions cannot launder old executions into new coverage. New assertions are still a model obligation, not mechanically proven by rerunning a command. Changed checks need new executions. Failed/stale evidence stays visible without being promoted to fresh; removed/changed checks remain in revision history.
13
+ - Once verification has started, revisions cannot erase that fact to downgrade a required task. User-owned required validators are rebound automatically.
14
+ - `delivery_check({id:"all"})` runs all declared suites sequentially, collecting ordinary failures before reporting an error. Cancellation and evidence-scope errors still stop execution.
15
+ - For required delivery plans, `delivery_status` and `delivery_finish` share completion checks: required checks must be fresh, artifact roots must exist, declared output paths must be files, structured steps must be done, newly added/remapped requirements need fresh executions, and structured required plans need a snapshot-bound `delivery_review` receipt. Informational/advisory handoffs remain non-blocking, but those classifications cannot authorize new command execution. Explicit unfinished legacy progress also blocks finish. Old untracked string-only plans remain compatible.
16
+
17
+ ### Dependency-aware steps
18
+
19
+ ```json
20
+ {
21
+ "steps": [
22
+ {"id":"contract","title":"Capture failing API compatibility behavior","kind":"regression","checks":[]},
23
+ {"id":"api","title":"Implement server adapter","dependsOn":["contract"]},
24
+ {"id":"client","title":"Migrate client","dependsOn":["contract"]},
25
+ {"id":"integration","title":"Verify old and new clients","dependsOn":["api","client"],"checks":["integration"]}
26
+ ]
27
+ }
28
+ ```
29
+
30
+ Define `unit` and `integration` in the plan's checks and map observable acceptance criteria to them. The intentionally-red `kind:"regression"` milestone must have `checks:[]`: reproduce a behavioral assertion failure via a focused shell command and record the result in progress notes, then mark it done. Import/syntax failures do not establish the requested behavior. Keep passing suites on acceptance and the later integration milestone; this avoids the circular requirement to fix code before finishing regression capture. For ordinary work steps, mark done after their mapped checks pass. Numeric indexes still work. Unknown/duplicate IDs, missing dependencies, cycles and missing check references are rejected.
31
+
32
+ The API and client branches can proceed independently once the contract step is done. Dependency order is enforced by progress updates, not by restricting arbitrary shell commands. Reopening a prerequisite resets downstream progress. Revisions preserve progress only for unambiguously unchanged steps; changed prerequisites reset dependent progress. Legacy strings are matched by unique title rather than old index.
33
+
34
+ ## Traceable final review and monitoring
35
+
36
+ For structured required plans, `delivery_review({action:"inspect"})` captures `git diff HEAD` without external diff/textconv helpers, plus the full untracked-file list. It returns a capture ID and saved path; read the full file if truncated and inspect new-file contents separately. Git workspaces need a committed baseline and must be the repository root. Non-Git workspaces receive an explicit manual-source-review limitation instead of a fabricated diff.
37
+
38
+ After fixing findings and rerunning checks, record:
39
+
40
+ ```js
41
+ delivery_review({
42
+ action: "record", captureId: "<returned ID>",
43
+ coverage: [{ requirement: "<exact acceptance text>", assertions: "<test cases/assertions covering this behavior>" }],
44
+ probes: ["<additional boundary/metamorphic command and observed result>"],
45
+ findings: [], limitations: ["<honest remaining assurance limits>"]
46
+ })
47
+ ```
48
+
49
+ Include every criterion, including user-owned validators. Unresolved findings prevent recording: repair them or finish blocked. Source changes or any plan revision invalidate the receipt. The harness handoff stores exact check evidence and review evidence; model-authored output reports remain untrusted. Review descriptions and claimed probes are **self-reported**, not proof that files were read or assertions are adequate. This gate does not replace independent review.
50
+
51
+ Use `ctg --json -p "task"` for engine JSONL events including tool activity, or `ctg status --json` for a versioned report/fingerprint/completion snapshot. Text `-p` alone is not a live tool stream. Engine event shapes follow the bundled engine; report snapshots and saved logs remain the durable evidence. Treat output as potentially sensitive task data.
52
+
53
+ ## Practical workflows
54
+
55
+ ### 1. Cross-package API evolution in a TypeScript monorepo
56
+
57
+ **Goal:** add pagination without breaking older clients.
58
+
59
+ 1. Inspect server routes, shared types, generated clients, consumers and workspace scripts. Record compatibility invariants and baseline failures.
60
+ 2. Capture old response behavior with regression/contract tests. Plan separate server and client branches plus an integration join, as above.
61
+ 3. Discover a second consumer using a different serialization convention. Revise assumptions and add an adapter step; do not reset already passing evidence if only the plan changed.
62
+ 4. Implement the adapter with targeted tests. Since source changed, rerun affected suites during development and every declared suite against final source before finish. Include the repository's typecheck/build/lint gates, not just a smoke command.
63
+ 5. Exercise old and new public clients in fresh subprocesses, then inspect the final diff for unhandled consumers and unrelated changes.
64
+
65
+ **Automated planning coverage:** dependency gating, stable progress through reordering, shared-config staleness and no fabricated evidence reuse (`tests/planning.test.mjs`).
66
+
67
+ ### 2. Database migration with a discovered backfill risk
68
+
69
+ **Goal:** introduce a non-null column while preserving data and compatibility during rollout.
70
+
71
+ 1. Record schema version compatibility, backfill size, transaction/locking risks, retry behavior and rollback strategy. Use an isolated test database; a plan does not authorize production migration.
72
+ 2. Start with schema, backfill and verification milestones. Run a probe against representative old records.
73
+ 3. If the probe reveals duplicate or partially migrated records, revise the backfill milestone into idempotency, failure/restart and integrity checks. Preserve the original data-integrity acceptance criterion.
74
+ 4. Reopen affected prerequisites so downstream completion no longer appears valid. Map the final step to migration, rollback/recovery and old-client integration checks.
75
+ 5. Declare a migration report under `outputs` and inspect its contents. Merely having a report file is not proof of its correctness.
76
+
77
+ **Automated planning coverage:** changed prerequisite invalidation, failed-evidence history across revisions, blocked-task resumption, missing-output finish gates. These are planning scenarios, not tests of a real database engine.
78
+
79
+ ### 3. Shared-library regression across many services
80
+
81
+ **Goal:** fix a retry/cancellation bug without changing public behavior.
82
+
83
+ 1. Reproduce the bug with a failing regression; inspect call sites and existing error-handling conventions.
84
+ 2. Keep a small immediate implementation slice and coarse later integration milestones. Do not write a speculative 40-step plan just because the schema allows it.
85
+ 3. Run focused unit tests while iterating. Run all declared service suites to collect independent failures in one verification pass instead of discovering one per repair turn.
86
+ 4. Revise only after identifying the failure cause. Do not remove assertions or change commands merely to make the gate pass. External validators remain authoritative.
87
+ 5. If an external dependency is unavailable, preserve failing evidence and finish blocked with a specific limitation, rather than reclassifying the work as informational.
88
+
89
+ **Automated planning coverage:** real subprocess checks continue after an ordinary failure; changed commands invalidate evidence; multiple replans cannot wash away verification history (`tests/extension.test.mjs`).
90
+
91
+ ### 4. Long-running refactor interrupted by context compaction
92
+
93
+ **Goal:** reorganize a subsystem without behavioral drift over several work sessions.
94
+
95
+ 1. Capture invariants, package boundaries, assumptions and regression suites before moving code.
96
+ 2. Revise steps as hidden coupling is discovered. Keep stable IDs for unchanged work; avoid relying on numeric position.
97
+ 3. Resume from the active report. The injected context retains assumptions, progress and the latest revision reason. Full earlier snapshots remain in the durable report.
98
+ 4. Recheck workspace freshness before claiming success. Existing evidence is not portable across tasks or arbitrary changed workspaces.
99
+ 5. Use a separate review pass to look for missing requirements and weak tests; a self-authored plan is not an independent review.
100
+
101
+ **Automated planning coverage:** extension restoration/compaction continuity, cooperative workspace lock and superseded-writer rejection, dashboard revision/finish consistency.
102
+
103
+ ## Limits and deliberate tradeoffs
104
+
105
+ - Fingerprinting remains whole-workspace and conservative, with existing exclusions and file/byte limits. There is no inferred package dependency graph, scoped test cache, or selective source-change reuse. This costs reruns but avoids hiding changed shared configuration or undeclared callers. Large repositories can adjust `CARTHAGENT_MAX_FILES` / `CARTHAGENT_MAX_BYTES`; scope-limit errors must not become verified evidence.
106
+ - A check's `kind` is self-declared. Exit zero, file existence, step status and a prose review do not prove assertion strength, visual quality, data safety or complete requirement coverage. Existing tests, user-owned validators and independent review are still important.
107
+ - Declared outputs are existence-gated, not independently provenance-checked. Tests should assert their contents; screenshot files still require actual visual inspection where applicable.
108
+ - Original acceptance text and promised outputs cannot be removed by a same-task revision, except when reclassifying a mistaken required plan as informational before verification begins. Legitimate scope cancellation should be explicitly agreed with the user and recorded in a blocked handoff before creating a new task. A terminal new-task reset is an explicit boundary, not protection against a dishonest model.
109
+ - Revision snapshots grow the report and session state. Status/context deliberately omit full history, but there is no archive/retention policy yet.
110
+ - Locks coordinate participating local tools, not arbitrary edits or distributed workers. See [workspace coordination](workspace-coordination.md).
111
+ - Regression scenarios exercise the planning mechanics in temporary multi-package workspaces and real subprocesses. They do **not** establish improved model code quality, lower cost, or success on production-scale repositories; that requires controlled live-task evaluation.
112
+
113
+ ## Verification
114
+
115
+ ```sh
116
+ node --test tests/planning.test.mjs tests/extension.test.mjs tests/server.test.mjs tests/tui.test.mjs
117
+ npm run quality
118
+ ```
@@ -0,0 +1,23 @@
1
+ # Existing implementation production-branch merge
2
+
3
+ ## Scope and plan
4
+
5
+ User authorized merging existing work. Merge the current context-efficiency, opt-in Jev, startup guidance and benchmark/report history into current origin/main via PR. Preserve main's thinking-model catalog changes. No deployment, new paid benchmark, automatic Jev enablement or timeout-repair implementation is authorized by this merge.
6
+
7
+ 1. Reconcile current main into this branch without overwriting either worktree's unrelated work.
8
+ 2. Review production diff for SRP/DI, authority changes, default paid dispatch and durable evidence preservation; keep known benchmark failures and proposed-only timeout plan explicit.
9
+ 3. Run local quality plus available offline benchmark/integration tests. Use remote CI for OS/Node matrix, Python and browser checks. Do not equate green tests with semantic completeness.
10
+ 4. Publish PR with author review (not independent approval), known limitations and test receipts; merge only after green CI and no unresolved merge blockers. Verify resulting main commit remotely and fast-forward local main only if still clean.
11
+
12
+ ## Author challenge before integration
13
+
14
+ - New runtime modules separate pure context projection/discovery/guide, archival filesystem effects, advisor orchestration and injected provider transport. Existing serialized workspace operation remains the caller; advice does not write approval or resolve blockers.
15
+ - Jev defaults disabled; explicit opt-in plus provider credentials required. Exact requested OpenRouter model typesafe/jev-1.13, Decisions API, bounded inputs/response/time and durable three-attempt maximum. This is not a global dollar limit or zero-retention feature.
16
+ - Archives can retain sensitive original content; content-addressed local writes precede outbound substitution. Full report/session history retained. Pointer is not proof of reading. Context reduction and guide do not claim reliable autonomous completion.
17
+ - Benchmark-only gateway still has buffered stream diagnostics, question-contract drift and imperfect terminal error classification; hardcoded local fixture paths make these tools operator-specific, not production runtime dependencies. They are preserved as historical experimental infrastructure; no paid invocation in normal quality/CI.
18
+ - Current pilot results show uncompleted deliveries and no scored Jev dispatch. Merge ships an optional critic and deterministic ergonomics, not demonstrated Jev effectiveness or fixed provider timeouts.
19
+ - Proposed design-section patching, streaming timing instrumentation, command deadline changes and new pilot repetitions remain unimplemented in delivery-timeout-repair-plan.md.
20
+
21
+ ## Verification
22
+
23
+ Integrated origin/main at72f819a cleanly; thinking-model catalog/TUI changes preserved. Fresh npm run quality: lint/typecheck/build and362/362 tests pass. Separate node --test tools/benchmark/*.test.mjs:18/20 pass, including actual installed-engine offline full delivery, mocked advice, TLS transport and billing/profile tests. Two historical browser evaluator tests fail because local Snap geckodriver cannot preserve its mount namespace (driver log: Invalid argument, unexpected eof); shop6/6 non-browser categories and voxel7/7 non-browser categories pass. These failures remain disclosed, not converted to skips. Logs /tmp/ctg-production-quality.log and /tmp/ctg-production-benchmark-tests.log; historical evaluator diagnostic artifacts retained under /home/baissi/benchmarks/infrastructure-tests/. No live paid calls. Remote OS/Node/Python/browser CI pending at PR publication. Review is author-performed; independent human approval is not claimed.
@@ -0,0 +1,35 @@
1
+ # Repository quality and evaluation evidence
2
+
3
+ Run `npm ci` followed by `npm run quality`. Native Windows, macOS and Linux CI
4
+ runs lint/typecheck, build and JS/Python regressions. A separate Linux Firefox
5
+ job runs `npm run test:browser` and retains screenshots as diagnostic artifacts,
6
+ not evidence of manual visual approval.
7
+
8
+ ESLint recommended rules cover first-party `.mjs` source, tests and tooling.
9
+ TypeScript extension checking remains a separate compiler check. Vendored code,
10
+ scenario fixtures, generated artifacts and public assets are excluded from this
11
+ initial lint scope; this is not a claim that all repository languages are linted.
12
+ Unused parameters/caught errors and deliberately underscore-prefixed bindings
13
+ are permitted. Empty catch blocks remain permitted for established best-effort
14
+ cleanup patterns. No formatting rewrite is required.
15
+
16
+ ## Every implementation and evaluation
17
+
18
+ 1. Discover repository instructions and configured lint, format, type, test and
19
+ production-build commands. Use the target repository's conventions, not carthagent's
20
+ style by default. Do not weaken existing validators.
21
+ 2. Run those gates and focused behavior/failure-path regressions. Report missing
22
+ gates and pre-existing debt explicitly; do not silently call them passing.
23
+ 3. Review the actual diff: architecture, canonical implementations versus
24
+ duplication, validation boundaries, error handling, async cleanup, unused
25
+ code, dependencies, type weakening and public-behavior tests.
26
+ 4. Record findings with severity, path/line, rationale and resolution. Bind the
27
+ review to the commit/source fingerprint; edits invalidate the review.
28
+ 5. Report functional evidence, repository conformance, review findings and
29
+ unreviewed areas separately. A model review is not executable evidence.
30
+
31
+ Maintainer checklist: no unrelated churn; no blanket lint suppression; clean
32
+ failure/cleanup paths; bounded diagnostics; honest platform and visual claims.
33
+ Paid model comparisons additionally require an explicit spending cap and
34
+ independent task acceptance checks. Passing lint does not prove maintainability,
35
+ security, completeness or a favorable cost per accepted change.
@@ -0,0 +1,111 @@
1
+ # Repository-scale daily development benchmark — design proposal
2
+
3
+ ## Aim and honest hypothesis
4
+
5
+ Test whether Carthagent improves **correct feature delivery and regression avoidance** in existing repositories under matched resources, including permissioned online documentation. Do not construct a leaderboard of tasks selected because pi already failed. Harder tasks should challenge baseline and treatment alike; unknown outcome is the point.
6
+
7
+ This is a design/selection proposal, **not a runnable or frozen benchmark yet**. No task has an implemented withheld evaluator, proven environment or reference patch in this suite. Repository SHAs below are discovery anchors, not execution bases. Budget estimates are proposals, not spending authorization.
8
+
9
+ ## Candidate repositories: verified discovery, not inferred from search snippets
10
+
11
+ Primary GitHub API metadata and raw README contents were retrieved into `/home/baissi/benchmarks/repo-suite-design/`. Search-engine results were irrelevant and were not used as evidence.
12
+
13
+ - **Saleor core:** discovery SHA `9ea6bdeae2e704cc01f6659e9c4f87a83d0ce245`. Its README describes GraphQL-only headless commerce, channels, payments/webhooks and a separate dashboard; warns that main is unstable and recommends compatible release versions. Choose a stable release base plus compatible dashboard/storefront pins, not blindly this main SHA. API metadata identifies BSD-3-Clause; inspect licenses in all selected components before packaging fixtures. Sources: https://github.com/saleor/saleor/blob/9ea6bdeae2e704cc01f6659e9c4f87a83d0ce245/README.md and https://api.github.com/repos/saleor/saleor .
14
+ - **Medusa core:** discovery SHA `037232847319a12b83f597cce06e24371f96e81f` on develop. README describes a modular commerce framework and **open-core** licensing: core MIT, separately identified enterprise/RBAC materials require a commercial agreement. Restrict tasks to verified core paths or exclude the repository; do not assume the entire tree is MIT. Sources: https://github.com/medusajs/medusa/blob/037232847319a12b83f597cce06e24371f96e81f/README.md and https://docs.medusajs.com/learn/advanced-development/architecture/overview (linked by README; architecture page not independently fetched in this design).
15
+ - **Scheduling candidate, identity unresolved:** requested `calcom/cal.com`, discovery SHA `54343aa685ae8f33159d2f485ec4a57bad5c574a`; fetched README identifies **Cal.diy**, a community fork with enterprise features removed, Next.js/tRPC/React/Prisma, PostgreSQL, local yarn/Docker development. Resolve canonical repository/redirects and validate license/path scope before adoption; do not describe it as a verified commercial Cal.com checkout. Source: https://github.com/calcom/cal.com/blob/54343aa685ae8f33159d2f485ec4a57bad5c574a/README.md .
16
+ - Directus discovery request returned 404; not selected without resolving its current repository availability.
17
+
18
+ README architecture claims are verified page contents, not evidence that a local installation runs. The suite needs measured tracked file/LOC counts, package graph, baseline suite duration and feature ownership paths after checkout. 'Large codebase' is not established merely by stars/reputation.
19
+
20
+ ## Six proposed tickets
21
+
22
+ Final tickets must be checked against the pinned code: exclude functionality already present and avoid copying an existing upstream fix. Freeze exact public contracts before measured runs. Difficulty comes from existing invariants and cross-layer behavior, not obscure guessing.
23
+
24
+ ### R1 — Channel-scoped order CSV export (Saleor + compatible dashboard)
25
+
26
+ **User story:** An authorized staff member exports filtered orders for one channel from the existing list view, without exposing another channel's/customer's restricted data.
27
+
28
+ **Acceptance contract:** typed API entry point, existing permission checks, streaming/paginated processing, stable documented column/order/filter semantics, formula-injection-safe cells, UTC timestamps with explicit display timezone policy, audit event, bounded memory, accessible download/error state; existing exports/list filters unchanged. Declare whether the pinned project supports async export before choosing an API shape.
29
+
30
+ **Withheld evaluation:** cross-channel authorization matrix; user/app role variants; 20k seeded records with bounded memory threshold defined from reference; commas/newlines/Unicode/formulas; cancel/retry behavior; real browser list filter→export; existing relevant GraphQL tests. Mutants remove permission check, skip pagination, or mishandle quoted cells.
31
+
32
+ ### R2 — Optimistic bulk tagging with conflict recovery (Medusa core admin + API)
33
+
34
+ **User story:** Apply/remove an allowed product label on a filtered selection using existing admin UI, reflecting updates immediately while correctly handling partial failure and another editor.
35
+
36
+ **Acceptance:** existing typed routes and validation, permission-compatible core paths only, per-record version/concurrency rules, atomicity semantics explicitly chosen, idempotent retry, rollback of failed optimistic rows, stale-response protection after filter changes, keyboard operation and screen-reader status. No enterprise RBAC modification.
37
+
38
+ **Evaluation:** deterministic delayed/out-of-order HTTP responses, two clients editing same record, validation failure subset, duplicate requests, browser navigation/reload, persistence/restart, existing product tests. Reference patch and mutants establish that tests detect stale UI and lost updates.
39
+
40
+ ### R3 — Configurable reschedule cutoff with DST safety (resolved scheduling community repo)
41
+
42
+ **User story:** Event owner configures a reschedule cutoff; invitees see localized availability and receive consistent API/UI behavior near cutoff and daylight-saving changes.
43
+
44
+ **Acceptance:** schema/default migration that preserves old events, owner authorization, explicit instant-based cutoff semantics, existing cancellation rules unchanged, localized message, disabled controls plus server enforcement, idempotent competing reschedules. Define injected clock and fixed timezone database version.
45
+
46
+ **Evaluation:** before/at/after cutoff, DST gaps/folds, non-hour offsets, invalid timezone, old database migration, simultaneous requests, browser locale switching, unaffected cancellation routes. No real calendar account; local calendar adapter with real HTTP interaction.
47
+
48
+ ### R4 — Webhook consumer API-version upgrade (Saleor/Medusa integration)
49
+
50
+ **User story:** Update an existing integration to a pinned new upstream event version while accepting the documented old version during transition.
51
+
52
+ **Acceptance:** authenticate exact raw bytes; reject bad/stale signatures; durable deduplication; tolerate documented nullable fields; explicit version mapping; transactional state changes; backoff/Retry-After; redact credentials in logs; no real payments or outbound customer actions.
53
+
54
+ **Online track:** agents may fetch pinned vendor API docs/changelog, not hidden solutions or upstream implementing PRs. Evaluator serves both event versions from a local HTTP service with injected clock/failures. The third-party version/schema must be selected and verified during setup; no invented vendor version in the ticket.
55
+
56
+ **Evaluation:** replay/different payload same event ID, Unicode raw-body signatures, crash between receive/commit, duplicate concurrent delivery, 429 and permanent 4xx, restart; reference/mutants must distinguish retries from double side effects.
57
+
58
+ ### R5 — Persisted advanced search with backward-compatible URLs (admin web app)
59
+
60
+ **User story:** Users save named filter views, share valid URLs, and restore state across navigation without leaking another user's saved view.
61
+
62
+ **Acceptance:** schema migration, ownership enforcement, typed query parser, canonical URL encoding, old URLs still accepted, invalid/deleted filter values handled, back/forward works, no stale network response overwrites new state, accessible reset/error UX.
63
+
64
+ **Evaluation:** two users, migration from old DB, encoded operators/Unicode, malformed query fuzz cases, conflicting request order, browser back/forward/reload, screenshots for review plus objective layout/interaction checks. Existing search routes and API clients remain compatible.
65
+
66
+ ### R6 — Durable background import with cancel/resume (commerce core)
67
+
68
+ **User story:** Upload a product-import CSV, preview validation failures, start a bounded background job and resume safely after worker restart.
69
+
70
+ **Acceptance:** existing storage/queue seams, explicit row-level transaction/idempotency semantics, progress and cancellation state machine, maximum upload limits, formula/text handling, no partial undocumented silent success, old synchronous API compatibility if present, no customer-data outbound traffic.
71
+
72
+ **Evaluation:** malformed row midway, worker termination after database commit before acknowledgement, repeated upload/key, cancel racing commit, retry permanent errors, scoped status polling, real queue/DB/browser. Small and large files; resource bounds calibrated against reference, not arbitrary impossible latency requirements.
73
+
74
+ ## Tracks and network policy
75
+
76
+ 1. **Hermetic development:** prebuilt containers/dependency cache, local DB/Redis/mail/webhook stubs; no outbound network during candidates. Frozen documentation snapshot provided equally.
77
+ 2. **Online documentation:** same containers and tasks/budgets; read-only HTTPS allowlist for official docs, registry metadata and specified upstream source reference pages. Supervisor fetch proxy records URL/time/status/response hash and serves cached identical content for matched runs. Separate cold-live exploration pilot from reproducible cached evaluation.
78
+
79
+ The public web can contain misleading instructions. Treat fetched content as data, not benchmark authority. No production credentials, real payments/calendar events, deployments, public issue/PR submissions, repository pushes or access to supervisor evaluations. External tools need read-only treatment consistently in both arms; granting arbitrary shell before plan approval is not an acceptable workaround. Network/tool isolation must be an actual container/network policy, not merely a prompt. Dependency installs should finish in setup; unavailable upstream docs/services are infrastructure outcomes, not model zeros.
80
+
81
+ ## Fair experimental design
82
+
83
+ - Primary comparison: **plain pi vs context-efficient Carthagent**, same installed engine/model/provider routing, tools, documentation access, native compaction, temperature/reasoning, container hardware, wall/tool/dollar budgets.
84
+ - Secondary ablations: previous Carthagent vs new context projection (separate development tasks); Jev off/on only after primary completion improves. Do not conflate context management, advisor, engine version and larger budgets.
85
+ - Split tasks before execution: development tickets for tuning/fixture fixes, held-out feature tickets for reporting. No discard because baseline won or treatment failed. Pilot both arms to calibrate difficulty; publish all pilot outcomes separately.
86
+ - Proposed first scored tranche: 4 held-out tickets × 2 arms × **3 paired repetitions** = 24 runs. Balanced/reversed arm order and task order. Add online subset as a separately labeled stratum, not unbalanced extra access for treatment.
87
+ - Proposed upper bound per cell: 45 min, 250 tool attempts, $5 including compaction/advisor; **$120 max** for 24 cells, plus explicitly capped setup/diagnostic allowance. Requires user approval and capacity/budget confirmation; do not charge the old $27 campaign. Limits may change during unscored setup only, then freeze.
88
+ - Report paired task-level differences, full run distributions and uncertainty; do not treat assertions or three repeats as independent task samples. A few repository tickets cannot establish universal superiority.
89
+
90
+ ## Success and evidence
91
+
92
+ Primary: strict delivery success = held-out acceptance + protected regression checks + runnable migration/launch + honest final handoff. Separate functional partial-credit, candidate tests, false completion, harness gate completion, time/cost, context growth/compaction calls and infrastructure/resource failures. A runtime pass with missing tests or unfinished handoff is not full success.
93
+
94
+ Maintain immutable original requirements and validators. Baseline and treatment may not edit protected evaluators or weaken existing tests unnoticed. Save source diff, task-specific file scope, executed commands, DB snapshots, request logs, final answer, screenshots and network receipts. Blind reviewer assesses maintainability/security against a predefined rubric; disclose if the supervisor is the only reviewer. No arbitrary 'one file/function' SRP score. Hidden evaluator location must be inaccessible from candidate containers, not a sibling directory under the same user.
95
+
96
+ ## Readiness gates before any measured run
97
+
98
+ - Resolve repository identity/license, pin commit + submodules/lockfiles/container digests and compatible companion repositories.
99
+ - Create isolated container with non-root user, no host auth mounts, limited egress, resource/process limits, separate evaluator service and fresh DB/queues per cell.
100
+ - Install dependencies once; pass existing relevant baseline tests; record unrelated failures without deleting them. Verify browser + migrations and project runtime versions (do not force Node 26 on an unsupported app).
101
+ - Implement reference patch for each ticket, withheld tests and semantic mutants; green reference, intentionally red base and mutant failures must prove test sensitivity. Reference/hidden tests never enter candidate checkout or online allowed pages.
102
+ - Freeze task text, base SHA, public contracts, test/container hashes, docs corpus, budgets and analysis plan; verify before every launch. Add realistic >400KB history/compaction transport preflight and byte/terminal classification regression tests before paying for candidates.
103
+ - Do not start until both arms work in the identical environment and compaction retains obligations. Pause on shared infrastructure failures; retain every cell and any protocol deviation.
104
+
105
+ ## Local capacity check
106
+
107
+ The current host reports approximately 7.6GiB RAM, 2GiB swap and ample disk; neither `docker` nor `podman` was found on PATH. The scheduling README suggests a development Node heap as high as 16GiB. A large multi-service browser fixture is therefore **not ready on this host**. Start with a smaller single-service API ticket or provision a suitable isolated worker; do not silently install privileged container infrastructure or run commercial services to make the benchmark proceed.
108
+
109
+ ## Implementation status
110
+
111
+ Only design and repository discovery are complete here. Checkout/license review, containers, pinned runnable bases, six exact tickets/reference implementations, protected evaluators and repeated paid comparisons are **not implemented/run**. This distinction prevents promising a difficult but nonexistent 'pi cannot handle it' benchmark.
@@ -0,0 +1,9 @@
1
+ # Review assurance
2
+
3
+ `ctg review <pr>` launches one fresh reviewer, with a default 300-second subprocess timeout. `--timeout` accepts integers from 1 through 300. PR metadata lookups each have their own 30-second deadline; this is not a whole-command 300-second deadline.
4
+
5
+ Approval requires successful execution, a valid final verdict line and preceding single-line `REVIEW_JSON` object (version 1, matching snapshot/head, findings with file, positive line, blocking/nonblocking severity, issue and fix), unchanged local source fingerprint, and the same remote PR head before and after review. Missing head identity fails closed. The source fingerprint has the same exclusions as delivery evidence; it is not a filesystem sandbox. Changes made and reverted during review cannot be detected by endpoint comparison.
6
+
7
+ Read-only behavior is currently an instruction, not enforced isolation. A reviewer may execute tools; use a disposable checkout with restricted credentials for untrusted repositories. Snapshot checks detect some mutations after the fact, not prevent them. The CLI now persists a three-attempt admission limit per canonical PR URL in this workspace under `.harness/reviews/`. Failed and inconclusive attempts count; changed heads do not reset the allowance. Concurrent attempts are excluded by an exclusive lock. Approved identical snapshots are not rerun. The third non-approved result escalates; further attempts require user intervention. This is not a cross-workspace quota or protection against state-file edits. Interrupted locks are never automatically stolen: confirm the writer is gone and inspect the saved history before manually recovering state.
8
+
9
+ Review findings are model judgments, separate from test/lint/build evidence. They should identify severity, file and line, rationale, proposed resolution, and uncertainty. A valid verdict does not prove completeness, correctness, or that the reviewer inspected the intended diff. Local context can differ from the PR; the reviewer must use the PR diff as the authoritative change.
@@ -0,0 +1,59 @@
1
+ # Review workflow experiment: not a proven quality improvement
2
+
3
+ Two matched reruns used the original 52-file voxel-project baseline, identical
4
+ prompt, DeepSeek v4.1 Flash, high thinking, and a 30-minute budget. No generated
5
+ source was repaired by the evaluator before scoring. These are single attempts,
6
+ not controlled evidence of causal performance changes.
7
+
8
+ | Run | Seconds | Verified usage USD | Playable acceptance |
9
+ | --- | ---: | ---: | --- |
10
+ | Original CTG | 538.50 | 0.318282600 | Failed |
11
+ | Persistent review findings | 420.51 | 0.326691900 | Failed |
12
+ | Mandatory outcome-contract experiment | 407.71 | 0.518784300 | Failed |
13
+
14
+ The first patched run exercised gameplay handlers in smoke, but ordinary startup
15
+ crashed and coordinate conventions disagreed. The next run tested a real native
16
+ window launch successfully, but rendered geometry, camera-relative strafe and
17
+ player-safe placement still failed independent probes. Both reported verified.
18
+
19
+ Outcome linkage improved traceability; it did not establish assertion adequacy.
20
+ The original paired experiment ran concurrently with another agent, whereas the
21
+ reruns ran alone; sampling and warm caches also varied. No general speed or cost
22
+ advantage is established. Tests and screenshots are not proof of playability.
23
+
24
+ The final experiment also exposed unnecessary review retries: invented finding
25
+ IDs, omitted findings arrays, and resubmitting a resolved finding. Resolution
26
+ retries now accept identical evidence idempotently and do not reopen a finding
27
+ being explicitly resolved in the same record. Different evidence cannot overwrite
28
+ an existing resolution; genuinely recurring findings can still be reported.
29
+
30
+ Outcome contracts are now **opt-in**, rather than inferred from component count.
31
+ Test across CLI, API, persistence, migration and packaging tasks, including simple
32
+ changes, before considering a mandatory policy. Measure false verified finishes,
33
+ successful deliveries, appropriate blocked results, cost and unnecessary friction.
34
+
35
+ ## Follow-up: fresh-context acceptance review and model repairs
36
+
37
+ A further fresh implementation with generic representation/integration guidance
38
+ still failed single-shot acceptance. A separate fresh CTG reviewer reproduced the
39
+ render/control defects and the implementation model repaired them. Subsequent
40
+ evaluation found intermittent native graphics output; model repair added a
41
+ documented native software-renderer path. A second fresh reviewer found an AABB
42
+ overlap error and a raycast boundary error, which the model repaired with tests.
43
+ Final fresh review approved the core acceptance, with 75 Python tests passing,
44
+ actual native launch, image/state correspondence, camera-relative movement over
45
+ 60 angle combinations, safe placement and chunk-isolation probes.
46
+
47
+ This success required multiple review/repair rounds and extra time beyond the
48
+ original 30-minute single-run comparison. Some interrupted continuations needed
49
+ a fresh repair context. It is not evidence of autonomous single-shot reliability,
50
+ lower cost, or a complete manual play test. Physical pointer input was unavailable.
51
+ The successful general mechanism was fresh-context executable falsification,
52
+ not game-specific rules in CTG. The generated game—not the harness—contains the
53
+ domain-specific fixes.
54
+
55
+ The experimental `ctg review workspace --request-file original-task.txt` command
56
+ exposes this review mechanism without requiring a pull request. It runs a separate
57
+ context with no delivery extension and does not automatically repair source,
58
+ grant verified status, or make its verdict independent proof. Review subprocess
59
+ tools are not OS-sandboxed; no source modifications are requested by its prompt.
@@ -0,0 +1,58 @@
1
+ # Tested planning and agent-authored workflows
2
+
3
+ Status: **all six implementation stages tested and merged**. Owner: Carthagent. This is the implementation contract for the six sequential PRs below. Historical live-trial notes are evidence, not current operating instructions, and must remain intact.
4
+
5
+ ## Non-negotiable behavior
6
+
7
+ For new delivery tasks, no product code, test code, prototypes, arbitrary shell commands or mutation-capable custom tools before a tested plan is approved. Planning is structured data written through harness tools. Read-only discovery remains possible. Approval means readiness to implement, not correctness of future code. Informational tasks never grant mutation permission. Legacy reports remain readable but must pass the new gate before new mutations.
8
+
9
+ The workflow is discovery → requirements/examples → architecture/workflow → deterministic validation → adversarial review/scenario walkthroughs → revise/retest until blocking findings are resolved → approval → regression tests → implementation → integration/final review. Approval is bound to plan identity, revision and the inspected source snapshot. The first authorized mutation starts implementation; subsequent planned source edits do not invalidate the design approval on every keystroke. A plan revision always relocks implementation. Source changes before implementation begins stale the approval. During implementation, unexpected external edits cannot be distinguished from all legitimate edits without stronger isolation; disclose that limitation.
10
+
11
+ ## Architecture responsibilities and DI
12
+
13
+ - `planning`: pure contract validation, review receipts, approval lifecycle. No I/O, network or rendering. Inject snapshot hashes/time where needed.
14
+ - `workflow`: pure graph semantics and projections; immutable mandatory gate overlay. No execution or model authority.
15
+ - `planning-access`: fail-closed tool policy, read-only discovery boundary. Inject tool metadata/runner where appropriate. No heuristic shell allowlist.
16
+ - extension/server/CLI: composition roots for persistence, workspace locks and execution. All execution entry points enforce the same approval policy.
17
+ - UI: renders observed state and evidence; never infers success from prose or animation. Workflow, architecture and evidence are distinct views.
18
+ - `plan-advisor`: optional injected classifier port and Jev HTTP adapter. Advisory only; cannot mint approval, modify requirements or bypass checks. No keys/provider calls required for normal operation or tests.
19
+
20
+ SRP is cohesion and one reason to change, not one function per file. DI exposes time/network/process/storage boundaries; deterministic contract tests verify boundaries, while integration tests cover real entry points.
21
+
22
+ ## Planned contract
23
+
24
+ A design contains components (responsibility, non-responsibilities, owned requirements, layer, dependencies), ports (owner, input/output/error contracts, adapter, injection mechanism, composition root and test double), scenarios (requirement, component path, input, expected behavior, failure case, concrete assertion, check IDs), risks (blocking/open or resolved with evidence), and workflow (stable nodes, dependency edges and bounded recovery transitions). Exact existing acceptance text stays authoritative. Every criterion requires positive and failure/boundary scenarios. Every declared external dependency must have an injection contract. A structural validator cannot prove the architecture is good or that a scenario is adequate.
25
+
26
+ Reviews record challenges, walkthroughs and findings against an exact revision, design digest and source fingerprint. Review is explicitly model-authored; reviewers cannot assert independent provenance without an actual separate invocation. No confidence threshold unlocks implementation. Blocking findings must be resolved through a new design revision and fresh validation/review. Optional findings need a recorded disposition.
27
+
28
+ ## Six sequential PRs
29
+
30
+ | Stage | Deliverable | Acceptance and tests | Status / PR |
31
+ |---|---|---|---|
32
+ | 1 | Planning contract, validator and lifecycle | Missing requirements/scenarios/ports; invalid references; blockers; stale review/approval; revision history; no I/O in policy | Merged [#93](https://github.com/B-icy/Carthagent/pull/93); 335 local tests and all CI green |
33
+ | 2 | Approval gate and mutation restrictions | Default pre-plan protection; shell/custom-tool bypass; informational downgrade; CLI/HTTP check bypass; restore/revision; truthful enforcement scope | Merged [#94](https://github.com/B-icy/Carthagent/pull/94); 337 local tests and all CI green |
34
+ | 3 | Agent-authored workflow and architecture | Stable IDs; DAG prerequisites; explicit bounded recovery; mandatory gate overlay; D2 escaping; old plan rendering | Merged [#95](https://github.com/B-icy/Carthagent/pull/95); 340 local tests and all CI green |
35
+ | 4 | Event-driven workflow/architecture/evidence UI | Current phase, reason locked, findings, evidence, stale states; safe rendering; terminal projection; browser integration | Merged [#96](https://github.com/B-icy/Carthagent/pull/96); 341 local tests and all CI green; local Firefox blocked by snap /tmp restriction |
36
+ | 5 | Adversarial review and scenario loop | Inspection receipt; complete challenges/walkthroughs; finding history; unresolved blocker; repair/revalidate; honest self-review provenance | Merged [#97](https://github.com/B-icy/Carthagent/pull/97); 343 local tests and all CI green |
37
+ | 6 | Optional Jev advisory evaluation | Injected fake/HTTP adapter; no-key baseline; failure/timeout/malformed response; shadow findings, false negatives, latency/cost metrics; no approval authority | Merged [#98](https://github.com/B-icy/Carthagent/pull/98); 348 local tests, real loopback HTTP transport, no-key corpus and all CI pass; no live Jev benchmark |
38
+
39
+ Each stage: focused tests → quality → PR inspection and cross-platform CI → merge → update this ledger for the next stage. GitHub does not permit self-approval; author review and authorized merge are not independent approval. No silent weakening of requirements to obtain green CI.
40
+
41
+ ## Plan testing performed before implementation
42
+
43
+ 1. Requirement walkthrough: source/test generation is prohibited before approval; planning JSON is allowed through dedicated APIs. No executable planning probes are smuggled through shell.
44
+ 2. Boundary walkthrough: requirements map to component owners, contracts and scenario assertions. Fake-only testing is insufficient; tests must include adapter and public entry-point behavior.
45
+ 3. Failure walkthrough: malformed design → findings → revise → fresh validation/review; unresolved assumption blocks approval. Provider failures cannot change gate state.
46
+ 4. Lifecycle walkthrough: compaction restores receipts; changed revision invalidates approval; changed snapshot before first mutation invalidates it; implementing source changes require final check reruns, not endless approval deadlock.
47
+ 5. Enforcement challenge: tool interception is not an OS sandbox. Fail closed for all non-read tools before approval, including unknown tools. Disable raw shell during planning. Do not claim protection from external processes or a malicious host. Baseline execution before approval is unavailable unless a real isolated runner is supplied; report this rather than pretending shell regexes provide isolation.
48
+ 6. UI challenge: arbitrary D2 is not executable truth. Agent authors graph semantics; harness owns mandatory gates and observed statuses. Render a shared validated model into D2 and terminal/dashboard projections.
49
+ 7. Review challenge: a separate prompt is not independent assurance. Record reviewer provenance honestly, retain findings, bind receipts. Jev cannot certify completeness or authorize mutations.
50
+ 8. Scope challenge: preserve legacy report visibility and original failures, but do not grandfather old reports into unapproved mutation. Update stale operating guidance rather than delete historical evidence.
51
+
52
+ Preimplementation outcome: ready to implement this roadmap sequentially. Completion outcome: the six scoped stages are merged, preserving the limitations below. Known limitation: semantic adequacy and independently verified review quality cannot be proven by schema validation. A paid live Jev benchmark is not authorized by enabling an adapter; use deterministic injected evaluation and clearly distinguish it from provider effectiveness.
53
+
54
+ ## Progress journal
55
+
56
+ - Stage 6 results and limits: [optional advisor evaluation](plan-advisor-evaluation.md). No service credentials were accessed and no paid/provider request was made. Jev remains optional and outside normal approval flow.
57
+ - Stages 4–6 use `/tmp/ctg-tested-planning`, an isolated Git worktree, to preserve concurrent unrelated provider/TUI changes in the original checkout. Local Firefox was blocked by snap's `/tmp` namespace; CI Firefox passed for stages 4–6. Final JavaScript quality passed 348 tests; Linux/macOS/Windows × Node 22/24 and browser CI were green before each merge. Python validation ran in CI, not locally.
58
+ - Initial repository inspection confirms current plan-existence gate and fixed D2 suffix do not meet this contract. No implementation changes were made before documenting and challenging this plan.
@@ -0,0 +1,58 @@
1
+ # Tested planning
2
+
3
+ ## Quick start without exhaustive discovery
4
+
5
+ Use `delivery_design {"action":"guide"}` **before creating a plan** for the compact exact field contract and illustrative example. It does not need approval, execute commands, mutate the workspace, or call Jev. Substitute actual task requirements and real checks; the example is not a ready-made design for your project.
6
+
7
+ Inspect relevant entry points, callers/types and nearby tests, then submit the first concrete contract. After eight discovery results or two blocked execution attempts, the extension recommends a plan or one targeted unresolved question; after sixteen results it emphasizes excessive discovery. These are advisory checkpoints, not a hard cutoff. Necessary reads remain available. Numeric checkpoint state follows the selected session branch and survives compaction; a new user input resets it and a successful plan suppresses it. Informational requests do not receive these reminders (classification is heuristic, not an authorization decision).
8
+
9
+ Validation reports offending references and allowed IDs. Repair via `delivery_revise`, preserving every acceptance requirement and output; then validate → inspect → review → approve. Keep unknowns explicit rather than inventing baseline results. Jev, if enabled, runs only at valid inspection and challenges semantic adequacy—not schema syntax. See [Jev configuration and disclosure](jev.md).
10
+
11
+
12
+ Context handling: [compact projections and recovery](context-efficiency.md). `delivery_status` returns active obligations rather than the full report history. A large `delivery_design inspect` returns `captureArchive.path`; read the entire immutable capture in pages before authoring review. Its capture ID/digest/source binding and all validation/approval requirements are unchanged. A pointer is not evidence that the plan was read. Full history remains in the report/session; older successful planning exchanges may be referenced by verified archives in outbound model context. before code
13
+
14
+ New and resumed delivery tasks must test and approve their design before generating product code, tests or executable prototypes. A plan's existence is no longer permission to implement. `--delivery-strict=false` does not bypass this policy.
15
+
16
+ ## Sequence
17
+
18
+ 1. Discover with built-in `read`, `ls`, `find`, `grep`. Shell and unknown/custom tools are blocked before approval, including apparently read-only shell commands. No isolated baseline runner is supplied; do not claim preapproval commands ran.
19
+ 2. Call `delivery_plan` with the existing acceptance/check contract and `design` below. Planning data is persisted by the harness, not arbitrary file writes.
20
+ 3. Call `delivery_design {action:"validate"}`. Resolve blocking diagnostics using `delivery_revise`.
21
+ 4. Call `delivery_design {action:"inspect"}` to capture the exact validated plan, previous findings and unresolved blocker IDs. Read that capture. Record `delivery_design {action:"review",review:{captureId,challenges,walkthroughs,findings,limitations,resolutions:[]}}`. Walk through **every** scenario with `{scenario,trace,assertion}`. Findings have `severity:"blocking"|"advisory"`, `description`, and an explicit `disposition` for advisory findings. Review is model-authored, not independent proof.
22
+ Blocking findings receive harness IDs and cannot disappear through an empty second review. Revise the design, validate and inspect again, then supply `resolutions:[{id,change,evidence}]` for each repaired blocker. Same-revision resolutions are rejected. Findings, validation receipts and revisions remain in history. Capture binds the actual plan snapshot, but does not prove it was read or that a claimed resolution is semantically sufficient.
23
+
24
+ 5. Call `delivery_design {action:"approve"}` only after challenges and iterations. The approval is bound to run, revision, full plan digest and source fingerprint.
25
+ 6. Generate regression tests, implement, run checks, and complete final diff-linked review. Existing evidence rules and user-owned validators remain authoritative.
26
+
27
+ Revisions always relock implementation. Source edits before the first authorized implementation action stale approval. Once implementation starts, planned source edits do not require approval after each keystroke; they still invalidate final verification evidence. Resume restores receipts. Legacy reports remain readable but cannot authorize new commands or writes without a tested design.
28
+
29
+ Informational plans still finish without a repair loop, but cannot authorize arbitrary process execution. Consequently `advisory` checks cannot be newly executed through the delivery runner without a required, approved design. Existing advisory evidence remains readable. Use `none` for read-only answers.
30
+
31
+ ## Design fields
32
+
33
+ `design` is planning data, not executable code:
34
+
35
+ - `components`: `{id,responsibility,excludes:[],layer,dependencies:[],externalDependencies:[],requirements:[]}`. Layers: `core`, `adapter`, `composition`, `presentation`. Requirements use exact acceptance text. Declare explicit non-responsibilities. Core components cannot depend on concrete adapters; `externalDependencies` name owned ports.
36
+ - `ports`: `{id,owner,adapter,compositionRoot,input,output,errors,injection,testDouble,integrationAssertion}`. Owner/adapter/compositionRoot reference component IDs. Declare contracts and where dependencies are injected. Real adapter assertions complement test doubles.
37
+ - `scenarios`: `{id,requirement,kind,path:[],input,expected,assertion,checks:[]}`. Kinds: `positive`, `failure`, `boundary`. Every requirement needs a positive and failure/boundary scenario. Paths name components; checks name existing executable suites. Specify observable assertions, not implementation descriptions.
38
+ - `risks`: `{id,description,status:"open"|"resolved",blocking:boolean,evidence?}`. Blocking open risks prohibit approval; resolved risks need evidence.
39
+
40
+ SRP means cohesive ownership/reasons to change, not mechanically one function per file. Contract validation detects missing declarations and contradictions, not undeclared hidden dependencies or semantic inadequacy.
41
+
42
+ ## Agent-authored workflow
43
+
44
+ Optional `workflow:{nodes:[],recovery:[]}` is the canonical graph, not free-form executable D2. Each node declares `{id,title,type,dependsOn:[],requirements:[],components:[],checks:[],inputs:[],artifacts:[],effects:[]}`. Types: `work`, `decision`, `check`, `artifact`. Work nodes reference a `step` (structured ID or `legacy_1` etc.); every step must appear. Decisions declare `condition`; check nodes need check IDs. Effects are `read`, `write`, `execute` declarations, not permissions. IDs beginning `gate_` are reserved.
45
+
46
+ Prerequisites form a DAG. Recovery transitions declare `{from,to,when,maxAttempts,stop}` with 1–10 attempts. These are proposed bounded recovery routes, **not an executable scheduler**; the agent still performs actions through gated tools and session budgets. D2 is generated from this validated graph. The harness overlays design approval, fresh verification, final review and handoff gates; the model cannot remove those. Legacy plans retain their old D2 and have a canonical fallback projection. Architecture is a separate component/dependency/port projection.
47
+
48
+ ## Workflow, architecture and evidence views
49
+
50
+ The dashboard Plan panel has three selectable views and a pinned revision/lock explanation. Workflow shows observed current work, node states and recovery routes; architecture shows responsibilities, non-responsibilities, dependency direction and injection contracts; evidence shows execution revisions, logs and stale/failed status. Check buttons are disabled while approval is locked. Proposed decisions/artifacts are never inferred successful.
51
+
52
+ The terminal supports `/workflow`, `/architecture` and `/evidence` in the side pane. Report-file/tool-result updates refresh the shared projection; dashboard status polling consumes that same projection. This is observed-state refresh, not a claimed ordered event stream. `ctg status --json` includes `planningView` for other consumers. A passing command or an approved plan remains distinct from semantic correctness.
53
+
54
+ ## API and enforcement scope
55
+
56
+ `POST /api/design` accepts the same action/review fields under the dashboard's authentication and workspace lock. `/api/checks/run`, `ctg check`, and `delivery_check` enforce the same approval policy. Participating tool calls are fail-closed before approval; this is **not an OS sandbox**. External processes, trusted host/extensions, tool-name replacement, raw API state-file tampering and postapproval unexpected edits are outside the guarantee. A tool hook does not hold a cross-process lease for an arbitrary tool's entire execution; avoid concurrent sessions editing one workspace.
57
+
58
+ Implementation status, blockers and receipts are available through `delivery_status`, report JSON and `/api/status`. See the [six-stage roadmap](tested-planning-roadmap.md) for rollout and outstanding stages. Historical trial notes retain the behavior and failures observed at their original revisions.
@@ -0,0 +1,9 @@
1
+ # Command and settings pickers
2
+
3
+ - In the `/` command palette, **Enter activates the highlighted command once**, even when the typed name is partial. **Tab completes** the command without running it. Escape dismisses the palette without changing the text.
4
+ - `/model` opens model search directly across providers. Type a provider or model name, browse with arrows, and press Enter to switch. The current model is marked independently of the highlighted candidate. Successful selection returns to the prompt.
5
+ - Settings uses the same interaction: Enter opens a row's choices, arrows browse, Enter applies, Escape cancels. Choosing from settings returns to settings. Provider selection is only a model-list filter; it never switches the model by itself. Theme changes are applied only on confirmation, not previewed.
6
+ - Switching models during an active response is rejected with an explanation. While a switch is pending, repeated confirmation is ignored; errors leave the picker open for retry. Escape cancels browsing, not a request already submitted. Ctrl-C remains available.
7
+ - Opening settings does not consume the prompt draft. Activating a slash command consumes that command text, as before.
8
+
9
+ Validation: `npm run quality` covers keyboard parsing, picker transitions and pending/error behavior. On POSIX, `python3 tools/test-picker-pty.py` starts the offline demo in a real pseudo-terminal and exercises single-Enter opening, model selection, Tab completion and Escape. It uses temporary configuration and makes no provider calls. This is not a substitute for native terminal visual review.