gentle-pi 4.5.1 → 4.7.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 (428) hide show
  1. package/README.md +17 -15
  2. package/assets/agents/gentle-ai-explore.md +1 -0
  3. package/assets/agents/gentle-ai-verify.md +8 -1
  4. package/assets/agents/gentle-ai-worker.md +4 -0
  5. package/assets/agents/jd-fix-agent.md +1 -0
  6. package/assets/agents/jd-judge-a.md +1 -0
  7. package/assets/agents/jd-judge-b.md +1 -0
  8. package/assets/design-canvas/canvas.css +13 -1
  9. package/assets/design-canvas/canvas.js +11 -2
  10. package/assets/install-wizard/wizard.js +1 -0
  11. package/assets/migrations/agent-body-history.json +162 -0
  12. package/assets/orchestrator-delegation-reference.md +7 -7
  13. package/assets/orchestrator-delegation.md +3 -3
  14. package/assets/orchestrator-full-delegation-card.md +65 -0
  15. package/assets/orchestrator-full-delegation.md +34 -0
  16. package/assets/orchestrator-memory.md +3 -3
  17. package/assets/orchestrator-prompts.md +1 -1
  18. package/assets/orchestrator-skills.md +1 -1
  19. package/assets/orchestrator-verification.md +14 -8
  20. package/assets/orchestrator.md +11 -11
  21. package/bin/gentle-shell.mjs +225 -82
  22. package/docs/agent-status.md +61 -0
  23. package/docs/bundled-install.md +7 -5
  24. package/docs/ci-performance.md +11 -0
  25. package/docs/delegated-verification.md +35 -7
  26. package/docs/fast-mode.md +15 -0
  27. package/docs/gentle-agents-activity.md +22 -0
  28. package/docs/gentle-shell.md +113 -25
  29. package/docs/install-wizard.md +2 -2
  30. package/docs/mcp-status.md +52 -0
  31. package/docs/permission-modes.md +9 -4
  32. package/docs/prompt-budget.md +28 -0
  33. package/docs/readme-reference.md +154 -50
  34. package/docs/render-cache-performance.md +11 -1
  35. package/docs/review-coordinator.md +33 -0
  36. package/docs/review-request-context.md +19 -0
  37. package/docs/review-windows-acl.md +18 -0
  38. package/docs/session-profile-format.md +20 -5
  39. package/docs/sound-notifications.md +1 -1
  40. package/docs/star-prompt.md +32 -0
  41. package/docs/voice.md +6 -3
  42. package/docs/work-continuity.md +46 -0
  43. package/docs/yolo-mode.md +5 -5
  44. package/extensions/ask-user-choice.ts +1 -0
  45. package/extensions/ask-user-question.ts +2 -0
  46. package/extensions/child-safety.ts +3 -0
  47. package/extensions/codegraph-tools.ts +38 -4
  48. package/extensions/gentle-agent-status.ts +99 -0
  49. package/extensions/gentle-agents.ts +803 -84
  50. package/extensions/gentle-ai.ts +2491 -596
  51. package/extensions/gentle-fast.ts +61 -0
  52. package/extensions/gentle-guide.ts +174 -0
  53. package/extensions/gentle-herdr-activity.ts +21 -1
  54. package/extensions/gentle-herdr-agent.ts +144 -0
  55. package/extensions/gentle-program-identity.ts +61 -0
  56. package/extensions/gentle-shell.ts +895 -120
  57. package/extensions/gentle-star-prompt.ts +334 -0
  58. package/extensions/gentle-stats.ts +5 -5
  59. package/extensions/gentle-todo.ts +59 -23
  60. package/extensions/gentle-tps.ts +48 -0
  61. package/extensions/history/store.ts +18 -12
  62. package/extensions/quiet-tools.ts +38 -8
  63. package/extensions/skill-registry.ts +210 -21
  64. package/extensions/startup-banner.ts +69 -10
  65. package/lib/agent-assets.ts +74 -17
  66. package/lib/agent-profile-pin.ts +3 -3
  67. package/lib/agent-profiles.ts +161 -3
  68. package/lib/agent-status.ts +105 -0
  69. package/lib/agents-config.ts +58 -3
  70. package/lib/agents-history.ts +24 -5
  71. package/lib/agents-keys.ts +8 -16
  72. package/lib/agents-messaging.ts +47 -5
  73. package/lib/agents-protocol.ts +80 -4
  74. package/lib/agents-runner.ts +287 -15
  75. package/lib/agents-view.ts +6 -1
  76. package/lib/agents-widget.ts +132 -9
  77. package/lib/auto-permission-runtime.ts +1 -1
  78. package/lib/bounded-writer-admission.ts +13 -1
  79. package/lib/bridge-cost.ts +28 -0
  80. package/lib/card-content-policy.ts +8 -6
  81. package/lib/codemode-renderer.ts +16 -0
  82. package/lib/command-palette-catalog.ts +1 -0
  83. package/lib/command-palette.ts +154 -25
  84. package/lib/context-backstop.ts +14 -5
  85. package/lib/destructive-command-guard.ts +48 -4
  86. package/lib/execution-surface-guard.ts +20 -0
  87. package/lib/exploration-budget.ts +64 -0
  88. package/lib/gentle-ai-binary.ts +1 -1
  89. package/lib/gentle-design.ts +3 -0
  90. package/lib/gentle-guide.ts +201 -0
  91. package/lib/gentle-shell-bundled.ts +6 -19
  92. package/lib/gentle-shell-launcher.ts +47 -8
  93. package/lib/herdr-activity.ts +23 -5
  94. package/lib/herdr-busy.ts +45 -0
  95. package/lib/herdr-task-summary-policy.ts +85 -0
  96. package/lib/image-attachments.ts +33 -0
  97. package/lib/image-disk-cache.ts +137 -0
  98. package/lib/inprocess-reviewer.ts +282 -132
  99. package/lib/jobs-sidebar-state.ts +5 -6
  100. package/lib/jobs-view.ts +198 -11
  101. package/lib/jobs-widget.ts +16 -52
  102. package/lib/keymaps-customize.ts +81 -0
  103. package/lib/keymaps.ts +291 -0
  104. package/lib/model-fallback-notice.ts +61 -0
  105. package/lib/model-fallback-policy.ts +141 -0
  106. package/lib/model-fallback-store.ts +143 -0
  107. package/lib/model-routing-authority.ts +32 -6
  108. package/lib/nan-provider.ts +3 -2
  109. package/lib/native-choice-list.ts +20 -2
  110. package/lib/native-review-cli.ts +103 -21
  111. package/lib/notification-customize.ts +48 -51
  112. package/lib/openai-fast-tier.ts +22 -0
  113. package/lib/orchestrator-discovery.ts +5 -1
  114. package/lib/orchestrator-fallback.ts +75 -0
  115. package/lib/orchestrator-mode-policy.ts +105 -0
  116. package/lib/pasted-image-paths.ts +113 -0
  117. package/lib/questionnaire/questionnaire-view.ts +225 -18
  118. package/lib/rdd-mode-control.ts +32 -0
  119. package/lib/reply-language-anchor.ts +104 -0
  120. package/lib/review-blocker.ts +92 -0
  121. package/lib/review-candidate-symlink-scan.ts +136 -0
  122. package/lib/review-candidate-view-owner.ts +85 -44
  123. package/lib/review-candidate-view.ts +10 -7
  124. package/lib/review-continuation-registry.ts +99 -0
  125. package/lib/review-coordinator.ts +163 -0
  126. package/lib/review-failure-facts.ts +49 -0
  127. package/lib/review-host-relay.ts +51 -11
  128. package/lib/review-integration-v2.ts +29 -8
  129. package/lib/review-relay-phase-timing.ts +45 -0
  130. package/lib/review-repository.ts +5 -0
  131. package/lib/review-start-context.ts +17 -0
  132. package/lib/session-profile-append-controller.ts +21 -6
  133. package/lib/session-profile-authority.ts +119 -0
  134. package/lib/session-profile-binding.ts +54 -5
  135. package/lib/session-profile-freeze.ts +107 -9
  136. package/lib/session-profile-integration.ts +313 -0
  137. package/lib/session-profile-persistence.ts +63 -9
  138. package/lib/shell-bar.ts +269 -72
  139. package/lib/shell-card.ts +26 -6
  140. package/lib/shell-changes.ts +2 -0
  141. package/lib/shell-page.ts +120 -0
  142. package/lib/shell-panel.ts +163 -0
  143. package/lib/shell-prompt.ts +53 -1
  144. package/lib/shell-sidebar-layout.ts +198 -53
  145. package/lib/shell-sidebar.ts +61 -1
  146. package/lib/shell-stats.ts +123 -0
  147. package/lib/shell-todo.ts +79 -1
  148. package/lib/shell-usage.ts +12 -2
  149. package/lib/star-prompt.ts +197 -0
  150. package/lib/verifier-admission.ts +18 -8
  151. package/lib/verifier-settle-reminder.ts +64 -0
  152. package/lib/vim-editor-adapter.ts +6 -1
  153. package/lib/visual-customization-policy.ts +67 -12
  154. package/lib/visual-customize-view.ts +373 -40
  155. package/lib/visual-layout-preview.ts +47 -0
  156. package/lib/visual-profiles.ts +2 -2
  157. package/lib/windows-session-transport.ts +53 -2
  158. package/lib/yolo-session-policy.ts +68 -16
  159. package/package.json +2 -1
  160. package/runtime/gentle-ai-binary.mjs +1 -1
  161. package/runtime/gentle-shell-bundled.mjs +6 -19
  162. package/runtime/gentle-shell-launcher.mjs +46 -7
  163. package/runtime/native-review-cli.mjs +100 -18
  164. package/runtime/review-integration-v2.mjs +29 -8
  165. package/runtime/windows-session-transport.ps1 +60 -3
  166. package/scripts/bootstrap.sh +4 -1
  167. package/scripts/build-full-delegation-card.mjs +175 -0
  168. package/scripts/bundled-install.mjs +38 -8
  169. package/scripts/download-progress.mjs +68 -0
  170. package/scripts/gentle-ai-installer.mjs +41 -18
  171. package/scripts/gentle-ai-proxy.mjs +294 -0
  172. package/scripts/install-gentle-ai.mjs +14 -1
  173. package/scripts/installer-preflight.mjs +6 -6
  174. package/scripts/installer-runner.mjs +27 -12
  175. package/scripts/installer-server.mjs +8 -7
  176. package/scripts/pi-update.mjs +113 -3
  177. package/scripts/render-cache-host.mjs +72 -0
  178. package/scripts/render-cache-performance-worker.mjs +5 -4
  179. package/scripts/render-cache-performance.mjs +6 -1
  180. package/scripts/run-test-suite.mjs +41 -13
  181. package/scripts/shell-snapshot.mjs +340 -0
  182. package/scripts/test-packed-runner.mjs +1 -1
  183. package/scripts/update-agent-body-history.mjs +41 -0
  184. package/scripts/verify-installer-tap.mjs +45 -0
  185. package/scripts/verify-package-files.mjs +14 -2
  186. package/scripts/voice-worker.cjs +32 -6
  187. package/skills/design/SKILL.md +11 -8
  188. package/skills/gentle-ai/SKILL.md +4 -4
  189. package/skills/gentle-ui-design/SKILL.md +46 -0
  190. package/skills/gentle-ui-design/references/adaptive-interfaces.md +46 -0
  191. package/skills/gentle-ui-design/references/browse-and-compare.md +62 -0
  192. package/skills/gentle-ui-design/references/composition-and-feedback.md +56 -0
  193. package/skills/gentle-ui-design/references/task-and-content.md +60 -0
  194. package/skills/skill-registry/SKILL.md +4 -2
  195. package/skills/tui-design/NOTICE.md +5 -0
  196. package/skills/tui-design/SKILL.md +56 -0
  197. package/skills/tui-design/references/commands.md +75 -0
  198. package/skills/tui-design/references/critique.md +48 -0
  199. package/skills/tui-design/references/design-doc.md +44 -0
  200. package/skills/tui-design/references/terminal-craft.md +64 -0
  201. package/skills/tui-design/references/visual-loop.md +32 -0
  202. package/skills/work-unit-commits/SKILL.md +6 -7
  203. package/tests/agent-home.test.ts +28 -9
  204. package/tests/agent-profiles-workflow.test.ts +163 -0
  205. package/tests/agent-risk-escalation.test.ts +1 -1
  206. package/tests/agent-status.test.ts +143 -0
  207. package/tests/agents-config.test.ts +96 -0
  208. package/tests/agents-history.test.ts +31 -0
  209. package/tests/agents-jobs-frames.test.ts +93 -0
  210. package/tests/agents-prompt-lifecycle-runtime.test.ts +376 -0
  211. package/tests/agents-protocol.test.ts +53 -1
  212. package/tests/agents-runner-drain.test.ts +193 -0
  213. package/tests/agents-runner.test.ts +345 -4
  214. package/tests/agents-view.test.ts +27 -0
  215. package/tests/agents-widget.test.ts +312 -10
  216. package/tests/append-system-prompt-route.test.ts +4 -1
  217. package/tests/ask-user-choice.test.ts +4 -3
  218. package/tests/ask-user-question.test.ts +97 -0
  219. package/tests/auto-permission-runtime.test.ts +1 -1
  220. package/tests/autonomous-guard.test.ts +346 -10
  221. package/tests/bounded-scan-contract.test.ts +39 -0
  222. package/tests/bounded-stop-contract.test.ts +43 -3
  223. package/tests/bridge-cost.test.ts +47 -0
  224. package/tests/bundled-install.test.ts +36 -9
  225. package/tests/card-content-policy.test.ts +3 -3
  226. package/tests/chained-pr-skill.test.ts +8 -6
  227. package/tests/child-safety.test.ts +11 -0
  228. package/tests/ci-concurrency.test.ts +11 -0
  229. package/tests/ci-merge-base-identity.test.ts +114 -0
  230. package/tests/codegraph-tools.test.ts +80 -5
  231. package/tests/codemode-rendering.test.ts +22 -2
  232. package/tests/command-palette.test.ts +300 -3
  233. package/tests/commit-slice-signal.test.ts +11 -9
  234. package/tests/delegate-for-reason-contract.test.ts +8 -7
  235. package/tests/design-canvas-assets.test.ts +185 -2
  236. package/tests/destructive-command-guard.test.ts +52 -0
  237. package/tests/download-progress.test.ts +71 -0
  238. package/tests/execution-surface-guard.test.ts +55 -0
  239. package/tests/exploration-budget.test.ts +128 -0
  240. package/tests/fixtures/agent-assets/gentle-ai-worker.strict-tdd-era.md +122 -0
  241. package/tests/fixtures/measure-orchestrator-prompt.mjs +2 -1
  242. package/tests/fixtures/primary-session-prompt/gentleman.golden.md +26 -14
  243. package/tests/fixtures/proxy-tls/proxy.crt +19 -0
  244. package/tests/fixtures/proxy-tls/proxy.key +28 -0
  245. package/tests/fixtures/session-profile-v1/gentle-ai-reviewer.ts +89 -0
  246. package/tests/fixtures/session-profile-v1/replay.ts +172 -0
  247. package/tests/fixtures/session-profile-v1/session-profile-authority.ts +113 -0
  248. package/tests/fixtures/session-profile-v1/session-profile-binding.ts +83 -0
  249. package/tests/fixtures/session-profile-v1/session-profile-disk-reader.ts +182 -0
  250. package/tests/fixtures/session-profile-v1/session-profile-freeze.ts +290 -0
  251. package/tests/fixtures/session-profile-v1/session-profile-persistence.ts +195 -0
  252. package/tests/fixtures/session-profile-v1/v1-inputs.ts +16 -0
  253. package/tests/fixtures/windows-pipe-availability.ps1 +26 -0
  254. package/tests/fixtures/windows-session-bootstrap.ps1 +6 -2
  255. package/tests/full-delegation-closure.test.ts +131 -0
  256. package/tests/full-delegation-notices.test.ts +76 -0
  257. package/tests/generic-agent-tools.test.ts +3 -3
  258. package/tests/gentle-agent-status.test.ts +74 -0
  259. package/tests/gentle-agents-child-jobs.test.ts +237 -0
  260. package/tests/gentle-agents.test.ts +1491 -38
  261. package/tests/gentle-ai-binary.test.ts +3 -1
  262. package/tests/gentle-ai-elapsed-store.test.ts +19 -0
  263. package/tests/gentle-ai-exploration-budget.test.ts +151 -0
  264. package/tests/gentle-ai-installer.test.ts +134 -51
  265. package/tests/gentle-ai-proxy.test.ts +434 -0
  266. package/tests/gentle-ai.test.ts +1101 -52
  267. package/tests/gentle-design.test.ts +21 -0
  268. package/tests/gentle-fast.test.ts +73 -0
  269. package/tests/gentle-guide.test.ts +208 -0
  270. package/tests/gentle-herdr-activity.test.ts +80 -3
  271. package/tests/gentle-herdr-agent.test.ts +111 -0
  272. package/tests/gentle-program-identity.test.ts +197 -0
  273. package/tests/gentle-shell-bin.test.ts +172 -26
  274. package/tests/gentle-shell-bundled.test.ts +207 -31
  275. package/tests/gentle-shell-launcher.test.ts +93 -10
  276. package/tests/gentle-shell.test.ts +1937 -66
  277. package/tests/gentle-stats.test.ts +15 -2
  278. package/tests/gentle-todo.test.ts +67 -4
  279. package/tests/gentle-tps.test.ts +123 -0
  280. package/tests/gentle-ui-design-skill.test.ts +59 -0
  281. package/tests/herdr-busy.test.ts +59 -0
  282. package/tests/herdr-task-summary-policy.test.ts +132 -0
  283. package/tests/history-store-private-mode.test.ts +40 -0
  284. package/tests/image-disk-cache.test.ts +163 -0
  285. package/tests/image-paste-chips.test.ts +42 -0
  286. package/tests/independent-recovery-delivery.test.ts +83 -0
  287. package/tests/inprocess-reviewer.test.ts +298 -4
  288. package/tests/installer-posix-bootstrap.test.ts +68 -6
  289. package/tests/installer-preflight.test.ts +5 -4
  290. package/tests/installer-runner.test.ts +79 -44
  291. package/tests/installer-server.test.ts +14 -11
  292. package/tests/installer-windows-diagnostics.test.ts +4 -5
  293. package/tests/isolated-config-home.ts +28 -0
  294. package/tests/jobs-view.test.ts +260 -6
  295. package/tests/jobs-widget.test.ts +25 -37
  296. package/tests/keymaps-customize.test.ts +114 -0
  297. package/tests/keymaps.test.ts +103 -0
  298. package/tests/maintainer/mcp-status.maintest.ts +88 -0
  299. package/tests/maintainer/pi-update-source.maintest.ts +116 -0
  300. package/tests/modal-mouse-boundaries.test.ts +136 -0
  301. package/tests/model-fallback-notice.test.ts +45 -0
  302. package/tests/model-fallback-policy.test.ts +83 -0
  303. package/tests/model-fallback-store.test.ts +111 -0
  304. package/tests/model-routing-authority.test.ts +178 -2
  305. package/tests/nan-provider.test.ts +4 -4
  306. package/tests/native-choice-list.test.ts +77 -2
  307. package/tests/native-review-capability-contract.test.ts +7 -1
  308. package/tests/native-review-cli.test.ts +269 -1
  309. package/tests/no-self-pause-contract.test.ts +22 -0
  310. package/tests/notification-customize.test.ts +58 -34
  311. package/tests/odd-routing-canonical-ratchet.test.ts +6 -6
  312. package/tests/odd-routing-contract.test.ts +1 -1
  313. package/tests/orchestrator-budget.test.ts +7 -2
  314. package/tests/orchestrator-delegation-mode.test.ts +153 -0
  315. package/tests/orchestrator-fallback.test.ts +82 -0
  316. package/tests/orchestrator-mode-policy.test.ts +175 -0
  317. package/tests/orchestrator-prompt-budget.test.ts +133 -0
  318. package/tests/orchestrator-rdd-ownership.test.ts +2 -2
  319. package/tests/package-manifest.test.ts +169 -14
  320. package/tests/pasted-image-paths.test.ts +118 -0
  321. package/tests/permission-allowlist.test.ts +202 -0
  322. package/tests/persona-reply-language.test.ts +20 -1
  323. package/tests/pi-update-launcher.test.ts +40 -8
  324. package/tests/pi-update-source.test.ts +162 -0
  325. package/tests/pnpm-workspace-config.test.ts +58 -0
  326. package/tests/primary-session-prompt.test.ts +13 -0
  327. package/tests/profile-fast-tier.test.ts +311 -0
  328. package/tests/profile-pin.test.ts +29 -2
  329. package/tests/profile-tier-footer.test.ts +84 -0
  330. package/tests/profiles-panel-delegation-mode.test.ts +422 -0
  331. package/tests/questionnaire-view.test.ts +265 -0
  332. package/tests/quiet-bash-runtime.test.ts +1 -1
  333. package/tests/quiet-tool-rendering.test.ts +48 -0
  334. package/tests/rdd-aware-verification-contract.test.ts +16 -11
  335. package/tests/rdd-customize.test.ts +287 -0
  336. package/tests/rdd-mode-cache.test.ts +450 -0
  337. package/tests/rdd-mode-control.test.ts +407 -0
  338. package/tests/rdd-mode-scope-regression.test.ts +137 -0
  339. package/tests/rdd-off-independent-regression.test.ts +69 -0
  340. package/tests/rdd-status-line.test.ts +18 -0
  341. package/tests/render-cache-performance.test.ts +171 -2
  342. package/tests/reply-language-anchor.test.ts +173 -0
  343. package/tests/review-agent-end-preflight.test.ts +1 -1
  344. package/tests/review-blocker.test.ts +193 -0
  345. package/tests/review-candidate-owner-retry.test.ts +1 -1
  346. package/tests/review-candidate-owner-sweep.test.ts +93 -0
  347. package/tests/review-candidate-symlink-scan.test.ts +157 -0
  348. package/tests/review-candidate-view.test.ts +52 -1
  349. package/tests/review-candidate-windows-boundary.test.ts +131 -0
  350. package/tests/review-candidate-windows-probe.test.ts +63 -0
  351. package/tests/review-committed-restart-ack.test.ts +129 -0
  352. package/tests/review-continuation-registry.test.ts +76 -0
  353. package/tests/review-controller-native-routing.test.ts +381 -11
  354. package/tests/review-controller-workspace-root.test.ts +230 -3
  355. package/tests/review-controller.test.ts +96 -11
  356. package/tests/review-coordinator-runtime.test.ts +117 -0
  357. package/tests/review-coordinator.test.ts +195 -0
  358. package/tests/review-failure-facts.test.ts +87 -0
  359. package/tests/review-gate.test.ts +24 -0
  360. package/tests/review-host-relay-routing.test.ts +258 -4
  361. package/tests/review-host-relay.test.ts +39 -0
  362. package/tests/review-inspect-preflight.test.ts +197 -0
  363. package/tests/review-integration-v2-forward.test.ts +59 -0
  364. package/tests/review-integration-v2.test.ts +46 -3
  365. package/tests/review-json-arguments.test.ts +65 -10
  366. package/tests/review-last-event-closure.test.ts +68 -0
  367. package/tests/review-loadout-rdd-off-sdk.test.ts +65 -31
  368. package/tests/review-owner-identity.test.ts +60 -24
  369. package/tests/review-relay-phase-timing.test.ts +128 -0
  370. package/tests/review-relay-transport-agent.test.ts +12 -2
  371. package/tests/review-repository.test.ts +52 -1
  372. package/tests/review-reviewer-evidence.test.ts +183 -0
  373. package/tests/review-risk-assessment.test.ts +74 -3
  374. package/tests/review-session-standing-permission-controller.test.ts +21 -1
  375. package/tests/review-sidebar-state.test.ts +5 -5
  376. package/tests/review-start-context.test.ts +19 -0
  377. package/tests/review-tool-prose-budget.test.ts +121 -0
  378. package/tests/run-test-suite.test.ts +183 -6
  379. package/tests/runtime-harness.mjs +4 -1
  380. package/tests/sensitive-path-tools.test.ts +250 -0
  381. package/tests/session-profile-append-controller-pi.test.ts +60 -31
  382. package/tests/session-profile-append-controller.test.ts +63 -0
  383. package/tests/session-profile-authority.test.ts +259 -0
  384. package/tests/session-profile-binding.test.ts +34 -1
  385. package/tests/session-profile-disk-reader-pi.test.ts +58 -16
  386. package/tests/session-profile-extension.test.ts +615 -0
  387. package/tests/session-profile-freeze.test.ts +110 -2
  388. package/tests/session-profile-integration.test.ts +857 -0
  389. package/tests/session-profile-persistence.test.ts +57 -0
  390. package/tests/session-profile-v1-compat.test.ts +255 -0
  391. package/tests/shell-bar.test.ts +274 -72
  392. package/tests/shell-card.test.ts +13 -1
  393. package/tests/shell-page.test.ts +108 -0
  394. package/tests/shell-panel.test.ts +360 -0
  395. package/tests/shell-prompt.test.ts +54 -0
  396. package/tests/shell-render-cache.test.ts +5 -0
  397. package/tests/shell-sidebar-fullscreen.test.ts +13 -1
  398. package/tests/shell-sidebar-layout.test.ts +447 -44
  399. package/tests/shell-sidebar-scroll-benchmark.test.ts +1 -1
  400. package/tests/shell-stats.test.ts +90 -0
  401. package/tests/shell-surface-transparent.test.ts +89 -0
  402. package/tests/shell-todo.test.ts +12 -0
  403. package/tests/shell-usage.test.ts +14 -0
  404. package/tests/skill-registry.test.ts +902 -2
  405. package/tests/star-prompt.test.ts +470 -0
  406. package/tests/startup-banner.test.ts +209 -2
  407. package/tests/startup-home-repo.test.ts +2 -0
  408. package/tests/support/review-coordinator-runtime.ts +69 -0
  409. package/tests/task-size-routing-contract.test.ts +50 -4
  410. package/tests/verifier-admission.test.ts +49 -0
  411. package/tests/verifier-settle-reminder.test.ts +281 -0
  412. package/tests/verify-first-launch-contract.test.ts +134 -8
  413. package/tests/verify-installer-tap.test.ts +57 -0
  414. package/tests/vim-editor-adapter.test.ts +2 -2
  415. package/tests/visual-customization-policy.test.ts +95 -8
  416. package/tests/visual-customize-view.test.ts +818 -9
  417. package/tests/visual-layout-preview.test.ts +42 -0
  418. package/tests/visual-profiles.test.ts +11 -0
  419. package/tests/voice-worker.test.ts +73 -2
  420. package/tests/windows-session-bootstrap.test.ts +105 -2
  421. package/tests/windows-session-transport.test.ts +126 -0
  422. package/tests/work-continuity-contract.test.ts +114 -0
  423. package/tests/writer-feature-document-admission.test.ts +92 -0
  424. package/tests/writer-surfaces.test.ts +12 -10
  425. package/tests/yolo-customize.test.ts +57 -15
  426. package/tests/yolo-mode-runtime.test.ts +4 -2
  427. package/tests/yolo-mode.test.ts +39 -20
  428. package/tests/yolo-session-policy.test.ts +270 -1
