carthagent 1.0.7 → 1.1.0-beta.1

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 (294) hide show
  1. package/README.md +140 -83
  2. package/bin/ctg.mjs +14 -732
  3. package/docs/beta-rewards-e2e-plan.md +48 -0
  4. package/docs/beta-rewards-e2e-results.md +84 -0
  5. package/docs/glyph-review/host-chrome-glyph-compatibility-v4.md +83 -0
  6. package/docs/glyph-review/test-isolation-v1.md +26 -0
  7. package/docs/glyph-review/typecheck-base.log +1 -0
  8. package/docs/glyph-review/typecheck-v4.log +1 -0
  9. package/docs/glyph-review/unicode-inventory-v4.csv +402 -0
  10. package/docs/help-dispatch-review.md +69 -0
  11. package/docs/launch-readiness-live-results.md +65 -0
  12. package/docs/legacy-cli.md +150 -0
  13. package/docs/live-theme-plugin-api.md +18 -0
  14. package/docs/native-cli.md +102 -0
  15. package/docs/native-compatibility.md +16 -0
  16. package/docs/native-daily-quests.md +132 -0
  17. package/docs/native-glyph-pty.md +59 -0
  18. package/docs/native-manual-testing.md +336 -0
  19. package/docs/native-slash-acceptance-handoff.md +49 -0
  20. package/docs/native-terminal-paired-failure-2026-10-17.md +40 -0
  21. package/docs/native-terminal-performance.md +310 -0
  22. package/docs/native-terminal-semantics-evidence/README.md +25 -0
  23. package/docs/native-terminal-semantics-evidence/controlled-host-model-selftest.json +16 -0
  24. package/docs/native-terminal-semantics-evidence/current-acceptance-status.json +59 -0
  25. package/docs/native-terminal-semantics-evidence/final-binary-focused-85bb44a.json +154 -0
  26. package/docs/native-terminal-semantics-evidence/final-binary-full-incomplete-85bb44a.json +160 -0
  27. package/docs/native-terminal-semantics-evidence/final-binary-layout-85bb44a.json +149 -0
  28. package/docs/native-terminal-semantics-evidence/final-binary-layout-interactive-85bb44a.json +159 -0
  29. package/docs/native-terminal-semantics-evidence/final-binary-model-picker-escape-unchanged-85bb44a.json +44 -0
  30. package/docs/native-terminal-semantics-evidence/final-binary-model-picker-exact-identity-85bb44a.json +47 -0
  31. package/docs/native-terminal-semantics-evidence/final-binary-model-picker-unchanged-model-incomplete-85bb44a.json +58 -0
  32. package/docs/native-terminal-semantics-evidence/final-binary-model-selftest.json +16 -0
  33. package/docs/native-terminal-semantics-evidence/final-binary-picker-cancel-incomplete-85bb44a.json +62 -0
  34. package/docs/native-terminal-semantics-evidence/focused-clipboard-title-stale-binary.json +161 -0
  35. package/docs/native-terminal-semantics-evidence/layout-stale-binary-observation-not-accepted.json +153 -0
  36. package/docs/native-terminal-semantics-evidence/picker-latest-incomplete-attempt.json +62 -0
  37. package/docs/native-terminal-semantics-evidence/picker-previous-probe-pass.json +61 -0
  38. package/docs/native-terminal-semantics.md +89 -0
  39. package/docs/native-upgrade.md +175 -0
  40. package/docs/opencode-composed-source-review.md +89 -0
  41. package/docs/opencode-migration.md +225 -9
  42. package/docs/opencode-owned-runtime.md +241 -0
  43. package/docs/opencode-runtime.md +12 -0
  44. package/docs/opencode-theme-provider-proof/README.md +55 -0
  45. package/docs/opencode-theme-provider-proof/live-theme-api-base.patch +122 -0
  46. package/docs/opencode-theme-provider-proof/plugin-theme-provider.patch +107 -0
  47. package/docs/opencode-theme-provider-proof/session-ui-base.patch +1217 -0
  48. package/docs/owned-host-controls-proof.md +39 -0
  49. package/docs/owned-runtime-release-manifest.md +42 -0
  50. package/docs/owned-visual-clear-proof.md +40 -0
  51. package/docs/patches/opencode-v2.0.32-glyph-spinner-test-isolation-v1.patch +50 -0
  52. package/docs/patches/opencode-v2.0.32-glyphs.patch +3670 -0
  53. package/docs/patches/opencode-v2.0.32-help-dispatch.patch +156 -0
  54. package/docs/patches/opencode-v2.0.32-live-theme-api.patch +122 -0
  55. package/docs/patches/opencode-v2.0.32-session-ui-combined-v1.patch +5272 -0
  56. package/docs/patches/opencode-v2.0.32-session-ui-combined-v2.patch +6052 -0
  57. package/docs/patches/opencode-v2.0.32-session-ui-combined-v3.patch +8657 -0
  58. package/docs/patches/opencode-v2.0.32-session-ui-combined-v4.patch +9928 -0
  59. package/docs/patches/opencode-v2.0.32-session-ui-combined-v5.patch +13965 -0
  60. package/docs/patches/opencode-v2.0.32-session-ui.patch +5137 -0
  61. package/docs/release-notes-beta.1.md +60 -0
  62. package/docs/release-notes-native-draft.md +73 -0
  63. package/docs/release-notes-preview.10.md +121 -0
  64. package/docs/release-notes-preview.11.md +76 -0
  65. package/docs/release-notes-preview.12.md +55 -0
  66. package/docs/release-notes-preview.13.md +68 -0
  67. package/docs/release-notes-preview.9.md +130 -0
  68. package/docs/source-preview.md +120 -0
  69. package/evaluate.mjs +28 -1
  70. package/lib/budget.mjs +1 -1
  71. package/lib/codegraph.mjs +1 -1
  72. package/lib/delivery-review.mjs +19 -6
  73. package/lib/delivery.mjs +3 -2
  74. package/lib/environment.mjs +8 -0
  75. package/lib/guidance.mjs +1 -1
  76. package/lib/opencode/cli-runtime.mjs +1171 -0
  77. package/lib/opencode/cli.mjs +252 -0
  78. package/lib/opencode/credentials.mjs +63 -8
  79. package/lib/opencode/demo.mjs +53 -0
  80. package/lib/opencode/evaluation-budget-plugin/index.ts +3 -0
  81. package/lib/opencode/evaluation.mjs +32 -12
  82. package/lib/opencode/headless.mjs +22 -5
  83. package/lib/opencode/provider-policy.mjs +23 -0
  84. package/lib/opencode/review.mjs +37 -16
  85. package/lib/opencode/runtime-artifact.mjs +335 -0
  86. package/lib/opencode/runtime-github-transport.mjs +121 -0
  87. package/lib/opencode/runtime-release.json +36 -0
  88. package/lib/opencode/runtime.mjs +299 -20
  89. package/lib/opencode/service.mjs +77 -35
  90. package/lib/opencode/session-options.mjs +6 -2
  91. package/lib/opencode/update.mjs +222 -0
  92. package/lib/opencode/workspace.mjs +1 -1
  93. package/lib/planning-advice.mjs +2 -2
  94. package/lib/providers/experiential.mjs +2 -2
  95. package/lib/tui/framing.mjs +1 -80
  96. package/lib/update.mjs +10 -1
  97. package/package.json +33 -7
  98. package/plugins/carthagent/README.md +23 -0
  99. package/plugins/carthagent/src/bootstrap.ts +1 -1
  100. package/plugins/carthagent/src/daily-evidence.mjs +57 -0
  101. package/plugins/carthagent/src/daily-quests-rpc.ts +50 -0
  102. package/plugins/carthagent/src/daily-source-rpc.ts +52 -0
  103. package/plugins/carthagent/src/index.ts +71 -24
  104. package/plugins/carthagent/src/rpc.ts +51 -6
  105. package/plugins/carthagent/src/server/codegraph.ts +12 -5
  106. package/plugins/carthagent/src/server/daily-quests-rpc.ts +277 -0
  107. package/plugins/carthagent/src/server/daily-source-rpc.ts +243 -0
  108. package/plugins/carthagent/src/server/delivery.ts +227 -112
  109. package/plugins/carthagent/src/server/framing.mjs +80 -0
  110. package/plugins/carthagent/src/server/policy.ts +1 -1
  111. package/plugins/carthagent/src/server/providers.ts +59 -31
  112. package/plugins/carthagent/src/server/session-controls.ts +3 -1
  113. package/plugins/carthagent/src/server/ship-agents.ts +77 -0
  114. package/plugins/carthagent/src/server/ship-context.mjs +60 -0
  115. package/plugins/carthagent/src/server/ship-guidance.ts +41 -0
  116. package/plugins/carthagent/src/server/ship-rpc.ts +69 -0
  117. package/plugins/carthagent/src/server/voyages-rpc.ts +280 -0
  118. package/plugins/carthagent/src/testing.ts +5 -0
  119. package/plugins/carthagent/src/tui.tsx +496 -0
  120. package/plugins/carthagent/src/ui/client.ts +127 -0
  121. package/plugins/carthagent/src/ui/commands.ts +70 -0
  122. package/plugins/carthagent/src/ui/daily-editor-focus.mjs +52 -0
  123. package/plugins/carthagent/src/ui/daily-editor.mjs +4 -0
  124. package/plugins/carthagent/src/ui/daily-quests-events.mjs +18 -0
  125. package/plugins/carthagent/src/ui/daily-quests-state.mjs +218 -0
  126. package/plugins/carthagent/src/ui/daily-quests.tsx +235 -0
  127. package/plugins/carthagent/src/ui/host-state.ts +42 -0
  128. package/plugins/carthagent/src/ui/model-command.ts +32 -0
  129. package/plugins/carthagent/src/ui/native-navigation.ts +23 -0
  130. package/plugins/carthagent/src/ui/native-review.d.mts +33 -0
  131. package/plugins/carthagent/src/ui/native-review.mjs +159 -0
  132. package/plugins/carthagent/src/ui/resume-session.mjs +34 -0
  133. package/plugins/carthagent/src/ui/select-mouse.ts +17 -0
  134. package/plugins/carthagent/src/ui/session-preferences.d.mts +7 -0
  135. package/plugins/carthagent/src/ui/session-preferences.mjs +14 -0
  136. package/plugins/carthagent/src/ui/theme-provision.d.mts +3 -0
  137. package/plugins/carthagent/src/ui/theme-provision.mjs +134 -0
  138. package/plugins/carthagent/src/ui/voyages-navigation-state.mjs +56 -0
  139. package/plugins/carthagent/src/ui/voyages-navigation.tsx +131 -0
  140. package/plugins/carthagent/src/ui/voyages-state.mjs +165 -0
  141. package/plugins/carthagent/src/ui/voyages.tsx +131 -0
  142. package/plugins/carthagent/src/ui/workspace-live.ts +61 -0
  143. package/plugins/carthagent/src/ui/workspace.tsx +379 -0
  144. package/plugins/carthagent/src/voyages-rpc.ts +64 -0
  145. package/plugins/carthagent/src/workspace-rpc.ts +36 -0
  146. package/plugins/carthagent/tests/commands.test.ts +107 -0
  147. package/plugins/carthagent/tests/session-preferences.test.mjs +41 -0
  148. package/plugins/carthagent/tests/voyages-navigation.test.tsx +269 -0
  149. package/plugins/carthagent/themes/carthage.json +67 -0
  150. package/plugins/carthagent/tui.ts +26 -1
  151. package/script/ctg/build-owned-runtime.sh +166 -0
  152. package/tests/budget-engine.test.mjs +4 -3
  153. package/tests/cli.test.mjs +52 -96
  154. package/tests/daily-evidence.test.mjs +62 -0
  155. package/tests/delivery-review.test.mjs +57 -2
  156. package/tests/delivery.test.mjs +22 -1
  157. package/tests/fixtures/native-discovery-plugin/server.ts +15 -0
  158. package/tests/generate-owned-runtime-release.test.mjs +354 -0
  159. package/tests/installed-runtime-contract.test.mjs +43 -0
  160. package/tests/native-cli-host-smoke.mjs +457 -0
  161. package/tests/native-daily-editor-focus.test.mjs +213 -0
  162. package/tests/native-daily-editor.test.mjs +43 -0
  163. package/tests/native-daily-quests-layout.test.mjs +55 -0
  164. package/tests/native-daily-quests-rpc.test.mjs +456 -0
  165. package/tests/native-daily-quests-ui.test.mjs +778 -0
  166. package/tests/native-daily-source.test.mjs +525 -0
  167. package/tests/native-demo-ui.test.mjs +48 -0
  168. package/tests/native-evaluation-admission.test.mjs +24 -0
  169. package/tests/native-fixture-browser-cleanup.test.mjs +65 -0
  170. package/tests/native-fixture-runtime.test.mjs +111 -0
  171. package/tests/native-fixture-stop-diagnostics.test.mjs +67 -0
  172. package/tests/native-glyph-pty.test.mjs +107 -0
  173. package/tests/native-manual-projects.test.mjs +170 -0
  174. package/tests/native-model-command.test.mjs +67 -0
  175. package/tests/native-owned-runtime-env.test.mjs +140 -0
  176. package/tests/native-paired-guards.test.mjs +464 -0
  177. package/tests/native-provider-policy.test.mjs +31 -0
  178. package/tests/native-pty-invocation.test.mjs +114 -0
  179. package/tests/native-pty-runtime.test.mjs +45 -0
  180. package/tests/native-resume-session.test.mjs +46 -0
  181. package/tests/native-review-consumer.test.mjs +286 -0
  182. package/tests/native-runtime-identity.test.mjs +214 -0
  183. package/tests/native-select-mouse.test.mjs +23 -0
  184. package/tests/native-ship-guidance.test.mjs +16 -0
  185. package/tests/native-ship-parity.test.mjs +526 -0
  186. package/tests/native-ship-plan.test.mjs +85 -0
  187. package/tests/native-ship-rpc.test.mjs +71 -0
  188. package/tests/native-ui-commands.test.mjs +6 -0
  189. package/tests/native-voyages-layout.test.mjs +28 -0
  190. package/tests/native-voyages-navigation.test.mjs +169 -0
  191. package/tests/native-voyages-rpc.test.mjs +397 -0
  192. package/tests/native-voyages-ui.test.mjs +307 -0
  193. package/tests/opencode-atomic-write.test.mjs +55 -0
  194. package/tests/opencode-cli.test.mjs +1312 -0
  195. package/tests/opencode-codegraph-plugin.test.mjs +47 -0
  196. package/tests/opencode-delivery.test.mjs +16 -0
  197. package/tests/opencode-providers.test.mjs +245 -18
  198. package/tests/opencode-runtime.test.mjs +597 -8
  199. package/tests/opencode-session-controls.test.mjs +15 -0
  200. package/tests/opencode-ship-rpc.test.mjs +71 -0
  201. package/tests/opencode-update.test.mjs +475 -0
  202. package/tests/opencode-workspace.test.mjs +51 -2
  203. package/tests/owned-runtime-publish-workflow.test.mjs +477 -0
  204. package/tests/release-workflow.test.mjs +46 -0
  205. package/tests/runtime-artifact.test.mjs +269 -0
  206. package/tests/runtime-development-trust.test.mjs +231 -0
  207. package/tests/runtime-github-transport.test.mjs +132 -0
  208. package/tests/runtime-token-env.test.mjs +23 -0
  209. package/tests/server.test.mjs +3 -1
  210. package/tests/ship-telemetry.test.mjs +1 -1
  211. package/tests/source-preview.test.mjs +253 -0
  212. package/tests/test_native_terminal_probe.py +76 -0
  213. package/tests/test_native_terminal_semantics.py +232 -0
  214. package/tests/update.test.mjs +42 -5
  215. package/tests/verify-draft-runtime-gate.test.mjs +280 -0
  216. package/tests/verify-owned-runtime-release.test.mjs +371 -0
  217. package/tests/workspace-live.test.mjs +127 -0
  218. package/tools/benchmark/diagnose-request.mjs +59 -36
  219. package/tools/benchmark/eval-common.mjs +3 -3
  220. package/tools/benchmark/evaluators.test.mjs +4 -4
  221. package/tools/benchmark/guard.test.mjs +35 -2
  222. package/tools/benchmark/guard.ts +20 -7
  223. package/tools/benchmark/planning-startup.test.mjs +30 -34
  224. package/tools/benchmark/runner.mjs +12 -7
  225. package/tools/benchmark/runner.test.mjs +23 -7
  226. package/tools/benchmark/upstream-error.test.mjs +16 -2
  227. package/tools/generate-owned-runtime-release.mjs +217 -0
  228. package/tools/installed-runtime-contract.mjs +16 -0
  229. package/tools/manual-runtime-manifest.mjs +39 -0
  230. package/tools/native-fixture-browser-cleanup.mjs +59 -0
  231. package/tools/native-fixture-stop-diagnostics.mjs +43 -0
  232. package/tools/native-fixture.mjs +199 -40
  233. package/tools/native-glyph-helpers.py +127 -0
  234. package/tools/native-glyph-pty.py +144 -0
  235. package/tools/native-manual-projects.mjs +259 -0
  236. package/tools/native-manual.mjs +338 -0
  237. package/tools/native-model-picker-acceptance.py +306 -0
  238. package/tools/native-owned-runtime-env.sh +47 -0
  239. package/tools/native-paired-guards.mjs +282 -0
  240. package/tools/native-paired-manifest.mjs +72 -0
  241. package/tools/native-paired-orchestration.sh +51 -0
  242. package/tools/native-plugin-readiness.mjs +33 -0
  243. package/tools/native-plugin-readiness.test.mjs +53 -0
  244. package/tools/native-pty-invocation.mjs +26 -0
  245. package/tools/native-pty-runtime.mjs +83 -0
  246. package/tools/native-pty-smoke.py +147 -24
  247. package/tools/native-public-repo-shell-result.mjs +13 -0
  248. package/tools/native-public-repo-shell-result.test.mjs +28 -0
  249. package/tools/native-runtime-identity.mjs +201 -0
  250. package/tools/native-slash-acceptance-env.py +38 -0
  251. package/tools/native-terminal-semantics.py +876 -0
  252. package/tools/owned-shell-observer/index.ts +16 -0
  253. package/tools/owned-shell-observer/package.json +1 -0
  254. package/tools/owned-visual-clear-env.py +48 -0
  255. package/tools/owned-visual-clear-model.py +21 -0
  256. package/tools/pinned-owned-runtime-inputs.mjs +46 -0
  257. package/tools/prepare-native-manual.mjs +122 -0
  258. package/tools/run-native-terminal-paired.sh +403 -0
  259. package/tools/runtime-token-env.mjs +8 -0
  260. package/tools/seed-native-switch-fixture.mjs +79 -0
  261. package/tools/test-native-controls.mjs +3 -1
  262. package/tools/test-native-daily-quests.mjs +65 -0
  263. package/tools/test-native-default-cli.mjs +106 -0
  264. package/tools/test-native-delivery-host.mjs +102 -20
  265. package/tools/test-native-evaluation.mjs +7 -3
  266. package/tools/test-native-glyph-pty.mjs +94 -0
  267. package/tools/test-native-host.mjs +87 -63
  268. package/tools/test-native-outcomes.mjs +3 -1
  269. package/tools/test-native-package.mjs +206 -38
  270. package/tools/test-native-performance.mjs +26 -0
  271. package/tools/test-native-product.mjs +90 -0
  272. package/tools/test-native-pty.mjs +34 -9
  273. package/tools/test-native-public-repo.mjs +224 -0
  274. package/tools/test-native-refresh-reentry.mjs +106 -0
  275. package/tools/test-native-report.mjs +27 -20
  276. package/tools/test-native-review.mjs +75 -0
  277. package/tools/test-native-runtime.mjs +120 -0
  278. package/tools/test-native-ship-models.mjs +176 -0
  279. package/tools/test-native-ship-walkthrough.mjs +96 -0
  280. package/tools/test-native-slash-commands.mjs +125 -0
  281. package/tools/test-native-slash-commands.py +242 -0
  282. package/tools/test-native-swe-host.mjs +224 -55
  283. package/tools/test-native-tasks.mjs +77 -0
  284. package/tools/test-native-terminal-performance.py +887 -0
  285. package/tools/test-native-terminal-readiness.sh +85 -0
  286. package/tools/test-native-terminal-semantics-installed.mjs +38 -0
  287. package/tools/test-native-visual-clear-installed.mjs +48 -0
  288. package/tools/test-owned-host-controls.mjs +238 -0
  289. package/tools/test-owned-opencode-runtime.mjs +35 -0
  290. package/tools/test-owned-visual-clear-env.py +120 -0
  291. package/tools/test-owned-visual-clear.py +373 -0
  292. package/tools/verify-draft-runtime-gate.mjs +138 -0
  293. package/tools/verify-owned-runtime-release.mjs +114 -0
  294. package/tools/verify-release-version.mjs +21 -1
