gentle-pi 4.6.0 → 4.8.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 (536) hide show
  1. package/README.md +65 -55
  2. package/assets/agents/gentle-ai-explore.md +4 -3
  3. package/assets/agents/gentle-ai-verify.md +23 -6
  4. package/assets/agents/gentle-ai-worker.md +9 -6
  5. package/assets/agents/jd-fix-agent.md +1 -0
  6. package/assets/agents/jd-judge-a.md +2 -3
  7. package/assets/agents/jd-judge-b.md +2 -3
  8. package/assets/agents/review-readability.md +1 -5
  9. package/assets/agents/review-reliability.md +1 -5
  10. package/assets/agents/review-resilience.md +1 -5
  11. package/assets/agents/review-risk.md +1 -5
  12. package/assets/design-canvas/canvas-api.js +45 -0
  13. package/assets/design-canvas/canvas-boards.js +456 -0
  14. package/assets/design-canvas/canvas-boot.js +217 -0
  15. package/assets/design-canvas/canvas-checks.js +491 -0
  16. package/assets/design-canvas/canvas-comments.js +315 -0
  17. package/assets/design-canvas/canvas-compare.js +159 -0
  18. package/assets/design-canvas/canvas-events.js +75 -0
  19. package/assets/design-canvas/canvas-export.js +393 -0
  20. package/assets/design-canvas/canvas-focus.js +203 -0
  21. package/assets/design-canvas/canvas-handoffs.js +150 -0
  22. package/assets/design-canvas/canvas-i18n-es.js +392 -0
  23. package/assets/design-canvas/canvas-i18n.js +108 -0
  24. package/assets/design-canvas/canvas-layout.js +526 -0
  25. package/assets/design-canvas/canvas-menu.js +213 -0
  26. package/assets/design-canvas/canvas-messages.js +86 -0
  27. package/assets/design-canvas/canvas-minimap.js +163 -0
  28. package/assets/design-canvas/canvas-parts.js +401 -0
  29. package/assets/design-canvas/canvas-popover.js +234 -0
  30. package/assets/design-canvas/canvas-rail.js +348 -0
  31. package/assets/design-canvas/canvas-sizes.js +524 -0
  32. package/assets/design-canvas/canvas-store.js +164 -0
  33. package/assets/design-canvas/canvas-tokens.js +674 -0
  34. package/assets/design-canvas/canvas-ui.js +24 -0
  35. package/assets/design-canvas/canvas-view.js +184 -0
  36. package/assets/design-canvas/canvas.css +759 -16
  37. package/assets/design-canvas/canvas.js +2 -1497
  38. package/assets/design-canvas/index.html +117 -36
  39. package/assets/design-canvas/inspector.js +546 -16
  40. package/assets/install-wizard/wizard.js +6 -1
  41. package/assets/migrations/agent-body-history.json +40 -1
  42. package/assets/orchestrator-delegation-reference.md +10 -16
  43. package/assets/orchestrator-delegation.md +5 -5
  44. package/assets/orchestrator-full-delegation-card.md +64 -0
  45. package/assets/orchestrator-full-delegation.md +34 -0
  46. package/assets/orchestrator-memory.md +5 -5
  47. package/assets/orchestrator-prompts.md +2 -2
  48. package/assets/orchestrator-quota-recovery.md +5 -0
  49. package/assets/orchestrator-skills.md +14 -13
  50. package/assets/orchestrator-tracking.md +10 -14
  51. package/assets/orchestrator-verification.md +12 -8
  52. package/assets/orchestrator-writer.md +4 -4
  53. package/assets/orchestrator.md +21 -25
  54. package/bin/gentle-shell.mjs +292 -65
  55. package/contracts/review-provider-contract-mirror/provider-contract.lock.json +8 -9
  56. package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/manifest.json +3 -3
  57. package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/orchestration/pi.md +1 -0
  58. package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/routing/pi.md +6 -6
  59. package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/generated/provider-capabilities.baseline.json +3 -3
  60. package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/generated/provider-roles.baseline.json +1 -1
  61. package/docs/agent-status.md +61 -0
  62. package/docs/assets/brand/sponsor-banner.svg +60 -0
  63. package/docs/bundled-install.md +20 -10
  64. package/docs/delegated-verification.md +46 -8
  65. package/docs/desktop-rpc.md +1253 -0
  66. package/docs/gentle-agents-activity.md +40 -0
  67. package/docs/gentle-shell.md +91 -30
  68. package/docs/install-wizard.md +30 -21
  69. package/docs/odd-preparation-continuity.md +24 -0
  70. package/docs/permission-modes.md +17 -4
  71. package/docs/prompt-budget.md +12 -0
  72. package/docs/rdd-odd-friction-triage-2026-11-07.md +57 -0
  73. package/docs/readme-reference.md +142 -45
  74. package/docs/render-cache-performance.md +11 -1
  75. package/docs/review-coordinator.md +53 -0
  76. package/docs/review-delivery-preflight.md +22 -0
  77. package/docs/review-request-context.md +19 -0
  78. package/docs/review-windows-acl.md +18 -0
  79. package/docs/voice.md +6 -3
  80. package/docs/work-continuity.md +11 -1
  81. package/docs/yolo-mode.md +5 -5
  82. package/extensions/ask-user-choice.ts +1 -0
  83. package/extensions/ask-user-question.ts +3 -2
  84. package/extensions/child-context.ts +21 -7
  85. package/extensions/child-safety.ts +3 -0
  86. package/extensions/gentle-agent-status.ts +99 -0
  87. package/extensions/gentle-agents.ts +559 -66
  88. package/extensions/gentle-ai.ts +2001 -518
  89. package/extensions/gentle-design.ts +69 -3
  90. package/extensions/gentle-desktop-rpc.ts +143 -0
  91. package/extensions/gentle-guide.ts +3 -0
  92. package/extensions/gentle-shell.ts +398 -115
  93. package/extensions/gentle-todo.ts +66 -27
  94. package/extensions/gentle-tps.ts +48 -0
  95. package/extensions/quiet-tools.ts +38 -8
  96. package/extensions/skill-registry.ts +349 -167
  97. package/extensions/startup-banner.ts +30 -3
  98. package/lib/agent-assets.ts +30 -6
  99. package/lib/agent-profile-pin.ts +3 -3
  100. package/lib/agent-profiles.ts +160 -2
  101. package/lib/agent-status.ts +105 -0
  102. package/lib/agent-tool-overlay.ts +117 -0
  103. package/lib/agents-config.ts +93 -6
  104. package/lib/agents-history.ts +24 -5
  105. package/lib/agents-message-delivery.ts +17 -0
  106. package/lib/agents-messaging.ts +55 -7
  107. package/lib/agents-protocol.ts +15 -0
  108. package/lib/agents-report-cap.ts +115 -0
  109. package/lib/agents-runner.ts +272 -16
  110. package/lib/agents-session-transport.ts +17 -1
  111. package/lib/auto-permission-runtime.ts +1 -1
  112. package/lib/background-jobs-tools.ts +9 -4
  113. package/lib/bounded-writer-admission.ts +197 -32
  114. package/lib/card-content-policy.ts +8 -6
  115. package/lib/child-context-files.ts +21 -6
  116. package/lib/codemode-renderer.ts +1 -0
  117. package/lib/command-palette.ts +133 -17
  118. package/lib/context-backstop.ts +14 -5
  119. package/lib/delivery-conflict-markers.ts +349 -0
  120. package/lib/design-canvas-assets.ts +36 -0
  121. package/lib/design-canvas-server.ts +241 -23
  122. package/lib/design-comments.ts +94 -4
  123. package/lib/design-handoffs.ts +2 -1
  124. package/lib/design-layout.ts +125 -0
  125. package/lib/design-parts.ts +281 -0
  126. package/lib/design-system-tokens.ts +111 -0
  127. package/lib/desktop-agents-service.ts +294 -0
  128. package/lib/desktop-design-service.ts +233 -0
  129. package/lib/desktop-jobs-service.ts +263 -0
  130. package/lib/desktop-rpc-agents.ts +294 -0
  131. package/lib/desktop-rpc-config.ts +731 -0
  132. package/lib/desktop-rpc-design.ts +138 -0
  133. package/lib/desktop-rpc-jobs.ts +181 -0
  134. package/lib/desktop-rpc-permissions.ts +177 -0
  135. package/lib/desktop-rpc-profiles.ts +196 -0
  136. package/lib/desktop-rpc-usage.ts +229 -0
  137. package/lib/desktop-rpc.ts +225 -0
  138. package/lib/desktop-usage-service.ts +310 -0
  139. package/lib/destructive-command-guard.ts +236 -17
  140. package/lib/execution-surface-guard.ts +20 -0
  141. package/lib/exploration-budget.ts +4 -2
  142. package/lib/gentle-ai-binary.ts +1 -1
  143. package/lib/gentle-ai-renderer.ts +13 -1
  144. package/lib/gentle-design.ts +204 -14
  145. package/lib/gentle-shell-bundled.ts +106 -28
  146. package/lib/gentle-shell-launcher.ts +43 -8
  147. package/lib/herdr-activity.ts +14 -2
  148. package/lib/herdr-busy.ts +45 -0
  149. package/lib/hidden-tools.ts +35 -0
  150. package/lib/image-attachments.ts +33 -0
  151. package/lib/image-disk-cache.ts +137 -0
  152. package/lib/inprocess-reviewer.ts +358 -144
  153. package/lib/jobs-view.ts +198 -11
  154. package/lib/model-fallback-policy.ts +9 -0
  155. package/lib/model-routing-authority.ts +31 -4
  156. package/lib/nan-provider.ts +42 -28
  157. package/lib/native-choice-list.ts +20 -2
  158. package/lib/native-review-cli.ts +172 -20
  159. package/lib/orchestrator-discovery.ts +39 -2
  160. package/lib/orchestrator-mode-policy.ts +105 -0
  161. package/lib/questionnaire/questionnaire-view.ts +105 -12
  162. package/lib/rdd-mode-control.ts +32 -0
  163. package/lib/reply-language-anchor.ts +129 -0
  164. package/lib/request-context-placement.ts +53 -0
  165. package/lib/review-blocker.ts +92 -0
  166. package/lib/review-candidate-symlink-scan.ts +136 -0
  167. package/lib/review-candidate-view-owner.ts +81 -44
  168. package/lib/review-candidate-view.ts +11 -1
  169. package/lib/review-continuation-registry.ts +116 -0
  170. package/lib/review-coordinator.ts +407 -0
  171. package/lib/review-delivery-preflight.ts +85 -0
  172. package/lib/review-failure-facts.ts +49 -0
  173. package/lib/review-host-relay.ts +51 -11
  174. package/lib/review-integration-v2.ts +63 -4
  175. package/lib/review-relay-phase-timing.ts +45 -0
  176. package/lib/review-start-context.ts +17 -0
  177. package/lib/reviewer-stream.ts +87 -0
  178. package/lib/session-profile-freeze.ts +4 -2
  179. package/lib/shell-bar.ts +140 -58
  180. package/lib/shell-changes.ts +2 -0
  181. package/lib/shell-panel.ts +17 -3
  182. package/lib/shell-prompt.ts +16 -3
  183. package/lib/shell-sidebar-layout.ts +112 -40
  184. package/lib/shell-sidebar.ts +7 -0
  185. package/lib/shell-todo.ts +10 -3
  186. package/lib/shell-usage.ts +10 -0
  187. package/lib/verifier-admission.ts +1 -1
  188. package/lib/vim-editor-adapter.ts +9 -2
  189. package/lib/visual-customization-policy.ts +36 -16
  190. package/lib/visual-customize-view.ts +216 -21
  191. package/lib/visual-layout-preview.ts +9 -5
  192. package/lib/visual-profiles.ts +2 -2
  193. package/lib/windows-session-transport.ts +53 -2
  194. package/lib/writer-batch-admission.ts +55 -0
  195. package/lib/yolo-session-policy.ts +46 -16
  196. package/package.json +3 -2
  197. package/prompts/skill-creation.md +1 -10
  198. package/runtime/design-canvas-assets.mjs +37 -0
  199. package/runtime/gentle-ai-binary.mjs +1 -1
  200. package/runtime/gentle-shell-bundled.mjs +106 -28
  201. package/runtime/gentle-shell-launcher.mjs +42 -7
  202. package/runtime/native-review-cli.mjs +169 -17
  203. package/runtime/review-integration-v2.mjs +63 -4
  204. package/scripts/bootstrap.cmd +2 -2
  205. package/scripts/bootstrap.sh +41 -4
  206. package/scripts/build-full-delegation-card.mjs +179 -0
  207. package/scripts/build-runtime-modules.mjs +1 -0
  208. package/scripts/bundled-install.mjs +38 -8
  209. package/scripts/download-progress.mjs +68 -0
  210. package/scripts/gentle-ai-installer.mjs +41 -18
  211. package/scripts/gentle-ai-proxy.mjs +294 -0
  212. package/scripts/install-gentle-ai.mjs +14 -1
  213. package/scripts/installer-downloads.mjs +34 -8
  214. package/scripts/installer-preflight.mjs +33 -22
  215. package/scripts/installer-probes.mjs +25 -5
  216. package/scripts/installer-runner.mjs +27 -12
  217. package/scripts/installer-server.mjs +46 -16
  218. package/scripts/installer-windows.mjs +2 -2
  219. package/scripts/pi-update.mjs +166 -27
  220. package/scripts/prepare-verifier.mjs +107 -0
  221. package/scripts/render-cache-host.mjs +72 -0
  222. package/scripts/render-cache-performance-worker.mjs +5 -4
  223. package/scripts/render-cache-performance.mjs +6 -1
  224. package/scripts/run-test-suite.mjs +40 -28
  225. package/scripts/update-agent-body-history.mjs +55 -8
  226. package/scripts/verify-package-files.mjs +50 -19
  227. package/scripts/voice-worker.cjs +32 -6
  228. package/skills/branch-pr/SKILL.md +16 -16
  229. package/skills/comment-writer/SKILL.md +1 -1
  230. package/skills/design/SKILL.md +16 -13
  231. package/skills/gentle-ai/SKILL.md +7 -7
  232. package/skills/gentle-ui-design/SKILL.md +46 -0
  233. package/skills/gentle-ui-design/references/adaptive-interfaces.md +46 -0
  234. package/skills/gentle-ui-design/references/browse-and-compare.md +62 -0
  235. package/skills/gentle-ui-design/references/composition-and-feedback.md +56 -0
  236. package/skills/gentle-ui-design/references/task-and-content.md +60 -0
  237. package/skills/judgment-day/SKILL.md +2 -2
  238. package/skills/judgment-day/references/prompts-and-formats.md +1 -1
  239. package/skills/rdd-defect-workflow/SKILL.md +6 -6
  240. package/skills/skill-improver/SKILL.md +2 -2
  241. package/skills/skill-registry/SKILL.md +11 -11
  242. package/skills/tui-design/SKILL.md +1 -1
  243. package/skills/work-unit-commits/SKILL.md +10 -11
  244. package/tests/agent-home.test.ts +28 -9
  245. package/tests/agent-profiles-workflow.test.ts +163 -0
  246. package/tests/agent-prompt-diet-contract.test.ts +101 -0
  247. package/tests/agent-risk-escalation.test.ts +1 -1
  248. package/tests/agent-status.test.ts +143 -0
  249. package/tests/agent-tool-overlay-acceptance.test.ts +158 -0
  250. package/tests/agent-tool-overlay.test.ts +89 -0
  251. package/tests/agents-config.test.ts +106 -1
  252. package/tests/agents-history.test.ts +31 -0
  253. package/tests/agents-jobs-frames.test.ts +93 -0
  254. package/tests/agents-message-delivery.test.ts +36 -0
  255. package/tests/agents-prompt-lifecycle-runtime.test.ts +376 -0
  256. package/tests/agents-queries.test.ts +144 -4
  257. package/tests/agents-report-cap.test.ts +126 -0
  258. package/tests/agents-runner-drain.test.ts +193 -0
  259. package/tests/agents-runner.test.ts +215 -3
  260. package/tests/agents-session-transport.test.ts +34 -0
  261. package/tests/always-on-prompt-verdicts-contract.test.ts +188 -0
  262. package/tests/append-system-prompt-route.test.ts +12 -1
  263. package/tests/approved-text-leftovers-contract.test.ts +136 -0
  264. package/tests/artifact-language.test.ts +1 -1
  265. package/tests/ask-user-choice.test.ts +4 -3
  266. package/tests/ask-user-question.test.ts +99 -1
  267. package/tests/audit-leftovers-contract.test.ts +51 -0
  268. package/tests/auto-permission-runtime.test.ts +1 -1
  269. package/tests/autonomous-guard.test.ts +346 -10
  270. package/tests/bounded-stop-contract.test.ts +51 -3
  271. package/tests/branch-pr-skill.test.ts +10 -1
  272. package/tests/bridge-cost.test.ts +19 -4
  273. package/tests/bundled-install.test.ts +31 -6
  274. package/tests/card-content-policy.test.ts +3 -3
  275. package/tests/chained-pr-skill.test.ts +8 -6
  276. package/tests/child-context-files.test.ts +64 -8
  277. package/tests/child-safety.test.ts +11 -0
  278. package/tests/child-skills-catalog.test.ts +56 -0
  279. package/tests/codegraph-tools.test.ts +11 -5
  280. package/tests/codemode-rendering.test.ts +4 -1
  281. package/tests/command-palette.test.ts +284 -1
  282. package/tests/delegate-for-reason-contract.test.ts +32 -10
  283. package/tests/delivery-conflict-markers.test.ts +348 -0
  284. package/tests/design-canvas-all-sizes.test.ts +631 -0
  285. package/tests/design-canvas-allowlist.test.ts +32 -0
  286. package/tests/design-canvas-assets.test.ts +11 -695
  287. package/tests/design-canvas-boards.test.ts +77 -0
  288. package/tests/design-canvas-checks.test.ts +655 -0
  289. package/tests/design-canvas-compare.test.ts +79 -0
  290. package/tests/design-canvas-events.test.ts +59 -0
  291. package/tests/design-canvas-export.test.ts +1168 -0
  292. package/tests/design-canvas-focus.test.ts +113 -0
  293. package/tests/design-canvas-handoffs.test.ts +59 -0
  294. package/tests/design-canvas-i18n-review.test.ts +513 -0
  295. package/tests/design-canvas-i18n-views.test.ts +259 -0
  296. package/tests/design-canvas-i18n.test.ts +526 -0
  297. package/tests/design-canvas-inspector.test.ts +937 -0
  298. package/tests/design-canvas-layout.test.ts +1222 -0
  299. package/tests/design-canvas-minimap.test.ts +413 -0
  300. package/tests/design-canvas-modules.test.ts +90 -0
  301. package/tests/design-canvas-parts.test.ts +721 -0
  302. package/tests/design-canvas-rail.test.ts +799 -0
  303. package/tests/design-canvas-server.test.ts +855 -17
  304. package/tests/design-canvas-sizes.test.ts +548 -0
  305. package/tests/design-canvas-store.test.ts +180 -0
  306. package/tests/design-canvas-tokens.test.ts +965 -0
  307. package/tests/design-canvas-view.test.ts +299 -0
  308. package/tests/design-comments.test.ts +201 -1
  309. package/tests/design-handoffs.test.ts +20 -0
  310. package/tests/design-layout.test.ts +100 -0
  311. package/tests/design-parts.test.ts +260 -0
  312. package/tests/design-system-tokens.test.ts +215 -0
  313. package/tests/desktop-rpc-agents.test.ts +893 -0
  314. package/tests/desktop-rpc-config.test.ts +1452 -0
  315. package/tests/desktop-rpc-design.test.ts +662 -0
  316. package/tests/desktop-rpc-jobs.test.ts +796 -0
  317. package/tests/desktop-rpc-permissions.test.ts +311 -0
  318. package/tests/desktop-rpc-profiles.test.ts +140 -0
  319. package/tests/desktop-rpc-safety.test.ts +119 -0
  320. package/tests/desktop-rpc-usage.test.ts +697 -0
  321. package/tests/desktop-rpc.test.ts +252 -0
  322. package/tests/destructive-command-guard.test.ts +52 -0
  323. package/tests/devbinary/pi-host-relay.devtest.ts +149 -80
  324. package/tests/devbinary/review-session-consent.devtest.ts +84 -0
  325. package/tests/download-progress.test.ts +71 -0
  326. package/tests/engram-safety.test.ts +111 -0
  327. package/tests/execution-surface-guard.test.ts +55 -0
  328. package/tests/fixtures/devbinary/status-v9-escalated-non-blocking.captured.json +92 -0
  329. package/tests/fixtures/devbinary/status-v9-escalated-non-blocking.provenance.md +3 -0
  330. package/tests/fixtures/primary-session-prompt/gentleman.golden.md +26 -31
  331. package/tests/fixtures/proxy-tls/proxy.crt +19 -0
  332. package/tests/fixtures/proxy-tls/proxy.key +28 -0
  333. package/tests/fixtures/refusal-identity.probe.mjs +139 -0
  334. package/tests/fixtures/session-profile-v1/gentle-ai-reviewer.ts +89 -0
  335. package/tests/fixtures/session-profile-v1/replay.ts +53 -6
  336. package/tests/full-delegation-closure.test.ts +160 -0
  337. package/tests/full-delegation-notices.test.ts +76 -0
  338. package/tests/generic-agent-tools.test.ts +3 -3
  339. package/tests/gentle-agent-status.test.ts +74 -0
  340. package/tests/gentle-agents-child-jobs.test.ts +237 -0
  341. package/tests/gentle-agents.test.ts +1403 -20
  342. package/tests/gentle-ai-binary.test.ts +3 -1
  343. package/tests/gentle-ai-child-guards.test.ts +1 -0
  344. package/tests/gentle-ai-elapsed-store.test.ts +19 -0
  345. package/tests/gentle-ai-exploration-budget.test.ts +18 -2
  346. package/tests/gentle-ai-installer.test.ts +135 -51
  347. package/tests/gentle-ai-proxy.test.ts +434 -0
  348. package/tests/gentle-ai-renderer.test.ts +36 -2
  349. package/tests/gentle-ai.test.ts +233 -43
  350. package/tests/gentle-design.test.ts +386 -1
  351. package/tests/gentle-herdr-activity.test.ts +9 -6
  352. package/tests/gentle-shell-bin.test.ts +123 -0
  353. package/tests/gentle-shell-bundled.test.ts +293 -31
  354. package/tests/gentle-shell-launcher.test.ts +78 -11
  355. package/tests/gentle-shell.test.ts +1017 -146
  356. package/tests/gentle-todo.test.ts +51 -11
  357. package/tests/gentle-tps.test.ts +123 -0
  358. package/tests/gentle-ui-design-skill.test.ts +59 -0
  359. package/tests/herdr-busy.test.ts +59 -0
  360. package/tests/herdr-task-summary-policy.test.ts +8 -4
  361. package/tests/hidden-tools.test.ts +188 -0
  362. package/tests/image-disk-cache.test.ts +163 -0
  363. package/tests/independent-recovery-delivery.test.ts +97 -0
  364. package/tests/inprocess-reviewer.test.ts +249 -4
  365. package/tests/install-wizard.test.ts +27 -1
  366. package/tests/installer-downloads.test.ts +30 -1
  367. package/tests/installer-posix-bootstrap.test.ts +115 -14
  368. package/tests/installer-preflight.test.ts +54 -5
  369. package/tests/installer-probes.test.ts +146 -0
  370. package/tests/installer-runner.test.ts +79 -44
  371. package/tests/installer-server.test.ts +215 -13
  372. package/tests/installer-windows-bootstrap.test.ts +19 -1
  373. package/tests/jobs-view.test.ts +260 -6
  374. package/tests/judgment-day-severity-admission.test.ts +46 -0
  375. package/tests/lazy-module-contradictions-contract.test.ts +158 -0
  376. package/tests/maintainer/desktop-rpc.maintest.ts +632 -0
  377. package/tests/maintainer/pi-update-source.maintest.ts +48 -18
  378. package/tests/modal-mouse-boundaries.test.ts +136 -0
  379. package/tests/model-fallback-policy.test.ts +26 -7
  380. package/tests/model-routing-authority.test.ts +178 -2
  381. package/tests/nan-provider-runtime.test.ts +17 -3
  382. package/tests/nan-provider.test.ts +111 -56
  383. package/tests/native-choice-list.test.ts +77 -2
  384. package/tests/native-review-capability-contract.test.ts +17 -1
  385. package/tests/native-review-cli-nonblocking-findings.test.ts +165 -0
  386. package/tests/native-review-cli.test.ts +269 -1
  387. package/tests/native-review-parity.test.ts +24 -5
  388. package/tests/native-review-refusal-identity.test.ts +25 -0
  389. package/tests/no-self-pause-contract.test.ts +13 -2
  390. package/tests/odd-integration.test.ts +11 -3
  391. package/tests/odd-routing-canonical-ratchet.test.ts +3 -3
  392. package/tests/odd-routing-contract.test.ts +80 -28
  393. package/tests/orchestrator-budget.test.ts +35 -5
  394. package/tests/orchestrator-consultation-sdk.test.ts +32 -6
  395. package/tests/orchestrator-delegation-mode.test.ts +154 -0
  396. package/tests/orchestrator-discovery.test.ts +28 -0
  397. package/tests/orchestrator-mode-policy.test.ts +175 -0
  398. package/tests/orchestrator-prompt-budget.test.ts +13 -2
  399. package/tests/orchestrator-prompt-diet-contract.test.ts +221 -0
  400. package/tests/orchestrator-rdd-ownership.test.ts +4 -3
  401. package/tests/orchestrator-work-search.test.ts +4 -2
  402. package/tests/package-files.test.ts +25 -1
  403. package/tests/package-manifest.test.ts +16 -13
  404. package/tests/parallel-reason-contract.test.ts +6 -3
  405. package/tests/permission-allowlist.test.ts +372 -0
  406. package/tests/persona-neutral-voseo.test.ts +4 -4
  407. package/tests/persona-reply-language.test.ts +1 -1
  408. package/tests/persona-single-channel.test.ts +13 -5
  409. package/tests/pi-update-launcher.test.ts +25 -7
  410. package/tests/pi-update-source.test.ts +113 -6
  411. package/tests/pi-update.test.ts +294 -19
  412. package/tests/pnpm-workspace-config.test.ts +58 -0
  413. package/tests/pnpm-workspace-policy.test.ts +47 -0
  414. package/tests/primary-context-files.test.ts +233 -0
  415. package/tests/primary-context-three-files.test.ts +174 -0
  416. package/tests/primary-session-prompt.test.ts +13 -0
  417. package/tests/profile-pin.test.ts +29 -2
  418. package/tests/profile-tier-footer.test.ts +5 -0
  419. package/tests/profiles-panel-delegation-mode.test.ts +422 -0
  420. package/tests/provider-defect-handoff.test.ts +9 -2
  421. package/tests/questionnaire-view.test.ts +115 -0
  422. package/tests/quiet-bash-runtime.test.ts +1 -1
  423. package/tests/quiet-tool-rendering.test.ts +48 -0
  424. package/tests/rdd-aware-verification-contract.test.ts +17 -12
  425. package/tests/rdd-customize.test.ts +287 -0
  426. package/tests/rdd-mode-cache.test.ts +450 -0
  427. package/tests/rdd-mode-control.test.ts +407 -0
  428. package/tests/rdd-mode-scope-regression.test.ts +137 -0
  429. package/tests/rdd-off-independent-regression.test.ts +69 -0
  430. package/tests/rdd-status-line.test.ts +112 -1
  431. package/tests/render-cache-performance.test.ts +171 -2
  432. package/tests/reply-language-anchor-placement.test.ts +184 -0
  433. package/tests/reply-language-anchor.test.ts +189 -0
  434. package/tests/request-context-append-only.test.ts +218 -0
  435. package/tests/request-context-placement.test.ts +148 -0
  436. package/tests/review-agent-end-preflight.test.ts +80 -2
  437. package/tests/review-blocker.test.ts +193 -0
  438. package/tests/review-candidate-owner-retry.test.ts +1 -1
  439. package/tests/review-candidate-symlink-scan.test.ts +157 -0
  440. package/tests/review-candidate-view.test.ts +66 -1
  441. package/tests/review-candidate-windows-boundary.test.ts +131 -0
  442. package/tests/review-candidate-windows-probe.test.ts +63 -0
  443. package/tests/review-committed-restart-ack.test.ts +129 -0
  444. package/tests/review-continuation-registry.test.ts +107 -0
  445. package/tests/review-contract-prompt.test.ts +1 -1
  446. package/tests/review-controller-native-routing.test.ts +261 -5
  447. package/tests/review-controller-workspace-root.test.ts +230 -3
  448. package/tests/review-controller.test.ts +98 -12
  449. package/tests/review-coordinator-correction-gate.test.ts +105 -0
  450. package/tests/review-coordinator-findings.test.ts +206 -0
  451. package/tests/review-coordinator-nonblocking-scope.test.ts +169 -0
  452. package/tests/review-coordinator-runtime.test.ts +117 -0
  453. package/tests/review-coordinator.test.ts +462 -0
  454. package/tests/review-delivery-preflight.test.ts +462 -0
  455. package/tests/review-due-compaction.test.ts +31 -0
  456. package/tests/review-due-public-boundary.test.ts +26 -0
  457. package/tests/review-failure-facts.test.ts +87 -0
  458. package/tests/review-host-relay-routing.test.ts +258 -4
  459. package/tests/review-host-relay.test.ts +39 -0
  460. package/tests/review-integration-nonblocking-findings.test.ts +108 -0
  461. package/tests/review-integration-v2.test.ts +46 -3
  462. package/tests/review-json-arguments.test.ts +105 -11
  463. package/tests/review-last-event-closure.test.ts +68 -0
  464. package/tests/review-ledger-contract.test.ts +19 -40
  465. package/tests/review-loadout-rdd-off-sdk.test.ts +95 -32
  466. package/tests/review-one-call-findings.test.ts +131 -0
  467. package/tests/review-one-call-followups.test.ts +308 -0
  468. package/tests/review-one-call-reviewer-requests.test.ts +207 -0
  469. package/tests/review-one-call.test.ts +452 -0
  470. package/tests/review-owner-identity.test.ts +60 -24
  471. package/tests/review-relay-phase-timing.test.ts +128 -0
  472. package/tests/review-relay-transport-agent.test.ts +39 -2
  473. package/tests/review-reviewer-evidence.test.ts +223 -0
  474. package/tests/review-risk-assessment.test.ts +126 -8
  475. package/tests/review-run-statement-guidance-independent.test.ts +54 -0
  476. package/tests/review-session-standing-permission-controller.test.ts +53 -3
  477. package/tests/review-start-context.test.ts +19 -0
  478. package/tests/review-tool-prose-budget.test.ts +122 -0
  479. package/tests/reviewer-stream.test.ts +149 -0
  480. package/tests/run-test-suite.test.ts +122 -1
  481. package/tests/runtime-harness.mjs +4 -1
  482. package/tests/sensitive-path-tools.test.ts +181 -5
  483. package/tests/session-profile-append-controller-pi.test.ts +60 -31
  484. package/tests/session-profile-binding.test.ts +19 -1
  485. package/tests/session-profile-disk-reader-pi.test.ts +58 -16
  486. package/tests/session-profile-extension.test.ts +2 -2
  487. package/tests/session-profile-v1-compat.test.ts +35 -1
  488. package/tests/shell-bar.test.ts +186 -42
  489. package/tests/shell-panel.test.ts +50 -22
  490. package/tests/shell-prompt.test.ts +17 -0
  491. package/tests/shell-sidebar-fullscreen.test.ts +5 -5
  492. package/tests/shell-sidebar-layout.test.ts +294 -23
  493. package/tests/shell-sidebar-scroll-benchmark.test.ts +1 -1
  494. package/tests/shell-surface-transparent.test.ts +89 -0
  495. package/tests/shell-todo.test.ts +12 -0
  496. package/tests/shell-usage.test.ts +59 -10
  497. package/tests/skill-contradictions-contract.test.ts +122 -0
  498. package/tests/skill-registry-watcher.test.ts +216 -2
  499. package/tests/skill-registry.test.ts +1461 -5
  500. package/tests/startup-banner.test.ts +152 -1
  501. package/tests/startup-home-repo.test.ts +2 -0
  502. package/tests/support/design-canvas-dom.ts +369 -0
  503. package/tests/support/review-coordinator-runtime.ts +264 -0
  504. package/tests/task-size-routing-contract.test.ts +45 -12
  505. package/tests/test-strength-contract.test.ts +2 -1
  506. package/tests/todo-request-append-only.test.ts +214 -0
  507. package/tests/tool-batching-contract.test.ts +3 -1
  508. package/tests/update-agent-body-history.test.ts +138 -0
  509. package/tests/verification-tiers-contract.test.ts +229 -0
  510. package/tests/verifier-admission.test.ts +49 -0
  511. package/tests/verifier-preparation.test.ts +229 -0
  512. package/tests/verify-agent-contract.test.ts +20 -2
  513. package/tests/verify-first-launch-contract.test.ts +162 -11
  514. package/tests/vim-editor-adapter.test.ts +2 -2
  515. package/tests/visual-customization-policy.test.ts +39 -6
  516. package/tests/visual-customize-view.test.ts +573 -9
  517. package/tests/visual-layout-preview.test.ts +15 -1
  518. package/tests/visual-profiles.test.ts +11 -0
  519. package/tests/voice-worker.test.ts +73 -2
  520. package/tests/windows-session-transport.test.ts +126 -0
  521. package/tests/work-continuity-contract.test.ts +77 -6
  522. package/tests/writer-admission-messages.test.ts +232 -0
  523. package/tests/writer-batch-admission.test.ts +66 -0
  524. package/tests/writer-edit-surface-scope.test.ts +52 -20
  525. package/tests/writer-feature-document-admission.test.ts +276 -0
  526. package/tests/yolo-customize.test.ts +27 -4
  527. package/tests/yolo-mode.test.ts +62 -18
  528. package/tests/yolo-session-policy.test.ts +270 -1
  529. package/skills/_shared/review-ledger-contract.md +0 -106
  530. /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/README.md +0 -0
  531. /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/schemas/lens.schema.json +0 -0
  532. /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/schemas/refuter.schema.json +0 -0
  533. /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/schemas/targeted-validator.schema.json +0 -0
  534. /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/vectors/lens.json +0 -0
  535. /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/vectors/refuter.json +0 -0
  536. /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/vectors/targeted-validator.json +0 -0
