gentle-pi 4.9.0 → 5.1.0

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 (443) hide show
  1. package/README.md +2 -2
  2. package/assets/agents/gentle-ai-explore.md +3 -6
  3. package/assets/agents/gentle-ai-verify.md +2 -2
  4. package/assets/agents/gentle-ai-worker.md +9 -9
  5. package/assets/agents/jd-fix-agent.md +2 -2
  6. package/assets/agents/jd-judge-a.md +0 -1
  7. package/assets/agents/jd-judge-b.md +0 -1
  8. package/assets/migrations/agent-body-history.json +9 -0
  9. package/assets/orchestrator-delegation.md +1 -1
  10. package/assets/orchestrator-full-delegation.md +1 -1
  11. package/assets/orchestrator-maintenance.md +11 -0
  12. package/assets/orchestrator-quota-recovery.md +1 -1
  13. package/assets/orchestrator-skills.md +10 -0
  14. package/assets/orchestrator-tracking.md +2 -2
  15. package/assets/orchestrator-verification.md +10 -8
  16. package/assets/orchestrator.md +2 -2
  17. package/bin/gentle-shell.mjs +69 -17
  18. package/contracts/review-provider-contract-mirror/provider-contract.lock.json +11 -10
  19. package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/manifest.json +5 -5
  20. package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/orchestration/pi.md +5 -3
  21. package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/routing/pi.md +2 -2
  22. package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/schemas/lens.schema.json +3 -3
  23. package/contracts/review-provider-contract-mirror/v1.7.0/bundle/vectors/lens.json +1 -0
  24. package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/generated/provider-capabilities.baseline.json +3 -3
  25. package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/generated/provider-roles.baseline.json +3 -3
  26. package/docs/bundled-install.md +2 -2
  27. package/docs/delegated-verification.md +10 -6
  28. package/docs/desktop-feed.md +15 -6
  29. package/docs/desktop-rpc.md +298 -30
  30. package/docs/gentle-shell-desktop.md +10 -3
  31. package/docs/gentle-shell.md +25 -19
  32. package/docs/install-wizard.md +7 -5
  33. package/docs/native-authority-architecture.md +3 -3
  34. package/docs/odd-preparation-continuity.md +2 -2
  35. package/docs/permission-modes.md +10 -2
  36. package/docs/readme-reference.md +53 -24
  37. package/docs/review-coordinator.md +4 -2
  38. package/docs/session-profile-format.md +33 -7
  39. package/docs/sound-notifications.md +1 -1
  40. package/docs/work-continuity.md +7 -7
  41. package/docs/yolo-mode.md +1 -1
  42. package/extensions/ask-user-choice.ts +2 -2
  43. package/extensions/ask-user-question.ts +1 -1
  44. package/extensions/child-context.ts +2 -11
  45. package/extensions/gentle-agents.ts +86 -30
  46. package/extensions/gentle-ai.ts +918 -632
  47. package/extensions/gentle-desktop-feed.ts +13 -3
  48. package/extensions/gentle-desktop-rpc.ts +51 -2
  49. package/extensions/gentle-fast.ts +9 -2
  50. package/extensions/gentle-music.ts +2 -0
  51. package/extensions/gentle-notifications.ts +12 -4
  52. package/extensions/gentle-shell.ts +157 -62
  53. package/extensions/gentle-star-prompt.ts +3 -0
  54. package/extensions/gentle-tps.ts +7 -0
  55. package/extensions/history/index.ts +1 -1
  56. package/extensions/quiet-tools.ts +13 -22
  57. package/extensions/skill-registry.ts +9 -1
  58. package/extensions/startup-banner.ts +8 -13
  59. package/herdr/mods/gentle-agents/snapshot.js +30 -23
  60. package/herdr/mods/gentle-chat/feed.js +6 -0
  61. package/herdr/mods/gentle-chat/main.js +76 -16
  62. package/herdr/mods/gentle-chat/session.js +13 -5
  63. package/herdr/mods/gentle-chat/snapshot.js +30 -23
  64. package/herdr/mods/gentle-chat/ui.js +7 -1
  65. package/herdr/mods/gentle-inspector/main.js +2 -0
  66. package/herdr/mods/gentle-inspector/snapshot.js +30 -23
  67. package/herdr/mods/gentle-palette/main.js +1 -1
  68. package/herdr/mods/gentle-palette/snapshot.js +30 -23
  69. package/herdr/mods/gentle-pane/snapshot.js +30 -23
  70. package/herdr/mods/gentle-sidebar/snapshot.js +30 -23
  71. package/herdr/mods/gentle-spaces/snapshot.js +30 -23
  72. package/herdr/mods/gentle-status/snapshot.js +30 -23
  73. package/herdr/mods/gentle-tabs/main.js +3 -2
  74. package/herdr/mods/gentle-tabs/new-tab.js +9 -0
  75. package/herdr/mods/gentle-tabs/snapshot.js +30 -23
  76. package/herdr/mods/gentle-tokens/snapshot.js +30 -23
  77. package/lib/agent-profiles.ts +50 -10
  78. package/lib/agents-config.ts +69 -5
  79. package/lib/agents-runner.ts +34 -1
  80. package/lib/auto-permission-runtime.ts +2 -1
  81. package/lib/background-jobs-tools.ts +24 -16
  82. package/lib/banner-config.ts +69 -0
  83. package/lib/child-session.ts +6 -0
  84. package/lib/claude-bridge-config.ts +41 -0
  85. package/lib/codex-turn-continuation.ts +40 -0
  86. package/lib/compaction-threshold.ts +46 -0
  87. package/lib/context-threshold.ts +5 -5
  88. package/lib/desktop-agent-definitions-service.ts +93 -0
  89. package/lib/desktop-auth-service.ts +102 -0
  90. package/lib/desktop-background-subagents-service.ts +155 -0
  91. package/lib/desktop-command-rpc.ts +71 -0
  92. package/lib/desktop-feed-sources.ts +44 -1
  93. package/lib/desktop-feed.ts +41 -29
  94. package/lib/desktop-rpc-agent-definitions.ts +119 -0
  95. package/lib/desktop-rpc-agents.ts +44 -3
  96. package/lib/desktop-rpc-auth.ts +103 -0
  97. package/lib/desktop-rpc-background-subagents.ts +126 -0
  98. package/lib/desktop-rpc-changes.ts +13 -4
  99. package/lib/desktop-rpc-config.ts +287 -13
  100. package/lib/desktop-rpc-profile-binding.ts +212 -0
  101. package/lib/desktop-rpc-profiles.ts +2 -0
  102. package/lib/desktop-rpc-stats.ts +16 -4
  103. package/lib/desktop-rpc-status.ts +103 -0
  104. package/lib/desktop-status-service.ts +86 -0
  105. package/lib/destructive-command-guard.ts +9 -185
  106. package/lib/exploration-budget.ts +3 -7
  107. package/lib/gentle-design.ts +23 -4
  108. package/lib/gentle-shell-desktop.ts +85 -0
  109. package/lib/gentle-shell-launcher.ts +120 -8
  110. package/lib/mcp-config.ts +214 -0
  111. package/lib/native-choice-list.ts +1 -1
  112. package/lib/native-fullscreen-interaction.ts +3 -0
  113. package/lib/native-pointer-region.ts +1 -1
  114. package/lib/native-review-cli.ts +213 -397
  115. package/lib/odd-phase-inference.ts +1 -1
  116. package/lib/orchestrator-mode-policy.ts +25 -12
  117. package/lib/path-consent-fence.ts +113 -0
  118. package/lib/persona-config.ts +77 -0
  119. package/lib/pi-settings.ts +157 -0
  120. package/lib/questionnaire/questionnaire-view.ts +1 -1
  121. package/lib/review-continuation-registry.ts +9 -26
  122. package/lib/review-coordinator.ts +13 -2
  123. package/lib/review-host-relay.ts +2 -35
  124. package/lib/review-integration-v2.ts +129 -180
  125. package/lib/review-object-store.ts +0 -57
  126. package/lib/review-repository.ts +0 -44
  127. package/lib/review-risk-assessment.ts +11 -36
  128. package/lib/review-start-context.ts +2 -1
  129. package/lib/review-transaction.ts +6 -6
  130. package/lib/sensitive-paths.ts +45 -0
  131. package/lib/session-profile-binding.ts +29 -0
  132. package/lib/session-profile-freeze.ts +11 -4
  133. package/lib/session-worktree-registry.ts +11 -5
  134. package/lib/shell-bar.ts +41 -18
  135. package/lib/shell-card.ts +27 -1
  136. package/lib/shell-changes-view.ts +6 -2
  137. package/lib/shell-changes.ts +94 -37
  138. package/lib/shell-git-worker.ts +158 -0
  139. package/lib/shell-idle-changes.ts +88 -0
  140. package/lib/shell-untracked-cache.ts +142 -0
  141. package/lib/shell-untracked-lines.ts +178 -0
  142. package/lib/stats-collector.ts +24 -0
  143. package/lib/tower-open.ts +8 -1
  144. package/lib/tps-policy.ts +85 -0
  145. package/lib/vim-editor-adapter.ts +9 -2
  146. package/lib/voice-artifacts.ts +8 -1
  147. package/lib/voice-install.ts +7 -3
  148. package/lib/yolo-session-policy.ts +2 -2
  149. package/package.json +1 -1
  150. package/runtime/gentle-shell-desktop.mjs +85 -0
  151. package/runtime/gentle-shell-launcher.mjs +120 -8
  152. package/runtime/native-review-cli.mjs +206 -390
  153. package/runtime/review-integration-v2.mjs +129 -180
  154. package/runtime/review-risk-assessment.mjs +11 -36
  155. package/runtime/sensitive-paths.mjs +46 -0
  156. package/runtime/tower-open.mjs +8 -1
  157. package/scripts/build-runtime-modules.mjs +2 -0
  158. package/scripts/gentle-ai-installer.mjs +13 -14
  159. package/scripts/installer-preflight.mjs +1 -1
  160. package/scripts/main-channel.mjs +47 -11
  161. package/scripts/pi-update.mjs +10 -4
  162. package/scripts/prepare-verifier.mjs +14 -4
  163. package/scripts/verify-package-files.mjs +45 -13
  164. package/skills/judgment-day/SKILL.md +1 -1
  165. package/skills/judgment-day/references/prompts-and-formats.md +1 -1
  166. package/skills/provider-defect-report/SKILL.md +1 -1
  167. package/skills/rdd-defect-workflow/SKILL.md +2 -2
  168. package/skills/skill-creator/SKILL.md +4 -4
  169. package/skills/skill-improver/SKILL.md +4 -4
  170. package/skills/skill-registry/SKILL.md +2 -2
  171. package/tests/agent-profiles-workflow.test.ts +102 -0
  172. package/tests/agent-risk-escalation.test.ts +15 -0
  173. package/tests/agents-config.test.ts +22 -2
  174. package/tests/agents-protocol.test.ts +1 -1
  175. package/tests/agents-runner.test.ts +94 -2
  176. package/tests/append-system-prompt-route.test.ts +16 -11
  177. package/tests/ask-user-choice.test.ts +19 -0
  178. package/tests/ask-user-question.test.ts +23 -4
  179. package/tests/auto-permission-runtime.test.ts +4 -4
  180. package/tests/bounded-stop-contract.test.ts +50 -62
  181. package/tests/built-web-guard.test.ts +32 -0
  182. package/tests/child-context-files.test.ts +6 -6
  183. package/tests/child-ui-extensions.test.ts +125 -0
  184. package/tests/child-web-package.test.ts +1 -1
  185. package/tests/codex-turn-continuation.test.ts +183 -0
  186. package/tests/committed-range-untracked-exclusion.test.ts +18 -0
  187. package/tests/controlled-engineering-editor.test.ts +192 -0
  188. package/tests/controlled-engineering-launch.test.ts +136 -0
  189. package/tests/controlled-engineering.test.ts +244 -0
  190. package/tests/delegate-for-reason-contract.test.ts +1 -1
  191. package/tests/delivery-b-rendered-surfaces.test.ts +1 -1
  192. package/tests/delivery-conflict-markers.test.ts +2 -3
  193. package/tests/desktop-feed-tool-summaries.test.ts +1 -1
  194. package/tests/desktop-feed-transcript.test.ts +17 -0
  195. package/tests/desktop-feed.test.ts +141 -7
  196. package/tests/desktop-liveness.test.ts +125 -0
  197. package/tests/desktop-persona.test.ts +17 -0
  198. package/tests/desktop-rpc-agent-definitions.test.ts +219 -0
  199. package/tests/desktop-rpc-agents.test.ts +113 -3
  200. package/tests/desktop-rpc-auth.test.ts +278 -0
  201. package/tests/desktop-rpc-background-subagents.test.ts +186 -0
  202. package/tests/desktop-rpc-changes.test.ts +81 -4
  203. package/tests/desktop-rpc-config-mcp-fidelity.test.ts +106 -0
  204. package/tests/desktop-rpc-config-readonly-stores.test.ts +458 -0
  205. package/tests/desktop-rpc-config-settings.test.ts +234 -0
  206. package/tests/desktop-rpc-config.test.ts +17 -3
  207. package/tests/desktop-rpc-design.test.ts +30 -1
  208. package/tests/desktop-rpc-jobs.test.ts +9 -1
  209. package/tests/desktop-rpc-permissions.test.ts +9 -1
  210. package/tests/desktop-rpc-profile-binding.test.ts +195 -0
  211. package/tests/desktop-rpc-review.test.ts +1 -1
  212. package/tests/desktop-rpc-session-snapshot-commands.test.ts +50 -0
  213. package/tests/desktop-rpc-session.test.ts +2 -2
  214. package/tests/desktop-rpc-stats.test.ts +42 -11
  215. package/tests/desktop-rpc-status.test.ts +195 -0
  216. package/tests/desktop-rpc-updates.test.ts +1 -1
  217. package/tests/desktop-rpc-usage.test.ts +9 -1
  218. package/tests/desktop-rpc.test.ts +2 -2
  219. package/tests/desktop-session-switch.test.ts +237 -0
  220. package/tests/desktop-target-session.test.ts +104 -0
  221. package/tests/destructive-command-guard.test.ts +187 -0
  222. package/tests/devbinary/pi-host-relay.devtest.ts +73 -9
  223. package/tests/exploration-budget.test.ts +2 -26
  224. package/tests/fixtures/primary-session-prompt/gentleman.golden.md +15 -11
  225. package/tests/full-delegation-closure.test.ts +19 -9
  226. package/tests/generic-agent-tools.test.ts +3 -3
  227. package/tests/gentle-agents.test.ts +215 -10
  228. package/tests/gentle-ai-binary.test.ts +3 -3
  229. package/tests/gentle-ai-exploration-budget.test.ts +3 -2
  230. package/tests/gentle-ai-installer.test.ts +60 -59
  231. package/tests/gentle-ai.test.ts +30 -59
  232. package/tests/gentle-chat-read-failure.test.ts +74 -0
  233. package/tests/gentle-chat-session-read.test.ts +127 -0
  234. package/tests/gentle-design.test.ts +39 -0
  235. package/tests/gentle-notifications.test.ts +43 -5
  236. package/tests/gentle-shell-desktop.test.ts +108 -0
  237. package/tests/gentle-shell-launcher-auto-provision.test.ts +152 -0
  238. package/tests/gentle-shell-launcher-machine-output.test.ts +356 -0
  239. package/tests/gentle-shell-launcher-tower.test.ts +7 -1
  240. package/tests/gentle-shell.test.ts +163 -15
  241. package/tests/gentle-tps.test.ts +57 -0
  242. package/tests/independent-recovery-delivery.test.ts +15 -13
  243. package/tests/installer-preflight.test.ts +3 -2
  244. package/tests/installer-server.test.ts +3 -2
  245. package/tests/installer-windows-bootstrap.test.ts +6 -0
  246. package/tests/job-turn-end-texts.test.ts +57 -0
  247. package/tests/judgment-day-dispatch-diagnostics.test.ts +87 -0
  248. package/tests/lazy-module-contradictions-contract.test.ts +2 -3
  249. package/tests/main-channel-upgrade.test.ts +14 -7
  250. package/tests/main-channel.test.ts +78 -23
  251. package/tests/maintainer/desktop-rpc.maintest.ts +4 -4
  252. package/tests/native-fullscreen-interaction.test.ts +37 -1
  253. package/tests/native-review-capability-contract.test.ts +13 -1
  254. package/tests/native-review-cli-nonblocking-findings.test.ts +9 -84
  255. package/tests/native-review-cli.test.ts +199 -21
  256. package/tests/native-review-consent.test.ts +20 -3
  257. package/tests/native-review-start-escalation-real-binary.test.ts +42 -0
  258. package/tests/no-self-pause-contract.test.ts +8 -7
  259. package/tests/odd-phase-inference.test.ts +2 -2
  260. package/tests/odd-routing-canonical-ratchet.test.ts +1 -1
  261. package/tests/odd-routing-contract.test.ts +2 -2
  262. package/tests/orchestrator-budget.test.ts +7 -2
  263. package/tests/orchestrator-prompt-diet-contract.test.ts +5 -5
  264. package/tests/orchestrator-skills-inline-contract.test.ts +26 -0
  265. package/tests/package-manifest.test.ts +11 -16
  266. package/tests/packaged-agent-codemode.test.ts +79 -0
  267. package/tests/path-consent-fence.test.ts +326 -0
  268. package/tests/persona-config.test.ts +42 -0
  269. package/tests/pi-update-launcher.test.ts +1 -1
  270. package/tests/pi-update-source.test.ts +48 -2
  271. package/tests/primary-session-prompt.test.ts +9 -7
  272. package/tests/profile-fast-tier.test.ts +79 -4
  273. package/tests/progress-rule-contract.test.ts +54 -0
  274. package/tests/rdd-delivery-warning.test.ts +109 -0
  275. package/tests/review-actor-tool-deny.test.ts +1 -2
  276. package/tests/review-agent-end-preflight.test.ts +3 -1
  277. package/tests/review-assess-escalation-forwarding.test.ts +99 -0
  278. package/tests/review-authority-recovery-docs.test.ts +9 -12
  279. package/tests/review-continuation-registry.test.ts +24 -25
  280. package/tests/review-controller-native-recovery.test.ts +165 -178
  281. package/tests/review-controller-native-routing.test.ts +352 -27
  282. package/tests/review-coordinator-correction-gate.test.ts +5 -9
  283. package/tests/review-coordinator-runtime.test.ts +3 -2
  284. package/tests/review-coordinator.test.ts +14 -0
  285. package/tests/review-due-compaction.test.ts +1 -1
  286. package/tests/review-failure-facts.test.ts +2 -2
  287. package/tests/review-host-relay-restart-parity.test.ts +2 -52
  288. package/tests/review-host-relay-routing.test.ts +59 -298
  289. package/tests/review-host-relay.test.ts +0 -46
  290. package/tests/review-integration-nonblocking-findings.test.ts +3 -6
  291. package/tests/review-integration-v2-forward.test.ts +114 -234
  292. package/tests/review-integration-v2.test.ts +85 -39
  293. package/tests/review-json-arguments.test.ts +30 -9
  294. package/tests/review-legacy-check.test.ts +38 -0
  295. package/tests/review-object-store.test.ts +2 -57
  296. package/tests/review-one-call-findings.test.ts +1 -0
  297. package/tests/review-one-call.test.ts +56 -0
  298. package/tests/review-risk-assessment.test.ts +14 -43
  299. package/tests/review-run-escalate-forwarding.test.ts +59 -0
  300. package/tests/review-sidebar-state.test.ts +2 -1
  301. package/tests/review-untracked-inventory-replay.test.ts +181 -0
  302. package/tests/runtime-harness.mjs +30 -4
  303. package/tests/sensitive-path-tools.test.ts +210 -5
  304. package/tests/session-profile-binding-observers.test.ts +47 -0
  305. package/tests/session-profile-extension.test.ts +109 -11
  306. package/tests/session-profile-freeze.test.ts +49 -2
  307. package/tests/session-profile-v1-compat.test.ts +11 -3
  308. package/tests/session-worktree-registry.test.ts +23 -0
  309. package/tests/shell-bar.test.ts +21 -3
  310. package/tests/shell-changes-idle-start.test.ts +510 -0
  311. package/tests/shell-changes-untracked-bound.test.ts +230 -0
  312. package/tests/shell-changes-view.test.ts +8 -2
  313. package/tests/shell-changes.test.ts +134 -0
  314. package/tests/shell-git-runner-stall.test.ts +74 -0
  315. package/tests/shell-git-worker-fallback.test.ts +140 -0
  316. package/tests/shell-git-worker-lifetime.test.ts +91 -0
  317. package/tests/shell-render-cache-runtime.test.ts +256 -3
  318. package/tests/shell-sidebar-layout.test.ts +1 -1
  319. package/tests/shell-sidebar-scroll-benchmark.test.ts +14 -5
  320. package/tests/shell-untracked-cache.test.ts +213 -0
  321. package/tests/short-check-routing-contract.test.ts +11 -7
  322. package/tests/skill-references.test.ts +39 -0
  323. package/tests/skill-registry.test.ts +4 -4
  324. package/tests/startup-banner.test.ts +2 -1
  325. package/tests/status-timing-diagnostics.test.ts +2 -1
  326. package/tests/support/capabilities-v26.ts +22 -0
  327. package/tests/support/chat-ui.ts +39 -0
  328. package/tests/support/review-coordinator-runtime.ts +11 -2
  329. package/tests/support/status-v9.ts +8 -0
  330. package/tests/t7-recovery-preservation.test.ts +68 -0
  331. package/tests/tower-open.test.ts +24 -0
  332. package/tests/tower-pack.test.ts +48 -0
  333. package/tests/tps-policy.test.ts +96 -0
  334. package/tests/turn-end-rule-contract.test.ts +155 -0
  335. package/tests/turn-end-scope.test.ts +39 -0
  336. package/tests/verification-proportionality.test.ts +1 -1
  337. package/tests/verification-scoped-stop-contract.test.ts +1 -1
  338. package/tests/verification-tiers-contract.test.ts +4 -3
  339. package/tests/verifier-admission.test.ts +1 -1
  340. package/tests/verifier-preparation.test.ts +94 -1
  341. package/tests/verifier-settle-reminder.test.ts +1 -1
  342. package/tests/verify-first-launch-contract.test.ts +19 -7
  343. package/tests/vim-editor-adapter.test.ts +12 -2
  344. package/tests/voice-install.test.ts +97 -11
  345. package/tests/windows-hidden-processes.test.ts +11 -44
  346. package/tests/work-continuity-contract.test.ts +48 -55
  347. package/tests/yolo-session-policy.test.ts +2 -0
  348. package/web/tower/dist/assets/BatchableSprite-BJ_TQxjN.js +217 -0
  349. package/web/tower/dist/assets/BufferResource-DeJpHuO6.js +139 -0
  350. package/web/tower/dist/assets/CanvasPool-cwc03T_x.js +23 -0
  351. package/web/tower/dist/assets/CanvasRenderer-DO84oP5R.js +1 -0
  352. package/web/tower/dist/assets/Filter-BKhT9lO8.js +1 -0
  353. package/web/tower/dist/assets/GlUniformGroupSystem-DluI7cqd.js +130 -0
  354. package/web/tower/dist/assets/GpuUboSystem-CM4Dys0F.js +17 -0
  355. package/web/tower/dist/assets/Graphics-3OyUtCzC.js +1 -0
  356. package/web/tower/dist/assets/RenderTargetSystem-X-9GAQ1C.js +184 -0
  357. package/web/tower/dist/assets/WebGLRenderer-I0fqIX1w.js +20 -0
  358. package/web/tower/dist/assets/WebGPURenderer-BRWSXotK.js +79 -0
  359. package/web/tower/dist/assets/_commonjsHelpers-CqkleIqs.js +1 -0
  360. package/web/tower/dist/assets/abnfDiagram-VCTEODGH-C4iBBhTL.js +1 -0
  361. package/web/tower/dist/assets/architectureDiagram-5GKGNRK7-Ih-qvfTu.js +36 -0
  362. package/web/tower/dist/assets/blockDiagram-I7D4REHJ-I9z_u3wb.js +129 -0
  363. package/web/tower/dist/assets/browserAll-gmBFNIA4.js +14 -0
  364. package/web/tower/dist/assets/c4Diagram-7LVT6UL2-DOyk2rEJ.js +38 -0
  365. package/web/tower/dist/assets/canvasUtils-DTaMcbkN.js +1 -0
  366. package/web/tower/dist/assets/channel-wuxBkGGz.js +1 -0
  367. package/web/tower/dist/assets/chunk-2Q5K7J3B-BaJ-OrJ_.js +1 -0
  368. package/web/tower/dist/assets/chunk-5VM5RSS4-wICrhvyw.js +15 -0
  369. package/web/tower/dist/assets/chunk-F27PBJKO-DUQ_JqvZ.js +1 -0
  370. package/web/tower/dist/assets/chunk-IMKFNOWR-DKfgQrGM.js +231 -0
  371. package/web/tower/dist/assets/chunk-JWPE2WC7-1k1LW87d.js +1 -0
  372. package/web/tower/dist/assets/chunk-POPQ4Y6H-Df8cN2w9.js +1 -0
  373. package/web/tower/dist/assets/chunk-SVP7TREG-CxU5LDj8.js +88 -0
  374. package/web/tower/dist/assets/chunk-TICWLB2K-CEuHEBi0.js +206 -0
  375. package/web/tower/dist/assets/chunk-XXDRQBXY-CbSAjj9l.js +1 -0
  376. package/web/tower/dist/assets/classDiagram-ZZMXUADV-DbRmVQRX.js +1 -0
  377. package/web/tower/dist/assets/classDiagram-v2-VYDZK3BY-DbRmVQRX.js +1 -0
  378. package/web/tower/dist/assets/cose-bilkent-JH36ORCC-8xZLSHER.js +1 -0
  379. package/web/tower/dist/assets/cynefin-OW5HDTMX-Cw4XG9Zj.js +166 -0
  380. package/web/tower/dist/assets/cynefinDiagram-5FMLGOSQ-CcQdokUv.js +62 -0
  381. package/web/tower/dist/assets/cytoscape.esm-BHa1VTXv.js +321 -0
  382. package/web/tower/dist/assets/d3-scale-4DPf7zan.js +1 -0
  383. package/web/tower/dist/assets/dagre-GXQ25YYZ-D-Xv7L9X.js +4 -0
  384. package/web/tower/dist/assets/diagram-S7CK7UJ4-Bqy2eT2c.js +30 -0
  385. package/web/tower/dist/assets/diagram-UQ7AKVKN-B2wK2GHj.js +41 -0
  386. package/web/tower/dist/assets/diagram-VSXAHHWV-CIZqh7BH.js +3 -0
  387. package/web/tower/dist/assets/diagram-VX7I27RA-BGX4HBj2.js +24 -0
  388. package/web/tower/dist/assets/diagram-Z3DM3KII-DYpsfaJW.js +24 -0
  389. package/web/tower/dist/assets/ebnfDiagram-PWID7BFC-BNnwCZNv.js +1 -0
  390. package/web/tower/dist/assets/erDiagram-RLTQ6QDP-_MN9W-1E.js +99 -0
  391. package/web/tower/dist/assets/flowDiagram-HODETNUW-D_ndx1UC.js +168 -0
  392. package/web/tower/dist/assets/ganttDiagram-EL5Y4UJY-C8chdEiZ.js +292 -0
  393. package/web/tower/dist/assets/getPo2TextureFromSource-CqJsdi0J.js +1 -0
  394. package/web/tower/dist/assets/getTexelRangeRects-DN3N5aFp.js +57 -0
  395. package/web/tower/dist/assets/getTextureBatchBindGroup-RNSiAVH3.js +1 -0
  396. package/web/tower/dist/assets/gitGraphDiagram-WWUBYQGX-B5ijv7LI.js +106 -0
  397. package/web/tower/dist/assets/index-B1Ho-Igs.css +1 -0
  398. package/web/tower/dist/assets/index-CfNjH1Wr.js +45 -0
  399. package/web/tower/dist/assets/infoDiagram-27XIBGKW-AYbp5ElT.js +2 -0
  400. package/web/tower/dist/assets/ishikawaDiagram-5VMMS53U-DnmwARuR.js +70 -0
  401. package/web/tower/dist/assets/journeyDiagram-3NMN7TZE-CK737kko.js +139 -0
  402. package/web/tower/dist/assets/kanban-definition-UXKFOSKX-0AhM3axC.js +89 -0
  403. package/web/tower/dist/assets/katex-HP8lGamR.js +257 -0
  404. package/web/tower/dist/assets/layout-wOIeK9c_.js +1 -0
  405. package/web/tower/dist/assets/mermaid.core-CGYyw6G7.js +310 -0
  406. package/web/tower/dist/assets/mindmap-definition-YA3MSWOX-CkZ_JOdx.js +96 -0
  407. package/web/tower/dist/assets/pegDiagram-XKGWAZYB-CHAPspih.js +1 -0
  408. package/web/tower/dist/assets/pieDiagram-E7YTZNPT-LwCcZl5o.js +39 -0
  409. package/web/tower/dist/assets/preload-helper-PPVm8Dsz.js +1 -0
  410. package/web/tower/dist/assets/quadrantDiagram-AXDQQJYC-Cm4uijV2.js +7 -0
  411. package/web/tower/dist/assets/railroadDiagram-O6MQD6OU-BPQHZ2b5.js +1 -0
  412. package/web/tower/dist/assets/requirementDiagram-BXWQKSXE-JLtSUDfS.js +84 -0
  413. package/web/tower/dist/assets/sankeyDiagram-P5KCCOFB-DJsYv9ii.js +40 -0
  414. package/web/tower/dist/assets/sequenceDiagram-WJ2MYXX4-Ca8T8sT0.js +162 -0
  415. package/web/tower/dist/assets/sizeCapture-INFHLROL-Ch4i2dS-.js +1 -0
  416. package/web/tower/dist/assets/stateDiagram-D77RDMKH-DDSkncYm.js +1 -0
  417. package/web/tower/dist/assets/stateDiagram-v2-MP3YSRHH-BkO_9mIH.js +1 -0
  418. package/web/tower/dist/assets/swimlanes-42K2YHIH-Bns5iI3y.js +1 -0
  419. package/web/tower/dist/assets/swimlanesDiagram-VR7AAH4N--LEBb1ti.js +8 -0
  420. package/web/tower/dist/assets/timeline-definition-24CTP7MA-QJDuVTb3.js +120 -0
  421. package/web/tower/dist/assets/vennDiagram-4TSXK5OY-pBNxKxOV.js +34 -0
  422. package/web/tower/dist/assets/wardleyDiagram-VM6X3IG4-1PEarjN1.js +78 -0
  423. package/web/tower/dist/assets/webworkerAll-D_Np003p.js +83 -0
  424. package/web/tower/dist/assets/xychartDiagram-S5SC5T6Z-CLwsvOg7.js +7 -0
  425. package/web/tower/dist/index.html +41 -0
  426. package/contracts/review-provider-contract-mirror/v1.6.0/bundle/vectors/lens.json +0 -1
  427. package/docs/review-delivery-preflight.md +0 -22
  428. package/extensions/codegraph-tools.ts +0 -437
  429. package/lib/native-review-authority-quarantine.ts +0 -2
  430. package/lib/review-delivery-preflight.ts +0 -85
  431. package/lib/review-legacy-detector.ts +0 -81
  432. package/tests/child-codegraph-bootstrap.test.ts +0 -74
  433. package/tests/codegraph-tools.test.ts +0 -554
  434. package/tests/fixtures/devbinary/capabilities-v2.1.derived.json +0 -331
  435. package/tests/fixtures/refusal-identity.probe.mjs +0 -139
  436. package/tests/native-review-authority-quarantine.test.ts +0 -10
  437. package/tests/native-review-refusal-identity.test.ts +0 -25
  438. package/tests/review-delivery-preflight.test.ts +0 -462
  439. /package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/README.md +0 -0
  440. /package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/schemas/refuter.schema.json +0 -0
  441. /package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/schemas/targeted-validator.schema.json +0 -0
  442. /package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/vectors/refuter.json +0 -0
  443. /package/contracts/review-provider-contract-mirror/{v1.6.0 → v1.7.0}/bundle/vectors/targeted-validator.json +0 -0