@@ -0,0 +1,69 @@
1
+ # Natural `/help` dispatch patch review
2
+
3
+ Standalone upstream patch: `docs/patches/opencode-v2.0.32-help-dispatch.patch`
4
+
5
+ - Upstream baseline: OpenCode `843a6c514e606b436a7fe713422ace0a93ad3d61` (v2.0.32)
6
+ - Upstream implementation commit: `75fea3b9475da6bbc59c5eeb6461a2994c84341b`
7
+ - Final upstream source including review corrections: `242cbb79cab1b473b63e5abbc29973cf6938ecbc`
8
+ - Patch SHA-256: `c1ce7d983be8ecdd3481b16da103fb32d144b0ec01f894915a110b46acdc6fe5`
9
+
10
+ The TUI's native `/help` command is a fallback rather than an exclusive
11
+ reservation. Autocomplete presents one `/help` option: the most recently
12
+ registered non-native extension command, or native `help.show` if no extension
13
+ claims the name. Direct Enter dispatch applies the same last-extension-wins
14
+ rule. Other argument-taking slash commands retain their previous first-match
15
+ dispatch behavior. When a plugin is disabled/deactivated, disposing its keymap
16
+ layer removes its claim; autocomplete and Enter then fall back to native help.
17
+ Duplicate extension claims are deterministic: the last registered extension
18
+ owns `/help` until its layer is disposed, then the previous extension (or native
19
+ help) is revealed.
20
+
21
+ ## Focused regression test
22
+
23
+ Test: `packages/tui/test/plugin-keymap.test.tsx`,
24
+ `a plugin /help overrides native /help for natural autocomplete selection and restores it on disable`.
25
+
26
+ Run from `packages/tui` with Bun 1.4.2:
27
+
28
+ ```sh
29
+ bun test --timeout 30000 --test-name-pattern 'plugin /help' test/plugin-keymap.test.tsx
30
+ ```
31
+
32
+ Result on final source: focused test **1 passed, 0 failed**; the complete
33
+ `plugin-keymap.test.tsx` file **5 passed, 0 failed**. The fixture types `/help`
34
+ while autocomplete is open and presses Enter once without escaping or
35
+ dismissing it. Two plugin commands claim `/help`; the later handler runs. The
36
+ test verifies no `/session` request was made, disables the plugin through the
37
+ plugin UI, then submits `/help` again and verifies native help appears, also
38
+ without a session request. The fixture uses bare, no-argument `/help`, matching
39
+ the CTG command definition.
40
+
41
+ ## Broader test observations
42
+
43
+ An intermediate unfiltered run failed the existing test `setup layers before
44
+ and after await reach keyboard, palette, and slash across disable and enable`:
45
+ the new test's `help-override` query had accidentally been applied to that
46
+ existing test even though it registered `setup-keymap`. The query was restored
47
+ to the existing helper default; the help-specific query is used only by the new
48
+ test. The captured full-file run then passed **5/5**. This was an actual test
49
+ regression in the intermediate branch and is corrected in the published head.
50
+
51
+ Baseline control: the unmodified `843a6c5` worktree ran the existing
52
+ `setup layers before and after await...` test alone and passed (**1 passed, 0
53
+ failed**). Final corrected source ran the entire test file successfully (**5
54
+ passed, 0 failed**).
55
+
56
+ ## Typecheck and fixture limits
57
+
58
+ `bun run typecheck` from `packages/tui` was attempted using the available shared
59
+ dependencies. It emitted broad unrelated diagnostics across `packages/core`
60
+ and source files resolved from the dirty prototype checkout (including missing
61
+ workspace packages, Node/DOM/Bun globals, and Effect type errors), then exceeded
62
+ the 120-second timeout and was terminated. This environment did not provide a
63
+ valid full-package typecheck result. The autocomplete optional `command.slash`
64
+ access is explicitly guarded before reading `slash.arguments`.
65
+
66
+ The test runner prints an existing `MaxListenersExceededWarning` for renderer
67
+ resize listeners; it also occurs in the baseline control. No assertions were
68
+ weakened. The final-binary PTY proof is deferred until composition with the
69
+ independently reviewed session-ui and theme patches and the pending glyph work.
@@ -0,0 +1,65 @@
1
+ # Launch-readiness live checks
2
+
3
+ These checks use the user's existing preview.13 profile and real account. The active installation has a labeled local patch; this is not a new published release.
4
+
5
+ ## Fixed from real testing
6
+
7
+ | Finding | Repair | Evidence |
8
+ | --- | --- | --- |
9
+ | Review rejected a Next.js app below its Git root | Canonical containment, workspace-relative diff, explicit untracked scope, disabled cross-boundary rename detection | Same nested-workspace regression fails on released code and passes on patched code; scope, symlink and freshness assertions |
10
+ | DeepSeek searched for withheld write tools instead of planning | Guidance explains plan-gated direct tools, standard/strict prerequisites, and `shell` outside code mode | Fresh live Ship run created its plan and began editing without the previous search loop |
11
+ | Long headless run crashed on HTTP headers timeout while its session kept executing | Reattach only the observation request on `UND_ERR_HEADERS_TIMEOUT`; keep the admitted prompt and deadline | Repeated-timeout regression verifies one prompt and final result; admission and unrelated errors are not retried |
12
+ | Unaffordable shop selection displayed generic failure/sign-in advice | Distinguish insufficient coins, invalid quote and expired quote | Same regression fails before/passes after; live TUI shows insufficient coins with wallet unchanged |
13
+ | Daily evidence Ctrl+P conflicted with the global command palette | Move preview to Ctrl+G, including editor binding and instructions | Live editor rejects incomplete evidence with `invalid_daily_evidence`, without opening the palette; draft discarded, still three submissions and unchanged wallet |
14
+
15
+ ## Account transaction checks
16
+
17
+ - Starting balance: **50 coins / 0 XP**.
18
+ - Purchased sandals for **30 coins**, then equipped them.
19
+ - Ending balance: **20 coins / 0 XP**; sandals owned and equipped after service restart.
20
+ - Rejected: unowned equip, milestone-locked scenery, duplicate purchase, already-owned quote, stale profile version, insufficient funds.
21
+ - Quote creation did not debit. No pending purchase remained.
22
+ - Temporary ship-name customization persisted, then original name was restored.
23
+ - Native UI customization cancellation left profile version, name and wallet unchanged.
24
+
25
+ ## Daily quests
26
+
27
+ Three distinct actual outcomes exercised submission, grading, detail, polling and native status display:
28
+
29
+ | Kind | Outcome | Assessment |
30
+ | --- | --- | --- |
31
+ | Change | Nested-workspace review repair | `needs_evidence`; focus 0.47, outcome 0.96, validation 0.95 |
32
+ | Tests | Unaffordable-purchase regression | `assessed_complete`; focus 0.93, outcome 0.95, regression 0.95 |
33
+ | Review | Headless observation-timeout finding | `needs_evidence`; focus 0.89, finding 0.95, outcome 0.96 |
34
+
35
+ The rubric requires every criterion to meet 0.90 for completion. These are classifier assessments of submitted evidence, not independent code verification. No thresholds were weakened and no result was repeatedly submitted to seek a better score.
36
+
37
+ An attempted cross-quest claim of the same outcome was rejected with `daily_outcome_claimed`. Accepted/terminal records erased their local raw payloads; retry after erasure was rejected with `no_pending_payload`, while IDs remained pollable. Each accepted submission had one provider attempt.
38
+
39
+ **The current `daily-outcomes-v1` policy has rewards disabled.** Successful assessment did not grant coins, XP, distance or equipment. The subsequent owner-approved verified-delivery reward path is separate: its production earned claim/replay/restart checks passed; see [reward acceptance results](beta-rewards-e2e-results.md).
40
+
41
+ ## Validation and remaining scope
42
+
43
+ - Full Carthagent lint/typecheck passed.
44
+ - Full unit suite after the first four fixes: **1,127 passed, 5 skipped**.
45
+ - Native Voyages navigation: **12 passed**, 65 assertions.
46
+ - After the shortcut change, native typecheck, focused lint and the complete daily-quest test group passed; live keyboard verification passed.
47
+ - DeepSeek completed a **verified** Ship handoff for the real application's build/type/lint repairs. Independent reruns confirmed: **32 tests passed** (27 existing + 5 auth regressions), typecheck passed, lint exited 0 with **13 warnings**, and production build passed.
48
+ - Receipt audit confirms all four checks and final review bind to the current fingerprint `cea9b1d71e113d0b876cec4d3a2eef38f16e14decb519d033fb7d9325508b8bb`, with no pending checks, unverified requirements, missing artifacts/outputs or incomplete steps. Run: `903d3ed5-88db-41ca-b72d-f5699fa5ae7f`.
49
+ - Fresh Ship run reported cost: **$0.8724045**; earlier three-mode total: **$0.6963048**. Combined reported total: **$1.5687093**, excluding any unreconciled transport-failed usage.
50
+ - Native friends/badges views are not implemented. Authenticated Invest-With-Friends Google/database/Alpaca flows have not been exercised.
51
+ - Daily-quest summary text occasionally overlaps the actions heading in live terminal captures; this rendering issue remains open.
52
+ - Live evidence and exact requests/results are retained under `/tmp/opencode/launch-account/`; regression before/after logs under `/tmp/opencode/launch-*-regression/`.
53
+
54
+ ## Independent production smoke checks
55
+
56
+ - Production HTTP server rejected all **25 invalid trade payloads** with 400 after the final build.
57
+ - Browser navigation from the public home page to Login succeeded. The initial production session request returned 500 because this local environment has no `NEXTAUTH_SECRET`; server logs explicitly reported `NO_SECRET`.
58
+ - A second test process with an ephemeral, process-only secret and localhost `NEXTAUTH_URL` returned 200 with an anonymous session. Login rendered without console/page errors; unauthenticated `/home` redirected to `/`. No project credentials or environment files were changed.
59
+ - `/api/matches/current` and `/api/trades/my` returned 401 unauthenticated.
60
+ - A valid unauthenticated trade request returned **503, not the test's expected 401**: the existing route calls the Alpaca market clock before authenticating, and that clock lookup failed. No trade/database write was reached. This check is recorded as failed, not counted as a passing authentication test. Full authenticated Google/database/trading behavior remains unverified.
61
+ - Evidence: `/tmp/opencode/iwf-independent-{tests,typecheck,lint,build}.log`, `/tmp/opencode/iwf-production-http-results.log`, `/tmp/opencode/iwf-production-auth-results.json`, and `/tmp/opencode/iwf-launch-ship/verified-receipt-audit.json`.
62
+
63
+ ## Delivery state
64
+
65
+ The Carthagent fixes and this report are on `fix/launch-readiness-ship-voyages`. Invest-With-Friends changes remain local on `test/preview13-deepseek-modes`, preserving its existing work. Published preview.13 assets and stable npm `latest` have not been replaced. The installed local patch is explicitly labeled; these live results alone do not constitute a new release.
@@ -0,0 +1,150 @@
1
+ # Current default CLI: install, providers, Ship, and console
2
+
3
+ > This page documents the **currently-default regular (legacy) CLI** while
4
+ > native OpenCode remains opt-in with `CTG_NATIVE=1`. Its configuration and
5
+ > data paths are not the native OpenCode profile. Keep this guide available
6
+ > until the native default switch is accepted; it can then be archived or
7
+ > retired as part of that migration.
8
+
9
+ ## Install the current CLI
10
+
11
+ Core CLI requires Node ≥ 22.19. Optional workflows may need Git and an
12
+ authenticated `gh` for PR review, Python and scenario dependencies for game
13
+ graders, and a browser download for real-browser checks. The browser helper
14
+ downloads `chrome-headless-shell` on first use to `~/.carthagent/browser/`; no
15
+ local browser installation is needed. An external WebDriver endpoint is also
16
+ supported.
17
+
18
+ Install Carthagent:
19
+
20
+ ```sh
21
+ npm install -g carthagent
22
+ ctg
23
+ ```
24
+
25
+ If the shell cannot find `ctg`, restart the terminal and confirm npm's global
26
+ executable directory is on `PATH` (`$(npm prefix -g)/bin` on Linux/macOS; the
27
+ directory shown by `npm prefix -g` on Windows).
28
+
29
+ If npm reports `ENOTDIR`, `EEXIST`, or `ENOTEMPTY` while replacing
30
+ `node_modules/carthagent`, inspect the global install directory for a stale
31
+ entry from an earlier install or `npm link`. Preserve anything you need before
32
+ moving only the identified stale entries out of the way; then retry:
33
+
34
+ ```sh
35
+ npm root -g
36
+ # After reviewing the exact paths, move the stale carthagent entry/stash aside.
37
+ npm install -g carthagent
38
+ ```
39
+
40
+ The regular CLI's `ctg update` has cleanup-and-retry behavior for these stale
41
+ global-install rename failures. Do not apply that legacy updater behavior to the
42
+ native updater, which has a different contract; see [native upgrade guidance](native-upgrade.md).
43
+
44
+ For a development checkout:
45
+
46
+ ```sh
47
+ git clone https://github.com/B-icy/Carthagent
48
+ cd Carthagent
49
+ npm ci && npm install -g . # or run node bin/ctg.mjs directly
50
+ ```
51
+
52
+ ## Provider authentication
53
+
54
+ The regular CLI stores its provider credentials in
55
+ `~/.carthagent/agent/auth.json`; the native preview has a different isolated
56
+ credential store and profile. Do not copy or merge profile files to switch
57
+ runtimes.
58
+
59
+ Run `ctg login`, or use `/login` (`/auth`) inside the regular console. Carthagent
60
+ Ship is offered as the managed option, while Anthropic, OpenAI, OpenRouter and
61
+ other supported direct providers can also be connected. The login UI handles
62
+ OAuth URLs, device codes, and provider-supported API-key prompts. You can also
63
+ provide a provider key through its environment variable, for example:
64
+
65
+ ```sh
66
+ export ANTHROPIC_API_KEY=... # or OPENAI_API_KEY, GEMINI_API_KEY, OPENROUTER_API_KEY, XAI_API_KEY, ...
67
+ ctg
68
+ ```
69
+
70
+ Multiple provider credentials can coexist. In the regular console, `^t`
71
+ (settings) has provider and model rows; `←→` changes providers, and the model
72
+ picker is scoped to the selected provider. `/login` can connect another
73
+ provider. Override the model for one run with `--model <id>`; the last choice
74
+ is saved to `~/.carthagent/config.json` for the regular CLI.
75
+
76
+ ### Carthagent Ship
77
+
78
+ Choosing Ship in the login UI starts browser device authorization. Carthagent
79
+ stores the resulting short-lived access token and rotating refresh token in its
80
+ regular CLI credential store. After signing in:
81
+
82
+ ```sh
83
+ ctg account # credit, grants, plan, and CLI sessions
84
+ ctg billing checkout # checkout URL
85
+ ctg billing portal # customer portal URL
86
+ ctg logout-cloud [session-id] # revoke current or named CLI session
87
+ ```
88
+
89
+ The regular console also offers `/account`, `/billing checkout`, `/billing
90
+ portal`, and `/logout-cloud <session-id>`. Direct provider/API-key options
91
+ remain available if managed Ship credit is unavailable. A direct `EXPLABS_API_KEY`
92
+ environment key, where configured by an operator, is separate from the public
93
+ Ship device flow.
94
+
95
+ `CARTHAGENT_CLOUD_URL` overrides the Carthagent account/control-plane origin.
96
+ `EXP_GATEWAY_URL` specifically overrides the direct upstream model gateway for
97
+ preview or staging. Browser-account requests use the Ship control-plane
98
+ authority; API-key requests use the configured upstream gateway. Model
99
+ identities are discovered from `GET /v1/models`; published operating caps may
100
+ restrict catalog model limits. Pricing metadata is not inferred from that
101
+ endpoint. See the control-plane/operator documentation for hosted request and
102
+ billing behavior.
103
+
104
+ ## Regular console and commands
105
+
106
+ ```sh
107
+ ctg # interactive split-terminal console
108
+ ctg "Build a task CLI" # console with an initial task
109
+ ctg -p "Summarize this repo" # headless output (also automatic without a TTY)
110
+ ctg demo # scripted mock; no provider needed
111
+ ctg status # fingerprint, contract, pending checks
112
+ ctg check all # run declared checks
113
+ ctg account # Ship account details
114
+ ctg billing checkout # Ship checkout link
115
+ ctg serve # web dashboard
116
+ ctg test # unit suite
117
+ ctg update --check # check for a release without installing
118
+ ctg update # update using the regular CLI updater
119
+ ctg --help # all commands/options
120
+ ```
121
+
122
+ Inside the regular console: `enter` send/steer · `esc` abort (again force-
123
+ restarts the engine) · `^r` session picker · `tab`/`⇧tab` panes · `x` expand
124
+ tool output · `^v` paste · `/copy` copy the full last assistant response · `^t`
125
+ settings · `^c` quit. Drag-select copies text; at the pane edge, continue
126
+ holding to scroll during selection. Clipboard writes use native tools and OSC
127
+ 52; remote terminals may need clipboard permission and may impose size limits.
128
+ Regular sessions persist under `~/.carthagent/agent/sessions/`; `ctg -c`
129
+ continues the latest and `ctg -r` opens the picker.
130
+
131
+ ### Themes and useful flags
132
+
133
+ The regular console provides the `carthage` purple/gold theme, dark themes
134
+ (`opencode`, `tokyonight`, `nebula`, `ember`, `forest`, `mono`, `obsidian`,
135
+ `midnight`, `nord`, `solarized-dark`, `okabe-dark`, `contrast-dark`), light
136
+ themes (`paper`, `daylight`, `solarized-light`, `okabe-light`,
137
+ `contrast-light`), and adaptive `solarized`, `okabe`, `contrast`, and `system`
138
+ themes. Select with `--theme`, `/theme`, or `^t`; the dashboard theme picker
139
+ persists its choice separately in browser `localStorage`.
140
+
141
+ Common options include `--model`, `--thinking`, `--validators <file>`,
142
+ `--context <file>`, `--bash-cap <sec>`, `--review ask|yes|no`, `--isolate`,
143
+ `--no-delivery`, `--no-guide`, `--ascii`, `--glyphs <mode>`, `-c`, `-r`, and
144
+ `--session`. `--glyphs auto` selects Unicode where supported and otherwise
145
+ falls back to ASCII; set `--ascii`, `--glyphs unicode|ascii`,
146
+ `CARTHAGENT_GLYPHS=unicode|ascii`, or `CARTHAGENT_ASCII=1` to override.
147
+
148
+ For native preview behavior and its separate paths, see the [native upgrade
149
+ guide](native-upgrade.md). Native migration acceptance remains open; this page
150
+ continues to describe the default until that status changes.
@@ -0,0 +1,18 @@
1
+ # Live theme control for TUI plugins
2
+
3
+ Reviewable upstream patch: `docs/patches/opencode-v2.0.32-live-theme-api.patch`
4
+
5
+ Patch SHA-256: `0bcb1462688c00a09564e9874c3e01429baf92fe004bfc6400704fb24133c123`
6
+
7
+ The narrow host extension is `context.ui.theme.current()` and
8
+ `context.ui.theme.set({ name, mode? })`. It delegates to OpenCode's existing
9
+ reactive theme service, which applies changes in the running TUI and persists
10
+ configuration. It does not edit theme files or signal/restart the process.
11
+ Theme files must be provisioned before TUI startup so the host has discovered
12
+ them. A missing theme or unsupported requested mode returns `false` without
13
+ partially changing the active theme or mode.
14
+
15
+ Focused coverage: `packages/tui/test/plugin-theme.test.tsx` (2 tests).
16
+ Validation used Bun 1.4.2: focused theme tests pass 2/2 and the plugin package
17
+ typecheck passes. This is a standalone candidate patch; it is not composed into
18
+ the pinned runtime patch and does not update the runtime recipe digest.
@@ -0,0 +1,102 @@
1
+ # Native OpenCode CLI adapter
2
+
3
+ `lib/opencode/cli.mjs` is the compatibility boundary for the `ctg` command
4
+ surface. It parses aliases and flags, chooses interactive vs headless execution,
5
+ and dispatches to `lib/opencode/cli-runtime.mjs`. `bin/ctg.mjs` selects this route
6
+ only with `CTG_NATIVE=1`; the existing CLI remains the default until integration
7
+ gates pass.
8
+
9
+ ## Runtime integration port
10
+
11
+ The caller of `runOpenCodeCli()` supplies these concrete capabilities:
12
+
13
+ | Capability | Request/behavior |
14
+ | --- | --- |
15
+ | `run({ mode, options, prompt, args })` | Launch native OpenCode interactive or headless (`print`/JSONL) session. Honor `--engine-cli`/`--agent-cli` as an explicit executable override and `--isolate` as extension/skill/prompt discovery isolation using a fresh CTG profile, not a worktree. |
16
+ | `listModels({ query })` | Enumerate models from the native provider catalog, filter the optional query, and print the compatible provider/model/context/token/input/output columns. |
17
+ | `login({ args })` | Uses OpenCode 2 integration list/connect/status/complete/cancel APIs. Defaults to Carthagent Ship when available; optional integration and method arguments select another integration. Key-based methods are not prompted in clear text. |
18
+ | `account({ args })` | Uses the profile-owned Ship RPC and active managed OAuth connection; `--json` emits the account response. |
19
+ | `billing({ action })` | Uses the profile-owned Ship RPC to create checkout/portal links and opens the returned URL explicitly. |
20
+ | `logout({ session })` | Uses the profile-owned Ship RPC to revoke a named session or the current session; current logout also removes its native credential. |
21
+ | `archive({ args })` | Uses the profile-owned archive RPC for read-only list/search/read/export of configured legacy transcripts. |
22
+ | `review({ args })` | Uses the shared review facade, whose verdict is bound to the authoritative GitHub PR refs/source or exact local source snapshot. |
23
+ | `domain({ command, args })` | Existing status/hash/check/validate behavior backed by delivery domain modules. |
24
+ | `command({ command, args })` | Existing serve/test/eval/update utility commands; package updates install only the validated release spec. |
25
+
26
+ Capabilities that are not wired fail with an explicit missing-capability error;
27
+ there are no placeholder success paths. Operations return an integer process
28
+ status (or `undefined` for success). Cancellation from a native session maps to
29
+ 130. Headless resume maps the picker request to continuation; headless calls
30
+ without a task fail with an actionable message.
31
+
32
+ Headless success requires both the assistant's completed `finish: stop` message
33
+ and a terminal `idle` message with `outcome: succeeded`; text output alone is not
34
+ success. Native thinking levels are passed as model variants. The adapter rejects
35
+ `--max-tools`, `--max-seconds`, `--max-repairs`, `--no-delivery`, and `--no-strict`
36
+ unless the active native plugin advertises the matching session-option, budget,
37
+ and policy enforcement capabilities. They fail closed when that contract is
38
+ missing. `--bash-cap` is enforced by the native plugin's shell hooks when the
39
+ active plugin advertises session-option support. `--isolate` uses a fresh CTG
40
+ profile with empty skill, instruction, and command sources, while retaining the
41
+ Carthagent plugin; this disables ambient profile/project discovery without
42
+ creating a worktree.
43
+ `--codegraph-max-files` sets the bounded source-file scan limit for the native
44
+ code navigation index and is resolved per session. `--no-guide` is stored in
45
+ durable `carthagent.options` session metadata and honored by native prompt
46
+ framing; on a resumed session, explicitly supplied options override persisted
47
+ settings for that session only, while unspecified settings are preserved. `demo`
48
+ runs a separately labeled offline Node fixture in a disposable temporary workspace;
49
+ it makes no provider calls, edits no project files, and does not claim evidence for
50
+ the user's project. The shared update operation in `lib/opencode/update.mjs`
51
+ supports npm installs
52
+ and clean source clones; clone updates fetch the selected origin tag into a
53
+ private ref and check out its resolved commit, while dirty clones are refused.
54
+ The native CLI's current `update` command path is separate and refuses to
55
+ checkout into its active source tree; it installs the validated, release-pinned
56
+ package spec for npm installs. Release tag/version validation is required;
57
+ `--force` cannot bypass it. `quit`/`q`/`exit` report that no interactive session
58
+ is active when invoked as standalone commands.
59
+
60
+ `--json` translates real native session tool lifecycle and completed assistant
61
+ messages into the documented `tool_execution_start`, `tool_execution_end`, and
62
+ `message_end` JSONL records. It filters to the selected session and reconciles
63
+ message history after execution so stream/history projections do not duplicate a
64
+ turn. Failed assistant responses retain their error and stop reason, and terminal
65
+ failure/interruption outcomes are emitted as idle records rather than returning
66
+ an empty JSONL stream.
67
+ Accepted turns that time out or are cancelled keep their captured session and
68
+ tool lifecycle events, but are never reconciled against older session history.
69
+ Pre-admission interruption has no accepted marker and emits no prior-session
70
+ events. OAuth form secret fields are masked in raw terminal input; unsupported
71
+ API-key login methods are rejected before any prompt is displayed.
72
+
73
+ The disposable real-host adapter smoke is `node tests/native-cli-host-smoke.mjs`.
74
+ It resolves the pinned OpenCode executable through the package-owned native
75
+ runtime resolver and defaults runtime/plugin imports to this package. In a
76
+ source checkout without installed runtime dependencies, set `CTG_OPENCODE_BIN`
77
+ to an installed pinned binary; `CTG_NATIVE_RUNTIME_ROOT` and
78
+ `CTG_NATIVE_PLUGIN_PATH` explicitly override runtime/plugin imports when testing
79
+ another package tree. The smoke creates a disposable
80
+ cross-platform profile (including Windows profile/temp roots), disables project
81
+ configuration loading, and runs a local OpenAI-compatible fixture provider. It
82
+ injects the already-running service through the adapter test seam and verifies
83
+ print, a second print turn in the same session, workspace-scoped continuation
84
+ when a newer foreign-workspace session exists, successful and failing JSONL
85
+ lifecycle events, and explicit rejection of unenforced budget flags. It does
86
+ not verify normal runtime service provisioning/profile isolation or provider
87
+ login/account/billing.
88
+
89
+ ## Migration notes
90
+
91
+ - `ui` and `interactive` alias `tui`; `sessions` aliases `resume`; `s`, `c`,
92
+ `fingerprint`, `auth`, `cloud`, `web`, and `start` retain their established
93
+ command aliases.
94
+ - `--agent-cli` and `--engine-cli` share the explicit native executable
95
+ override. They must not silently select a legacy Pi executable.
96
+ - `--isolate` describes extension/skill/prompt discovery isolation and never
97
+ implies worktree creation.
98
+ - Help/output and domain exit behavior remain the CLI contract. PI session
99
+ stores are archive-only and are not read or continued by this adapter.
100
+ - Activation is intentionally staged: `CTG_NATIVE=1` is opt-in; changing the
101
+ default still requires parent integration to verify service/auth/model/review
102
+ behavior, package installation, and no supported default Pi execution path.
@@ -61,6 +61,15 @@ bounded cancellation, and a documented JSONL contract for evaluation consumers.
61
61
 
