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
@@ -27,7 +27,7 @@ import {
27
27
  trustedSystemExtractor,
28
28
  } from "../scripts/gentle-ai-installer.mjs";
29
29
 
30
- // v4.6.0 archive digests independently match the minisign-signed release
30
+ // v5.1.0 archive digests independently match the minisign-signed release
31
31
  // checksums; binary digests were computed from the extracted executables.
32
32
  function releaseAssets(): Record<string, { name: string; sha256: string; binarySha256: string; url: string }> {
33
33
  const assets: Record<string, { name: string; sha256: string; binarySha256: string; url: string }> = {};
@@ -43,18 +43,18 @@ function releaseAssets(): Record<string, { name: string; sha256: string; binaryS
43
43
  }
44
44
 
45
45
  const EXPECTED_ASSETS = {
46
- "darwin/amd64": { name: "gentle-ai_4.6.0_darwin_amd64.tar.gz", sha256: "57cbb8e91fe80268b64eeeba9d1f3b8645d3a36db262cbf3220143a594bf214b", binarySha256: "be1cb74d7e0b647d2e175c1aca71d5feb792130e4dabca465f37dabb13c3324e" },
47
- "darwin/arm64": { name: "gentle-ai_4.6.0_darwin_arm64.tar.gz", sha256: "7e939ef7593b84e52ea8c563064c0ed0fdb228fc1b6378fa0c09676695c72aac", binarySha256: "3c60ec6acd063245b85a9778ad670782c0dc65eae374f671bf160092cbb78e64" },
48
- "linux/amd64": { name: "gentle-ai_4.6.0_linux_amd64.tar.gz", sha256: "c645e8551f6e3f79831b142a6b087795dc3217e02e9dafb5b701dc4373b33e7d", binarySha256: "dc649e16c395390d42735fb0230b1a5df4269298fe8f3f14cdb3166ba1af1308" },
49
- "linux/arm64": { name: "gentle-ai_4.6.0_linux_arm64.tar.gz", sha256: "ab5a2f55ff41281bc41baea2ec730dcb05e8f55f3a9eea201c001693be490d32", binarySha256: "d02602ce98759cc3a0f7896557a729b3bf1a60c458e757ff09d8de34d4b93589" },
46
+ "darwin/amd64": { name: "gentle-ai_5.1.0_darwin_amd64.tar.gz", sha256: "7c673126a79b98475c96358da5a77664dc6d690bfc5766420d45ffe1c5ad5486", binarySha256: "aa2eed8b872df54c64db3a32e8ea0412c9d5a6268ea5609c2a9c9f1a023e1b88" },
47
+ "darwin/arm64": { name: "gentle-ai_5.1.0_darwin_arm64.tar.gz", sha256: "f9435841b47dd265904377c64832d5a26646b93a0f703e438a43aa14a8f2b6a1", binarySha256: "878e66eb4d0c625025e78681fe6c3a043a59064bf5d2e988dbb1372fb7fd08be" },
48
+ "linux/amd64": { name: "gentle-ai_5.1.0_linux_amd64.tar.gz", sha256: "a34b845ac4df7f3a120b53d7f3f8a783af3108036232c93ef80708cdd4be73f5", binarySha256: "66fa5e3c586619abf0a41c04727c4675ab99068f355d4f5d5eec75e1c34a0b17" },
49
+ "linux/arm64": { name: "gentle-ai_5.1.0_linux_arm64.tar.gz", sha256: "596fc5bb0846c75fd94eb8e9a10cab5a297dfb3f46ee1c643ed455e09143e122", binarySha256: "8ffa92180c14d62818de1ae3cdbf0a219b2a7bae52d2c144468f7187ced50e2f" },
50
50
  } as const;
51
51
 
52
- test("published Gentle AI v4.6.0 is the installer pin", () => {
53
- assert.equal(INSTALLER_VERSION, "4.6.0");
54
- // v4.0.0 moved the Go module path to the /v4 major-version suffix.
55
- assert.equal(GENTLE_AI_WINDOWS_SOURCE_MODULE, "github.com/gentleman-programming/gentle-ai/v4");
56
- assert.equal(GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM, "h1:FXR0FEGvnov6eCf/FR7Ey8PfxxdhbDHq1/WnkjpA1AQ=");
57
- assert.equal(GENTLE_AI_WINDOWS_SOURCE_TAG, "v4.6.0");
52
+ test("published Gentle AI v5.1.0 is the installer pin", () => {
53
+ assert.equal(INSTALLER_VERSION, "5.1.0");
54
+ // v5.0.0 moved the Go module path to the /v5 major-version suffix.
55
+ assert.equal(GENTLE_AI_WINDOWS_SOURCE_MODULE, "github.com/gentleman-programming/gentle-ai/v5");
56
+ assert.equal(GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM, "h1:SrWjhJn+hvtGM+N7O3k5JM3x+MPxOVDsH4B5QODlYjQ=");
57
+ assert.equal(GENTLE_AI_WINDOWS_SOURCE_TAG, "v5.1.0");
58
58
  });
59
59
 
60
60
  test("default installer package root is the package containing scripts, not its parent", () => {
@@ -65,15 +65,15 @@ test("default installer package root is the package containing scripts, not its
65
65
  assert.notEqual(resolveGentleAiInstallerPackageRoot(), dirname(expectedPackageRoot));
66
66
  });
67
67
 
68
- test("release mapping selects only the supported official v4.6.0 assets and pinned digests", () => {
68
+ test("release mapping selects only the supported official v5.1.0 assets and pinned digests", () => {
69
69
  assert.deepEqual(
70
70
  Object.fromEntries(Object.entries(releaseAssets()).map(([key, asset]) => [key, { name: asset.name, sha256: asset.sha256, binarySha256: asset.binarySha256 }])),
71
71
  EXPECTED_ASSETS,
72
72
  );
73
- assert.equal(resolveGentleAiReleaseAsset("linux", "x64").name, "gentle-ai_4.6.0_linux_amd64.tar.gz");
74
- assert.equal(resolveGentleAiReleaseAsset("darwin", "arm64").name, "gentle-ai_4.6.0_darwin_arm64.tar.gz");
73
+ assert.equal(resolveGentleAiReleaseAsset("linux", "x64").name, "gentle-ai_5.1.0_linux_amd64.tar.gz");
74
+ assert.equal(resolveGentleAiReleaseAsset("darwin", "arm64").name, "gentle-ai_5.1.0_darwin_arm64.tar.gz");
75
75
  for (const asset of Object.values(releaseAssets())) {
76
- assert.match(asset.url, /^https:\/\/github\.com\/Gentleman-Programming\/gentle-ai\/releases\/download\/v4\.6\.0\//);
76
+ assert.match(asset.url, /^https:\/\/github\.com\/Gentleman-Programming\/gentle-ai\/releases\/download\/v5\.1\.0\//);
77
77
  }
78
78
  });
79
79
 
@@ -83,7 +83,7 @@ test("raw release assets are admitted only under a prerelease pin", () => {
83
83
  assert.equal(gentleAiAssetForm("gentle-ai_2.5.0-rc.3_windows_amd64.exe", "2.5.0-rc.3"), "raw-binary");
84
84
  // A raw binary under a stable pin means the pin itself is wrong: stable
85
85
  // releases publish signed archives only, so this fails closed pre-download.
86
- assert.throws(() => gentleAiAssetForm("gentle-ai_4.6.0_linux_amd64", "4.6.0"), /only admitted for a prerelease pin/);
86
+ assert.throws(() => gentleAiAssetForm("gentle-ai_5.0.0_linux_amd64", "5.0.0"), /only admitted for a prerelease pin/);
87
87
  assert.throws(() => gentleAiAssetForm("gentle-ai.dmg", "2.5.0-rc.3"), /unsupported Gentle AI release asset form/);
88
88
  // The current stable pin admits every pinned asset row through the same
89
89
  // gate the installer uses at download time (default installerVersion
@@ -110,7 +110,7 @@ test("release digests are all-or-none and install fails closed while any digest
110
110
  }),
111
111
  /checksum mismatch/,
112
112
  );
113
- assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v4.6.0", "gentle-ai")), false);
113
+ assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v5.1.0", "gentle-ai")), false);
114
114
  }
115
115
  });
116
116
 
@@ -139,8 +139,8 @@ function windowsGoFixture(fixtureOptions: WindowsGoFixtureOptions = {}) {
139
139
  let goExecutable = "go";
140
140
  const metadata = [
141
141
  "gentle-ai.exe: go1.25.10",
142
- "\tpath\tgithub.com/gentleman-programming/gentle-ai/v4/cmd/gentle-ai",
143
- `\tmod\tgithub.com/gentleman-programming/gentle-ai/v4\tv4.6.0\t${GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM}`,
142
+ "\tpath\tgithub.com/gentleman-programming/gentle-ai/v5/cmd/gentle-ai",
143
+ `\tmod\tgithub.com/gentleman-programming/gentle-ai/v5\tv5.1.0\t${GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM}`,
144
144
  "\tbuild\t-buildmode=exe", "\tbuild\t-compiler=gc", "\tbuild\tCGO_ENABLED=0", `\tbuild\tGOARCH=${fixtureOptions.goArchitecture ?? "amd64"}`, "\tbuild\tGOOS=windows",
145
145
  ].join("\n");
146
146
  const run = async (file: string, arguments_: string[], options: WindowsGoCall["options"]) => {
@@ -158,15 +158,16 @@ function windowsGoFixture(fixtureOptions: WindowsGoFixtureOptions = {}) {
158
158
  return { stdout: "", stderr: "" };
159
159
  }
160
160
  if (file === goExecutable && arguments_[0] === "version" && arguments_[1] === "-m") return { stdout: metadata, stderr: "" };
161
- if (arguments_.length === 1 && arguments_[0] === "version") return { stdout: fixtureOptions.reportedVersion ?? "gentle-ai 4.6.0\n", stderr: "" };
161
+ if (arguments_.length === 1 && arguments_[0] === "version") return { stdout: fixtureOptions.reportedVersion ?? "gentle-ai 5.1.0\n", stderr: "" };
162
162
  throw new Error(`unexpected command: ${file} ${arguments_.join(" ")}`);
163
163
  };
164
164
  return { calls, run, setGoExecutable: (path: string) => { goExecutable = path; } };
165
165
  }
166
166
 
167
- test("win32 x64 and arm64 install the exact Go SumDB source tag without archive lookup", async () => {
167
+ test("win32 x64 and arm64 install the exact Go SumDB source tag without archive lookup", async (t) => {
168
168
  for (const [arch, goArchitecture] of [["x64", "amd64"], ["arm64", "arm64"]] as const) {
169
169
  const packageRoot = await mkdtemp(join(tmpdir(), `gentle-pi-installer-windows-${arch}-`));
170
+ t.after(() => rm(packageRoot, { recursive: true, force: true }));
170
171
  const fixture = windowsGoFixture({ goArchitecture });
171
172
  const goPath = join(packageRoot, "go.exe");
172
173
  await writeFile(goPath, "trusted local Go executable");
@@ -174,7 +175,7 @@ test("win32 x64 and arm64 install the exact Go SumDB source tag without archive
174
175
  const result = await installGentleAi({ packageRoot, platform: "win32", arch, execFile: fixture.run, resolveGoExecutable: async () => goPath });
175
176
  assert.equal(result.installed, true);
176
177
  assert.deepEqual(fixture.calls.filter((call) => call.file === goPath).map((call) => call.arguments_.slice(0, 2)), [
177
- ["version"], ["install", "github.com/gentleman-programming/gentle-ai/v4/cmd/gentle-ai@v4.6.0"], ["version", "-m"],
178
+ ["version"], ["install", "github.com/gentleman-programming/gentle-ai/v5/cmd/gentle-ai@v5.1.0"], ["version", "-m"],
178
179
  ]);
179
180
  }
180
181
  });
@@ -245,7 +246,7 @@ test("Windows source install reports missing or too-old Go without publishing a
245
246
  () => installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: async () => goPath }),
246
247
  (error: unknown) => error instanceof Error && "code" in error && error.code === fixtureOptions.expectedCode,
247
248
  );
248
- assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v4.6.0", "gentle-ai.exe")), false);
249
+ assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v5.1.0", "gentle-ai.exe")), false);
249
250
  assert.deepEqual((await readdir(packageRoot)).filter((entry) => entry.includes("install-")), []);
250
251
  }
251
252
  });
@@ -291,7 +292,7 @@ test("Windows source install builds in a short private directory under the temp
291
292
  }
292
293
  for (const call of fixture.calls.filter((entry) => entry.file === goPath)) assert.ok(call.options.cwd?.startsWith(buildDirectory), call.arguments_.join(" "));
293
294
  assert.deepEqual(await readdir(temporaryDirectory), [], "the build directory is removed");
294
- if (!installError) assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v4.6.0", "gentle-ai.exe")), true, "the verified binary is published into the package");
295
+ if (!installError) assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v5.1.0", "gentle-ai.exe")), true, "the verified binary is published into the package");
295
296
  } finally {
296
297
  await rm(packageRoot, { recursive: true, force: true });
297
298
  await rm(temporaryDirectory, { recursive: true, force: true });
@@ -313,7 +314,7 @@ test("Windows source install cleans staging after Go failure or wrong built vers
313
314
  () => installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: async () => goPath }),
314
315
  (error: unknown) => error instanceof Error && "code" in error && error.code === fixtureOptions.expectedCode,
315
316
  );
316
- const runtimeDirectory = join(packageRoot, ".gentle-ai", "v4.6.0");
317
+ const runtimeDirectory = join(packageRoot, ".gentle-ai", "v5.1.0");
317
318
  assert.ok(fixture.calls.some((call) => call.arguments_[0] === "install"));
318
319
  assert.equal(existsSync(join(runtimeDirectory, "gentle-ai.exe")), false);
319
320
  assert.equal(existsSync(runtimeDirectory) && (await readdir(runtimeDirectory)).some((entry) => entry.startsWith(".go-install-") || entry.endsWith(".tmp")), false);
@@ -334,7 +335,7 @@ test("Windows source installs reuse only a fully verified package-local binary",
334
335
  assert.equal(reused.installed, false);
335
336
  assert.ok(reuse.calls.every((call) => call.file !== "gentle-ai"), "the installer must never fall back to ambient gentle-ai on PATH");
336
337
 
337
- await writeFile(join(packageRoot, ".gentle-ai", "v4.6.0", "integrity.json"), "{}\n");
338
+ await writeFile(join(packageRoot, ".gentle-ai", "v5.1.0", "integrity.json"), "{}\n");
338
339
  const repaired = windowsGoFixture();
339
340
  repaired.setGoExecutable(goPath);
340
341
  assert.equal((await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: repaired.run, resolveGoExecutable: async () => goPath })).installed, true);