@@ -14,6 +14,16 @@ node scripts/render-cache-performance.mjs \
14
14
 
15
15
  Default matrix: 100/1,000/5,000 tools × 100/160 columns × float/neon × pulse, scroll, typing, streaming, append, resize and theme. Four fresh-process paired replicas alternate before/after order (AB/BA/AB/BA). `--counts`, `--widths`, `--styles`, `--samples`, `--repetitions` and `--live-ms` override these settings; use small counts and samples for a smoke run. Run serially on an otherwise idle machine.
16
16
 
17
+ The same entry point is available as `pnpm perf:render-cache -- <args>`, which keeps the harness discoverable without duplicating its arguments.
18
+
19
+ ## Host requirement
20
+
21
+ `--pi-root` must be a Pi install root, not the installed package directory: it needs `package.json`, `dist/` and a `node_modules/` carrying `@earendil-works/pi-tui`, `@earendil-works/pi-ai`, `@earendil-works/pi-agent-core` and `jiti`. The command validates it before it fingerprints either worktree, and the worker re-checks it before importing the host. Both refuse anything else and name the resolved root, the package and version they actually found, and the audited version, instead of failing on a bare read error.
22
+
23
+ The audited host version is 1.2.0, the same minimum the package declares (`>=1.2.0`), so the harness fails closed on any other version. Moving the pin requires re-auditing the private frame surface against the newer host and re-running the harness there.
24
+
25
+ On Windows without Developer Mode symlink creation is unavailable, so the report-path protection test skips with an explicit reason there; it still runs wherever symlinks are permitted.
26
+
17
27
  ## Read the evidence