@@ -6,7 +6,6 @@ import { join, win32 } from "node:path";
6
6
  import test from "node:test";
7
7
  import {
8
8
  CHANNEL_SCHEMA,
9
- GENTLE_AI_MAIN_PACKAGE,
10
9
  GENTLE_AI_MODULE,
11
10
  MainChannelError,
12
11
  buildMainGentleAi,
@@ -24,8 +23,8 @@ import { artifactFor } from "../scripts/installer-downloads.mjs";
24
23
 
25
24
  const SHELL_SHA = "6e7e3a18f794223396527a54c7c36d19c7d236c6";
26
25
  const AI_SHA = "1f9d5e6423e37f7d2316859045f379ba9b5d8c3a";
27
- const PSEUDO = "v4.0.1-0.20261008202137-1f9d5e6423e3";
28
- const LIST_FAILURE = "go: github.com/gentleman-programming/gentle-ai/v4@v4.0.1-0.20261008202137-1f9d5e6423e3: module lookup failed";
26
+ const PSEUDO = "v5.0.1-0.20261008202137-1f9d5e6423e3";
27
+ const LIST_FAILURE = "go: github.com/gentleman-programming/gentle-ai/v5@v5.0.1-0.20261008202137-1f9d5e6423e3: module lookup failed";
29
28
  const posixOnly = { skip: process.platform === "win32" };
30
29
 
31
30
  function sandbox() {
@@ -46,7 +45,7 @@ function gentleAiBuildRun(world: {
46
45
  probeVersion?: string;
47
46
  listFails?: boolean;
48
47
  }) {
49
- const { commit, listVersion = "v4.2.0", originHash = commit, embeddedVersion = listVersion, probeVersion = listVersion.replace(/^v/, ""), listFails = false } = world;
48
+ const { commit, listVersion = "v5.0.0", originHash = commit, embeddedVersion = listVersion, probeVersion = listVersion.replace(/^v/, ""), listFails = false } = world;
50
49
  const calls: Call[] = [];
51
50
  const run = async (command: string, argv: string[], options: Call["options"]) => {
52
51
  calls.push({ command, argv, options });
@@ -58,7 +57,7 @@ function gentleAiBuildRun(world: {
58
57
  if (argv[0] === "list") {
59
58
  if (listFails) return { code: 1, stdout: "", stderrTail: `${LIST_FAILURE}\n` };
60
59
  return { code: 0, stdout: JSON.stringify({ Path: GENTLE_AI_MODULE, Version: listVersion,
61
- Origin: { VCS: "git", URL: "https://github.com/gentleman-programming/gentle-ai", Hash: originHash, Ref: "refs/tags/v4.2.0" } }) };
60
+ Origin: { VCS: "git", URL: "https://github.com/gentleman-programming/gentle-ai", Hash: originHash, Ref: "refs/tags/v5.0.0" } }) };
62
61
  }
63
62
  if (argv[0] === "version" && argv[1] === "-m") {
64
63
  return { code: 0, stdout: `${command} (binary)\n\tmod\t${GENTLE_AI_MODULE}\t${embeddedVersion}\th1:J8EluS7QrfM+m3vmQlF26B/shZRjD6rBfsKtrABL5mc=\n` };
@@ -111,7 +110,7 @@ test("a main version marks the release version with the commit", () => {
111
110
  assert.equal(mainVersion("4.0.0", SHELL_SHA), "4.0.0-main.6e7e3a18f794");
112
111
  });
113
112
 
114
- test("the Gentle Shell main package is packed from the exact commit without prepack", async () => {
113
+ test("the Gentle Shell main package is packed from the exact commit without prepack, after building Tower", async () => {
115
114
  const s = sandbox();
116
115
  try {
117
116
  const calls: Call[] = [];
@@ -126,9 +125,15 @@ test("the Gentle Shell main package is packed from the exact commit without prep
126
125
  if (argv[0] === "-xzf") {
127
126
  const target = argv[argv.indexOf("-C") + 1];
128
127
  writeFileSync(join(target, "package.json"), JSON.stringify({ name: "gentle-pi", version: "4.0.0",
129
- scripts: { prepack: "pnpm test", prepare: "x", postinstall: "node scripts/install-gentle-ai.mjs" } }));
128
+ scripts: { prepack: "pnpm test", prepare: "x", postinstall: "node scripts/install-gentle-ai.mjs",
129
+ "build:tower": "cd web/tower && pnpm build" } }));
130
+ } else if (argv[0] === "run" && argv[1] === "build:tower") {
131
+ const dist = join(options.cwd!, "web", "tower", "dist");
132
+ mkdirSync(dist, { recursive: true });
133
+ writeFileSync(join(dist, "index.html"), "<!doctype html><title>tower</title>");
130
134
  } else {
131
135
  packed = JSON.parse(readFileSync(join(options.cwd!, "package.json"), "utf8"));
136
+ assert.ok(existsSync(join(options.cwd!, "web", "tower", "dist", "index.html")), "pack sees the Tower build");
132
137
  const destination = argv[argv.indexOf("--pack-destination") + 1];
133
138
  writeFileSync(join(destination, "gentle-pi-4.0.0-main.6e7e3a18f794.tgz"), "tgz");
134
139
  }
@@ -138,9 +143,8 @@ test("the Gentle Shell main package is packed from the exact commit without prep
138
143
  assert.equal(downloaded, `https://codeload.github.com/Gentleman-Programming/gentle-shell/tar.gz/${SHELL_SHA}`);
139
144
  assert.equal(tgz, join(s.home, ".pi", "gentle-ai", "main", "packages", "gentle-pi-4.0.0-main.6e7e3a18f794.tgz"));
140
145
  assert.ok(existsSync(tgz));
141
- const pack = calls.find((call) => call.command === "/bin/pnpm");
142
- assert.ok(pack);
143
- assert.deepEqual(pack.argv.slice(0, 1), ["pack"]);
146
+ const pnpmCalls = calls.filter((call) => call.command === "/bin/pnpm");
147
+ assert.deepEqual(pnpmCalls.map((call) => call.argv.slice(0, 2)), [["run", "build:tower"], ["pack", "--pack-destination"]]);
144
148
  assert.ok(packed);
145
149
  assert.equal(packed.version, "4.0.0-main.6e7e3a18f794");
146
150
  assert.equal(packed.scripts.prepack, undefined);
@@ -150,6 +154,41 @@ test("the Gentle Shell main package is packed from the exact commit without prep
150
154
  } finally { s.cleanup(); }
151
155
  });
152
156
 
157
+ test("a failed or empty Gentle Tower build refuses to pack the main package", async () => {
158
+ const s = sandbox();
159
+ try {
160
+ const fetch = async () => ({ ok: true, status: 200, arrayBuffer: async () => new TextEncoder().encode("archive").buffer });
161
+ const writeManifest = (argv: string[]) => {
162
+ writeFileSync(join(argv[argv.indexOf("-C") + 1], "package.json"), JSON.stringify({ name: "gentle-pi", version: "4.0.0",
163
+ scripts: { "build:tower": "false" } }));
164
+ };
165
+ const failed = async (command: string, argv: string[], options: Call["options"]) => {
166
+ if (argv[0] === "-xzf") {
167
+ writeManifest(argv);
168
+ return { code: 0, stdout: "" };
169
+ }
170
+ if (argv[0] === "run" && argv[1] === "build:tower") {
171
+ return { code: 1, stdout: "", stderrTail: "vite: build failed\n" };
172
+ }
173
+ assert.fail(`pack must not run after a failed Tower build (${command} ${argv.join(" ")}; cwd=${options.cwd})`);
174
+ };
175
+ await assert.rejects(packMainShell({ commit: SHELL_SHA, ctx: s.ctx, fetch, run: failed, pnpm: { command: "/bin/pnpm", prefix: [] }, fs: fsPromises }),
176
+ (error: MainChannelError) => error.code === "main-shell-tower-build-failed" && error.cause instanceof Error
177
+ && error.cause.message === "vite: build failed");
178
+ const missing = async (command: string, argv: string[], options: Call["options"]) => {
179
+ if (argv[0] === "-xzf") {
180
+ writeManifest(argv);
181
+ return { code: 0, stdout: "" };
182
+ }
183
+ if (argv[0] === "run" && argv[1] === "build:tower") return { code: 0, stdout: "ok" };
184
+ assert.fail(`pack must not run without web/tower/dist (${command} ${argv.join(" ")}; cwd=${options.cwd})`);
185
+ };
186
+ await assert.rejects(packMainShell({ commit: SHELL_SHA, ctx: s.ctx, fetch, run: missing, pnpm: { command: "/bin/pnpm", prefix: [] }, fs: fsPromises }),
187
+ (error: MainChannelError) => error.code === "main-shell-tower-build-failed"
188
+ && /web\/tower\/dist\/index\.html/.test(error.message));
189
+ } finally { s.cleanup(); }
190
+ });
191
+
153
192
  // Run 38061123855: with Git for Windows' usr\bin first on PATH, MSYS tar reads `D:\...` as a remote host.
154
193
  test("on Windows the source archive is extracted by System32's tar.exe by absolute path; POSIX keeps tar from PATH", async () => {
155
194
  const windowsTar = win32.join(process.env.SystemRoot ?? "C:\\Windows", "System32", "tar.exe");
@@ -162,6 +201,10 @@ test("on Windows the source archive is extracted by System32's tar.exe by absolu
162
201
  if (argv[0] === "-xzf") {
163
202
  extracts.push(command);
164
203
  writeFileSync(join(argv[argv.indexOf("-C") + 1], "package.json"), JSON.stringify({ name: "gentle-pi", version: "4.0.0" }));
204
+ } else if (argv[0] === "run" && argv[1] === "build:tower") {
205
+ const dist = join(options.cwd!, "web", "tower", "dist");
206
+ mkdirSync(dist, { recursive: true });
207
+ writeFileSync(join(dist, "index.html"), "<!doctype html><title>tower</title>");
165
208
  } else {
166
209
  writeFileSync(join(argv[argv.indexOf("--pack-destination") + 1], "gentle-pi-4.0.0-main.6e7e3a18f794.tgz"), "tgz");
167
210
  assert.ok(options.cwd);
@@ -186,7 +229,7 @@ test("a failed source extraction or Go build keeps the command's bounded stderr
186
229
  };
187
230
  await assert.rejects(packMainShell({ commit: SHELL_SHA, ctx: s.ctx, fetch, run: tar, pnpm: { command: "/bin/pnpm", prefix: [] }, fs: fsPromises, platform: "linux" }),
188
231
  (error: MainChannelError) => error.code === "main-shell-pack-failed" && error.cause instanceof Error && error.cause.message === tail.trim());
189
- const go = "go: downloading github.com/gentleman-programming/gentle-ai/v4\ngo: verifying module: checksum mismatch\n";
232
+ const go = "go: downloading github.com/gentleman-programming/gentle-ai/v5\ngo: verifying module: checksum mismatch\n";
190
233
  const build = async (_command: string, _argv: string[], options: { stderrTail?: number }) => {
191
234
  requested.push(options.stderrTail);
192
235
  return { code: 1, stdout: "", stderrTail: go };
@@ -208,26 +251,27 @@ test("Gentle AI main is built from the exact commit through Go's checksum databa
208
251
  const built = await buildMainGentleAi({ commit: AI_SHA, ctx: s.ctx, platform: "darwin", goPath, run, fs: fsPromises });
209
252
  const install = calls[0];
210
253
  assert.equal(install.command, goPath);
211
- assert.deepEqual(install.argv, ["install", `${GENTLE_AI_MAIN_PACKAGE}@${AI_SHA}`]);
254
+ assert.deepEqual(install.argv, ["install", `github.com/gentleman-programming/gentle-ai/v5/cmd/gentle-ai@${AI_SHA}`]);
255
+ assert.deepEqual(calls[1].argv, ["list", "-m", "-json", `github.com/gentleman-programming/gentle-ai/v5@${AI_SHA}`]);
212
256
  for (const [key, value] of Object.entries({ GOPROXY: "https://proxy.golang.org", GOSUMDB: "sum.golang.org", GOTOOLCHAIN: "local",
213
257
  GOFLAGS: "-modcacherw", GONOSUMDB: "", GOPRIVATE: "", GOINSECURE: "", GOENV: "off", GOWORK: "off" })) assert.equal(install.options.env![key], value, key);
214
258
  assert.equal(built.binaryPath, join(s.home, ".pi", "gentle-ai", "main", "gentle-ai", AI_SHA, "gentle-ai"));
215
- assert.equal(built.version, "4.0.1-0.20261008202137-1f9d5e6423e3");
259
+ assert.equal(built.version, "5.0.1-0.20261008202137-1f9d5e6423e3");
216
260
  assert.deepEqual(JSON.parse(readFileSync(join(s.home, ".pi", "gentle-ai", "dev-binary.json"), "utf8")),
217
261
  { schema: "gentle-pi.dev-binary/v1", path: built.binaryPath });
218
262
  } finally { s.cleanup(); }
219
263
  });
220
264
 
221
- // #2301: when main's HEAD is exactly a tag commit, Go stamps the tag (v4.2.0), not a
265
+ // #2301: when main's HEAD is exactly a tag commit, Go stamps the tag (v5.0.0), not a
222
266
  // pseudo-version, so the suffix check alone rejects every tagged release.
223
267
  test("a main commit that is exactly a release tag is accepted when Go resolves that tag to the commit", posixOnly, async () => {
224
268
  const s = sandbox();
225
269
  try {
226
270
  const TAGGED = "4acaf4241beae1e0c977c92dfe406a270f8d40de";
227
- const { run } = gentleAiBuildRun({ commit: TAGGED, listVersion: "v4.2.0", originHash: TAGGED });
271
+ const { run } = gentleAiBuildRun({ commit: TAGGED, listVersion: "v5.0.0", originHash: TAGGED });
228
272
  const built = await buildMainGentleAi({ commit: TAGGED, ctx: s.ctx, platform: "darwin", goPath: "/go/bin/go", run, fs: fsPromises });
229
273
  assert.equal(built.binaryPath, join(s.home, ".pi", "gentle-ai", "main", "gentle-ai", TAGGED, "gentle-ai"));
230
- assert.equal(built.version, "4.2.0");
274
+ assert.equal(built.version, "5.0.0");
231
275
  assert.deepEqual(JSON.parse(readFileSync(join(s.home, ".pi", "gentle-ai", "dev-binary.json"), "utf8")),
232
276
  { schema: "gentle-pi.dev-binary/v1", path: built.binaryPath });
233
277
  } finally { s.cleanup(); }
@@ -249,7 +293,7 @@ test("a go list whose Origin.Hash names another commit is rejected, and the buil
249
293
  test("a binary whose embedded module version differs from what Go resolved is rejected and never registered", posixOnly, async () => {
250
294
  const s = sandbox();
251
295
  try {
252
- const { run } = gentleAiBuildRun({ commit: AI_SHA, listVersion: PSEUDO, embeddedVersion: "v4.1.2" });
296
+ const { run } = gentleAiBuildRun({ commit: AI_SHA, listVersion: PSEUDO, embeddedVersion: "v5.0.2" });
253
297
  await assert.rejects(buildMainGentleAi({ commit: AI_SHA, ctx: s.ctx, platform: "darwin", goPath: "/go/bin/go", run, fs: fsPromises }),
254
298
  (error: MainChannelError) => error.code === "main-gentle-ai-unverified");
255
299
  assert.equal(existsSync(join(s.home, ".pi", "gentle-ai", "dev-binary.json")), false);
@@ -272,8 +316,8 @@ test("a failed go list is rejected as unverified, with its stderr tail as the ca
272
316
  // channel record) must not delete the working override when verification fails.
273
317
  for (const [name, failure] of Object.entries({
274
318
  "go list fails": { listFails: true },
275
- "the embedded version differs": { embeddedVersion: "v4.1.2" },
276
- "the reported version differs": { probeVersion: "4.0.1-0.20261008202137-aaaaaaaaaaaa" },
319
+ "the embedded version differs": { embeddedVersion: "v5.0.2" },
320
+ "the reported version differs": { probeVersion: "5.0.1-0.20261008202137-aaaaaaaaaaaa" },
277
321
  })) test(`a registered build of the same commit survives a rebuild whose verification fails because ${name}`, posixOnly, async () => {
278
322
  const s = sandbox();
279
323
  try {
@@ -314,7 +358,7 @@ test("go list and go version -m run with the same sealed environment and cwd as
314
358
  test("a Gentle AI build whose reported version differs from the resolved module version is rejected and never registered", posixOnly, async () => {
315
359
  const s = sandbox();
316
360
  try {
317
- const { run } = gentleAiBuildRun({ commit: AI_SHA, listVersion: PSEUDO, probeVersion: "4.0.1-0.20261008202137-aaaaaaaaaaaa" });
361
+ const { run } = gentleAiBuildRun({ commit: AI_SHA, listVersion: PSEUDO, probeVersion: "5.0.1-0.20261008202137-aaaaaaaaaaaa" });
318
362
  await assert.rejects(buildMainGentleAi({ commit: AI_SHA, ctx: s.ctx, platform: "darwin", goPath: "/go/bin/go", run, fs: fsPromises }),
319
363
  (error: MainChannelError) => error.code === "main-gentle-ai-unverified");
320
364
  assert.equal(existsSync(join(s.home, ".pi", "gentle-ai", "dev-binary.json")), false);
@@ -391,7 +435,7 @@ async function upgradeWorld({ userGo = null as string | null, pinned = false, ac
391
435
  const run = async (command: string, argv: string[], options: Call["options"]) => {
392
436
  calls.push({ command, argv, options });
393
437
  const isGo = command === "/usr/bin/go" || command === pinnedGo;
394
- const pseudo = (commit: string) => `v4.0.1-0.20261008202137-${commit.slice(0, 12)}`;
438
+ const pseudo = (commit: string) => `v5.0.1-0.20261008202137-${commit.slice(0, 12)}`;
395
439
  if (isGo && argv[0] === "version" && argv[1] === "-m") return { code: 0, stdout: `${command} (binary)\n\tmod\t${GENTLE_AI_MODULE}\t${pseudo(NEW_AI)}\th1:J8EluS7QrfM+m3vmQlF26B/shZRjD6rBfsKtrABL5mc=\n` };
396
440
  if (isGo && argv[0] === "list") {
397
441
  const requested = argv[3].slice(`${GENTLE_AI_MODULE}@`.length);
@@ -403,7 +447,7 @@ async function upgradeWorld({ userGo = null as string | null, pinned = false, ac
403
447
  writeFileSync(join(options.env!.GOBIN, "gentle-ai"), "#!/bin/sh\n", { mode: 0o755 });
404
448
  return { code: 0, stdout: "" };
405
449
  }
406
- return { code: 0, stdout: `gentle-ai 4.0.1-0.20261008202137-${NEW_AI.slice(0, 12)}\n` };
450
+ return { code: 0, stdout: `gentle-ai 5.0.1-0.20261008202137-${NEW_AI.slice(0, 12)}\n` };
407
451
  };
408
452
  const which = async (name: string) => (name === "pnpm" || (name === "go" && userGo !== null) ? `/usr/bin/${name}` : null);
409
453
  // The verified download itself is acquireGo's (installer-downloads tests); here it only publishes the pinned path.
@@ -414,12 +458,23 @@ async function upgradeWorld({ userGo = null as string | null, pinned = false, ac
414
458
  if (acquireFails) throw new Error("Go verified acquisition failed; nothing was published", { cause: new Error("Conflicting Go destination: /x") });
415
459
  return { goPath: pinnedGo, version: "1.25.14", acquired: true };
416
460
  };
417
- const upgrade = () => runUpgrade({ args: ["--channel", "main"], ctx: s.ctx, platform: "darwin", arch: "arm64", packageRoot: join(s.root, "pkg"),
461
+ const upgrade = (progressStream?: { write: (chunk: string) => void }) => runUpgrade({ progressStream, args: ["--channel", "main"], ctx: s.ctx, platform: "darwin", arch: "arm64", packageRoot: join(s.root, "pkg"),
418
462
  currentVersion: "4.0.0-main.6e7e3a18f794", adapters: { fetch, run, fs: fsPromises, which, acquireGo }, out: () => {} });
419
463
  const builtWith = () => calls.find((call) => call.argv[0] === "install")?.command;
420
464
  return { ...s, calls, pinnedGo, upgrade, builtWith, acquired };
421
465
  }
422
466
 
467
+ test("main upgrade shows active stages and clears progress before a build error", posixOnly, async () => {
468
+ const w = await upgradeWorld({ acquireFails: true });
469
+ const frames: string[] = [];
470
+ try {
471
+ await assert.rejects(w.upgrade({ write: chunk => frames.push(chunk) }), /getting the pinned Go/);
472
+ assert.match(frames.join(""), /Checking main revisions/);
473
+ assert.match(frames.join(""), /Building Gentle AI/);
474
+ assert.equal(frames.at(-1), "\r\x1b[2K");
475
+ } finally { w.cleanup(); }
476
+ });
477
+
423
478
  test("upgrading main uses the installer's pinned Go when the user's Go is missing, older or cannot be checked, and leaves the user's Go as it is", posixOnly, async () => {
424
479
  for (const userGo of [null, "1.24.0", "devel"]) {
425
480
  const w = await upgradeWorld({ userGo, pinned: true });
@@ -180,8 +180,8 @@ test("installed Pi dispatches Desktop RPC without adding conversation messages",
180
180
  assert.equal(response.kind, "response");
181
181
  assert.equal(response.requestId, "real-1");
182
182
  assert.equal(response.ok, true);
183
- assert.deepEqual(response.data.methods, ["capabilities", "get_snapshot", "get_config", "set_config", "get_permission_mode", "set_permission_mode", "get_subscription_usage", "refresh_subscription_usage", "get_design_canvas", "list_jobs", "cancel_job", "get_job_output", "apply_profile", "list_subagents", "cancel_subagent", "get_subagent_thread", "list_sessions", "switch_session", "get_changes", "get_change_diff", "get_review_mode", "set_review_mode", "get_usage_stats", "get_update_status"]);
184
- assert.deepEqual(response.data.events, ["config_changed", "permission_mode_changed", "rate_limit", "design_canvas", "jobs_update", "profile_applied", "agents_update", "review_mode_changed"]);
183
+ assert.deepEqual(response.data.methods, ["capabilities", "get_snapshot", "get_config", "set_config", "get_permission_mode", "set_permission_mode", "get_subscription_usage", "refresh_subscription_usage", "get_design_canvas", "list_jobs", "cancel_job", "get_job_output", "apply_profile", "list_subagents", "cancel_subagent", "get_subagent_thread", "list_sessions", "switch_session", "get_changes", "get_change_diff", "get_review_mode", "set_review_mode", "get_usage_stats", "get_update_status", "list_agent_definitions", "get_status", "get_background_subagents", "set_background_subagents", "get_profile_binding", "clear_profile_binding", "get_auth_status", "reload_credentials"]);
184
+ assert.deepEqual(response.data.events, ["config_changed", "permission_mode_changed", "rate_limit", "design_canvas", "jobs_update", "profile_applied", "agents_update", "review_mode_changed", "profile_binding_changed"]);
185
185
  } finally {
186
186
  rmSync(root, { recursive: true, force: true });
187
187
  }
@@ -248,10 +248,10 @@ test("installed Pi serves Desktop config reads from the existing stores", () =>
248
248
  assert.deepEqual(models.data.value, { worker: { model: "openai/gpt-probe" } });
249
249
 
250
250
  const snapshot = byRequest("config-3").data;
251
- assert.equal(snapshot.state.config.stores.length, 6);
251
+ assert.equal(snapshot.state.config.stores.length, 12);
252
252
  assert.deepEqual(
253
253
  snapshot.state.config.stores.map((entry: any) => entry.store),
254
- ["profiles", "models", "profile_fallbacks", "subagents", "pins", "managed_assets"],
254
+ ["profiles", "models", "profile_fallbacks", "subagents", "pins", "managed_assets", "persona", "banner", "notifications", "mcp", "pi_settings", "claude_bridge"],
255
255
  );
256
256
  assert.equal(snapshot.state.config.stores[0].status, "ok");
257
257
  assert.equal(JSON.stringify(snapshot).includes("claude-probe"), false, "snapshots stay bounded");
@@ -1,6 +1,6 @@
1
1
  import assert from "node:assert/strict";
2
2
  import test, { mock } from "node:test";
3
- import { Container, MouseRegion, type TuiMouseEvent, SelectList, Text } from "@earendil-works/pi-tui";
3
+ import { Container, MouseRegion, type TuiMouseEvent, SelectList, Text, TuiAltScreen } from "@earendil-works/pi-tui";
4
4
  import { createNativeFullscreenInteraction } from "../lib/native-fullscreen-interaction.ts";
5
5
 
6
6
  const items = [
@@ -123,3 +123,39 @@ test("native fullscreen interaction preserves Container geometry and SelectList
123
123
  assert.equal(click?.handled, true);
124
124
  assert.deepEqual(selected, ["second", "second"]);
125
125
  });
126
+
127
+ test("native fullscreen interaction ignores mouse events without finite geometry", () => {
128
+ const seen: string[] = [];
129
+ const interaction = createNativeFullscreenInteraction({
130
+ keyboardTarget: new Text("x", 0, 0),
131
+ requestRender() {},
132
+ mouseObserver: { beforeMouse: () => seen.push("before"), afterMouse: () => seen.push("after") },
133
+ });
134
+ assert.equal(interaction.handleMouse({ type: "click" } as unknown as TuiMouseEvent), undefined);
135
+ assert.deepEqual(seen, [], "a malformed event is not observed");
136
+ });
137
+
138
+ test("real alt-screen mouse events keep finite geometry and still reach the observer and target", () => {
139
+ const seen: string[] = []; const hits: string[] = [];
140
+ const root = createNativeFullscreenInteraction({ keyboardTarget: new Text("k", 0, 0), requestRender() {}, mouseObserver: { beforeMouse: (e: TuiMouseEvent) => { seen.push(e.type); }, afterMouse() {} } });
141
+ root.addChild(new Text("top", 0, 0));
142
+ root.addChild(new MouseRegion(new Text("target", 0, 0), (e) => { hits.push(e.type); return { handled: true }; }));
143
+ const terminal = { start() {}, stop() {}, async drainInput() {}, write() {}, get columns() { return 40; }, get rows() { return 10; }, moveBy() {}, hideCursor() {}, showCursor() {}, clearLine() {}, clearFromCursor() {}, clearScreen() {}, setTitle() {}, setProgress() {}, kittyProtocolActive: false, getBufferedInput() { return ""; }, hasPendingInput() { return false; } } as never;
144
+ const tui = new TuiAltScreen(terminal, false); tui.setLayoutRoot(root as never); tui.start();
145
+ try {
146
+ (tui as unknown as { doRender(): void }).doRender();
147
+ const row = (tui as unknown as { previousScreen: string[] }).previousScreen.findIndex((l) => l.includes("target"));
148
+ const t = tui as unknown as { handleMouseEvent(raw: { button: number; x: number; y: number; release: boolean }): void };
149
+ t.handleMouseEvent({ button: 0, x: 1, y: row, release: false }); t.handleMouseEvent({ button: 0, x: 1, y: row, release: true });
150
+ assert.ok(hits.includes("press") && hits.includes("click")); assert.ok(seen.includes("press"));
151
+ } finally { tui.stop(); }
152
+ });
153
+ test("finite zero or negative geometry is still observed; only non-finite geometry is ignored", () => {
154
+ for (const [patch, observed] of [[{ width: 0 }, true], [{ y: -1 }, true], [{ width: Number.NaN }, false], [{ height: Infinity }, false], [{ y: undefined }, false]] as const) {
155
+ const seen: string[] = [];
156
+ const root = createNativeFullscreenInteraction({ keyboardTarget: new Text("k", 0, 0), requestRender() {}, mouseObserver: { beforeMouse: () => seen.push("b"), afterMouse: () => seen.push("a") } });
157
+ root.addChild(new Text("row", 0, 0));
158
+ root.handleMouse({ ...mouse("click", "left", 0, 10), ...patch } as TuiMouseEvent);
159
+ assert.deepEqual(seen, observed ? ["b", "a"] : [], JSON.stringify(patch));
160
+ }
161
+ });
@@ -416,11 +416,23 @@ test("4.6.0 keeps the 4.5.0 native CLI contract despite provider bundle 1.6.0",
416
416
  assert.deepEqual(contract, NATIVE_CLI_CONTRACTS["4.5.0"] as Record<string, boolean>);
417
417
  });
418
418
 
419
+ test("5.0.0 retains the compact-v2 CLI contract for the runtime pin", () => {
420
+ const contract = NATIVE_CLI_CONTRACTS["5.0.0"] as Record<string, boolean>;
421
+ assert.ok(contract, "the signed v5 runtime must have an explicit capability row");
422
+ assert.deepEqual(contract, NATIVE_CLI_CONTRACTS["4.6.0"] as Record<string, boolean>);
423
+ });
424
+
425
+ test("5.1.0 retains the 5.0.0 compact-v2 CLI contract for the runtime pin", () => {
426
+ const contract = NATIVE_CLI_CONTRACTS["5.1.0"] as Record<string, boolean>;
427
+ assert.ok(contract, "the published v5.1.0 runtime must have an explicit capability row");
428
+ assert.deepEqual(contract, NATIVE_CLI_CONTRACTS["5.0.0"] as Record<string, boolean>);
429
+ });
430
+
419
431
  test("no shipped version key was added beyond the pin bump", () => {
420
432
  // Rows are promises to consumers, so a new key only ever appears in a
421
433
  // dedicated commit alongside a pin bump, never as a side effect. v2.2.4 and
422
434
  // v2.3.0 shipped upstream while Pi stayed on 2.2.3 and were never pinned,
423
435
  // so they get no row: a row asserts ground truth measured against a binary
424
436
  // Pi actually ran, and the table only has to be ascending, not gapless.
425
- assert.deepEqual(Object.keys(NATIVE_CLI_CONTRACTS), [...DARK_VERSIONS, "2.2.0", "2.2.1", "2.2.2", "2.2.3", "2.4.0", "2.5.0-rc.3", "2.5.0", "2.6.0", "2.7.0", "2.8.0", "2.8.1", "2.8.2", "2.9.0", "2.9.1", "3.0.0", "3.0.1", "3.1.0", "3.2.1", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "4.0.0", "4.1.1", "4.2.0", "4.3.1", "4.4.0", "4.5.0", "4.6.0"]);
437
+ assert.deepEqual(Object.keys(NATIVE_CLI_CONTRACTS), [...DARK_VERSIONS, "2.2.0", "2.2.1", "2.2.2", "2.2.3", "2.4.0", "2.5.0-rc.3", "2.5.0", "2.6.0", "2.7.0", "2.8.0", "2.8.1", "2.8.2", "2.9.0", "2.9.1", "3.0.0", "3.0.1", "3.1.0", "3.2.1", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "4.0.0", "4.1.1", "4.2.0", "4.3.1", "4.4.0", "4.5.0", "4.6.0", "5.0.0", "5.1.0"]);
426
438
  });
@@ -4,11 +4,12 @@ import { tmpdir } from "node:os";
4
4
  import { join } from "node:path";
5
5
  import test, { after } from "node:test";
6
6
  import { NativeReviewCliV216, NativeReviewIntegrationError, type ExecFileAdapter } from "../lib/native-review-cli.ts";
7
+ import { statusV9 } from "./support/status-v9.ts";
7
8
 
8
9
  // odd/tasks/review-one-call.md T11 (S5), L18: contracted STATUS asks for the
9
- // non-blocking findings (gentle-ai#6088) only when the caller requests them; a
10
- // provider that refuses the unknown flag is asked once more without it and is
11
- // not sent the flag again while it stays the same binary.
10
+ // non-blocking findings (gentle-ai#6088) only when the caller requests them.
11
+ // gentle-ai v4.6.0 (the minimum supported binary) always understands the flag,
12
+ // so a refusal of it is an ordinary failure and is never retried without it.
12
13
 
13
14
  const scratch = realpathSync(mkdtempSync(join(realpathSync(tmpdir()), "native-nbf-")));
14
15
  after(() => rmSync(scratch, { recursive: true, force: true }));
@@ -20,7 +21,7 @@ function binary(content = `fixture-${binaries}`): string {
20
21
  return path;
21
22
  }
22
23
 
23
- const statusBody = JSON.parse(readFileSync(join(process.cwd(), "tests", "fixtures", "devbinary", "status-v5.captured.json"), "utf8"));
24
+ const statusBody = statusV9(JSON.parse(readFileSync(join(process.cwd(), "tests", "fixtures", "devbinary", "status-v5.captured.json"), "utf8")));
24
25
  const refusal = (cause: string) => ({
25
26
  schema: "gentle-ai.review-integration.failure/v2", contract: "gentle-ai.review-integration/v2", operation: "review.status", phase: "preflight",
26
27
  code: "invalid_request", message: "The negotiated review request is invalid.", mutation_outcome: "not_started", authority_applicability: "not_evaluated",
@@ -49,37 +50,12 @@ test("a contracted STATUS sends --non-blocking-findings only when the caller ask
49
50
  assert.deepEqual(queue.calls.map((call) => call.arguments), [[...base, "--non-blocking-findings", "--next-transition"], [...base, "--next-transition"]]);
50
51
  });
51
52
 
52
- test("a provider that refuses the unknown flag is asked once more without it and is not sent it again while it is the same binary", async () => {
53
+ test("the unknown-flag refusal is no longer retried without the flag: it surfaces unchanged", async () => {
53
54
  const executable = binary();
54
- const queue = adapter([{ body: UNKNOWN_FLAG, exitCode: 1 }, { body: statusBody }, { body: statusBody }]);
55
+ const queue = adapter([{ body: UNKNOWN_FLAG, exitCode: 1 }]);
55
56
  const cli = new NativeReviewCliV216(queue.adapter, () => executable, 30_000, 1024 * 1024);
56
- const first = await cli.targetStatus({ ...request, nonBlockingFindings: true });
57
- assert.equal(first.nextTransition?.kind, "collect", "the run ends as today");
58
- assert.equal(Object.hasOwn(first, "nonBlockingFindings"), false);
59
- await cli.targetStatus({ ...request, nonBlockingFindings: true });
60
- assert.deepEqual(queue.calls.map((call) => call.arguments), [
61
- [...base, "--non-blocking-findings", "--next-transition"],
62
- [...base, "--next-transition"],
63
- [...base, "--next-transition"],
64
- ]);
65
- // A replaced binary at the same path is a different provider: asked again.
66
- writeFileSync(executable, "a newer provider");
67
- const renewed = adapter([{ body: statusBody }]);
68
- const replaced = new NativeReviewCliV216(renewed.adapter, () => executable, 30_000, 1024 * 1024);
69
- await replaced.targetStatus({ ...request, nonBlockingFindings: true });
70
- assert.deepEqual(renewed.calls[0]!.arguments, [...base, "--non-blocking-findings", "--next-transition"]);
71
- });
72
-
73
- test("the refusal is remembered per binary: another binary is still sent the flag", async () => {
74
- const old = binary("old provider");
75
- const current = binary("current provider");
76
- let path = old;
77
- const queue = adapter([{ body: UNKNOWN_FLAG, exitCode: 1 }, { body: statusBody }, { body: statusBody }]);
78
- const cli = new NativeReviewCliV216(queue.adapter, () => path, 30_000, 1024 * 1024);
79
- await cli.targetStatus({ ...request, nonBlockingFindings: true });
80
- path = current;
81
- await cli.targetStatus({ ...request, nonBlockingFindings: true });
82
- assert.deepEqual(queue.calls.map((call) => [call.file, call.arguments.includes("--non-blocking-findings")]), [[old, true], [old, false], [current, true]]);
57
+ await assert.rejects(cli.targetStatus({ ...request, nonBlockingFindings: true }), (error: unknown) => error instanceof NativeReviewIntegrationError && error.failureEnvelope.cause === UNKNOWN_FLAG.cause);
58
+ assert.equal(queue.calls.length, 1);
83
59
  });
84
60
 
85
61
  test("any other STATUS failure is not retried and keeps its error", async () => {
@@ -99,23 +75,6 @@ test("the flag rides only Gentle Shell's own contracted STATUS, never a provider
99
75
  assert.equal(queue.calls[0]!.arguments.includes("--non-blocking-findings"), false);
100
76
  });
101
77
 
102
- // Verifier regressions (odd/tasks/review-one-call.md L19).
103
- test("two concurrent first STATUS calls each pay the refusal once; later calls never resend the flag", async () => {
104
- const executable = binary("concurrent provider");
105
- const calls: boolean[] = [];
106
- const adapterFn: ExecFileAdapter = async (request) => {
107
- const flagged = request.arguments.includes("--non-blocking-findings");
108
- calls.push(flagged);
109
- await new Promise((resolve) => setTimeout(resolve, 5));
110
- const refused = flagged;
111
- return { stdout: JSON.stringify(refused ? UNKNOWN_FLAG : statusBody), stderr: refused ? "Error: The negotiated review request is invalid. [invalid_request]\n" : "", exitCode: refused ? 1 : 0, signal: null, timedOut: false, outputLimitExceeded: false };
112
- };
113
- const cli = new NativeReviewCliV216(adapterFn, () => executable, 30_000, 1024 * 1024);
114
- await Promise.all([cli.targetStatus({ ...request, nonBlockingFindings: true }), cli.targetStatus({ ...request, nonBlockingFindings: true })]);
115
- await cli.targetStatus({ ...request, nonBlockingFindings: true });
116
- assert.deepEqual(calls, [true, true, false, false, false]);
117
- });
118
-
119
78
  test("look-alike refusals are not retried", async () => {
120
79
  for (const body of [
121
80
  refusal("x flag provided but not defined: -non-blocking-findings"),
@@ -129,37 +88,3 @@ test("look-alike refusals are not retried", async () => {
129
88
  }
130
89
  });
131
90
 
132
- test("an in-flight old refusal does not suppress the flag for a replacement executable", async () => {
133
- const executable = binary("old in-flight provider");
134
- let enter!: () => void;
135
- let release!: () => void;
136
- const entered = new Promise<void>((resolve) => { enter = resolve; });
137
- const held = new Promise<void>((resolve) => { release = resolve; });
138
- const queue = adapter([{ body: UNKNOWN_FLAG, exitCode: 1 }, { body: statusBody }, { body: statusBody }]);
139
- let first = true;
140
- const cli = new NativeReviewCliV216(async (call) => {
141
- if (first) { first = false; enter(); await held; }
142
- return queue.adapter(call);
143
- }, executable, 30_000, 1024 * 1024);
144
- const pending = cli.targetStatus({ ...request, nonBlockingFindings: true });
145
- await entered;
146
- writeFileSync(executable, "replacement supporting provider");
147
- release();
148
- assert.equal((await pending).nextTransition?.kind, "collect");
149
- assert.equal((await cli.targetStatus({ ...request, nonBlockingFindings: true })).nextTransition?.kind, "collect");
150
- assert.deepEqual(queue.calls.map((call) => call.arguments), [
151
- [...base, "--non-blocking-findings", "--next-transition"],
152
- [...base, "--next-transition"],
153
- [...base, "--non-blocking-findings", "--next-transition"],
154
- ]);
155
- });
156
-
157
- test("unreadable executable identity preserves STATUS refusal fallback without caching", async () => {
158
- const executable = join(scratch, "absent-executable");
159
- const queue = adapter([{ body: UNKNOWN_FLAG, exitCode: 1 }, { body: statusBody }, { body: UNKNOWN_FLAG, exitCode: 1 }, { body: statusBody }]);
160
- const cli = new NativeReviewCliV216(queue.adapter, executable, 30_000, 1024 * 1024);
161
- for (let call = 0; call < 2; call++) {
162
- assert.equal((await cli.targetStatus({ ...request, nonBlockingFindings: true })).nextTransition?.kind, "collect");
163
- }
164
- assert.deepEqual(queue.calls.map((call) => call.arguments.includes("--non-blocking-findings")), [true, false, true, false]);
165
- });