@@ -375,8 +376,8 @@ async function hardenedWindowsGoFixture(packageRoot: string, fixtureOptions: Har
375
376
  : undefined;
376
377
  const metadata = fixtureOptions.metadataOverride ?? [
377
378
  "gentle-ai.exe: go1.25.10",
378
- "\tpath\tgithub.com/gentleman-programming/gentle-ai/v4/cmd/gentle-ai",
379
- `\tmod\tgithub.com/gentleman-programming/gentle-ai/v4\tv4.6.0\t${GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM}`,
379
+ "\tpath\tgithub.com/gentleman-programming/gentle-ai/v5/cmd/gentle-ai",
380
+ `\tmod\tgithub.com/gentleman-programming/gentle-ai/v5\tv5.1.0\t${GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM}`,
380
381
  "\tbuild\t-buildmode=exe",
381
382
  "\tbuild\t-compiler=gc",
382
383
  "\tbuild\tCGO_ENABLED=0",
@@ -396,7 +397,7 @@ async function hardenedWindowsGoFixture(packageRoot: string, fixtureOptions: Har
396
397
  return { stdout: "", stderr: "" };
397
398
  }
398
399
  if (file === goPath && arguments_[0] === "version" && arguments_[1] === "-m") return { stdout: metadata, stderr: "" };
399
- if (arguments_.length === 1 && arguments_[0] === "version") return { stdout: "gentle-ai 4.6.0\n", stderr: "" };
400
+ if (arguments_.length === 1 && arguments_[0] === "version") return { stdout: "gentle-ai 5.1.0\n", stderr: "" };
400
401
  throw new Error(`unexpected command: ${file} ${arguments_.join(" ")}`);
401
402
  };
402
403
  return {
@@ -438,7 +439,7 @@ test("Windows source installation resolves one validated Go executable and seals
438
439
  const goCalls = fixture.calls.filter((call) => call.file === fixture.goPath);
439
440
  assert.deepEqual(goCalls.map((call) => call.arguments_.slice(0, 2)), [
440
441
  ["version"],
441
- ["install", "github.com/gentleman-programming/gentle-ai/v4/cmd/gentle-ai@v4.6.0"],
442
+ ["install", "github.com/gentleman-programming/gentle-ai/v5/cmd/gentle-ai@v5.1.0"],
442
443
  ["version", "-m"],
443
444
  ]);
444
445
  for (const call of goCalls) {
@@ -464,14 +465,14 @@ test("Windows source manifest binds verified Go metadata and architecture", asyn
464
465
  const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-provenance-"));
465
466
  const fixture = await hardenedWindowsGoFixture(packageRoot, { architecture: "arm64" });
466
467
  const result = await installGentleAi({ packageRoot, platform: "win32", arch: "arm64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable });
467
- const manifest = JSON.parse(await readFile(join(packageRoot, ".gentle-ai", "v4.6.0", "integrity.json"), "utf8")) as Record<string, string>;
468
+ const manifest = JSON.parse(await readFile(join(packageRoot, ".gentle-ai", "v5.1.0", "integrity.json"), "utf8")) as Record<string, string>;
468
469
  assert.equal(result.installed, true);
469
470
  assert.deepEqual(manifest, {
470
- version: "4.6.0",
471
+ version: "5.1.0",
471
472
  method: "go-sumdb-source-build",
472
- package: "github.com/gentleman-programming/gentle-ai/v4/cmd/gentle-ai",
473
- module: "github.com/gentleman-programming/gentle-ai/v4",
474
- tag: "v4.6.0",
473
+ package: "github.com/gentleman-programming/gentle-ai/v5/cmd/gentle-ai",
474
+ module: "github.com/gentleman-programming/gentle-ai/v5",
475
+ tag: "v5.1.0",
475
476
  architecture: "arm64",
476
477
  binarySha256: createHash("sha256").update("trusted Windows source build").digest("hex"),
477
478
  moduleChecksum: GENTLE_AI_WINDOWS_SOURCE_MODULE_CHECKSUM,
@@ -491,12 +492,12 @@ test("Windows source installation rejects Go metadata for a different architectu
491
492
  () => installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable }),
492
493
  (error: unknown) => error instanceof Error && "code" in error && error.code === "GENTLE_AI_GO_INSTALL_FAILED",
493
494
  );
494
- assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v4.6.0", "gentle-ai.exe")), false);
495
+ assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v5.1.0", "gentle-ai.exe")), false);
495
496
  });
496
497
 
497
498
  test("Windows source installation treats a fresh ownerless lock as active", async () => {
498
499
  const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-ownerless-lock-"));
499
- const lockPath = join(packageRoot, ".gentle-ai", ".v4.6.0.install.lock");
500
+ const lockPath = join(packageRoot, ".gentle-ai", ".v5.1.0.install.lock");
500
501
  await mkdir(lockPath, { recursive: true });
501
502
  const fixture = await hardenedWindowsGoFixture(packageRoot);
502
503
  await assertManualLockRecoveryRequired(packageRoot, fixture);
@@ -504,7 +505,7 @@ test("Windows source installation treats a fresh ownerless lock as active", asyn
504
505
 
505
506
  test("Windows source installation preserves a lock whose owner nonce changed before release", async () => {
506
507
  const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-owner-lock-"));
507
- const lockOwnerPath = join(packageRoot, ".gentle-ai", ".v4.6.0.install.lock", "owner.json");
508
+ const lockOwnerPath = join(packageRoot, ".gentle-ai", ".v5.1.0.install.lock", "owner.json");
508
509
  const fixture = await hardenedWindowsGoFixture(packageRoot);
509
510
  let replacedOwner = false;
510
511
  const run = async (...arguments_: Parameters<typeof fixture.run>) => {
@@ -521,7 +522,7 @@ test("Windows source installation preserves a lock whose owner nonce changed bef
521
522
  });
522
523
 
523
524
  async function assertManualLockRecoveryRequired(packageRoot: string, fixture: Awaited<ReturnType<typeof hardenedWindowsGoFixture>>, options: Record<string, unknown> = {}) {
524
- const lockPath = join(packageRoot, ".gentle-ai", ".v4.6.0.install.lock");
525
+ const lockPath = join(packageRoot, ".gentle-ai", ".v5.1.0.install.lock");
525
526
  await assert.rejects(
526
527
  () => installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable, ...options }),
527
528
  (error: unknown) => error instanceof Error && error.message.includes(lockPath) && /confirm no installer is active.*remove.*manually/i.test(error.message),
@@ -531,18 +532,18 @@ async function assertManualLockRecoveryRequired(packageRoot: string, fixture: Aw
531
532
  }
532
533
 
533
534
  function tombstonePath(packageRoot: string, nonce: string): string {
534
- return join(packageRoot, ".gentle-ai", `.v4.6.0.install.tombstone-${nonce}`);
535
+ return join(packageRoot, ".gentle-ai", `.v5.1.0.install.tombstone-${nonce}`);
535
536
  }
536
537
 
537
538
  async function tombstones(packageRoot: string): Promise<string[]> {
538
539
  const runtimeRoot = join(packageRoot, ".gentle-ai");
539
540
  return existsSync(runtimeRoot)
540
- ? (await readdir(runtimeRoot)).filter((entry) => entry.startsWith(".v4.6.0.install.tombstone-"))
541
+ ? (await readdir(runtimeRoot)).filter((entry) => entry.startsWith(".v5.1.0.install.tombstone-"))
541
542
  : [];
542
543
  }
543
544
 
544
545
  function backupBundlePath(packageRoot: string, nonce: string): string {
545
- return join(packageRoot, ".gentle-ai", `.v4.6.0.backup-${nonce}`);
546
+ return join(packageRoot, ".gentle-ai", `.v5.1.0.backup-${nonce}`);
546
547
  }
547
548
 
548
549
  async function copyWindowsBundle(source: string, destination: string): Promise<void> {
@@ -553,7 +554,7 @@ async function copyWindowsBundle(source: string, destination: string): Promise<v
553
554
 
554
555
  test("Windows source installation fails closed for an ownerless lock even after the stale threshold", async () => {
555
556
  const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-ownerless-stale-lock-"));
556
- const lockPath = join(packageRoot, ".gentle-ai", ".v4.6.0.install.lock");
557
+ const lockPath = join(packageRoot, ".gentle-ai", ".v5.1.0.install.lock");
557
558
  await mkdir(lockPath, { recursive: true });
558
559
  const fixture = await hardenedWindowsGoFixture(packageRoot);
559
560
  await assertManualLockRecoveryRequired(packageRoot, fixture, { now: () => Date.now() + 10 * 60_000 });
@@ -561,7 +562,7 @@ test("Windows source installation fails closed for an ownerless lock even after
561
562
 
562
563
  test("Windows source installation fails closed for a stale owner lock", async () => {
563
564
  const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-stale-lock-"));
564
- const lockPath = join(packageRoot, ".gentle-ai", ".v4.6.0.install.lock");
565
+ const lockPath = join(packageRoot, ".gentle-ai", ".v5.1.0.install.lock");
565
566
  await mkdir(lockPath, { recursive: true });
566
567
  await writeFile(join(lockPath, "owner.json"), `${JSON.stringify({ createdAt: 0, nonce: "0".repeat(64) })}\n`);
567
568
  const fixture = await hardenedWindowsGoFixture(packageRoot);
@@ -613,7 +614,7 @@ test("Windows source acquisition fails closed when a tombstone appears after its
613
614
  (error: unknown) => error instanceof Error && error.message.includes(foreignTombstone),
614
615
  );
615
616
  assert.equal(existsSync(foreignTombstone), true);
616
- assert.equal(existsSync(join(packageRoot, ".gentle-ai", ".v4.6.0.install.lock")), false);
617
+ assert.equal(existsSync(join(packageRoot, ".gentle-ai", ".v5.1.0.install.lock")), false);
617
618
  assert.equal(fixture.calls.some((call) => call.arguments_[0] === "install"), false);
618
619
  });
619
620
 
@@ -621,7 +622,7 @@ test("Windows source release deletes its matching tombstone and allows reuse", a
621
622
  const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-owned-lock-release-"));
622
623
  const fixture = await hardenedWindowsGoFixture(packageRoot);
623
624
  await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable });
624
- assert.equal(existsSync(join(packageRoot, ".gentle-ai", ".v4.6.0.install.lock")), false);
625
+ assert.equal(existsSync(join(packageRoot, ".gentle-ai", ".v5.1.0.install.lock")), false);
625
626
  assert.deepEqual(await tombstones(packageRoot), []);
626
627
  const reuse = await hardenedWindowsGoFixture(packageRoot);
627
628
  assert.equal((await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: reuse.run, resolveGoExecutable: reuse.resolveGoExecutable })).installed, false);
@@ -631,7 +632,7 @@ test("Windows source recovers a valid backup after a crash between publication r
631
632
  const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-backup-crash-"));
632
633
  const initial = await hardenedWindowsGoFixture(packageRoot);
633
634
  await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: initial.run, resolveGoExecutable: initial.resolveGoExecutable });
634
- const live = join(packageRoot, ".gentle-ai", "v4.6.0");
635
+ const live = join(packageRoot, ".gentle-ai", "v5.1.0");
635
636
  const backup = backupBundlePath(packageRoot, "crash");
636
637
  await rename(live, backup);
637
638
  const recovery = await hardenedWindowsGoFixture(packageRoot);
@@ -667,7 +668,7 @@ test("Windows source cleans one validated backup only when the live bundle is va
667
668
  const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-backup-valid-live-"));
668
669
  const initial = await hardenedWindowsGoFixture(packageRoot);
669
670
  await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: initial.run, resolveGoExecutable: initial.resolveGoExecutable });
670
- const live = join(packageRoot, ".gentle-ai", "v4.6.0");
671
+ const live = join(packageRoot, ".gentle-ai", "v5.1.0");
671
672
  const backup = backupBundlePath(packageRoot, "valid");
672
673
  await copyWindowsBundle(live, backup);
673
674
  const reuse = await hardenedWindowsGoFixture(packageRoot);
@@ -680,7 +681,7 @@ test("Windows source preserves a valid backup when the live bundle is invalid",
680
681
  const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-backup-invalid-live-"));
681
682
  const initial = await hardenedWindowsGoFixture(packageRoot);
682
683
  await installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: initial.run, resolveGoExecutable: initial.resolveGoExecutable });
683
- const live = join(packageRoot, ".gentle-ai", "v4.6.0");
684
+ const live = join(packageRoot, ".gentle-ai", "v5.1.0");
684
685
  const backup = backupBundlePath(packageRoot, "valid");
685
686
  await copyWindowsBundle(live, backup);
686
687
  await writeFile(join(live, "integrity.json"), "{}\n");
@@ -698,7 +699,7 @@ test("Windows concurrent installs fail closed until normal release, then reuse t
698
699
  const fixture = await hardenedWindowsGoFixture(packageRoot, { blockInstall: true });
699
700
  const first = installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable });
700
701
  await fixture.waitForInstall();
701
- const lockPath = join(packageRoot, ".gentle-ai", ".v4.6.0.install.lock");
702
+ const lockPath = join(packageRoot, ".gentle-ai", ".v5.1.0.install.lock");
702
703
  await assert.rejects(
703
704
  () => installGentleAi({ packageRoot, platform: "win32", arch: "x64", execFile: fixture.run, resolveGoExecutable: fixture.resolveGoExecutable }),
704
705
  (error: unknown) => error instanceof Error && error.message.includes(lockPath),
@@ -712,7 +713,7 @@ test("Windows concurrent installs fail closed until normal release, then reuse t
712
713
 
713
714
  test("Windows source publication rolls back a prior bundle when final directory swap fails", async () => {
714
715
  const packageRoot = await mkdtemp(join(tmpdir(), "gentle-pi-installer-rollback-"));
715
- const versionDirectory = join(packageRoot, ".gentle-ai", "v4.6.0");
716
+ const versionDirectory = join(packageRoot, ".gentle-ai", "v5.1.0");
716
717
  await mkdir(versionDirectory, { recursive: true });
717
718
  await writeFile(join(versionDirectory, "old.txt"), "previous bundle");
718
719
  const fixture = await hardenedWindowsGoFixture(packageRoot);
@@ -1148,7 +1149,7 @@ test("Darwin/Linux signed bundles retain their four-field manifest and reusable
1148
1149
  },
1149
1150
  };
1150
1151
  await installGentleAi(options);
1151
- const manifestPath = join(packageRoot, ".gentle-ai", "v4.6.0", "integrity.json");
1152
+ const manifestPath = join(packageRoot, ".gentle-ai", "v5.1.0", "integrity.json");
1152
1153
  const manifest = JSON.parse(await readFile(manifestPath, "utf8")) as Record<string, string>;
1153
1154
  assert.deepEqual(Object.keys(manifest), ["version", "asset", "assetSha256", "binarySha256"]);
1154
1155
  assert.equal((await installGentleAi({ ...options, download: async () => { throw new Error("signed bundle must be reused"); } })).installed, false);
@@ -1161,7 +1162,7 @@ test("a pinned asset falls back to its gentle-pi mirror only on download failure
1161
1162
  // under the current stable pin, whose form gate refuses raw binaries.
1162
1163
  const payload = Buffer.from("signed archive fixture");
1163
1164
  const binary = "mirrored binary";
1164
- const baseAsset = { name: "gentle-ai_4.6.0_linux_amd64.tar.gz", sha256: createHash("sha256").update(payload).digest("hex"), binarySha256: createHash("sha256").update(binary).digest("hex"), url: "https://example.invalid/upstream", mirrorUrl: "https://example.invalid/mirror", executable: "gentle-ai" };
1165
+ const baseAsset = { name: "gentle-ai_5.0.0_linux_amd64.tar.gz", sha256: createHash("sha256").update(payload).digest("hex"), binarySha256: createHash("sha256").update(binary).digest("hex"), url: "https://example.invalid/upstream", mirrorUrl: "https://example.invalid/mirror", executable: "gentle-ai" };
1165
1166
  const extractArchive = async (_archive: string, destination: string) => {
1166
1167
  await mkdir(destination, { recursive: true });
1167
1168
  await writeFile(join(destination, "gentle-ai"), binary);
@@ -1305,7 +1306,7 @@ test("checksum mismatch cleans temporary state without promoting a binary", asyn
1305
1306
  }),
1306
1307
  /checksum mismatch/,
1307
1308
  );
1308
- assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v4.6.0", "gentle-ai")), false);
1309
+ assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v5.1.0", "gentle-ai")), false);
1309
1310
  assert.deepEqual((await readdir(packageRoot)).filter((entry) => entry.startsWith(".gentle-ai-install-")), []);
1310
1311
  });
1311
1312
 
@@ -1327,7 +1328,7 @@ test("installer promotes only the expected regular executable with executable PO
1327
1328
  await chmod(extracted, 0o700);
1328
1329
  },
1329
1330
  });
1330
- const binary = join(packageRoot, ".gentle-ai", "v4.6.0", "gentle-ai");
1331
+ const binary = join(packageRoot, ".gentle-ai", "v5.1.0", "gentle-ai");
1331
1332
  assert.equal(existsSync(binary), true);
1332
1333
  assert.equal(await readFile(binary, "utf8"), "native executable");
1333
1334
  assert.ok(((await stat(binary)).mode & 0o111) !== 0);
@@ -1358,7 +1359,7 @@ test("installer rejects an extracted binary that differs from its pinned digest"
1358
1359
  }),
1359
1360
  /binary checksum mismatch/,
1360
1361
  );
1361
- assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v4.6.0", "gentle-ai")), false);
1362
+ assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v5.1.0", "gentle-ai")), false);
1362
1363
  });
1363
1364
 
1364
1365
  test("installer repairs a valid non-executable POSIX binary instead of reusing it", async (t) => {
@@ -1381,7 +1382,7 @@ test("installer repairs a valid non-executable POSIX binary instead of reusing i
1381
1382
  },
1382
1383
  };
1383
1384
  await installGentleAi(options);
1384
- const binary = join(packageRoot, ".gentle-ai", "v4.6.0", "gentle-ai");
1385
+ const binary = join(packageRoot, ".gentle-ai", "v5.1.0", "gentle-ai");
1385
1386
  await chmod(binary, 0o600);
1386
1387
  const repaired = await installGentleAi(options);
1387
1388
  assert.equal(repaired.installed, true);
@@ -1418,7 +1419,7 @@ test("installer rejects archives with multiple expected executable entries", asy
1418
1419
  }),
1419
1420
  /exactly one regular gentle-ai/,
1420
1421
  );
1421
- assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v4.6.0", "gentle-ai")), false);
1422
+ assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v5.1.0", "gentle-ai")), false);
1422
1423
  });