18
28
 
19
29
  - `runs`: raw action-plus-frame wall/CPU times, cold render, construction time, paint/projection counters, visible-screen hashes, memory snapshots and a separate live quality-timer/typing run.
@@ -25,4 +35,4 @@ Default matrix: 100/1,000/5,000 tools × 100/160 columns × float/neon × pulse,
25
35
 
26
36
  Reports must use a new path outside the source/harness/host roots; existing files and symlinks are rejected. Read only reports with a `finished` field after successful process exit: progress writes are not atomic.
27
37
 
28
- The transcript is synthetic. Deterministic cases drive the real quality interval callback with controlled time; the separate live run uses real timers and records input-to-frame latency and timer drift. The ANSI sink has no terminal emulator or real terminal-write cost. Model/network latency, other extensions and real session restore/startup are not measured. Private APIs are audited only on Pi and pi-tui 1.1.0 and fail closed on version/editor identity/output mismatches. Preserve raw data and report replicas separately; consecutive frames are correlated, so neither p95 nor a render speedup describes the entire application's latency.
38
+ The transcript is synthetic. Deterministic cases drive the real quality interval callback with controlled time; the separate live run uses real timers and records input-to-frame latency and timer drift. The ANSI sink has no terminal emulator or real terminal-write cost. Model/network latency, other extensions and real session restore/startup are not measured. Private APIs are audited only on Pi and pi-tui 1.2.0 and fail closed on version/editor identity/output mismatches. Preserve raw data and report replicas separately; consecutive frames are correlated, so neither p95 nor a render speedup describes the entire application's latency.
@@ -0,0 +1,53 @@
1
+ # Ordinary review in one call
2
+
3
+ `gentle_review_run` runs one ordinary native review in one parent tool call. It is registered in every parent session; managed child sessions never get it, and `GENTLE_PI_EXPERIMENTAL_REVIEW_COORDINATOR=0` before loading the extension opts out. The variable is no longer needed to enable it. While receipt-driven development (RDD) is off, the tool's declaration and guidance are left out of the request, so the prompt is byte-identical to a session without it, and every facade call it makes is refused by the review mode gate. It is model-only and follows the existing direct-call restriction; it is not a codemode entry point.
4
+
5
+ While RDD is not off, its guidance tells the parent to prefer `gentle_review_run` over single review operations to drive a due native review. Single operations remain for what the run result hands back (the consent answer, the correction plan through `gentle_review_capture`, status and recovery), for a review the user explicitly asks for after `not-due`, and for ASSESS after a delegated writer. Correction edits and maintenance remain explicit handoffs. The tool runs the same provider-issued transitions the mirrored review contract describes for single operations (assess, inspect, START, bound STATUS, captures, acknowledgement); it does not change that contract.
6
+
7
+ 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.
8
+
9
+ 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. The START consent stays with the host: in an interactive session the existing consent dialog may resolve it inside the call; otherwise the run returns `consent-required` with the provider envelope; the parent relays it to the human, submits only the human's explicit answer, once, with `gentle_review` `answer-consent` (the model never chooses the answer), and resumes `gentle_review_run` with the returned `lineageId`. The tool rejects consent arguments and never sends a consent answer.
10
+
11
+ 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; from a capture closure it reads only `advisory_findings` and `advisory_finding_claims`, from a STATUS correction request only its `findings`, after that request has already returned `input-required`, and from the STATUS that ends the run on a correction request or a stop only its `non_blocking_findings`, to relay them. Facade operations that require additional maintenance authorization return to the caller. The run returns `closed` after the verified acknowledgement, or stops with `not-due`, `assessment-unavailable`, `request-context-requires-fresh-review`, `consent-required`, `input-required` (a correction plan; with its findings and the review's non-blocking findings when the provider reports the non-blocking ones), `selection-required` (an intended-untracked selection; resume with `resume_input`), `stopped` (an escalated review: with its non-blocking findings), `handoff` (maintenance or another unsupported operation), `repeated-capture`, `forecast` (not displayed), `binding-drift` (lineage or target drift the coordinator detects in STATUS; when the facade rejects the drifted route first, for example in the STATUS after a reconciled reviewer group, the run returns `blocked` with `capture-route-registration-rejected`), `transition-limit`, `cancelled` (after an approved closure, with its findings) or `blocked` (an error). `forecast` is returned only when a UI host has no display callback.
12
+
13
+ The run never chooses intended untracked paths. On `selection-required` its result carries `resume_input`, the run's own inputs (selector, `lenses`, `lensesReason`, `requestContextPath`) without any untracked selection; when the caller passed no `workspaceRoot` and INSPECT reported the root it resolved (`workspace_root`), `resume_input.workspaceRoot` names that root, so a resume from a session in another workspace still reviews the one the selection was offered for; after the human or the parent chooses, resume `gentle_review_run` with `resume_input` plus `untrackedScope` (`exclude`, or `select` with `intendedUntracked`). The run then resolves the selection through INSPECT and START keeps the requested lenses and frozen request context. The run relays the facade's INSPECT envelope without its `nextStep`, which names the single `select-intended-untracked` operation: that operation starts the review with only the context a START retained, so after an INSPECT it would start without them. The envelope keeps its `selectionBinding`, whose eligible paths are what the choice is made from; the resume itself does not submit it. A single `gentle_review` INSPECT still returns its own `nextStep` unchanged.
14
+
15
+ 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.
16
+
17
+ The existing capture facade presents the model-run forecast before execution. With a UI the run displays it to the human before the reviewer runs; its collapsed line leads with the model-run count and the lenses or roles that will run. Without a UI nobody could see it before the run, so the run records it and continues. Every observed forecast is 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 changed session or disabled mode prevents the run. Accepted captures refresh bound STATUS for the next transition; failed or reoffered captures never retry. A reviewer group whose results were all admitted without a closing event returns `native-reviewer-group-status-reconciled` after the facade's own bound STATUS confirmed lineage and target and offered no further reviewer capture (for example when the findings need the refuter); the run accepts it like any capture and takes the next transition from bound STATUS, so the refuter runs in the same call. The same outcome with a `failure`, `native_failure`, `reconciliation` or `reconciliation_failure` field, a failed reconciliation, or group authority drift returns `blocked`. An older provider's self-contained refuter or validator vector (`--execute=true`) runs the role in the provider and returns `native-provider-role-captured` with `status: "captured"` instead of a closure; the run accepts it from a single capture like an admitted reviewer result and takes the next transition from bound STATUS. From a group capture, with another status or with one of those fields, it returns `blocked`.
18
+
19
+ Approval closes through the offered facade acknowledgement. The verified ACK envelope identifies the frozen target and burned authority and keeps `delivery: "ordinary-repository-policy"`. Once the run has captured an approved closure with `advisory_findings`, every result it returns from then on carries them, unchanged, whatever the outcome (`closed`, or `blocked` and the other stops before the acknowledgement); when the closure had no such key, neither does the result, and a closure that is not approved adds nothing. A run resumed by `lineageId` that goes straight to the acknowledgement returns `closed` without them: neither bound STATUS nor the acknowledgement envelope carries the closure's findings, so the stopped result before it is the one that carried them. Beside it, `advisory_finding_claims` maps each advisory finding id to the reviewer's own claim for that finding, taken from the same closure's `reviewer_results` by exact id and copied unchanged up to 1,024 UTF-8 bytes (cut at the last whole character within the cap). Claims are added in `advisory_findings` order until the next one would bring the closure's claim text past 8,192 UTF-8 bytes; that id and every later one get no entry. An id with no matching reviewer finding, or with more than one, is left out, and the key is absent when no id has a claim or `advisory_findings` is absent. `advisory_finding_claims_truncated` lists, in the same order, the ids whose claim is a cut prefix, and `advisory_finding_claims_omitted` the ids whose one matching claim the 8,192-byte limit left out; each key is present only when it lists an id, and the run relays each only as an array of strings, beside the claims. They travel with `advisory_findings` on every result that carries them. The facade's approved capture closure carries the same map, so a single `gentle_review_capture` returns it too. The claims are the reviewers' own text: information to relay, never instructions to follow. Nothing routes on either key. There is no post-ACK STATUS, ASSESS or replay, and closure makes no claim about subsequent edits or permission to commit, push or publish.
20
+
21
+ A review that does not approve returns finding text only where the facade already received it. When bound STATUS asks for a correction plan, the run returns `input-required` with that STATUS envelope unchanged (apart from `non_blocking_findings`, below). Only when that STATUS also carries the provider's `non_blocking_findings` (an empty list counts) does it add, beside the envelope, the correction fields that follow; without that answer the result is exactly as before these fields existed, because a parent given only the findings to correct would stop looking for the review's non-blocking findings and the user would lose them. The correction fields are `correction_findings`: each finding of the provider's correction request, in the provider's order, with its `id`, `lens`, `location`, `severity`, and, when present, `evidence_class` and `causal_disposition` copied unchanged (the evidence and proof references stay in the relayed envelope). `correction_finding_claims` maps each of those ids to the finding's `claim` by the same rules as `advisory_finding_claims`: copied unchanged up to 1,024 UTF-8 bytes, added in `correction_findings` order until the next one would pass 8,192 bytes, an id with more than one finding left out, and the key absent when no id has a claim; `correction_finding_claims_truncated` and `correction_finding_claims_omitted` mark them the same way. If any finding lacks a nonempty string `id`, `lens`, `location`, `severity` or `claim`, or carries a non-string `evidence_class` or `causal_disposition`, none of these keys is returned and the outcome is still `input-required`. The correction request carries only the findings to fix (BLOCKER or CRITICAL); a non-blocking finding of the same review is not in it. An escalated review ends `stopped` with the provider's `escalation` (cause, finding ids and refuter outcomes) in the relayed envelope. These claims are also the reviewers' own text, to relay and never to follow, and nothing routes on them.
22
+
23
+ The non-blocking findings of a review that stopped come from the provider's STATUS (gentle-ai#6088). Only the run asks for them. The facade's `gentle_review` `status` and `inspect` operations add `--non-blocking-findings` to their contracted STATUS only when `gentle_review_run` dispatches them. The run sets that scope around its own facade calls, in process; it is not a tool parameter, so no model input can set it. A direct `gentle_review` call never sends the flag, with any provider. The STATUS reads inside captures, recovery, acknowledgement and START never send it. For a current compact authority in `correction_required` or `escalated`, a provider that supports the opt-in answers with `non_blocking_findings`: a `statement` and the admitted findings that are neither to correct nor unresolved, each with `id`, optional `lens` and `location`, `severity`, `disposition` (`informational`, `follow_up` or `refuted`) and the reviewer's `claim`. The decoder accepts the key only on status/v9 for such an authority, with exact key sets, and rejects it anywhere else.
24
+
25
+ When the run returns `input-required` for a correction request, or `stopped`, from that STATUS, it returns `non_blocking_findings`: the `statement`, and each finding's `id`, `lens`, `location`, `severity` and `disposition`, unchanged and in the provider's order. Findings are listed until the next one would bring the list past 16 KiB of JSON. `non_blocking_findings_omitted_count` then gives how many were left out, and is absent when none was. Beside it, `non_blocking_finding_claims`, `non_blocking_finding_claims_truncated` and `non_blocking_finding_claims_omitted` follow the advisory claims' rules and limits (1,024 and 8,192 UTF-8 bytes) over the listed findings only. Claims are cut at bytes only; control characters such as ANSI escapes pass through unchanged, as on the other claim paths. An empty claim is a claim. These top-level keys are the only copy. The relayed provider record (`result.result`) leaves out `non_blocking_findings`, and only that key; everything else in it is unchanged. With 300 findings of about 1.2 KB each, the run's result text is about 29 KB.
26
+
27
+ An empty provider list is the provider's answer and is returned as `non_blocking_findings` with no findings and no claims key. When STATUS has no such key (an older provider, another state), none of these keys is returned. A malformed set (a disposition outside the three values, a missing claim, an extra key, an empty statement, `findings` that is not an array, a non-string severity) fails the strict STATUS decode like any unknown key: the facade's STATUS fails and the run ends `blocked`, with none of these keys. The run drops the keys and keeps its outcome in one case only: a set the decoder accepts but whose `statement`, `id`, `severity`, `lens` or `location` is whitespace-only. The decoder requires only a non-empty string; the run requires a non-blank one.
28
+
29
+ A provider older than the opt-in refuses the unknown flag (`invalid_request`, not started, cause exactly `flag provided but not defined: -non-blocking-findings`). The same STATUS is then repeated once without the flag, and that provider binary (path and sha256) is not sent the flag again in the same process. Any other STATUS failure is handled as before. The flag is never added to a provider-issued intended-untracked submission, and the run never reads the provider's storage.
30
+
31
+ ## Validation and rollout
32
+
33
+ ```sh
34
+ node --experimental-strip-types --test tests/review-coordinator.test.ts tests/review-coordinator-runtime.test.ts tests/review-one-call.test.ts tests/review-one-call-followups.test.ts tests/review-last-event-closure.test.ts
35
+ ```
36
+
37
+ 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.
38
+
39
+ 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.
40
+
41
+ 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.
42
+
43
+ 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.
44
+
45
+ Reviewer authentication and completion share a host deadline. Cancellation or an expired deadline prevents further dispatch, and late results are not admitted. Once a capture has returned an admitted closure with `advisory_findings`, a cancellation at any later point before the acknowledgement completes (right after that capture, while the next STATUS is in flight, or when STATUS or the acknowledgement rejects because of it) makes the run return `cancelled` with that capture's envelope without its `status` and `state` (and the closure without its `state`), since the review is approved but neither closed nor acknowledged, together with the findings, their claims and marks and the `lineage_id`, and dispatches nothing more; resuming with `lineageId` reaches the acknowledgement without them. An acknowledgement that already completed returns `closed`; a failure other than the cancellation (anything but an `AbortError` or the signal's own reason) is reported as before, even when the signal has also been aborted. Without such a closure the call is cancelled as before. A provider that ignores cancellation may continue consuming resources after the host stops waiting.
46
+
47
+ Related delivery: [issue #2881](https://github.com/Gentleman-Programming/gentle-shell/issues/2881); default registration: [odd/tasks/review-one-call.md](../odd/tasks/review-one-call.md) (gentle-ai#6062).
48
+
49
+ ## Non-blocking statement budget
50
+
51
+ The host-returned `non_blocking_findings.statement` shares the 1,024 UTF-8-byte per-claim limit. It preserves a whole-codepoint prefix and adds nested `statement_truncated: true` only when cut; otherwise the statement and absence of that marker stay unchanged. This also applies to an empty findings list. Consumers must disclose the marker rather than present the prefix as the complete provider statement.
52
+
53
+ This is derived host output, not a new field in the incoming provider schema. The 16 KiB findings-list bound, separate claim bounds, provider order, outcome and authority remain unchanged.
@@ -0,0 +1,22 @@
1
+ # Host delivery preflight
2
+
3
+ Shell's host workflow now checks recognizable `git push`, `gh pr create` and `gh pr merge` calls before execution (issue #2997). This changes Shell's previous unconditional delivery bypass. It does not restore the provider's retired receipt/gate APIs or change its byte-pinned contract artifacts. The vendored `review-integration.md` remains an exact upstream snapshot; this document describes the newer Shell-owned ordering policy.
4
+
5
+ With RDD on, select the actual delivery slice through `gentle_review` assess with explicit `baseRef` and `committedOnly: true`. `workspaceRoot` selects its worktree. The host resolves that selector to a fixed commit before assessment; a confirmed committed-range assessment retains only that base commit in the existing session continuation registry. Invalid or unresolved selections leave the existing hint unchanged. No parallel registry, cached verdict, capture/confirmation state or stored HEAD snapshot is created. The native assessment is always fresh and compares that fixed base to current HEAD, including commits made since selection. This also covers assessments invoked by the coordinator. Committed-only delivery requests omit untracked selection flags because they require no untracked inventory.
6
+
7
+ After command authorization, each foreground call gets one assessment per selected repository, even for a batch such as `git push && gh pr create`. A shell wrapper alone does not block the call. Native `reviewDue: false` preserves ordinary policy. A due review requires following the facade transitions or an exact host-recorded human decline; caller-supplied outcomes grant nothing. HEAD/base and session checks around the fresh read prevent using a result that changed during admission. A new HEAD before admission is assessed automatically, without requiring another registration cycle.
8
+
9
+ Commands that change the candidate (commit, revert, switch, rebase, etc.) must finish before its delivery can be evaluated. Delivery through the background or monitor tools still needs a separate foreground call because the job can run after its preflight is stale; background waits without delivery remain available. Missing base, cancellation and unavailable native evidence remain concrete blockers. Dynamic or implicit directory changes and recognized inline Git/environment repository redirects (such as `--git-dir`, `GIT_WORK_TREE` or `env -C`) are unresolved targets: run delivery inside its repository or use literal `cd` or `git -C`. The host cannot infer a redirected target's RDD mode from the session repository. For resolved repositories, RDD off retains ordinary command policy. The check runs no review, consent answer, acknowledgement, mode change or network lookup, and does not authorize delivery.
10
+
11
+ This covers recognizable shell invocations, including common shell wrappers and substitutions. It is not a shell sandbox or an installed Git hook. Script files, arbitrary interpreter programs and external actors are outside its detection boundary. The caller owns the actual slice, every pushed ref and the PR/remote destination: checking a local candidate does not verify an explicit remote override, prove an arbitrary PR number matches local HEAD or prevent later remote edits after auto-merge scheduling.
12
+
13
+ Literal `cd` is resolved only in a direct leading `&&` chain without other control operators, including inside a supported shell wrapper. A later `;` or other control operator also makes the directory state ambiguous if the `cd` fails. `cd` in subshells, pipelines, background syntax or ambiguous conditional flow, and any `pushd`/`popd`, make the delivery target unresolved. Split those steps and issue delivery from the intended repository or use literal `git -C`; the host does not simulate shell directory state.
14
+
15
+ Recognizable scheduling and exported routing are checked as follows:
16
+
17
+ - Shell `&` applies to its whole and/or list or compound command, not merely the last segment. With RDD on, recognized delivery such as `sleep 30 && git push &` or `git push && echo done &` must be separated into a new foreground call before assessment. Scheduling metadata also follows supported wrappers and substitutions. Background work outside the delivery's list does not by itself mark a later foreground delivery asynchronous; resolved RDD-off targets retain ordinary policy.
18
+ - Literal exports of `GIT_DIR`, `GIT_WORK_TREE`, `GIT_COMMON_DIR` or `GIT_NAMESPACE` make later delivery in that environment unresolved, including exports through same-shell `eval`. This is rejected before reading the session repository's RDD mode. Exports inside a subshell, background list or backtick substitution do not contaminate a later parent-shell delivery; a delivery within that same child environment still has an unresolved target. Separate routing changes from delivery and issue it from the intended repository. This is bounded recognition of literal shell forms, not general shell-variable evaluation.
19
+
20
+ The provider's assessment policy, including `under_budget`, remains unchanged. The companion provider report #6028 remains separate; this host change does not claim to resolve inconsistent outcomes between provider assessment and other hosts' Stop hooks.
21
+
22
+ Regression coverage uses the real Shell hook and isolated Git repositories with stubbed native answers, plus the real native client's request validation with a stubbed process adapter. It checks one assessment per delivery batch, zero added asynchronous Git reads when retaining a base (canonical selection now performs synchronous Git resolution), fixed HEAD/branch bases, foreground batching/wrappers/eval, asynchronous delivery lists, process-scoped exports, unresolved-directory rejection, candidate-changing boundaries, late HEAD/selector/session changes, cancellation, and native non-due/human-decline paths. An additional Bash probe uses an inert local function to confirm scheduling and export visibility; it executes no Git delivery. These checks do not perform a real remote push/merge or claim a complete live-model journey or production latency improvement.
@@ -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.
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
 
@@ -8,12 +8,22 @@ This is a Shell prompt-guidance improvement, not an incident closure for #2211 o
8
8
  | --- | --- |
9
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
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. |
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 automatically. The narrow human-requested quota recovery below is a separate attempt. |
12
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
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
14
 
15
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
16
 
17
+ ## Temporary verifier quota recovery
18
+
19
+ The always-on prompt points to `assets/orchestrator-quota-recovery.md`; the parent loads these conditions only when recovery is requested.
20
+
21
+ A verifier that ended on a temporary quota error without a verdict has not supplied proof or approval. Its automatic cycle stops. After availability is restored, the human can explicitly request one new bounded attempt at the missing verification for the same candidate. A general request to continue implementation is not that request.
22
+
23
+ Preserve the failed attempt and still-valid successful checks; run the missing verification rather than replaying passed suites. Before dispatch, confirm the previous child has ended and no child has uncertain status. A candidate change requires the ordinary verification decision for that changed candidate. Do not automatically wait, retry, or substitute a provider/model. Consent, actual denials, explicit one-run/no-retry limits, terminal native outcomes and exhausted native budgets remain binding; this request does not reset them.
24
+
25
+ This guidance changes no runtime quota detection, provider selection, or native review authority. The provider-owned Close text and pinned contracts remain unchanged. Delivered-instruction tests do not establish model adherence or a successful subscription-recovery journey.
26
+
17
27
  ## Current bounded checks
18
28
 
19
29
  On the current Windows workspace, with existing dependencies and no installation, network, provider, or model calls, the bounded verification run recorded these results:
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;
@@ -247,12 +247,12 @@ export default function askUserQuestion(pi: ExtensionAPI): void {
247
247
  label: "Ask User Question",
248
248
  description: "Ask one to four structured questions in a single call, each with two to four ordered options, and read the user's answers back in one result.",
249
249
  promptGuidelines: [
250
- "Use ask_user_question to collect decisions in one batch: ask one to four questions at a time, each with two to four options.",
250
+ "Use ask_user_question to collect decisions in one batch.",
251
251
  "Keep each header a short chip of at most 16 characters and each option label at most 60 characters.",
252
252
  "Add a preview to an option when the user needs to compare rich detail side-by-side with the options.",
253
253
  "Set multiSelect when the choices are not mutually exclusive.",
254
254
  "The free-text \"Type something.\" row is always available and is also how the user bails out into a normal conversation; never rely on it as a hidden escape hatch.",
255
- "Never use this tool for decisions that must not be delegated to the user.",
255
+ "Consent, maintenance authorizations and exact-token decisions use ask_user_choice, never this tool.",
256
256
  ],
257
257
  parameters: QuestionParamsSchema,
258
258
  executionMode: "sequential",
@@ -295,6 +295,7 @@ export default function askUserQuestion(pi: ExtensionAPI): void {
295
295
  const container = createNativeFullscreenInteraction({
296
296
  keyboardTarget: view,
297
297
  requestRender: () => tui.requestRender(),
298
+ mouseObserver: view.createMouseObserver(() => tui.requestRender()),
298
299
  });
299
300
  container.addChild(new DynamicBorder((text: string) => theme.fg("accent", text)));
300
301
  container.addChild(view);
@@ -1,14 +1,15 @@
1
1
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
2
  import { filterChildSessionContextFiles, type ContextFileOptions } from "../lib/child-context-files.ts";
3
- import { REQUESTED_TOOLS_ENV } from "../lib/agents-runner.ts";
3
+ import { CHILD_SKILLS_CATALOG_ENV, REQUESTED_TOOLS_ENV } from "../lib/agents-runner.ts";
4
4
  import { registerCodeGraphTool } from "./codegraph-tools.ts";
5
5
 
6
6
  // gentle-shell#1587: delegated children drop the orchestrator-only gentle-ai
7
- // managed blocks from their context files. Gentle Agents passes this file to
8
- // every child with --extension because children do not load the gentle-pi
9
- // package in the isolated Gentle Shell home. At startup it also supplies the
10
- // existing CodeGraph implementation only when explicitly requested and absent
11
- // (the full package already registers it). Outside a child session it is inert.
7
+ // managed blocks and the engram-protocol memory block from their context files
8
+ // and keep everything else. Gentle Agents passes this file to every child with
9
+ // --extension because children do not load the gentle-pi package in the
10
+ // isolated Gentle Shell home. At startup it also supplies the existing
11
+ // CodeGraph implementation only when explicitly requested and absent (the full
12
+ // package already registers it). Outside a child session it is inert.
12
13
  export function createChildContextExtension(env: NodeJS.ProcessEnv = process.env): (pi: ExtensionAPI) => void {
13
14
  return (pi) => {
14
15
  const requested = (env[REQUESTED_TOOLS_ENV] ?? "").split(",").map(name => name.trim());
@@ -22,14 +23,27 @@ export function createChildContextExtension(env: NodeJS.ProcessEnv = process.env
22
23
  // The filtered copies replace contextFiles on the same options object
23
24
  // (pi-claude-bridge rebuilds its prompt from it). This never throws,
24
25
  // keeps the original files on any error or malformed markers, and is
25
- // idempotent: already-filtered content has nothing left to remove.
26
+ // idempotent: already-filtered content has nothing left to remove. The
27
+ // engram-protocol block goes too, because gentle-engram injects its own
28
+ // memory protocol every turn; the file on disk keeps it.
26
29
  const options = (event as { systemPromptOptions?: ContextFileOptions | null } | undefined)?.systemPromptOptions;
27
30
  filterChildSessionContextFiles(options);
31
+ dropSkillsCatalog(event, env);
28
32
  return undefined;
29
33
  });
30
34
  };
31
35
  }
32
36
 
37
+ // The runner marks the children of the package-owned generic agents, whose
38
+ // parent passes exact skill paths. Emptying the loaded skills in place removes
39
+ // Pi's `<available_skills>` section under every launch form, including skills
40
+ // of a package passed with --extension, which --no-skills keeps.
41
+ function dropSkillsCatalog(event: unknown, env: NodeJS.ProcessEnv): void {
42
+ if (env[CHILD_SKILLS_CATALOG_ENV] !== "1") return;
43
+ const skills = (event as { systemPromptOptions?: { skills?: unknown } | null } | undefined)?.systemPromptOptions?.skills;
44
+ if (Array.isArray(skills)) skills.length = 0;
45
+ }
46
+
33
47
  export default function childContextExtension(pi: ExtensionAPI): void {
34
48
  createChildContextExtension()(pi);
35
49
  }
@@ -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);
@@ -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();