62
62
  ## Cross-cutting gates
63
63
 
64
+ The PR #152 TUI scope owns theme provisioning, workspace presentation, and
65
+ session-scoped host commands. `/login`, `/auth`, `/account`, `/cloud`, `/usage`,
66
+ `/billing`, `/logout-cloud`, `/update`, and `/upgrade` remain CLI-authoritative
67
+ operations and must be integrated through the separate CLI author RPC; this TUI
68
+ must not create a second provider/cloud/update implementation. `/quit`, `/q`,
69
+ and `/exit` remain native host lifecycle commands rather than plugin aliases.
70
+ These responsibilities are not counted as complete by listing them in a command
71
+ manifest.
72
+
64
73
  - Two simultaneous tasks in different worktrees cannot share active contracts,
65
74
  budget counters, Ship telemetry identities, or review receipts.
66
75
  - Normal OpenCode configuration, credentials, service and sessions remain
@@ -92,6 +101,13 @@ The following probes use a disposable profile and deterministic loopback provide
92
101
  package-owned `node_modules/@opencode/cli/bin/opencode.exe`. An optional first
93
102
  argument selects an installed plugin directory.
94
103
 
104
+ The interactive help command must be checked with both `/help` and `/ctg-help`.
105
+ Strict post-submit probes on the pinned OpenCode 2.0.32 host currently show
106
+ `/help` opening native Help. Earlier positive results could match autocomplete
107
+ text before submission. `/ctg-help` works, but neither that alias nor dismissing
108
+ autocomplete before submitting `/help` satisfies the required command behavior.
109
+ Native command precedence remains an open acceptance gate.
110
+
95
111
  - `node tools/test-native-controls.mjs`: concurrent framing/raw admission,