1423
1424
 
1424
1425
  test("installer rejects an archive without the expected regular executable", async () => {
@@ -1436,7 +1437,7 @@ test("installer rejects an archive without the expected regular executable", asy
1436
1437
  }),
1437
1438
  /non-regular gentle-ai/,
1438
1439
  );
1439
- assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v4.6.0", "gentle-ai")), false);
1440
+ assert.equal(existsSync(join(packageRoot, ".gentle-ai", "v5.1.0", "gentle-ai")), false);
1440
1441
  });
1441
1442
 
1442
1443
  test("safeRemoveDirectory passes Windows-safe retry options to recursive rm cleanup", async () => {
@@ -1572,59 +1572,6 @@ test("models screen lists configuration problems under the profile name without
1572
1572
  assert.ok(!plain.some((line) => line.includes("…")));
1573
1573
  });
1574
1574
 
1575
- test("#2997: due-review workflow preflight precedes delivery while commits and ordinary command safety remain independent", async () => {
1576
- type ToolCallHandler = (
1577
- event: { toolName: string; input: unknown },
1578
- ctx: ExtensionContext,
1579
- ) => Promise<ToolCallEventResult | undefined>;
1580
- const commands = [
1581
- "git commit -m relay",
1582
- "git push origin feature/relay",
1583
- "gh pr create --base main --head feature/relay",
1584
- "gh release create v1.2.3",
1585
- "git status && git commit -m relay",
1586
- "env SAFE=1 git push origin feature/relay",
1587
- "sh -c 'gh pr create --base main --head feature/relay'",
1588
- "sh -c 'gh release create v1.2.3'",
1589
- ] as const;
1590
- const modes = [
1591
- { label: "no native CLI", nativeReviewCli: null },
1592
- { label: "RDD off", nativeReviewCli: { reviewMode: async () => ({ status: { effective: "off" } }) } },
1593
- { label: "RDD on", nativeReviewCli: { reviewMode: async () => ({ status: { effective: "on" } }) } },
1594
- { label: "mode failure", nativeReviewCli: { reviewMode: async () => { throw new Error("mode unavailable"); } } },
1595
- ] as const;
1596
-
1597
- for (const mode of modes) {
1598
- const handlers = new Map<string, ToolCallHandler>();
1599
- const pi = {
1600
- on(name: string, handler: ToolCallHandler) {
1601
- handlers.set(name, handler);
1602
- },
1603
- events: { emit() {} },
1604
- registerCommand() {},
1605
- registerTool() {},
1606
- } as unknown as ExtensionAPI;
1607
- createGentleAiExtension({ nativeReviewCli: mode.nativeReviewCli as never })(pi);
1608
- const toolCall = handlers.get("tool_call");
1609
- assert.equal(typeof toolCall, "function", mode.label);
1610
- const ctx = {
1611
- cwd: process.cwd(),
1612
- hasUI: true,
1613
- ui: { confirm: async () => true },
1614
- } as unknown as ExtensionContext;
1615
-
1616
- for (const command of commands) {
1617
- const result = await toolCall!({ toolName: "bash", input: { command } }, ctx);
1618
- const deliveryCommands: readonly string[] = [commands[1], commands[2], commands[5], commands[6]];
1619
- const delivery = deliveryCommands.includes(command);
1620
- if (delivery && (mode.label === "RDD on" || mode.label === "mode failure")) {
1621
- assert.equal(result?.block, true, `${mode.label}: ${command}`);
1622
- assert.match(result?.reason ?? "", /RDD pre-delivery/);
1623
- } else assert.equal(result, undefined, `${mode.label}: ${command}`);
1624
- }
1625
- }
1626
- });
1627
-
1628
1575
  test("guarded command confirmation emits a generic correlated permission lifecycle", async () => {
1629
1576
  type ToolCallHandler = (
1630
1577
  event: { toolName: string; input: unknown },
@@ -1892,7 +1839,7 @@ test(`${channel} emits only a private, balanced Herdr projection`, () => {
1892
1839
  registerTool() {},
1893
1840
  } as unknown as ExtensionAPI;
1894
1841
  createGentleAiExtension({ nativeReviewCli: null })(pi);
1895
- const privateHostDiscovery = new Set(["gentle:yolo:host-ui", "gentle:rdd:host-ui", "gentle:desktop:profiles-service", "gentle:desktop:review-service"]);
1842
+ const privateHostDiscovery = new Set(["gentle:yolo:host-ui", "gentle:rdd:host-ui", "gentle:desktop:profiles-service", "gentle:desktop:review-service", "gentle:desktop:status-service", "gentle:desktop:background-subagents-service"]);
1896
1843
  for (const channel of privateHostDiscovery) assert.equal(eventHandlers.has(channel), true);
1897
1844
  assert.deepEqual([...eventHandlers.keys()].filter(name => !privateHostDiscovery.has(name)).sort(), [
1898
1845
  "gentle-pi:ask-user-choice:blocked", "gentle-pi:ask-user-question:blocked", "rpiv:ask-user:blocked",
@@ -4358,12 +4305,35 @@ test("A3 provider review roles keep the explicit session binding ahead of the fr
4358
4305
  }
4359
4306
  });
4360
4307
 
4361
- test("A3 documented divergence: provider review roles skip the orchestrator fallback on resume without a startup record", (t) => {
4308
+ test("A3 S5: a resumed session reads its startup record's orchestrator for the provider review roles", (t) => {
4309
+ const { fixture, storePath, settingsPath, writeStore, writeSettings } = profilesStoreFixture(t);
4310
+ resetFrozenInheritedProfilesForTesting();
4311
+ t.after(() => resetFrozenInheritedProfilesForTesting());
4312
+ // #2863: a later process opening the session has no in-memory freeze; the
4313
+ // startup record is what gives reviewers the profile's orchestrator instead
4314
+ // of the persisted default. The authority publishes exactly this binding:
4315
+ // the record's origin and its full definition, orchestrator included.
4316
+ const orchestrator = { model: "openai/sol", thinking: "medium" as const };
4317
+ const team = { orchestrator, "review-risk": { model: "openai/sol-risk" } };
4318
+ writeStore({ sol: team }, "sol");
4319
+ writeSettings({ defaultProvider: "nan", defaultModel: "flash" });
4320
+ const before = [readFileSync(storePath, "utf8"), readFileSync(settingsPath, "utf8")];
4321
+ bindSessionProfile("recorded-session", "sol", team, { origin: "global" });
4322
+ assert.equal(readSessionProfileBinding("recorded-session")?.origin, "global", "the record is the session's startup state, not an explicit choice");
4323
+ const routing = __testing.readReviewerModelConfig(fixture.root, "recorded-session");
4324
+ for (const role of ["review-refuter", "review-validator"]) {
4325
+ assert.deepEqual(__testing.reviewHostRelaySelection(role, routing), { selection: "openai/sol", thinking: "medium", routingKey: role });
4326
+ }
4327
+ assert.equal(__testing.reviewHostRelaySelection("risk", routing).selection, "openai/sol-risk");
4328
+ assert.deepEqual([readFileSync(storePath, "utf8"), readFileSync(settingsPath, "utf8")], before, "reading the record never writes shared state");
4329
+ });
4330
+
4331
+ // S3: sessions from before A2 never recorded a startup state, so they keep
4332
+ // today's behavior; only these sessions still miss the orchestrator on resume.
4333
+ test("A3 S3: a pre-A2 session without a startup record keeps the persisted-default reviewer fallback", (t) => {
4362
4334
  const { fixture, writeStore, writeSettings } = profilesStoreFixture(t);
4363
4335
  resetFrozenInheritedProfilesForTesting();
4364
4336
  t.after(() => resetFrozenInheritedProfilesForTesting());
4365
- // #2863: a resume without a startup record cannot recover the original orchestrator.
4366
- // Matrak's record PR closes this remaining divergence; this is not an own start.
4367
4337
  writeStore({ sol: { orchestrator: { model: "openai/sol" }, "review-risk": { model: "openai/sol-risk" } } }, "sol");
4368
4338
  writeSettings({ defaultProvider: "nan", defaultModel: "flash" });
4369
4339
  freezeSessionProfileAtStartup({ sessionId: "inherited-session", cwd: fixture.root, configHome: fixture.configHome });
@@ -4372,7 +4342,7 @@ test("A3 documented divergence: provider review roles skip the orchestrator fall
4372
4342
  assert.equal(__testing.reviewHostRelaySelection("review-refuter", routing).selection, "nan/flash");
4373
4343
  });
4374
4344
 
4375
- // #2863: A3 closes the own-start in-memory half; resume still needs a record.
4345
+ // #2863: A3 closes the own-start in-memory half and the resume half through the record.
4376
4346
  for (const role of ["review-refuter", "review-validator"]) {
4377
4347
  test(`A3 ${role} uses the orchestrator frozen at the session's own start`, (t) => {
4378
4348
  const { fixture, storePath, settingsPath, writeStore, writeSettings } = profilesStoreFixture(t);
@@ -4959,7 +4929,8 @@ test("clear after a session's own start goes back to the defaults it started wit
4959
4929
  await __testing.runProfilesPanelAction(ctx, { setModel: async () => true, setThinkingLevel() {}, getThinkingLevel: (): ThinkingLevel => "medium" }, h.storePath, readValidProfilesStore(h.storePath), { type: "use-session", name: "fast" }, {});
4960
4930
  await h.run("clear", ctx);
4961
4931
  const family = manager.getBranch().filter((entry) => entry.type === "custom" && entry.customType === SESSION_PROFILE_CUSTOM_TYPE);
4962
- assert.equal(family.length, 2, "the clear follows the Use in this session bind");
4932
+ assert.equal(family.length, 3, "the own-start record, the Use bind, then the clear");
4933
+ assert.deepEqual((family[0] as { data?: unknown }).data, createSessionProfileStartupBind("global", "team", TEAM_DEFINITION), "the own start records the profile it began with");
4963
4934
  assert.deepEqual((family.at(-1) as { data?: unknown }).data, createSessionProfileStartupBind("global", "team", TEAM_DEFINITION));
4964
4935
  assert.match(h.last().message, /New launches go back to the profile this session started with, "team/);
4965
4936
  });
@@ -0,0 +1,74 @@
1
+ // Gentle Chat must show a failed transcript read as a failure, never as an empty conversation, and
2
+ // read again on the next refresh (issue #3537: a session file that cannot be read showed
3
+ // "No messages yet" and reported nothing).
4
+ import assert from "node:assert/strict";
5
+ import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
6
+ import { registerHooks } from "node:module";
7
+ import { tmpdir } from "node:os";
8
+ import { join } from "node:path";
9
+ import test from "node:test";
10
+
11
+ // The Herdr runtime modules main.js imports, inert: these tests drive the view's reads directly.
12
+ const stub = (names: string[], extra = "") => `data:text/javascript,${encodeURIComponent(`
13
+ const noop = () => null;
14
+ ${extra}
15
+ export const ${names.map((n) => `${n} = noop`).join(", ")};
16
+ `)}`;
17
+ const MODULES: Record<string, string> = {
18
+ "gpui-kit": stub(["div", "svg"], "export class View {}"),
19
+ "gpui-base": stub(["v_flex", "h_flex", "TextView", "Textarea", "Popover", "TextareaState", "ScrollHandle"]),
20
+ herdr: stub(["agents", "props", "layout", "hc", "run", "setShared", "shared", "theme", "watchFolder", "nextCommand", "openOverlay",
21
+ "readTextFile", "writeTextFile", "terminals", "panes", "focused", "home", "exec", "fonts", "settings"]),
22
+ };
23
+ // Herdr's fs/promises also has `exists` (actions.js); the reads use Node's readFile.
24
+ const FS = `data:text/javascript,${encodeURIComponent(`export * from "node:fs/promises"; export const exists = async () => false;`)}`;
25
+ registerHooks({ resolve(specifier, context, next) {
26
+ if (MODULES[specifier]) return { url: MODULES[specifier], shortCircuit: true };
27
+ if (specifier === "fs/promises" && context.parentURL?.includes("/herdr/mods/")) return { url: FS, shortCircuit: true };
28
+ return next(specifier, context);
29
+ } });
30
+
31
+ const { default: GentleChat } = await import("../herdr/mods/gentle-chat/main.js");
32
+ const { createFeed } = await import("../herdr/mods/gentle-chat/feed.js");
33
+
34
+ const cx = { notify() {} };
35
+ const line = (text: string) => `${JSON.stringify({ type: "message", message: { role: "user", content: [{ type: "text", text }] } })}\n`;
36
+
37
+ // The view of a local session whose session file is `file`; `snap`: it publishes a snapshot, so its
38
+ // first read is the file's tail (readTail), else the whole file (readAfter).
39
+ function view(file: string, snap: boolean) {
40
+ const v = Object.create(GentleChat.prototype);
41
+ Object.assign(v, { key: "s1", address: null, foreign: false, snap: snap ? { identity: { sessionFile: file } } : null, file,
42
+ feed: createFeed(), pos: 0, start: 0, size: 0, back: 1, loading: false, again: false });
43
+ return v;
44
+ }
45
+
46
+ function folder(t: test.TestContext) {
47
+ const dir = mkdtempSync(join(tmpdir(), "gentle-chat-fail-"));
48
+ t.after(() => rmSync(dir, { recursive: true, force: true }));
49
+ return dir;
50
+ }
51
+
52
+ const FAILED = ["Cannot read this conversation", "Its session file could not be read. The chat tries again when the session updates."];
53
+
54
+ for (const snap of [true, false]) {
55
+ test(`an unreadable session file shows the failure, and the next read shows its messages (${snap ? "tail" : "whole"} read)`, async (t) => {
56
+ const file = join(folder(t), "session.jsonl");
57
+ const v = view(file, snap);
58
+ await v.load(cx);
59
+ assert.equal(v.feed.items.length, 0);
60
+ assert.deepEqual(v.emptyText(), FAILED);
61
+ writeFileSync(file, line("hello"));
62
+ await v.load(cx);
63
+ assert.equal(v.feed.items.length, 1);
64
+ assert.deepEqual(v.emptyText(), ["No messages yet", "Type below to start."]);
65
+ });
66
+ }
67
+
68
+ test("a readable session file with no messages still says No messages yet", async (t) => {
69
+ const file = join(folder(t), "session.jsonl");
70
+ writeFileSync(file, "");
71
+ const v = view(file, true);
72
+ await v.load(cx);
73
+ assert.deepEqual(v.emptyText(), ["No messages yet", "Type below to start."]);
74
+ });