@@ -0,0 +1,33 @@
1
+ # Experimental ordinary review coordinator
2
+
3
+ Enable `GENTLE_PI_EXPERIMENTAL_REVIEW_COORDINATOR=1` before loading the extension to register `gentle_review_run` in a parent session. The tool is absent by default and in managed child sessions. It is model-only and follows the existing direct-call restriction; it is not a codemode entry point.
4
+
5
+ The coordinator calls the existing wrapped review facade executors. Native mode, host consent, session identity, workspace/base selection, opaque bindings and native admission remain authoritative. It never parses binding strings, invents results, retries a failed capture or authorizes delivery.
6
+
7
+ For a fresh ordinary review, provide pertinent `lenses` and `lensesReason`, optionally `workspaceRoot`, a committed selector (`baseRef` together with `committedOnly: true`), and an existing `requestContextPath`. [Frozen request intent](review-request-context.md) is accepted only for a fresh transaction. Unresolved consent returns to the host.
8
+
9
+ The loop follows the native next_transition kind. It runs supported facade execute offers, captures the exact ordered opaque bindings, returns authored input to the model, and surfaces stop unchanged. It never reads native states, reason codes, binding contents or capture closure variants. Facade operations that require additional maintenance authorization return to the caller.
10
+
11
+ Native correction_request explicitly identifies a plan that needs authored input. The coordinator returns that request to the model without deriving requiresInput metadata from submission domains or changing ordinary STATUS output. Unsupported capture responses return control to the caller. Correction-plan authoring and edits remain explicit handoffs; after an authorized edit, resume with the same lineage and workspace/base selection. Native decides which opaque capture comes next.
12
+
13
+ The existing capture facade presents the model-run forecast before execution. Every observed forecast is also preserved losslessly in the final forecasts array, including when a later operation refuses. The primary model must relay every entry in the user’s language, preserving all fields and counts. These forecasts are informational, not review consent. A missing display, changed session or disabled mode prevents the run. Accepted captures refresh bound STATUS for the next transition; failed or reoffered captures never retry.
14
+
15
+ Approval closes through the offered facade acknowledgement. The verified ACK envelope identifies the frozen target and burned authority. There is no post-ACK STATUS, ASSESS or replay, and closure makes no claim about subsequent edits or permission to commit, push or publish.
16
+
17
+ ## Validation and rollout
18
+
19
+ ```sh
20
+ node --experimental-strip-types --test tests/review-coordinator.test.ts tests/review-coordinator-runtime.test.ts tests/review-last-event-closure.test.ts tests/rdd-off-native-refusal.test.ts
21
+ ```
22
+
23
+ Unit and registered-runtime tests cover opaque binding order, authored input, native stop, state/reason independence, consent, cancellation, mode/session changes, failed or repeated captures, identity drift and terminal ACK without follow-up queries. Runtime fixtures are in-memory authority simulations; they do not claim real native approval.
24
+
25
+ Historical measurements, candidate identities and their limitations live in [issue #2881](https://github.com/Gentleman-Programming/gentle-shell/issues/2881) and [PR #2884](https://github.com/Gentleman-Programming/gentle-shell/pull/2884). Benchmark data is not shipped in the npm package and does not certify this candidate.
26
+
27
+ SDK event accounting sees the outer coordinator call. Its returned metrics.steps describe internal facade calls; those direct calls emit no additional tool_call/tool_result or timing events.
28
+
29
+ When the relay supplies execution evidence, the final reviewer_runs array retains snapshots of the resolved reviewer model, phase, durations and available reported usage/cost. Groups include all prepared runs, even when submission later stops; legacy submitted-only diagnostics are not counted again. Missing usage stays unknown. This is not a billing ledger: sibling runs can remain unreported when group preparation fails before returning its results, and thrown/cancelled calls retain their existing behavior. The coordinator computes no cost total and emits no additional SDK accounting events.
30
+
31
+ Reviewer authentication and completion share a host deadline. Cancellation or an expired deadline prevents further dispatch, and late results are not admitted. A provider that ignores cancellation may continue consuming resources after the host stops waiting.
32
+
33
+ Related delivery: [issue #2881](https://github.com/Gentleman-Programming/gentle-shell/issues/2881). Keep the feature default-off until independent security/reliability review and an opt-in real-use pilot complete.
@@ -0,0 +1,19 @@
1
+ # Frozen request intent in Shell
2
+
3
+ Fresh ordinary `gentle_review` START accepts `input.requestContextPath`, for example:
4
+
5
+ ```json
6
+ {"operation":"start","input":"{\"mode\":\"ordinary\",\"requestContextPath\":\"docs/feature-request.md\",\"lenses\":[\"risk\"],\"lensesReason\":\"Changes document authorization\"}"}
7
+ ```
8
+
9
+ Relative paths resolve against the selected workspace; `~/` (and `~\` on Windows) expands to the home directory. Shell resolves the real path before forwarding it and rejects missing paths or broken aliases. Supply an existing UTF-8 file containing the request the candidate was built for; files outside the repository can be explicitly selected too. Their contents are sent to reviewer models just like request files inside the repository. Gentle AI reads the file through its existing `--request-context` contract, includes it in the native prompt budget, freezes its contents, and binds the hash into authority and reviewer subject identity. Shell forwards the provider-issued START and consent arguments unchanged. Before forwarding the file, Shell queries the selected executable’s advertised capabilities and requires both `start_request_context` and `start_options_preflight`. The executable hash is reused only while its device, inode, size, mtime and ctime match; capabilities are cached per client, executable path and digest. STATUS and authority are always queried afresh. Unsupported providers fail early with “provider does not support request context”; Shell never retries without its intent.
10
+
11
+ Use this field when business intent is needed to distinguish a requested behavior change from a regression. `lensesReason` only explains lens selection, and a README does not reach reviewers merely because it exists. Native treats request text as evidence, not reviewer instructions, and excludes its optional `## Verify` section from reviewer context.
12
+
13
+ Existing lineages retain their frozen intent. START with an explicit request file is blocked when authority already exists; resolve that authority through the ordinary workflow before requesting a fresh review. Editing the source file does not rewrite an old review or retroactively revoke its original scope. Native refuses replaying a lineage under a changed request, and produces different reviewer subject hashes for different intent. Resume with `lineageId` without supplying a request path; the original frozen intent remains in force.
14
+
15
+ The same sensitive-path policy used by file tools applies to request files, including aliases resolving into protected locations. Files such as .env, .envrc, .netrc, private keys and files in secrets directories are rejected before native reads. This checks path names, not file contents; hardlinks do not expose their other names through realpath and are not detected by this policy. Select a specification that excludes credentials. Resolving aliases reduces the gap between checking and opening a path, but does not make the subsequent native read atomic with the Shell check.
16
+
17
+ If START pauses for intended-untracked selection, its continuation retains the selected request file. Unrelated native stops remain visible without being mistaken for an existing review. Consent also retains the original file: every offered and replayed choice must carry exactly one matching request-context argument. Selecting a different file requires a fresh request.
18
+
19
+ START and consent compare request paths literally on every platform. If native changes Windows path spelling (including trailing dots or extended-path prefixes), Shell refuses the transition rather than assuming the paths identify the same file.
@@ -0,0 +1,18 @@
1
+ # Windows candidate owner observations
2
+
3
+ Candidate creation, verification and explicit cleanup retain their existing owner, DACL, marker, lock, registration and replacement checks. Each Windows safety boundary obtains a fresh observation. The three parent directories share one read-only PowerShell invocation; file checks remain separate. Observations are not cached across calls, Git callbacks or writable-conversion callbacks.
4
+
5
+ The trusted system PowerShell reads the current identity and each requested object's owner and Access SDDL. Paths travel through UTF-8 JSON on stdin. The response is bounded and must contain the complete ordered set of observations. Existing owner/DACL policy validators decide whether those observations are authorized. Invalid responses and policy failures are outside the idempotent transport retry.
6
+
7
+ This reduces process startup work without changing removal sequencing or adding a recursive deletion fallback. Automatic Windows orphan sweeping remains conservative. Non-Windows ownership checks keep their existing behavior.
8
+
9
+ ## Verification
10
+
11
+ ```sh
12
+ node --experimental-strip-types --test tests/review-owner-identity.test.ts tests/review-candidate-windows-probe.test.ts tests/review-candidate-owner-retry.test.ts tests/review-candidate-owner-sweep.test.ts
13
+ node --experimental-strip-types --test tests/review-candidate-windows-boundary.test.ts
14
+ ```
15
+
16
+ The second file uses real Windows ACLs in disposable Git repositories, including quoted/Unicode paths, changes after Git inspection, marker/lock tampering, Git removal failure and parent replacement. It skips on other platforms. The parser/transport tests separately cover incomplete responses and an unauthorized owner through a controlled subprocess response; they do not claim a privileged ownership transfer.
17
+
18
+ Related work and experimental measurements: [issue #2881](https://github.com/Gentleman-Programming/gentle-shell/issues/2881). The combined redesign measurements include other changes and are not an isolated performance claim for this patch.
@@ -1,8 +1,8 @@
1
1
  # Session profile record format
2
2
 
3
3
  `lib/session-profile-persistence.ts` defines the optional session profile v1
4
- codec and pure replay contract. Adding this module does not change Enter,
5
- startup, routing, shared defaults, or live orchestrator behavior.
4
+ codec and pure replay contract. The record shapes and how each version reads
5
+ them are specified in gentle-shell#2742.
6
6
 
7
7
  ## Payloads
8
8
 
@@ -10,12 +10,27 @@ A custom entry uses `customType: "gentle-pi.session-profile/v1"` and one payload
10
10
 
11
11
  ```json
12
12
  {"kind":"bind","origin":"user","name":"work","modelProfiles":{"worker":{"model":"provider/model"},"orchestrator":{"thinking":"high"}}}
13
+ {"kind":"bind","origin":"user","name":"work","modelProfiles":{"worker":{"model":"provider/model"}},"startup":"none"}
14
+ {"kind":"bind","origin":"local","name":"team","modelProfiles":{"worker":{"model":"provider/model"},"orchestrator":{"model":"provider/model"}}}
13
15
  {"kind":"clear"}
16
+ {"kind":"clear","startup":"none"}
14
17
  ```
15
18
 
16
- The encoder creates only explicit `user` selections. The decoder accepts the
17
- closed origin set `user`, `local`, `repo`, and `global`; this does not implement
18
- inherited startup persistence or follow mode. A bound empty snapshot is not a
19
+ | Payload | Meaning |
20
+ | --- | --- |
21
+ | `bind`, origin `user` | An explicit choice (Use in this session). An optional `startup` field holds the session's startup state: `{"origin","name","modelProfiles"}` with origin `local`, `repo` or `global`, or `"none"`. |
22
+ | `bind`, origin `local`, `repo` or `global` | A startup record: the profile the session started with and the layer it came from. `modelProfiles` is the full normalized definition, `orchestrator` included; launch routing uses its role entries only. |
23
+ | `clear` | A legacy clear: no session profile, startup state unknown. |
24
+ | `clear` with `startup: "none"` | The session started with no profile in any layer. |
25
+
26
+ The decoder accepts the closed origin set `user`, `local`, `repo`, and `global`.
27
+ A malformed `startup` field is dropped, so the record keeps the routing a v1
28
+ reader gives it, and a `startup` on a clear other than `"none"` reads as a
29
+ legacy clear. A v1 reader ignores `startup`, reads a startup record as an
30
+ explicit choice and a clear with `startup: "none"` as a clear; launch routing
31
+ is the same except in the case gentle-shell#2742 section 2 documents (a session
32
+ that started with no profile, resumed by a v1 version after a default
33
+ appeared). A bound empty snapshot is not a
19
34
  clear. Snapshots are detached, known invalid fields reject the whole binding,
20
35
  and unknown extra fields carry no routing meaning. Existing route normalization
21
36
  supports legacy model strings and `effort`; valid `thinking` takes precedence.
@@ -13,7 +13,7 @@ Audio is **off by default**. In a primary Pi terminal, open `/gentle:customize`
13
13
 
14
14
  **Context warning.** When context usage reaches **90%** of the active model's window, Gentle warns once per high episode. The sound is the `context.high` event: turn **Audio notifications** on, expand **Advanced**, and select its sound. A file saved before `context.high` existed stays silent for it, so select a sound on that Advanced row to hear it; its recommended tone is `builtin:attention`. The visual warning is fully independent: the **Sections → Section contextWarning** row in `/gentle:customize` (shown by default) toggles it, and neither toggle changes the other. The episode rearms when usage drops below 90%, after a successful compaction, or in a new session; a canceled or failed compaction does not rearm, and the unknown reading right after a successful compaction never repeats the warning.
15
15
 
16
- The inline field and the recovery confirmation render inside the same card. **Escape** cancels the field or confirmation; a second Escape closes the card. If the field, value or `y yes` cannot be shown in full (a resize or a very small terminal), Enter or `y` is refused instead of acting on something invisible. Invalid/unreadable configuration disables automatic audio: saving in that state requires a fresh explicit inline confirmation to replace it, cancel preserves the file and settings, and a failed write does not grant consent to the next attempt. Diagnostics are generic local UI notices, not conversation messages, tools, model context or agent state.
16
+ The inline field and the recovery confirmation render inside the same card. Long input prompts and values wrap across the available preview lines (up to three when the card has at least 11 rows), and Enter submits the exact value only when it is fully visible. If the input still cannot fit, `Needs N columns for one line · Esc cancel` gives a sufficient terminal width; shorten the value, enlarge the terminal, or cancel. **Escape** cancels the field or confirmation; a second Escape closes the card. If the field, value or `y yes` cannot be shown in full (a resize or a very small terminal), Enter or `y` is refused instead of acting on something invisible. Invalid/unreadable configuration disables automatic audio: saving in that state requires a fresh explicit inline confirmation to replace it, cancel preserves the file and settings, and a failed write does not grant consent to the next attempt. Diagnostics are generic local UI notices, not conversation messages, tools, model context or agent state.
17
17
 
18
18
  ## Supported events and defaults
19
19
 
@@ -0,0 +1,32 @@
1
+ # GitHub star prompt
2
+
3
+ Gentle Shell can thank engaged users with a single, non-blocking invitation to star the repository — modeled on t3code's `GitHubStarPrompt` courtesies, and engineered to never interrupt active work.
4
+
5
+ ## Behavior
6
+
7
+ - **Engagement gate.** The offer may appear only after more than five interactive prompts have been sent across sessions (the counter persists in the gentle config home). Prompts 1–5 stay silent.
8
+ - **Idle only.** The offer waits for 30 seconds without any keyboard activity and for no running agent before showing anything. Typing at any moment restarts the wait and is never consumed.
9
+ - **Once per session.** If the offer goes unanswered, it auto-hides after five minutes and does not return until the next session.
10
+ - **Dismissal is forever.** `Alt+D` (or any dismissal path) persists a never-ask-again flag. If state cannot be read or written, the extension never asks at all: a dismissal that cannot be saved must not be replaced by nagging.
11
+ - **Already starred.** When the authenticated `gh` account already starred the repositories, the offer marks itself dismissed without ever showing. If `gh` cannot answer, the offer stays silent for that session.
12
+
13
+ ## The offer
14
+
15
+ When idle conditions are met, a one-line offer appears below the editor, painted in the theme's `success` green (the color of added lines in the changes view) so it stands out, followed by a `[star]` button:
16
+
17
+ ```
18
+ Enjoying Gentle Shell? Ctrl+G stars both Gentleman-Programming repos (github.com/Gentleman-Programming/gentle-shell and github.com/Gentleman-Programming/gentle-ai) on GitHub, Alt+D never asks again [star]
19
+ ```
20
+
21
+ The row is responsive: it shows the longest wording that fits whole, from the full text above down to `Enjoying Gentle Shell? Ctrl+G stars us on GitHub, Alt+D never asks again`, `Ctrl+G star, Alt+D dismiss`, and `Ctrl+G star`, so no word is ever cut. The `[star]` button stays right-aligned at every width, like the changes row's `/gentle:changes` hint, and exists only while the offer is visible.
22
+
23
+ Only two control chords are intercepted while the offer is visible — plain typing is passed through untouched, so the prompt can never eat a character:
24
+
25
+ - `Ctrl+G` or a left click on `[star]` — star now.
26
+ - `Alt+D` — never ask again.
27
+
28
+ The `[star]` button uses the shell's shared hover treatment, like the sidebar's clickable controls. Mouse reports arrive only in fullscreen mode; under tmux, zellij, and screen clicks work but hover does not, and without mouse support the chords keep working.
29
+
30
+ ## Starring
31
+
32
+ `Ctrl+G` stars **both sibling repositories**, `Gentleman-Programming/gentle-shell` and `Gentleman-Programming/gentle-ai`, right from the terminal through the authenticated `gh` account, only after that explicit keypress (each PUT is an idempotent no-op when already starred). If `gh` is missing or fails, it falls back to opening both URLs in the browser instead of dead-ending.
package/docs/voice.md CHANGED
@@ -230,8 +230,8 @@ built for their architecture (checked from the binary headers, not by loading).
230
230
  |--------|--------------------------------------------|
231
231
  | macOS arm64 | macOS 11 or newer |
232
232
  | macOS x64 | macOS 10.12 or newer |
233
- | Linux x64, glibc 2.34+ | ALSA `libasound.so.2` |
234
- | Linux arm64, glibc 2.34+ | ALSA `libasound.so.2` |
233
+ | Linux x64, glibc 2.34+ | ALSA `libasound.so.2`; under WSL, a PulseAudio server (WSLg provides one) |
234
+ | Linux arm64, glibc 2.34+ | ALSA `libasound.so.2`; under WSL, a PulseAudio server (WSLg provides one) |
235
235
  | Windows x64 | Microsoft Visual C++ runtime (`vcruntime140.dll`) |
236
236
 
237
237
  node-cpal requires Node 22 or newer, and a dictation session refuses to start
@@ -243,7 +243,10 @@ None of these targets has been verified on real hardware yet: native loading,
243
243
  library paths and microphone capture have not been executed. Linux with a glibc
244
244
  older than 2.34 is unsupported and the diagnosis names the version found.
245
245
  Windows ARM64 has no native sherpa-onnx package and is unsupported. musl Linux
246
- is unsupported. WSL is reported as unproven.
246
+ is unsupported. On a Microsoft kernel (WSL) the worker selects node-cpal's
247
+ shipped PulseAudio backend instead of ALSA, because WSLg exposes audio through
248
+ a PulseAudio server and no ALSA device; the backend's own native file is
249
+ validated before loading.
247
250
 
248
251
  ## Licenses and attribution
249
252
 
@@ -0,0 +1,46 @@
1
+ # Bounded work continuity
2
+
3
+ ## Scope and delivered guidance
4
+
5
+ This is a Shell prompt-guidance improvement, not an incident closure for #2211 or #1669. The always-on parent guidance distinguishes a recoverable failure from genuinely inaccessible proof before a bounded stop, and describes a parent-only route for explicitly authorized maintenance that a worker cannot perform. Neither rule grants permission, changes correction limits, or implements a backup or rollback operation.
6
+
7
+ | Situation | Guidance delivered to the parent |
8
+ | --- | --- |
9
+ | A test or harness check fails, but a correction and rerun remain in scope and within the existing budget | Correct and continue without asking for approval of each transition. Do not reset the budget or weaken the check. |
10
+ | The human specified one run, no retries, or diagnostic only | Honor that limit; do not propose diagnostic-only or single-attempt authorization unless requested. |
11
+ | Proof is genuinely inaccessible, consent is required, an action is denied, or the correction budget is exhausted | Stop and report the blocker. Terminal outcomes and existing bounded-stop rules remain binding; an unavailable verifier is not retried. |
12
+ | A worker cannot perform an upgrade | Only the parent may act after explicit authorization of the operation, exact scope and ownership, preservation, permitted tools, applicable fresh consent and guards, a validated backup, applicable artifact/migration validation, and a recovery path are established. |
13
+ | An authorized rollback mixes task changes and unrelated changes, even in one file | Preserve unrelated edits; remove only proven task-created helpers. Never blanket restore, reset, or clean. Ambiguous ownership or denial stops the operation. |
14
+
15
+ Broad feature approval is not destructive-operation authority. Do not reroute a denial to another worker or tool. No real maintenance, backup, migration, rollback, destructive Git operation, or model/provider operation was performed for this work.
16
+
17
+ ## Current bounded checks
18
+
19
+ On the current Windows workspace, with existing dependencies and no installation, network, provider, or model calls, the bounded verification run recorded these results:
20
+
21
+ | Command | Result |
22
+ | --- | --- |
23
+ | `node --experimental-strip-types --test tests/work-continuity-contract.test.ts` | Exit 0; 2 passed, 0 failed, 0 skipped, 0 cancelled. |
24
+ | `node --experimental-strip-types --test tests/append-system-prompt-route.test.ts` | Exit 0; 4 passed, 0 failed, 0 skipped, 0 cancelled. |
25
+ | `node --experimental-strip-types --test tests/review-contract-prompt.test.ts` | Exit 0; 12 passed, 0 failed, 0 skipped, 0 cancelled. |
26
+ | `node scripts/check-provider-contract.mjs` | Exit 0; mirror contract 1.4.0, 10 bundle entries, and 2 generated baselines verified. |
27
+
28
+ Each test command ran once. The parent repeated the provider-mirror check as a spot check; it also exited 0. These checks establish prompt delivery through Pi's `before_agent_start` event, prompt idempotence, child and named-agent exclusions, and offline provider-mirror integrity. They do not execute a model's decisions or reproduce either reported incident. Actual model behavior, including recovery, explicit-limit, upgrade, and mixed-ownership rollback decisions, remains unverified.
29
+
30
+ ## Historical preservation and later baseline evidence
31
+
32
+ The original preservation snapshot remains historical evidence, not a current conclusion: its recorded focused result was 11 instruction-delivery tests plus typecheck, provider-contract, and runtime-harness passes. Its full-suite record was 337 failures, 1 cancellation, and 331 skipped tests. The full log became unavailable, so those failures were not waived, attributed to this change, or comprehensively compared with baseline.
33
+
34
+ The snapshot's statement that no representative baseline/candidate comparisons had run was accurate at that time. Subsequent committed Windows diagnostics now provide narrower current evidence:
35
+
36
+ - [Representative baseline/candidate probes](../odd/diagnostics/work-continuity-windows/representative-baseline-candidate-probes.md) show three exact selected failures on both baseline `eff5d24694b21663095a4790b3ef15de21c290c2` and the original WIP candidate.
37
+ - [Remaining commit-path verification](../odd/diagnostics/work-continuity-windows/remaining-commit-path-verification.md) establishes a fourth selected baseline failure, then records its fixture-only portability correction and a complete-file result of 12 passed.
38
+ - [Complete-file verification](../odd/diagnostics/work-continuity-windows/complete-file-verification.md) records 17 passed for writer surfaces and 23 passed with 46 POSIX skips for bundled install; the later commit-path report supersedes its earlier 11/12 result for that file.
39
+
40
+ Those four selected cases are bounded Windows evidence only. They do not attribute all 337 historical failures, test Linux or skipped POSIX behavior, waive the unavailable full-suite evidence, or establish delivery readiness. The later fixture corrections are separate from the original Shell prompt-guidance improvement.
41
+
42
+ ## Ownership and review limits
43
+
44
+ The continuity clarification is Shell-owned and operates before existing terminal outcomes. The provider owns the mirrored Close contract; its bundle, hashes, and wording remain unchanged. A provider-owned semantic change requires separate authority.
45
+
46
+ Global RDD was on. An earlier preflight stopped with `immutable_review_transport_unsupported`; no review authority was started, no receipt exists, and review or mode was not retried. That unavailable review transport does not itself authorize or prohibit ordinary delivery; any delivery decision must use its applicable authority and evidence. Two wording advisories remain nonblocking and unproven: the sentence about not proposing diagnostic-only or single-attempt authorization, and the maintenance sentence that stops when a prerequisite is missing. No GitHub issue status was consulted, and this document does not claim publishing, delivery approval, or issue closure.
package/docs/yolo-mode.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  > 🚀 **Full speed, destructive actions still ask.** YOLO lets the agent implement, commit, push and open PRs within the already authorized task without asking each time, which suits long autonomous runs. Destructive operations still require fresh confirmation; the one exception is recursive removal of the session's own temp scratch (see [Temp scratch removal](#temp-scratch-removal)).
4
4
 
5
- Use `/gentle:yolo enable` in the interactive primary Pi TUI to stop repeated permission questions for ordinary work **within your already authorized task**. YOLO is **OFF** unless you select it or save YOLO as the user-global default. [Normal, Auto and global defaults](permission-modes.md) are managed separately from the live-session toggle. The active status and a separate editor widget both say **🚀 YOLO ON 🔥 — destructive confirmations remain**, even when Gentle Shell hides its status layout.
5
+ Use `/gentle:yolo` in the interactive primary Pi TUI to choose Normal, Auto, YOLO or Super Yolo for the current session. Select YOLO to stop repeated permission questions for ordinary work **within your already authorized task**. YOLO is **OFF** unless you select it or save YOLO as the user-global default. [Permission modes and global defaults](permission-modes.md) are managed separately from the live-session selection. The active status and a separate editor widget both say **🚀 YOLO ON 🔥 — destructive confirmations remain**, even when Gentle Shell hides its status layout.
6
6
 
7
7
  | Command | Effect |
8
8
  | --- | --- |
9
9
  | `/gentle:yolo enable` | Select YOLO for this live session and workspace/clone. |
10
10
  | `/gentle:yolo disable` | Select Normal immediately and clear the YOLO indicators; saved defaults stay unchanged. |
11
- | `/gentle:yolo status` | Show the current state without activating. |
12
- | `/gentle:yolo` | Open a menu titled **🚀 Gentle YOLO 🔥 — standing permission (current: ON\|OFF)** with `enable`, `disable` and `status`. Cancelling changes nothing. Without an interactive menu UI it behaves like `status`. |
11
+ | `/gentle:yolo status` | Show YOLO or Super Yolo when active, otherwise **YOLO OFF**, without activating. |
12
+ | `/gentle:yolo` | Choose `normal`, `auto`, `yolo` or `super-yolo` for this session. The menu shows the current mode and a short description of each choice. Cancelling changes nothing; without an interactive primary TUI it reports status instead. |
13
13
 
14
14
  Invalid arguments leave state unchanged.
15
15
 
@@ -17,7 +17,7 @@ The Session command palette also includes YOLO. Interactive selection requires a
17
17
 
18
18
  ## Super Yolo
19
19
 
20
- **💥 Super Yolo removes every permission prompt; the only line left is private material.** Select it with `/gentle:mode super-yolo` or save it for new sessions with `/gentle:mode default super-yolo`.
20
+ **💥 Super Yolo removes every permission prompt; the only line left is private material.** Select it with `/gentle:yolo` or `/gentle:mode super-yolo`, or save it for new sessions with `/gentle:mode default super-yolo`.
21
21
 
22
22
  While it is active:
23
23
 
@@ -26,7 +26,7 @@ While it is active:
26
26
  - The **sensitive-path guard stays hard-blocked**: `read`, `write` and `edit` of `.env` files, `.ssh`, keychains, `*.pem/*.key/*.p12/*.pfx`, `secrets/` directories and cloud credential files are refused in every mode, Super Yolo included.
27
27
  - Code-level catastrophic denies remain: `rm -rf /`, `rm -rf ~`, `--no-preserve-root`, `git reset --hard`, forced clean and force push are blocked without a dialog.
28
28
  - `ask_user` tools, provider consent, maintenance/recovery authorization and opaque-token decisions are never automatically answered.
29
- - The `/gentle:yolo` toggle shows **ON** while Super Yolo is active and turning it off returns to Normal. Children never inherit Super Yolo; their bounded delegation and child guards are unchanged.
29
+ - `/gentle:yolo status` identifies Super Yolo while it is active, and `/gentle:yolo disable` returns to Normal. Children never inherit Super Yolo; their bounded delegation and child guards are unchanged.
30
30
 
31
31
  Super Yolo is deliberate maximum autonomy for a workspace you accept the consequences of. The shell recognition remains lexical, not a sandbox: unrecognized script forms, custom tools and prompt injection can still reach destructive effects, and OS-level isolation remains your real containment boundary.
32
32
 
@@ -261,6 +261,7 @@ export default function askUserChoice(pi: ExtensionAPI): void {
261
261
  selectedPrefix: (text) => theme.fg("accent", text),
262
262
  selectedText: (text) => theme.fg("accent", text),
263
263
  description: (text) => theme.fg("muted", text),
264
+ fg: (_role, text) => theme.fg("warning", text),
264
265
  hoverBackground: (text) => theme.bg("toolPendingBg", text),
265
266
  }, keybindings);
266
267
  let completed = false;
@@ -288,12 +288,14 @@ export default function askUserQuestion(pi: ExtensionAPI): void {
288
288
  theme,
289
289
  keybindings,
290
290
  onComplete: (result) => done(result),
291
+ rows: () => tui?.terminal?.rows ?? 24,
291
292
  });
292
293
  // Native dock swap, never an overlay: the transcript stays scrollable
293
294
  // while the questionnaire owns focus. No `overlay` option is passed.
294
295
  const container = createNativeFullscreenInteraction({
295
296
  keyboardTarget: view,
296
297
  requestRender: () => tui.requestRender(),
298
+ mouseObserver: view.createMouseObserver(() => tui.requestRender()),
297
299
  });
298
300
  container.addChild(new DynamicBorder((text: string) => theme.fg("accent", text)));
299
301
  container.addChild(view);
@@ -1,6 +1,7 @@
1
1
  import type { ExtensionAPI, ToolCallEventResult } from "@earendil-works/pi-coding-agent";
2
2
  import { SHELL_COMMAND_TOOLS } from "../lib/background-jobs.ts";
3
3
  import { recognizeDestructiveCommands } from "../lib/destructive-command-guard.ts";
4
+ import { evaluateExecutionSurfaceTool } from "../lib/execution-surface-guard.ts";
4
5
 
5
6
  export function blockChildDestructiveCommand(command: string): ToolCallEventResult | undefined {
6
7
  if (recognizeDestructiveCommands(command).length === 0) return undefined;
@@ -13,6 +14,8 @@ export function createChildSafetyExtension(env: NodeJS.ProcessEnv = process.env)
13
14
  return (pi) => {
14
15
  if (env.GENTLE_PI_AGENTS_CHILD !== "1") return;
15
16
  pi.on("tool_call", (event) => {
17
+ const surfaceDenied = evaluateExecutionSurfaceTool(event.toolName, event.input);
18
+ if (surfaceDenied) return surfaceDenied;
16
19
  const command = (event.input as { command?: unknown }).command;
17
20
  if (!SHELL_COMMAND_TOOLS.has(event.toolName) || typeof command !== "string") return undefined;
18
21
  return blockChildDestructiveCommand(command);
@@ -78,6 +78,40 @@ const FALLBACK_INSTRUCTIONS = "Use read, grep, and find for this exploration.";
78
78
  // init is the legitimately slow first index, so only the user's signal bounds it.
79
79
  const CODEGRAPH_QUERY_TIMEOUT_MS = 180_000;
80
80
  const execFileAsync = promisify(execFile);
81
+ const GIT_ROOT_REQUIRED = "CodeGraph requires a real Git project root equal to the current workspace.";
82
+ const GIT_DIAGNOSTIC_MAX_CHARS = 1_000;
83
+
84
+ /**
85
+ * Compare two directories by file identity, not path spelling. On Windows a mapped
86
+ * drive (`X:\repo`) and the UNC path Git reports for it (`\\server\share\repo`) name
87
+ * the same directory but never compare equal as strings (#2558).
88
+ */
89
+ export function isSameDirectory(left: string, right: string): boolean {
90
+ if (left === right) return true;
91
+ try {
92
+ const a = statSync(left, { bigint: true });
93
+ const b = statSync(right, { bigint: true });
94
+ // A zero inode means the filesystem reports no identity; never treat that as a match.
95
+ return a.isDirectory() && b.isDirectory() && a.ino !== 0n && a.dev === b.dev && a.ino === b.ino;
96
+ } catch {
97
+ return false;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Keep the stable prefix and append what was compared, so a path mismatch and a Git
103
+ * refusal (for example safe.directory on a network share) are told apart (#2558).
104
+ */
105
+ function gitRootRequiredError(workspace: string, label: "git toplevel" | "git", detail: string): Error {
106
+ return new Error(`${GIT_ROOT_REQUIRED}\n workspace: ${workspace}\n ${label}: ${detail.split(/\r?\n/).filter((line) => line.trim()).join("\n ")}`);
107
+ }
108
+
109
+ /** Prefer Git's own stderr over Node's "Command failed" wrapper, bounded for the tool output. */
110
+ function gitFailureDetail(error: unknown): string {
111
+ const stderr = (error as { stderr?: unknown } | undefined)?.stderr;
112
+ const text = (typeof stderr === "string" && stderr.trim()) || (error instanceof Error ? error.message : String(error)).trim();
113
+ return text.length > GIT_DIAGNOSTIC_MAX_CHARS ? `${text.slice(0, GIT_DIAGNOSTIC_MAX_CHARS)}...` : text;
114
+ }
81
115
 
82
116
  function resolveWorkspaceCwd(cwd: string): string {
83
117
  const resolved = realpathSync(cwd);
@@ -91,16 +125,16 @@ function resolveWorkspaceCwd(cwd: string): string {
91
125
  const root = realpathSync(execFileSync("git", ["rev-parse", "--show-toplevel"], {
92
126
  cwd: resolved,
93
127
  encoding: "utf8",
94
- stdio: ["ignore", "pipe", "ignore"],
128
+ stdio: ["ignore", "pipe", "pipe"],
95
129
  windowsHide: true,
96
130
  }).trim());
97
- if (root !== resolved) {
98
- throw new Error("CodeGraph requires a real Git project root equal to the current workspace.");
131
+ if (!isSameDirectory(root, resolved)) {
132
+ throw gitRootRequiredError(resolved, "git toplevel", root);
99
133
  }
100
134
  return resolved;
101
135
  } catch (error) {
102
136
  if (error instanceof Error && /real Git project root/.test(error.message)) throw error;
103
- throw new Error("CodeGraph requires a real Git project root equal to the current workspace.");
137
+ throw gitRootRequiredError(resolved, "git", gitFailureDetail(error));
104
138
  }
105
139
  }
106
140
 
@@ -0,0 +1,99 @@
1
+ import { resolve } from "node:path";
2
+ import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
3
+ import { gentlePiConfigHome } from "../lib/agent-home.ts";
4
+ import { agentStatus, createAgentStatusStore, type AgentStatus } from "../lib/agent-status.ts";
5
+ import { activeTodoTitle, herdrAgentLabel } from "../lib/herdr-activity.ts";
6
+ import { HERDR_TASK_SUMMARY_CHANGED, resolveHerdrTaskSummarySettings } from "../lib/herdr-task-summary-policy.ts";
7
+ import { NOTIFICATION_ATTENTION_EVENT } from "../lib/notification-events.ts";
8
+ import { replayTodo } from "../lib/shell-todo.ts";
9
+
10
+ // One-second watch plus a nine-second deadline leaves room for tick alignment.
11
+ const REFRESH_MS = 9000;
12
+
13
+ interface Options {
14
+ env?: NodeJS.ProcessEnv;
15
+ gentlePiConfigHome?: string;
16
+ now?: () => number;
17
+ watch?: (tick: () => void) => () => void;
18
+ schedule?: (flush: () => void) => () => void;
19
+ store?: (home: string, session: string) => { write: (value: AgentStatus) => boolean; remove: () => void };
20
+ }
21
+ export function createAgentStatusExtension(options: Options = {}) {
22
+ return (pi: ExtensionAPI): void => {
23
+ const env = options.env ?? process.env;
24
+ if (env.GENTLE_PI_AGENTS_CHILD === "1") return;
25
+ const home = resolve(options.gentlePiConfigHome ?? gentlePiConfigHome(env));
26
+ const now = options.now ?? Date.now;
27
+ let owner: string | undefined;
28
+ let ctx: ExtensionContext;
29
+ let store: ReturnType<typeof createAgentStatusStore> | ReturnType<NonNullable<Options["store"]>> | undefined;
30
+ let working = false; let taskActive = false; let blocked = 0; let enabled = true;
31
+ let tasks: unknown = []; let last = ""; let refreshed = -Infinity;
32
+ let cancel: (() => void) | undefined; let stop: (() => void) | undefined;
33
+ let subscriptions: Array<() => void> = [];
34
+ const owns = (context: ExtensionContext) => owner !== undefined && context.sessionManager.getSessionId() === owner;
35
+ const flush = () => {
36
+ cancel = undefined;
37
+ if (!owner || !store) return;
38
+ const title = enabled && taskActive ? activeTodoTitle(tasks) : null;
39
+ const input = { agent: herdrAgentLabel(env), session: owner, pid: process.pid, cwd: ctx.cwd,
40
+ state: blocked > 0 ? "blocked" as const : working ? "working" as const : "idle" as const,
41
+ task: title ? { title } : null };
42
+ const key = JSON.stringify(input); const time = now();
43
+ if (key === last && time - refreshed < REFRESH_MS) return;
44
+ try { if (store.write(agentStatus(input, time))) { last = key; refreshed = time; } } catch { /* Retry on refresh. */ }
45
+ };
46
+ const publish = () => {
47
+ if (!owner || cancel) return;
48
+ cancel = (options.schedule ?? ((fn) => {
49
+ const timer = setTimeout(fn, 0); timer.unref(); return () => clearTimeout(timer);
50
+ }))(flush);
51
+ };
52
+ const close = () => {
53
+ cancel?.(); cancel = undefined; stop?.(); stop = undefined;
54
+ for (const unsubscribe of subscriptions) unsubscribe(); subscriptions = [];
55
+ try { store?.remove(); } catch { /* Never break shutdown. */ }
56
+ store = undefined; owner = undefined;
57
+ };
58
+ pi.on("session_start", (_event, context) => {
59
+ close();
60
+ if (context.mode !== "tui" || !context.hasUI) return;
61
+ ctx = context; owner = ctx.sessionManager.getSessionId();
62
+ if (!owner) return;
63
+ try { store = (options.store ?? createAgentStatusStore)(home, owner); } catch { owner = undefined; return; }
64
+ working = ctx.isIdle() === false; taskActive = working; blocked = 0; last = ""; refreshed = -Infinity;
65
+ tasks = replayTodo(ctx.sessionManager.getBranch()).tasks;
66
+ enabled = resolveHerdrTaskSummarySettings({ gentlePiConfigHome: home }).settings.enabled;
67
+ subscriptions = [pi.events.on(NOTIFICATION_ATTENTION_EVENT, (data: unknown) => {
68
+ const event = data as { active?: boolean } | undefined;
69
+ blocked = event?.active ? blocked + 1 : Math.max(0, blocked - 1); publish();
70
+ }), pi.events.on(HERDR_TASK_SUMMARY_CHANGED, (data: unknown) => {
71
+ const event = data as { configHome?: unknown } | undefined;
72
+ if (typeof event?.configHome !== "string" || resolve(event.configHome) !== home) return;
73
+ const next = resolveHerdrTaskSummarySettings({ gentlePiConfigHome: home });
74
+ if (next.malformed || next.readError) return;
75
+ enabled = next.settings.enabled; publish();
76
+ })];
77
+ stop = (options.watch ?? ((tick) => {
78
+ const timer = setInterval(tick, 1000); timer.unref(); return () => clearInterval(timer);
79
+ }))(() => { if (now() - refreshed >= REFRESH_MS) { cancel?.(); flush(); } });
80
+ publish();
81
+ });
82
+ pi.on("agent_start", (_event, context) => { if (owns(context)) { working = true; taskActive = true; publish(); } });
83
+ pi.on("agent_settled", (_event, context) => {
84
+ if (!owns(context)) return;
85
+ taskActive = false; if (context.isIdle() === true) working = false; publish();
86
+ });
87
+ pi.on("session_tree", (_event, context) => {
88
+ if (!owns(context)) return;
89
+ taskActive = false; tasks = replayTodo(context.sessionManager.getBranch()).tasks; publish();
90
+ });
91
+ pi.on("tool_execution_end", (event, context) => {
92
+ if (!owns(context) || event.toolName !== "todo" || event.isError) return;
93
+ const details = (event.result as { details?: { gentleTodo?: { tasks?: unknown }; error?: unknown } })?.details;
94
+ if (details && Object.hasOwn(details, "gentleTodo") && !details.error) { tasks = details.gentleTodo?.tasks; publish(); }
95
+ });
96
+ pi.on("session_shutdown", (_event, context) => { if (owns(context)) close(); });
97
+ };
98
+ }
99
+ export default createAgentStatusExtension();