96
112
  persisted launcher settings and framing overrides, compaction notes reaching
97
113
  the summary request, cross-location RPC rejection, and whole-service restart
@@ -0,0 +1,132 @@
1
+ # Native daily coding quests
2
+
3
+ Open `/quests`, or `/voyages`, then **Daily coding quests**. On a development
4
+ runtime with navigation support, the left rail also has **Projects / Voyages**
5
+ modes. Switching modes does not leave the main page or create, interrupt, or
6
+ close a coding session. The Voyages navigator shows read-only profile and daily
7
+ assignment summaries. Select an entry explicitly to open its detail page;
8
+ opening a quest does not compose evidence or grant consent. **Return to coding**
9
+ opens the selected session, or Home when no session is selected.
10
+
11
+ The rail keeps each mode's selection and scroll position. Its compact layout
12
+ uses `Q` (quests), `P` (profile), `E` (equipment), `R` (refresh), `S` (sign in),
13
+ and `B` (return to coding); numbered rows are actual assignments. At widths
14
+ that cannot fit the rail, use the command palette, `/voyages`, or `/quests`.
15
+ Badges and friends have no native views yet. The navigator does not invent
16
+ links or data for them. Older released runtimes keep slash-command navigation.
17
+
18
+ Use the native Carthagent Ship
19
+ device sign-in. The client uses the existing configured Carthagent API and scoped
20
+ bearer connection. Signing in, running Ship, or finishing a local delivery does
21
+ not consent to grading and never automatically uploads evidence.
22
+
23
+ ## Select, edit, preview, consent
24
+
25
+ 1. Refresh and select one of the server's daily assignments. The server supplies
26
+ the title, kind, rubric, criteria, UTC day and closing time. There are no
27
+ locally generated objectives or invented completion states.
28
+ 2. Choose an actual local Ship report, or a clearly labeled manual claim. Local
29
+ report access is limited to an owned session and its exact active report.
30
+ Select individual checks/findings and goal/change text. Nothing is selected
31
+ by default. Check output and finding text may contain private information.
32
+ 3. Edit the evidence JSON. Remove or redact sensitive material yourself. No
33
+ automatic secret detection is promised. Use **Tab** to switch between the
34
+ editor and actions, and **Ctrl+P** to validate and preview, never to submit.
35
+ With the native runtime's default input bindings, **Enter** also previews;
36
+ **Ctrl+J** inserts a newline (as do **Shift/Ctrl/Alt+Enter**). These follow
37
+ the runtime's configured input-submit and input-newline shortcuts.
38
+ 4. Inspect the complete canonical outbound JSON in the scrollable preview.
39
+ **Ctrl+U/D** scrolls details and preview. Unknown fields, invalid references,
40
+ unsupported controls, mismatched passing-check revisions and UTF-8 size
41
+ violations are rejected before dispatch. Editing invalidates the preview.
42
+ 5. Choose **Consent and submit this preview**, then explicitly **Consent and
43
+ send**. This grants consent for this submission only. Cancel never sends.
44
+
45
+ Account, connection or location invalidation clears the local draft/preview and
46
+ closes this page's pending dialogs; it never preserves old consent. If evidence
47
+ selection or confirmation was interrupted, a page notice explains the cancellation
48
+ and the actions selection resets to **Refresh**, not Back. Refresh and review
49
+ again before giving fresh consent. No request is resent automatically. A request
50
+ that already started may still have reached the server: check its stable ID in
51
+ the recovery journal rather than assuming cancellation withdrew it.
52
+
53
+ The report's integer plan revision is not a source revision. The source-backed
54
+ projection uses the actual workspace fingerprint. A current report does not
55
+ retain a complete check history, so failed-before execution is **not recorded**
56
+ and is never inferred. Manual additions and edited text remain user claims.
57
+ Project/outcome/run UUIDs are stable references, not proof of authorship. Keep
58
+ those IDs when revising the same outcome. A separate outcome must describe
59
+ genuinely different work, not evade retained-outcome restrictions.
60
+
61
+ Every check has `name`, `before` (`failed` or `not_run`), `after` (`passed`,
62
+ `failed`, or `not_run`), `revision` (40/64 hex), and `result`. A passing check's
63
+ revision must equal the evidence revision. Every finding has `issue`,
64
+ `evidence`, and `resolution`. Empty arrays are valid but do not prove criteria.
65
+ Only enter `before: "failed"` if an actual earlier failure was observed.
66
+ There can be at most 12 checks and 5 findings. The complete canonical evidence
67
+ must fit 12,288 UTF-8 bytes, and the request 16,384 bytes. Per-field byte limits
68
+ are enforced before trimming, so shortening/redacting may be necessary.
69
+
70
+ ## Processing and recovery
71
+
72
+ HTTP acceptance is not completion. **Queued** and **grading** are pending.
73
+ **Graded** has a separate decision: classifier-assessed complete, not met, or
74
+ needs evidence. **Failed** is an operational processing failure, not a negative
75
+ coding assessment. The displayed scores are uncalibrated rubric scores, not
76
+ confidence or probabilities. Only server state determines completion.
77
+
78
+ The native server persists the exact selected request and submission UUID in a
79
+ private profile-wide journal before sending. An uncertain send must be polled
80
+ by that UUID, or explicitly replayed with the same saved ID and body. Refresh
81
+ and poll are read-only and never replay. A new UUID is not a network retry.
82
+ The saved records remain available after midnight; a job accepted before the
83
+ UTC boundary can finish afterward. Validation/authentication/conflict failures
84
+ are not reasons for blind retries.
85
+
86
+ Accepted submissions need only their IDs for polling, so local raw payloads are
87
+ erased when acceptance is known. Unknown-send raw payloads are retained for
88
+ exact recovery for up to 24 hours, purged on the next journal access. This is
89
+ not a background deletion timer. **Erase local payload** removes those bytes
90
+ while retaining IDs for read-only status checks. It cannot cancel a backend
91
+ job or withdraw evidence already sent. Corrupt or unwritable journals fail
92
+ closed rather than sending without durable recovery.
93
+
94
+ ## External processing and retention
95
+
96
+ Carthagent receives the exact selected request. External **JEV** receives the
97
+ revision, goal, change, selected checks/findings and server rubric, not the
98
+ project/outcome/run UUIDs. The flow does not upload a transcript, archive,
99
+ whole project, full review capture, or full check log. Included output tails
100
+ and authored text still require your privacy review.
101
+
102
+ Backend raw evidence is pending for up to 24 hours and erased on terminal
103
+ processing; outages can delay cleanup. Backend metadata is retained for
104
+ 90 days. Provider policy applies. Immediate provider or backup deletion is
105
+ not promised. Local metadata is retained for recovery, with bounded storage
106
+ and expiry applied on journal access.
107
+
108
+ Assessment is based on submitted evidence, **not independent verification**.
109
+ There are **no coins, XP, distance, inventory, or other rewards** in this flow.
110
+ Editable personal quests remain separate from server daily assignments.
111
+
112
+ ## Validation boundary
113
+
114
+ Offline contract, persistence, ownership, schema and UI-controller tests do not
115
+ prove production provider accuracy or a live native submission. The backend's
116
+ previous synthetic acceptance submissions were backend tests, not native TUI
117
+ acceptance. Live acceptance requires a dedicated owned QA account, normal
118
+ device sign-in and a separately authorized bounded provider-attempt allowance.
119
+ Do not silently spend that allowance or substitute a mock result for
120
+ production proof.
121
+
122
+ The navigator's real-component renderer tests run with Bun 1.4.2 through
123
+ `npm run test:native-navigation`. They use isolated, synthetic account summaries
124
+ and do not contact a provider. They cover focus ownership, modal guards,
125
+ compact mode, preserved selection/scroll, and read-only route selection. They
126
+ are not live authentication, grading, or full rebuilt-runtime acceptance.
127
+
128
+ Run the new boundary on the real pinned native host without external grading:
129
+ `node tools/test-native-daily-quests.mjs`. This checks registration, all six
130
+ declared authentication failures, and actual local source projection through
131
+ the host's output validator. Its constructed report is a schema fixture,
132
+ not evidence that a check ran or a substitute for live submission acceptance.
@@ -0,0 +1,59 @@
1
+ # Owned OpenCode glyph PTY acceptance
2
+
3
+ `npm run test:native-glyph-pty` resolves the runtime through CTG's production
4
+ `resolveOpenCode` path, requires its identity to be CTG-owned, and verifies the
5
+ runtime provenance and executable digest before starting a TUI. The packaged
6
+ release manifest is the default trust root. To test an explicitly staged owned
7
+ artifact, provide both a staging root and an independently trusted release
8
+ manifest:
9
+
10
+ ```sh
11
+ CTG_TEST_RUNTIME_ARTIFACT_ROOT=/path/to/owned-runtime \
12
+ CTG_TEST_RUNTIME_RELEASE_MANIFEST=/path/to/trusted-release.json \
13
+ CTG_GLYPH_ARTIFACT=/tmp/glyph-pty.json \
14
+ npm run test:native-glyph-pty
15
+ ```
16
+
17
+ The explicit artifact preflight runs before the production resolver can execute
18
+ it. Do not set `CTG_OPENCODE_BIN` or `CTG_TEST_RUNTIME_SHA256`; either would
19
+ bypass the acceptance trust chain. The runner launches two full TUI sessions in
20
+ real PTYs, with isolated temporary home/config/data/state/cache/database and
21
+ project directories: one with `CTG_TUI_GLYPHS=ascii`, one with
22
+ `CTG_TUI_GLYPHS=unicode`. It stages (but does not submit) the exact text
23
+ `CTG_GLYPH_PAYLOAD 漢字 café → • − …` in the composer. The paired PTY parser
24
+ tracks East Asian wide-cell width and combining marks locally to this probe; it
25
+ requires the entire exact ordered payload on the rendered prompt row. No model
26
+ provider is used.
27
+
28
+ Assertions cover one known static chrome mapping: the startup logo must be the
29
+ ASCII wordmark in ASCII mode and the block-art wordmark in Unicode mode. The
30
+ complete arbitrary Unicode user payload must independently match, in order, on
31
+ the rendered composer row. The composer row itself is excluded from startup-logo
32
+ classification. This is not coverage of prompt borders, ellipses, bullets,
33
+ separators, other dialogs, shell output, or tool-group disclosure.
34
+ The JSON artifact records the exact runtime version, compatibility version,
35
+ binary SHA-256, source/patch/lock provenance, production resolver identity,
36
+ mode-specific parsed screens, and captured-PTY digests. A PTY pass establishes
37
+ the exercised home composer frame only; it is not a claim that every TUI dialog,
38
+ shell result, tool group, or disclosure state was rendered.
39
+
40
+ Both spawned processes receive allowlisted environments. The Node resolver may
41
+ use `CTG_RUNTIME_GITHUB_TOKEN` while acquiring an unpublished draft runtime, but
42
+ the Python harness and each OpenCode PTY child receive only PATH/locale plus
43
+ fresh temporary profile paths and the explicit glyph mode. The optional release
44
+ token is never forwarded to the child TUI, model, or tools. No host account,
45
+ provider credential, network provider, performance, memory, or real clipboard
46
+ claim is part of this acceptance test.
47
+
48
+ The historical negative-control runtime with SHA-256
49
+ `85bb44a65e8c185f4f33d41507d29acc77f2db0cdcb0103a14476021c8e43794` predates the
50
+ glyph patch; it rendered the Unicode startup logo in ASCII mode and was rejected.
51
+ That artifact is no longer available here and its result is not a glyph pass.
52
+ Positive acceptance requires rerunning this harness against the final combined
53
+ runtime artifact and retaining its JSON report.
54
+
55
+ Pure Unicode cell-width, composer-payload, and child-environment helper code is
56
+ in `tools/native-glyph-helpers.py`, which has no OS-specific PTY imports. Its
57
+ unit tests run on supported platforms when Python is available (select an
58
+ interpreter with `PYTHON`). The actual PTY execution runner remains Unix-only;
59
+ this does not claim Windows PTY acceptance.