gentle-pi 4.8.0 → 4.9.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 (370) hide show
  1. package/README.md +60 -0
  2. package/assets/agents/gentle-ai-explore.md +1 -1
  3. package/assets/agents/gentle-ai-verify.md +1 -1
  4. package/assets/agents/gentle-ai-worker.md +10 -9
  5. package/assets/design-canvas/canvas-boards.js +22 -2
  6. package/assets/design-canvas/canvas-boot.js +3 -1
  7. package/assets/design-canvas/canvas-i18n-es.js +5 -0
  8. package/assets/design-canvas/canvas-menu.js +13 -7
  9. package/assets/design-canvas/canvas-messages.js +1 -1
  10. package/assets/design-canvas/canvas-rail.js +5 -2
  11. package/assets/design-canvas/canvas-store.js +3 -0
  12. package/assets/design-canvas/canvas-theme.js +69 -0
  13. package/assets/design-canvas/canvas.css +27 -2
  14. package/assets/design-canvas/index.html +3 -0
  15. package/assets/design-canvas/inspector.js +28 -5
  16. package/assets/design-canvas/theme-early.js +10 -0
  17. package/assets/migrations/agent-body-history.json +6 -0
  18. package/assets/orchestrator-delegation.md +1 -5
  19. package/assets/orchestrator-full-delegation-card.md +9 -13
  20. package/assets/orchestrator-full-delegation.md +2 -2
  21. package/assets/orchestrator-memory.md +2 -2
  22. package/assets/orchestrator-prompts.md +3 -31
  23. package/assets/orchestrator-tracking.md +6 -6
  24. package/assets/orchestrator-verification.md +4 -4
  25. package/assets/orchestrator-writer.md +12 -12
  26. package/assets/orchestrator.md +2 -2
  27. package/bin/gentle-shell.mjs +77 -1
  28. package/contracts/review-provider-contract-mirror/provider-contract.lock.json +7 -7
  29. package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/manifest.json +3 -3
  30. package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/orchestration/pi.md +1 -1
  31. package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/routing/pi.md +10 -10
  32. package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/generated/provider-capabilities.baseline.json +3 -3
  33. package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/generated/provider-roles.baseline.json +1 -1
  34. package/docs/assets/features/gentle-tower.png +0 -0
  35. package/docs/auto-permission-answers.md +1 -1
  36. package/docs/bundled-install.md +1 -1
  37. package/docs/delegated-verification.md +6 -4
  38. package/docs/desktop-feed.md +303 -0
  39. package/docs/desktop-rpc.md +703 -25
  40. package/docs/fast-mode.md +2 -2
  41. package/docs/gentle-shell-desktop.md +465 -0
  42. package/docs/gentle-shell.md +65 -3
  43. package/docs/images/desktop/chat.png +0 -0
  44. package/docs/images/desktop/palette.png +0 -0
  45. package/docs/images/desktop/todo.png +0 -0
  46. package/docs/install-wizard.md +1 -1
  47. package/docs/odd-preparation-continuity.md +1 -1
  48. package/docs/readme-reference.md +44 -15
  49. package/docs/work-continuity.md +10 -7
  50. package/extensions/ask-user-choice.ts +36 -18
  51. package/extensions/ask-user-question.ts +47 -8
  52. package/extensions/gentle-agents.ts +206 -37
  53. package/extensions/gentle-ai.ts +234 -24
  54. package/extensions/gentle-desktop-feed.ts +778 -0
  55. package/extensions/gentle-desktop-rpc.ts +145 -12
  56. package/extensions/gentle-herdr-desktop-status.ts +275 -0
  57. package/extensions/gentle-shell.ts +69 -7
  58. package/extensions/gentle-stats.ts +30 -1
  59. package/extensions/gentle-tower.ts +305 -0
  60. package/extensions/skill-registry.ts +13 -3
  61. package/herdr/RECIPE.md +157 -0
  62. package/herdr/keys.json +14 -0
  63. package/herdr/layouts/gentle-shell.json +202 -0
  64. package/herdr/mods/gentle-agents/icons/kind-herdr.svg +1 -0
  65. package/herdr/mods/gentle-agents/icons/kind-remote.svg +1 -0
  66. package/herdr/mods/gentle-agents/icons/kind-tui.svg +1 -0
  67. package/herdr/mods/gentle-agents/main.js +190 -0
  68. package/herdr/mods/gentle-agents/mod.json +1 -0
  69. package/herdr/mods/gentle-agents/snapshot.js +469 -0
  70. package/herdr/mods/gentle-agents/tokens.js +273 -0
  71. package/herdr/mods/gentle-chat/MINIMAL.md +69 -0
  72. package/herdr/mods/gentle-chat/actions.js +180 -0
  73. package/herdr/mods/gentle-chat/feed.js +321 -0
  74. package/herdr/mods/gentle-chat/icons/branch.svg +1 -0
  75. package/herdr/mods/gentle-chat/icons/chat.svg +1 -0
  76. package/herdr/mods/gentle-chat/icons/check.svg +1 -0
  77. package/herdr/mods/gentle-chat/icons/chev.svg +1 -0
  78. package/herdr/mods/gentle-chat/icons/clip.svg +1 -0
  79. package/herdr/mods/gentle-chat/icons/down.svg +1 -0
  80. package/herdr/mods/gentle-chat/icons/folder.svg +1 -0
  81. package/herdr/mods/gentle-chat/icons/kind-herdr.svg +1 -0
  82. package/herdr/mods/gentle-chat/icons/kind-remote.svg +1 -0
  83. package/herdr/mods/gentle-chat/icons/kind-tui.svg +1 -0
  84. package/herdr/mods/gentle-chat/icons/mark.svg +1 -0
  85. package/herdr/mods/gentle-chat/icons/send.svg +1 -0
  86. package/herdr/mods/gentle-chat/icons/shield.svg +1 -0
  87. package/herdr/mods/gentle-chat/icons/stop.svg +1 -0
  88. package/herdr/mods/gentle-chat/icons/term.svg +1 -0
  89. package/herdr/mods/gentle-chat/icons/user.svg +1 -0
  90. package/herdr/mods/gentle-chat/icons/x.svg +1 -0
  91. package/herdr/mods/gentle-chat/main.js +968 -0
  92. package/herdr/mods/gentle-chat/mod.json +1 -0
  93. package/herdr/mods/gentle-chat/session.js +212 -0
  94. package/herdr/mods/gentle-chat/snapshot.js +469 -0
  95. package/herdr/mods/gentle-chat/tokens.js +137 -0
  96. package/herdr/mods/gentle-chat/ui.js +883 -0
  97. package/herdr/mods/gentle-confirm/main.js +60 -0
  98. package/herdr/mods/gentle-confirm/mod.json +1 -0
  99. package/herdr/mods/gentle-inspector/actions.js +180 -0
  100. package/herdr/mods/gentle-inspector/icons/bolt.svg +1 -0
  101. package/herdr/mods/gentle-inspector/icons/bot.svg +1 -0
  102. package/herdr/mods/gentle-inspector/icons/check.svg +1 -0
  103. package/herdr/mods/gentle-inspector/icons/db.svg +1 -0
  104. package/herdr/mods/gentle-inspector/icons/diff.svg +1 -0
  105. package/herdr/mods/gentle-inspector/icons/jobs.svg +1 -0
  106. package/herdr/mods/gentle-inspector/icons/plug.svg +1 -0
  107. package/herdr/mods/gentle-inspector/icons/review.svg +1 -0
  108. package/herdr/mods/gentle-inspector/icons/stats.svg +1 -0
  109. package/herdr/mods/gentle-inspector/icons/stop.svg +1 -0
  110. package/herdr/mods/gentle-inspector/icons/todo.svg +1 -0
  111. package/herdr/mods/gentle-inspector/main.js +500 -0
  112. package/herdr/mods/gentle-inspector/mod.json +1 -0
  113. package/herdr/mods/gentle-inspector/snapshot.js +469 -0
  114. package/herdr/mods/gentle-inspector/tokens.js +273 -0
  115. package/herdr/mods/gentle-palette/actions.js +180 -0
  116. package/herdr/mods/gentle-palette/icons/bolt.svg +1 -0
  117. package/herdr/mods/gentle-palette/icons/bot.svg +1 -0
  118. package/herdr/mods/gentle-palette/icons/chat.svg +1 -0
  119. package/herdr/mods/gentle-palette/icons/check.svg +1 -0
  120. package/herdr/mods/gentle-palette/icons/cmd.svg +1 -0
  121. package/herdr/mods/gentle-palette/icons/diff.svg +1 -0
  122. package/herdr/mods/gentle-palette/icons/jobs.svg +1 -0
  123. package/herdr/mods/gentle-palette/icons/plus.svg +1 -0
  124. package/herdr/mods/gentle-palette/icons/review.svg +1 -0
  125. package/herdr/mods/gentle-palette/icons/search.svg +1 -0
  126. package/herdr/mods/gentle-palette/icons/shield.svg +1 -0
  127. package/herdr/mods/gentle-palette/icons/stats.svg +1 -0
  128. package/herdr/mods/gentle-palette/icons/stop.svg +1 -0
  129. package/herdr/mods/gentle-palette/icons/term.svg +1 -0
  130. package/herdr/mods/gentle-palette/icons/todo.svg +1 -0
  131. package/herdr/mods/gentle-palette/main.js +333 -0
  132. package/herdr/mods/gentle-palette/mod.json +1 -0
  133. package/herdr/mods/gentle-palette/snapshot.js +469 -0
  134. package/herdr/mods/gentle-palette/tokens.js +273 -0
  135. package/herdr/mods/gentle-pane/icons/chat.svg +1 -0
  136. package/herdr/mods/gentle-pane/icons/close.svg +1 -0
  137. package/herdr/mods/gentle-pane/icons/kind-herdr.svg +1 -0
  138. package/herdr/mods/gentle-pane/icons/kind-remote.svg +1 -0
  139. package/herdr/mods/gentle-pane/icons/kind-tui.svg +1 -0
  140. package/herdr/mods/gentle-pane/icons/split-down.svg +1 -0
  141. package/herdr/mods/gentle-pane/icons/split-right.svg +1 -0
  142. package/herdr/mods/gentle-pane/icons/term.svg +1 -0
  143. package/herdr/mods/gentle-pane/icons/unzoom.svg +1 -0
  144. package/herdr/mods/gentle-pane/icons/zoom.svg +1 -0
  145. package/herdr/mods/gentle-pane/main.js +91 -0
  146. package/herdr/mods/gentle-pane/mod.json +1 -0
  147. package/herdr/mods/gentle-pane/snapshot.js +469 -0
  148. package/herdr/mods/gentle-pane/tokens.js +273 -0
  149. package/herdr/mods/gentle-sidebar/actions.js +180 -0
  150. package/herdr/mods/gentle-sidebar/icons/gear.svg +1 -0
  151. package/herdr/mods/gentle-sidebar/icons/mark.svg +1 -0
  152. package/herdr/mods/gentle-sidebar/icons/refresh.svg +1 -0
  153. package/herdr/mods/gentle-sidebar/icons/server-plus.svg +1 -0
  154. package/herdr/mods/gentle-sidebar/main.js +171 -0
  155. package/herdr/mods/gentle-sidebar/mod.json +1 -0
  156. package/herdr/mods/gentle-sidebar/snapshot.js +469 -0
  157. package/herdr/mods/gentle-sidebar/tokens.js +273 -0
  158. package/herdr/mods/gentle-spaces/icons/kind-herdr.svg +1 -0
  159. package/herdr/mods/gentle-spaces/icons/kind-remote.svg +1 -0
  160. package/herdr/mods/gentle-spaces/icons/kind-tui.svg +1 -0
  161. package/herdr/mods/gentle-spaces/icons/monitor.svg +1 -0
  162. package/herdr/mods/gentle-spaces/icons/plus.svg +1 -0
  163. package/herdr/mods/gentle-spaces/icons/server.svg +1 -0
  164. package/herdr/mods/gentle-spaces/machines.js +31 -0
  165. package/herdr/mods/gentle-spaces/main.js +299 -0
  166. package/herdr/mods/gentle-spaces/mod.json +1 -0
  167. package/herdr/mods/gentle-spaces/snapshot.js +469 -0
  168. package/herdr/mods/gentle-spaces/tokens.js +273 -0
  169. package/herdr/mods/gentle-status/actions.js +180 -0
  170. package/herdr/mods/gentle-status/main.js +192 -0
  171. package/herdr/mods/gentle-status/mod.json +1 -0
  172. package/herdr/mods/gentle-status/snapshot.js +469 -0
  173. package/herdr/mods/gentle-status/tokens.js +273 -0
  174. package/herdr/mods/gentle-tabs/icons/close.svg +1 -0
  175. package/herdr/mods/gentle-tabs/icons/kind-herdr.svg +1 -0
  176. package/herdr/mods/gentle-tabs/icons/kind-remote.svg +1 -0
  177. package/herdr/mods/gentle-tabs/icons/kind-tui.svg +1 -0
  178. package/herdr/mods/gentle-tabs/icons/plus.svg +1 -0
  179. package/herdr/mods/gentle-tabs/icons/win-close.svg +1 -0
  180. package/herdr/mods/gentle-tabs/icons/win-max.svg +1 -0
  181. package/herdr/mods/gentle-tabs/icons/win-min.svg +1 -0
  182. package/herdr/mods/gentle-tabs/icons/win-restore.svg +1 -0
  183. package/herdr/mods/gentle-tabs/main.js +171 -0
  184. package/herdr/mods/gentle-tabs/mod.json +1 -0
  185. package/herdr/mods/gentle-tabs/snapshot.js +469 -0
  186. package/herdr/mods/gentle-tabs/tokens.js +273 -0
  187. package/herdr/mods/gentle-tokens/main.js +20 -0
  188. package/herdr/mods/gentle-tokens/mod.json +1 -0
  189. package/herdr/mods/gentle-tokens/snapshot.js +469 -0
  190. package/herdr/mods/gentle-tokens/tokens.js +273 -0
  191. package/herdr/preview.png +0 -0
  192. package/herdr/themes/gentle-shell-dark.json +33 -0
  193. package/herdr/themes/gentle-shell-light.json +34 -0
  194. package/lib/agents-protocol.ts +2 -0
  195. package/lib/agents-rpc-publisher.ts +39 -12
  196. package/lib/agents-runner.ts +1 -0
  197. package/lib/auto-permission-answers.ts +2 -1
  198. package/lib/background-jobs.ts +22 -2
  199. package/lib/bounded-writer-admission.ts +1 -1
  200. package/lib/change-diff.ts +104 -0
  201. package/lib/commit-slice-signal.ts +1 -1
  202. package/lib/design-canvas-assets.ts +2 -0
  203. package/lib/desktop-agents-service.ts +31 -10
  204. package/lib/desktop-changes-service.ts +171 -0
  205. package/lib/desktop-feed-actions.ts +804 -0
  206. package/lib/desktop-feed-answers.ts +129 -0
  207. package/lib/desktop-feed-sources.ts +184 -0
  208. package/lib/desktop-feed-stats.ts +98 -0
  209. package/lib/desktop-feed-store.ts +124 -0
  210. package/lib/desktop-feed.ts +788 -0
  211. package/lib/desktop-jobs-service.ts +34 -7
  212. package/lib/desktop-review-service.ts +187 -0
  213. package/lib/desktop-rpc-agents.ts +112 -3
  214. package/lib/desktop-rpc-changes.ts +223 -0
  215. package/lib/desktop-rpc-config-watch.ts +285 -0
  216. package/lib/desktop-rpc-config.ts +162 -8
  217. package/lib/desktop-rpc-jobs.ts +118 -9
  218. package/lib/desktop-rpc-permissions.ts +154 -3
  219. package/lib/desktop-rpc-review.ts +180 -0
  220. package/lib/desktop-rpc-session.ts +203 -0
  221. package/lib/desktop-rpc-sessions.ts +250 -0
  222. package/lib/desktop-rpc-stats.ts +187 -0
  223. package/lib/desktop-rpc-updates.ts +143 -0
  224. package/lib/desktop-rpc.ts +116 -5
  225. package/lib/desktop-session-service.ts +223 -0
  226. package/lib/desktop-sessions-service.ts +249 -0
  227. package/lib/desktop-stats-service.ts +142 -0
  228. package/lib/desktop-updates-service.ts +268 -0
  229. package/lib/gentle-shell-desktop.ts +1370 -0
  230. package/lib/gentle-shell-launcher.ts +45 -3
  231. package/lib/herdr-desktop-events.ts +40 -0
  232. package/lib/herdr-desktop-status.ts +229 -0
  233. package/lib/jobs-sidebar-state.ts +5 -0
  234. package/lib/native-review-cli.ts +7 -0
  235. package/lib/openai-fast-tier.ts +1 -0
  236. package/lib/session-profile-freeze.ts +13 -5
  237. package/lib/stats-collector.ts +56 -27
  238. package/lib/tower-actions.ts +100 -0
  239. package/lib/tower-hub.ts +73 -0
  240. package/lib/tower-launch.ts +111 -0
  241. package/lib/tower-open.ts +99 -0
  242. package/lib/tower-presence.ts +70 -0
  243. package/lib/tower-server.ts +234 -0
  244. package/lib/tower-snapshot.ts +298 -0
  245. package/lib/update-status.ts +238 -0
  246. package/lib/verifier-settle-reminder.ts +1 -1
  247. package/package.json +13 -4
  248. package/runtime/design-canvas-assets.mjs +2 -0
  249. package/runtime/gentle-shell-desktop.mjs +1371 -0
  250. package/runtime/gentle-shell-launcher.mjs +44 -2
  251. package/runtime/native-review-cli.mjs +7 -0
  252. package/runtime/tower-actions.mjs +101 -0
  253. package/runtime/tower-hub.mjs +74 -0
  254. package/runtime/tower-launch.mjs +112 -0
  255. package/runtime/tower-open.mjs +100 -0
  256. package/runtime/tower-presence.mjs +71 -0
  257. package/runtime/tower-server.mjs +234 -0
  258. package/runtime/tower-snapshot.mjs +299 -0
  259. package/scripts/build-full-delegation-card.mjs +1 -21
  260. package/scripts/build-runtime-modules.mjs +9 -0
  261. package/scripts/gentle-ai-installer.mjs +10 -10
  262. package/scripts/verify-package-files.mjs +35 -15
  263. package/skills/provider-defect-report/SKILL.md +61 -0
  264. package/skills/rdd-defect-workflow/SKILL.md +3 -3
  265. package/tests/agent-prompt-diet-contract.test.ts +2 -2
  266. package/tests/append-system-prompt-route.test.ts +16 -5
  267. package/tests/ask-user-choice.test.ts +78 -21
  268. package/tests/ask-user-question.test.ts +59 -5
  269. package/tests/auto-permission-answers.test.ts +12 -1
  270. package/tests/background-jobs.test.ts +12 -0
  271. package/tests/bounded-stop-contract.test.ts +139 -26
  272. package/tests/change-diff.test.ts +75 -0
  273. package/tests/commit-slice-signal.test.ts +3 -2
  274. package/tests/decision-routing-contract.test.ts +390 -0
  275. package/tests/delegated-key-learnings-contract.test.ts +21 -28
  276. package/tests/delivery-b-rendered-surfaces.test.ts +32 -0
  277. package/tests/design-canvas-i18n.test.ts +24 -22
  278. package/tests/design-canvas-inspector.test.ts +67 -0
  279. package/tests/design-canvas-modules.test.ts +3 -2
  280. package/tests/design-canvas-rail.test.ts +10 -10
  281. package/tests/design-canvas-store.test.ts +9 -0
  282. package/tests/design-canvas-theme.test.ts +198 -0
  283. package/tests/design-canvas-tokens.test.ts +1 -1
  284. package/tests/desktop-feed-actions-guards.test.ts +595 -0
  285. package/tests/desktop-feed-actions.test.ts +761 -0
  286. package/tests/desktop-feed-live-work.test.ts +209 -0
  287. package/tests/desktop-feed-performance.test.ts +369 -0
  288. package/tests/desktop-feed-plan-profiles.test.ts +509 -0
  289. package/tests/desktop-feed-send-prompt.test.ts +303 -0
  290. package/tests/desktop-feed-tool-summaries.test.ts +69 -0
  291. package/tests/desktop-feed.test.ts +615 -0
  292. package/tests/desktop-rpc-agents.test.ts +428 -2
  293. package/tests/desktop-rpc-changes.test.ts +608 -0
  294. package/tests/desktop-rpc-config-watch.test.ts +1159 -0
  295. package/tests/desktop-rpc-config.test.ts +11 -1
  296. package/tests/desktop-rpc-design.test.ts +11 -1
  297. package/tests/desktop-rpc-jobs.test.ts +402 -5
  298. package/tests/desktop-rpc-permissions.test.ts +11 -1
  299. package/tests/desktop-rpc-review.test.ts +678 -0
  300. package/tests/desktop-rpc-session.test.ts +642 -0
  301. package/tests/desktop-rpc-sessions.test.ts +647 -0
  302. package/tests/desktop-rpc-stats.test.ts +431 -0
  303. package/tests/desktop-rpc-updates.test.ts +525 -0
  304. package/tests/desktop-rpc-usage.test.ts +11 -1
  305. package/tests/desktop-rpc.test.ts +43 -2
  306. package/tests/fixtures/primary-session-prompt/gentleman.golden.md +11 -13
  307. package/tests/fixtures/session-profile-v1/replay.ts +4 -1
  308. package/tests/full-delegation-closure.test.ts +20 -1
  309. package/tests/gentle-agents.test.ts +519 -4
  310. package/tests/gentle-ai-binary.test.ts +1 -1
  311. package/tests/gentle-ai-installer.test.ts +52 -52
  312. package/tests/gentle-ai.test.ts +75 -16
  313. package/tests/gentle-fast.test.ts +15 -0
  314. package/tests/gentle-herdr-desktop-status.test.ts +595 -0
  315. package/tests/gentle-shell-desktop-bin.test.ts +125 -0
  316. package/tests/gentle-shell-desktop.test.ts +927 -0
  317. package/tests/gentle-shell-launcher-tower.test.ts +104 -0
  318. package/tests/gentle-shell.test.ts +3 -0
  319. package/tests/gentle-tower.test.ts +578 -0
  320. package/tests/herdr-desktop-status.test.ts +285 -0
  321. package/tests/independent-recovery-delivery.test.ts +16 -4
  322. package/tests/installer-server.test.ts +2 -2
  323. package/tests/lazy-module-contradictions-contract.test.ts +27 -4
  324. package/tests/maintainer/desktop-rpc.maintest.ts +279 -4
  325. package/tests/native-review-capability-contract.test.ts +9 -1
  326. package/tests/no-self-pause-contract.test.ts +23 -13
  327. package/tests/odd-routing-canonical-ratchet.test.ts +10 -0
  328. package/tests/odd-routing-contract.test.ts +19 -3
  329. package/tests/orchestrator-budget.test.ts +3 -1
  330. package/tests/orchestrator-prompt-budget.test.ts +2 -1
  331. package/tests/orchestrator-prompt-diet-contract.test.ts +31 -3
  332. package/tests/package-manifest.test.ts +10 -10
  333. package/tests/pi-routing-measured-values.test.ts +24 -0
  334. package/tests/primary-session-prompt.test.ts +25 -0
  335. package/tests/profile-fast-tier.test.ts +66 -1
  336. package/tests/provider-defect-handoff.test.ts +118 -100
  337. package/tests/review-contract-prompt.test.ts +2 -1
  338. package/tests/review-due-public-boundary.test.ts +2 -1
  339. package/tests/sensitive-path-tools.test.ts +138 -4
  340. package/tests/session-profile-extension.test.ts +310 -16
  341. package/tests/session-profile-freeze.test.ts +26 -0
  342. package/tests/session-profile-v1-compat.test.ts +20 -0
  343. package/tests/skill-collision-prefixes.test.ts +1 -0
  344. package/tests/skill-contradictions-contract.test.ts +5 -3
  345. package/tests/skill-registry.test.ts +54 -0
  346. package/tests/stats-collector.test.ts +109 -2
  347. package/tests/support/design-canvas-dom.ts +17 -0
  348. package/tests/task-size-routing-contract.test.ts +7 -3
  349. package/tests/tower-actions.test.ts +247 -0
  350. package/tests/tower-artifacts.test.ts +114 -0
  351. package/tests/tower-open.test.ts +97 -0
  352. package/tests/tower-presence.test.ts +175 -0
  353. package/tests/tower-server.test.ts +122 -0
  354. package/tests/tower-snapshot.test.ts +236 -0
  355. package/tests/tower-web-echo.test.ts +125 -0
  356. package/tests/tower-web-hover.test.ts +251 -0
  357. package/tests/verification-scoped-stop-contract.test.ts +32 -0
  358. package/tests/verification-tiers-contract.test.ts +5 -5
  359. package/tests/verifier-settle-reminder.test.ts +2 -2
  360. package/tests/verify-first-launch-contract.test.ts +2 -2
  361. package/tests/work-continuity-contract.test.ts +83 -17
  362. package/tests/writer-rejection-next-step.test.ts +55 -0
  363. package/tests/writer-surface-authority-contract.test.ts +158 -0
  364. /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/README.md +0 -0
  365. /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/schemas/lens.schema.json +0 -0
  366. /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/schemas/refuter.schema.json +0 -0
  367. /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/schemas/targeted-validator.schema.json +0 -0
  368. /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/vectors/lens.json +0 -0
  369. /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/vectors/refuter.json +0 -0
  370. /package/contracts/review-provider-contract-mirror/{v1.5.0 → v1.6.0}/bundle/vectors/targeted-validator.json +0 -0
@@ -3,6 +3,7 @@
3
3
  "bodies": {
4
4
  "agents/gentle-ai-explore.md": [
5
5
  "1436a9d11151b23a3b78ca42fe94658d7f074af38136b471cd4c015aa0dfff26",
6
+ "329659acf78df0dbcb1d6dbd386ee40e816bcb2ad433193628c20f12bdb31cb2",
6
7
  "389c74cc4d949acaad20f21a13606755f46a73e74f07325851d44c445b1b689b",
7
8
  "46fcf933245b9a9920839919e1501a264a9dca94298b9af7a25b6bb6c07f4fcd",
8
9
  "956418197652f430b1a4339c2912f11f3df64374751667759bdc84346f2508a0",
@@ -28,6 +29,7 @@
28
29
  "375a4c092c2a52e1d7ddd2ef68d9c374d90ae62b85c0096ce0e3374f6eb05402",
29
30
  "45d4c9c8960a4975e0ae8406fcfb8e925f4bccdbc459cc111e538be9d621b091",
30
31
  "539a7b18cf72fd6873addb50765412e36eb6582b0981accd4d5968d500acae59",
32
+ "5e6b5a44ae0c0ea6cf2ddfa4ecf5f6b906bcad4dccb0d975358589ec2428778f",
31
33
  "62b61daf53459b21dca599667e49e66a87c8e25894eb02ddff5d334fa1bd159a",
32
34
  "642de8acfc92b3d3351cc0eef70d96b2c0d836b37ba322c8426f76ae6d44f8b6",
33
35
  "655a3089deb63c94de24e741e5a50d4bcf9435a7ecefe2ca1bc9d3b5de994383",
@@ -58,10 +60,12 @@
58
60
  "0000cf664ae3d7186f861a65a0635eb738afa0c59b492906af5cb4c4e666c418",
59
61
  "0cddd8508e4f0ce34ecd06e48cfd4037e9ec5bb0fdc3d77ff40537b110b931d1",
60
62
  "1178dcf29e31ebdf81c8667c89da604f186f1056a629aa1993424fa25d90b111",
63
+ "1ac78ef187a1ce21b27f6a656eea0307eaeec0e581d633e8ddb4106fa838dc5e",
61
64
  "1bbe61ae83655f349a2a813f8a59f7ddde15f9d730d706e5b23b1d72a24eba78",
62
65
  "26feb5e62e54494799b388cbb959c8ec4f94e9530555ddde9a64dac2fbb04938",
63
66
  "42e39b8659926d6509dc42dac8beb2d1a8876e1a9507cb3f93f417e041566230",
64
67
  "4caf5a849e40aea3fdaa060a0ae1aecccf510d1440a01de1a3e356c391420b21",
68
+ "4d481fe886e76bb2c98fc163e0048eac54b5b0ee0147ff55308921d7eddd03d9",
65
69
  "5864fda40e03b74748cb3de4815440bba22a0d28bc39eff129c1fd6097ee8808",
66
70
  "6010bc8878d509ce606b48dd11ef1655565dcdeb58e54f15fceaf45a5d6d3d5b",
67
71
  "62ca04031f71b5b5defe4c2a08c51a61b8e42ae34c8988a40045c05ac587c0ee",
@@ -72,6 +76,7 @@
72
76
  "844d72d6158e7b7727ec6e26454bfe684e704e8f705f19487a689db0de441f41",
73
77
  "86063adefe9a61b8c4a9ae13a96f03704a7fd6dcf814650d5cb945fb9edc4363",
74
78
  "891abb5122bf7df043393739a3b27a197dd5c04aa82f92a4807beb878571c627",
79
+ "8d28996b00391b3f10afc617f34d241949b5f41ef41e45bbcb2496950651ab9b",
75
80
  "92547d91843f2e9642305c6607b03c90063962237ff9e11c46d3f2ff4604ebe4",
76
81
  "9c02d247e11d89fbde5975d13cb3fd8d74ded6c6b8777c91db7c083d7db0f26b",
77
82
  "9c1646f893904d1fe6da24c592b90ae214ef8e7429de840225066b2a1b204081",
@@ -82,6 +87,7 @@
82
87
  "c08804e7674aa1908baf7992c006ae641bd9ccea155506f5304f3e782a02703d",
83
88
  "c317b419b95e33b25809575a1f9508068dddd95fd7a49faa6e767f58f0cff136",
84
89
  "cd29ec67703a5b61350f247db3659c1cba3e3b42875bb0f3af43601c3a724f3e",
90
+ "d3c3ad1031d73edea785c7c915a1ed9e7fea8434c29f50c7ccbd76efaaa7753a",
85
91
  "e3751bc757d3f2d5a809d08791778e689a606ac8662614995401d0a7a2f5f227",
86
92
  "e4e19c666892c5fdc789a5555485873d7a2a644064dfec9771fcfb224dd34040",
87
93
  "e9d2a7babaef1fb3fb62133cd122914fc38c1e6b7015b307cb1542278311b121",
@@ -17,7 +17,7 @@ Before delegating, declare a subject via `orchestrator_session_id` (reference).
17
17
 
18
18
  These boundaries do not authorize children to orchestrate. Each trigger holds only when its condition truly holds; none holds by default. Inline stays within the evidence budget. When one fires, stop and delegate through the runtime's subagent mechanism before continuing; executing past a fired trigger inline is a routing defect even if the work succeeds.
19
19
 
20
- 1. **Ask:** an open product or design decision gets one focused user question; stop and wait.
20
+ 1. **Ask:** open product or design decision, routed by ODD step 3; stop and wait.
21
21
  2. **Mapping trigger (Evidence-budget rule):** read inline only when the evidence fits one parallel batch of at most 3 calls totaling ~10k tokens. Reassess cumulative discovery after each batch; never reset it. When understanding needs more or over 3 lookups, delegate one explorer returning a handoff of at most ~2k tokens with `path:line` evidence; the trigger overrides initial size, including for read-only work. Re-evaluate size after. Preparation for an already understood inline write stays inline, not further discovery.
22
22
  3. **Verification rule** (gentle-pi#661/#662, RDD-aware): only a change whose Risk line names a high-risk item (Task Size, assess `escalate` when RDD is on or unknown) gets an independent `gentle-ai-verify` run after the change's own checks, as rarely as possible; otherwise whoever made the change runs its focused test and suite inline, small tasks included. Routing: `orchestrator-verification.md`.
23
23
  4. **Track:** a large task gets the feature document, Engram mirror, `todo`, and work-unit commits (`orchestrator-memory.md`).
@@ -44,7 +44,3 @@ For a large task's bounded writes, prefer the installed package-owned `gentle-ai
44
44
  - A child must be able to do the task it is given. Check the agent's declared `tools` in `subagent_list_agents` before launching: never give a read-only explorer shell work, and never assume your own tools transfer to the child. With no qualified agent, report the capability gap; a fired trigger is never replaced by inline work.
45
45
  - Background (policy on, `subagent_run` present): omit `mode`; it returns a task id at once. End the turn and resume on its `gentle-agents.result` completion message; never sleep or poll `subagent_status`. Otherwise run in the foreground. Detail: reference.
46
46
  - Do not pass `model` to generic subagents unless the user asks.
47
-
48
- #### Key Learnings closing block
49
-
50
- Generic Explore/general worker prompts (`gentle-ai-explore`, `gentle-ai-worker`, `gentle-ai-verify`, or their native `Agent` fallback) end with: after the normal result, close the final response text with a `## Key Learnings` block of 1–5 numbered items, each a standalone factual sentence of at least 20 characters and at least 4 words; omit it when there is genuinely no reusable learning. It layers on after the Return contract without changing its fields and applies to final response text only. Engram automatically extracts and persists the items; the worker does not parse the block or call passive-capture tools; this is separate from explicit `mem_save`. Agents that must return strict JSON never receive it.
@@ -28,20 +28,20 @@ Before delegating, declare a subject via `orchestrator_session_id`.
28
28
 
29
29
  #### Allowed edit surfaces (MANDATORY)
30
30
 
31
- The bounded writer refuses to write outside the exact allowed edit surfaces and stops with `status: interaction_required` when they are missing. Every new writer launch carries the section (a continuation inherits it); after an admission rejection, repair what it names once, never relaunch the same prompt unchanged.
31
+ The writer refuses to write outside its exact surfaces and stops with `interaction_required` without them. Every new writer launch carries the section (a continuation inherits it); after an admission rejection, repair what it names once, never relaunch the same prompt unchanged, and never end the turn on one: take the next step it names.
32
32
 
33
- Before launching a bounded writer (`gentle-ai-worker`, a user-configured `worker`, or the native `Agent` fallback), derive the allowed edit surface from the delegated task — files the change must touch, plus directories where it authorizes new files — and pass it in the prompt under an `## Allowed edit surfaces` heading, in the exact-path form of `## Skills to load before work`:
33
+ Before launching any bounded writer, even the native `Agent` fallback, derive its surface from the task (files the change touches, plus directories where it authorizes new files) and pass it under `## Allowed edit surfaces`:
34
34
 
35
- - exact repository-relative paths or narrow globs, one per line; never `.` and never a bare repository root; paths containing whitespace require whole-entry backticks (for example, ``- `Directory With Spaces/note.md` ``); a list marker alone does not permit whitespace;
36
- - the section ends only at the next canonical ATX Markdown heading of any level (zero to three leading ASCII spaces, one to six `#`, then an ASCII space); every non-empty line before that heading must be a valid surface entry, so put explanatory prose under a following heading;
37
- - pre-existing untracked targets the writer may write, listed explicitly;
38
- - nothing beyond the delegated task — a surface wider than the task is the same defect as no surface at all.
35
+ - exact repository-relative paths or narrow globs, one per line; never `.` and never a bare repository root; whitespace needs whole-entry backticks (``- `My Dir/a.md` ``), not just a list marker;
36
+ - the section ends at the next heading of any level (0-3 leading ASCII spaces, 1-6 `#`, an ASCII space); every non-empty line before it must be an entry; prose goes under a later heading;
37
+ - pre-existing untracked targets it may write, listed explicitly;
38
+ - nothing beyond the task; wider is the same defect as none.
39
39
 
40
- Test scratch stays outside the worktree (`mktemp -d`), never in the repository (nor caches or `TMPDIR`); state needed inside uses an excluded path the test removes. The runtime owns session scratch; `/gentle:scratch` lists or cleans recorded clones and worktrees.
40
+ Test scratch stays outside the worktree (`mktemp -d`), never in the repository (nor caches or `TMPDIR`); inside state uses an excluded path the test removes. The runtime owns session scratch; `/gentle:scratch` lists or cleans recorded clones and worktrees.
41
41
 
42
- If the surface genuinely cannot be derived, do not launch the writer or ask the human to author paths. Derive a candidate set first — the exact paths this task would touch — and present that enumerated list as an approve/decline choice under the Lossless Blocking Prompts rules in `orchestrator-prompts.md`.
42
+ If the surface cannot be derived, do not launch or make the human author paths: offer the derived exact paths as an approve/decline choice (Lossless Blocking Prompts, `orchestrator-prompts.md`). Investigate technical route doubt; it is not a human question.
43
43
 
44
- Relay a writer's `interaction_required` payload about edit surfaces the same way: present its derived candidate paths as the choice, and add or drop paths only on the human's explicit instruction.
44
+ A writer never widens its surface; it reports exact candidate paths with reasons and awaits your replacement. Add a necessary path (test, helper) yourself, without the human, only in the authorized objective and repository, after checking ownership, existing work, risk, and concurrent writers and units; a cosmetic refactor never qualifies; an unresolved ownership or overlap conflict blocks it. New objective or scope, unapproved repository, private material, destructive or prohibited operation, missing consent, denial, or exhausted limit go to the human under existing protocols. Continue the same writer with a replacement, not a union: every still-needed path plus a concise reason, never repository-wide, no budget reset. A surface grants no repository authority or prohibited operation.
45
45
 
46
46
  <!-- gentle-pi:background-subagents -->
47
47
  #### Background Subagent Policy
@@ -58,7 +58,3 @@ When the policy is on and `subagent_run` is available:
58
58
  - Launch as many independent tasks as the work has; the runner queues beyond `max_concurrency`. Do not duplicate launches or work, and do not overlap files or topics.
59
59
  - Finished tasks persist across restarts; running ones are stopped when pi exits and must be relaunched, never claimed as recovered.
60
60
  <!-- /gentle-pi:background-subagents -->
61
-
62
- #### Key Learnings closing block
63
-
64
- Generic Explore/general worker prompts (`gentle-ai-explore`, `gentle-ai-worker`, `gentle-ai-verify`, or their native `Agent` fallback) end with: after the normal result, close the final response text with a `## Key Learnings` block of 1–5 numbered items, each a standalone factual sentence of at least 20 characters and at least 4 words; omit it when there is genuinely no reusable learning. It layers on after the Return contract without changing its fields and applies to final response text only. Engram automatically extracts and persists the items; the worker does not parse the block or call passive-capture tools; this is separate from explicit `mem_save`. Agents that must return strict JSON never receive it.
@@ -22,11 +22,11 @@ Task size decides tracking and risk, never who writes. A task is **small** when
22
22
 
23
23
  One writer per unit of behavior: its code, tests and docs together, never split across writers, and never launched while a unit it depends on still runs. Handoff, launch, edit-surface and background rules: `orchestrator-full-delegation-card.md`; tracked work: `orchestrator-tracking.md`.
24
24
 
25
- Independent units with disjoint surfaces launch together: all their `subagent_run` calls in the same assistant message or one `codemode` script, never one launch per message nor beside a sequential `todo`, `ask_user_*`, `codegraph` or `gentle_review*` (it serializes them); units needing the same file run one at a time. Fixes to one unit continue its worker (`subagent_continue`), never a new worker per fix. You own git: writers never commit, push, or run repository-wide formatters and installs.
25
+ Independent units with disjoint surfaces launch together: all their `subagent_run` calls in the same assistant message or one `codemode` script, never one launch per message nor beside a sequential `todo`, `ask_user_*`, `codegraph` or `gentle_review*` (it serializes them); units needing the same file run one at a time. In-limit fixes continue the worker (`subagent_continue`), never a new worker per fix. You own git: writers never commit, push, or run repository-wide formatters and installs.
26
26
 
27
27
  ## Mechanisms
28
28
 
29
- 1. **Ask** — open product or design decision → one focused question; stop and wait.
29
+ 1. **Ask** — open product or design decision, routed by ODD step 3; stop and wait.
30
30
  2. **Explore** — mapping beyond one bounded read batch (3 calls, ~10k tokens) or more than 3 lookups → one `gentle-ai-explore`, handoff at most ~2k tokens with `path:line` evidence, then one spot check. Reading that prepares a writer belongs in that writer's prompt.
31
31
  3. **Verify** — the writer runs the authorized checks and reports `<command>: <observed result>`, observing RED before it writes; you re-run one reported command as a spot check, and add one independent `gentle-ai-verify` only when the Risk line names a high-risk item; verification, handoffs, verifier setup failure: `orchestrator-verification.md` (`## Verifier preparation failure`).
32
32
  4. **Track** — by Task Size above.
@@ -4,7 +4,7 @@ Bind this to the parent Pi session only, on organic progress/recovery. Not alway
4
4
 
5
5
  ### Organic feature continuity
6
6
 
7
- For large authorized implementation (Task Size in the always-on core), the parent maintains `odd/tasks/<feature-name>.md` and an Engram recovery copy under topic `odd/<feature-name>/tasks`, scoped to the current project. Use a descriptive filename-safe feature name, reuse the same identity, and never overwrite another feature. Keep one feature document, not a separate plan file or topic. It is the specification subagents read by reference, so keep this fixed order, stable content first and the growing log last:
7
+ For large authorized implementation (Task Size in the always-on core), the parent maintains `odd/tasks/<feature-name>.md` and an Engram recovery copy under topic `odd/<feature-name>/tasks`, scoped to the current project. The feature document is canonical; the Engram mirror and `todo` are projections refreshed at task transitions. Use a descriptive filename-safe feature name, reuse the same identity, and never overwrite another feature. Keep one feature document, not a separate plan file or topic. It is the specification subagents read by reference, so keep this fixed order, stable content first and the growing log last:
8
8
 
9
9
  1. A header of two or three lines: objective, branch, delivery strategy, and test runner.
10
10
  2. `## Specs`: numbered `S1`..`Sn` requirements, constraints, and acceptance criteria with their checks. Quote the user's exact strings, error messages, commands, and examples verbatim, in the user's language; you may number and order them, but never summarize or reword those fragments. Do not add requirements the user never asked for; mark assumptions as assumptions.
@@ -21,7 +21,7 @@ On resume, use `mem_context`, then project/feature-scoped `mem_search`, and `mem
21
21
 
22
22
  At initial implementation or recovery after interruption or context loss, the parent reads both the actual file and full observation, reconciles them, and passes the locator, task IDs, and linked `S#`; workers read the document until `## Log` before edits. Within an intact continuation, reuse the established specs, next task, route, and applicable proof instead of restarting discovery or rebuilding the plan at every task. A progress question does not restart preparation: answer briefly with the concrete change, pending check or blocker, then continue the authorized task. New scope, external edits, stale proof, or missing context require inspecting the affected state before editing. Small work without a document still receives its authorized scope and checks.
23
23
 
24
- The existing `todo` tool is the required session/UI projection for large ODD, not a third authority. After reconciling and writing the durable file and Engram copy, create or rebuild the visible `todo` list from the same feature tasks before the first source write; after every task transition and material plan change, update both durable copies and the visible projection in the same turn; its replay or completed-list clearing must not delete or replace the durable file or Engram copy. If the projection is unavailable, record that limitation without pretending it is synchronized. When a change of direction makes tasks obsolete, mark them `dropped` in `## Tasks`, append the reason to `## Log`, and project them as `dropped` in the same turn; never mark them `done` or leave them `pending`. A dropped task never satisfies the tasks that depended on it: rework, reorder, or drop those too. When a task waits on something outside the list (a person, another team, an authorization), mark it `blocked` with a note naming what it waits for and the observable condition that unblocks it; return it to `pending` or `in_progress` once that holds, or `dropped` if abandoned. A prerequisite inside the list is ordering, not blocking: add it as a task and keep the dependent one `pending`. Small/read-only work does not acquire an ODD artifact or todo list merely because the UI can display tasks.
24
+ The visible `todo` list is required for large ODD, not a third authority. After reconciling and writing the durable file and Engram copy, create or rebuild the visible `todo` list from the same feature tasks before the first source write; after every task transition and material plan change, update both durable copies and the visible projection in the same turn; its replay or completed-list clearing must not delete or replace the durable file or Engram copy. If the projection is unavailable, record that limitation without pretending it is synchronized. When a change of direction makes tasks obsolete, mark them `dropped` in `## Tasks`, append the reason to `## Log`, and project them as `dropped` in the same turn; never mark them `done` or leave them `pending`. A dropped task never satisfies the tasks that depended on it: rework, reorder, or drop those too. When a task waits on something outside the list (a person, another team, an authorization), mark it `blocked` with a note naming what it waits for and the observable condition that unblocks it; return it to `pending` or `in_progress` once that holds, or `dropped` if abandoned. A prerequisite inside the list is ordering, not blocking: add it as a task and keep the dependent one `pending`. Small/read-only work does not acquire an ODD artifact or todo list merely because the UI can display tasks.
25
25
 
26
26
  Memory lifecycle rule (when Engram exposes lifecycle metadata/tooling):
27
27
 
@@ -1,6 +1,6 @@
1
1
  # Orchestrator — Delegation Prompts and Provider Defects (lazy-loaded)
2
2
 
3
- Bind this to the parent Pi session only. Load it for source handoffs or when a tool or subagent returns a user-facing blocking prompt or menu, or a Gentle AI provider defect appears.
3
+ Bind this to the parent Pi session only. Load it for source handoffs, a user-facing blocking prompt or menu from a tool or subagent, a decision needing Pi's ask interfaces, or a Gentle AI provider defect.
4
4
 
5
5
  ### Online Sources
6
6
 
@@ -11,38 +11,10 @@ Delegate web retrieval to the explorer's installed tools and existing permission
11
11
  When a sub-agent or tool returns a user-facing blocking prompt or menu, preserve its complete user-facing choice envelope: why input is required; every group and question in original order, including every group header; every option label and description; the selection mode; and the exact allowed-answer domain. Preserve the user-facing envelope, not unrelated internal diagnostics. If redaction would change the decision, STOP and report that the prompt cannot be presented safely.
12
12
 
13
13
  - Never summarize, abbreviate, reorder, relabel, merge, or omit choices. Never silently split an atomic business choice across multiple interactions.
14
- - Native route: For every strictly closed single-select envelope, use `ask_user_choice` only when it is available in the current interactive TUI and the complete envelope is exactly representable as one question with 2-4 ordered options. It is closed by default: do not enable `allowCustomResponse` for provider-owned consent prompts, maintenance authorizations, or any exact opaque-token decision. Enable custom responses only for ordinary prompts where free text is explicitly safe and intended. Pass each closed-envelope option's user-facing label and description plus its envelope-owned canonical option token as opaque `value`. A closed selection returns exactly one `value` as an opaque token; map it to the envelope-owned choice once, then select any envelope-owned continuation or invocation once where present. A custom selection returns free text through `customResponse`; never pass it through opaque-token mapping. Do not re-parse a closed selection's label or ordinal. `ask_user_question` is the externally owned open/free-text questionnaire: use it only for an open/free-text envelope it can represent, never for a closed domain. Otherwise fall through to the Fallback clause below. For an unresolved `gentle-ai.review-integration.consent/v3`, the selected continuation remains the exact captured provider-owned choice invocation; never synthesize it. The eligible Pi runtime may instead consume that envelope before it reaches the model through a three-action UI whose first two actions are the unchanged provider choices and whose third action is host-owned session permission. Never append that host action to the decoded or relayed provider envelope. If the runtime returns the envelope unresolved, the original two-choice fallback above applies unchanged.
14
+ - Native route: For every strictly closed single-select envelope, use `ask_user_choice` only when it is available in the current interactive TUI and the complete envelope is exactly representable as one question with 2-4 ordered options. It shows a "Type your answer" free-text entry unless closed: pass `allowCustomResponse: false` for every such envelope, including provider-owned consent prompts, maintenance authorizations, and any exact opaque-token decision. Pass each closed-envelope option's user-facing label and description plus its envelope-owned canonical option token as opaque `value`. A closed selection returns exactly one `value` as an opaque token; map it to the envelope-owned choice once, then select any envelope-owned continuation or invocation once where present. A custom selection returns free text through `customResponse`; never pass it through opaque-token mapping. Do not re-parse a closed selection's label or ordinal. `ask_user_question` is the externally owned open/free-text questionnaire: use it only for an open/free-text envelope it can represent, never for a closed domain. Otherwise fall through to the Fallback clause below. For an unresolved `gentle-ai.review-integration.consent/v3`, the selected continuation remains the exact captured provider-owned choice invocation; never synthesize it. The eligible Pi runtime may instead consume that envelope before it reaches the model through a three-action UI whose first two actions are the unchanged provider choices and whose third action is host-owned session permission. Never append that host action to the decoded or relayed provider envelope. If the runtime returns the envelope unresolved, the original two-choice fallback above applies unchanged.
15
15
  - Fallback: If a native UI is unavailable, denied, the runtime is noninteractive, or the complete envelope is oversized or otherwise unrepresentable because of question-count, option-count, or text-length limits, emit the COMPLETE choice envelope as a plain chat or terminal response. Include the required answer syntax and why the input blocks progress. Then STOP. Do not choose, default, infer, launch dependent work, or continue. Native-tool-only wording elsewhere never disables this fallback.
16
16
  - Answer validation: Accept an answer only when each response belongs to the exact allowed-answer domain presented for its group. Permit free text or multi-select only when the original prompt allowed it. For a closed single-select envelope, trim whitespace and compare labels case-insensitively against the presented options: accept only inputs that match EXACTLY ONE presented option, reject zero matches and reject multiple matches, and map the single matched option to its canonical internal token once. Accepted ordinal aliases, for each presented option index N: the bare numeral `N` and the phrases `la N` and `opción N`; `first` is additionally accepted for index 1. Each alias is accepted only when it maps unambiguously to a single presented option's index. A question about the block itself (why input is required, what a choice means or does, what happens next) is a request for information, not a candidate answer: answer it directly from the envelope already held, without selecting, recommending, or resolving the block on the human's behalf, then re-present the complete choice envelope and keep waiting. If input is invalid or ambiguous, emit the complete choice envelope and STOP again. Return a valid answer to the same blocked actor exactly once.
17
17
 
18
18
  #### Gentle AI Provider Defect Handoff (MANDATORY)
19
19
 
20
- Before losslessly relaying any blocking choice envelope, classify its semantic admissibility. **The test is what produced the failure, not what the work was doing when it happened.** Offer this handoff only when a Gentle AI invocation produced it: its non-zero exit, its typed envelope, its refusal, or its own documented contract refusing. A Gentle AI workflow merely hosting a failure is not enough, because the client runtime carries out the work: a delegated task failing inside that runtime is that runtime's defect even when our contract prescribed the task.
21
-
22
- When anything else produced it, there is no report and no handoff. That includes the model provider (context limits reached, rate limits, a refusal to process an input), the client runtime (a session that must be restarted, a crashed or empty sub-agent result, a dispatcher that never dispatched), the environment, and the user's own repository state. Do not name the component you believe is responsible, do not suggest where else to file it, and do not ask. Say plainly what blocked the work in the ordinary conversation, then continue or stop as the workflow dictates. A report system that files other projects' defects stops meaning anything when it files ours.
23
-
24
- Pending consent has no response deadline. `consent-binding-already-consumed` is a local lifecycle outcome, not a Gentle AI provider defect. An unknown consent binding is reportable only when independent evidence proves a fresh, same-session, unconsumed binding was lost. Never infer that evidence from the old combined stale-binding message.
25
-
26
- When it is ours, never offer to switch to, inspect, modify, or directly repair the Gentle AI repository from that workflow. If an upstream envelope offers direct repair, do not silently mutate it: reject it as semantically inadmissible and issue this separate orchestrator-owned handoff envelope.
27
-
28
- - Ask the user first, in the active orchestrator conversation language, for explicit consent to report the apparent defect. Present one single-select blocking envelope with exactly three semantic choices in this order. Its exact internal answer tokens are `report_and_continue`, `continue_without_reporting`, `stop_here`. Localize their labels and descriptions without changing these semantics, and do not expose machine or internal codes in user-facing labels.
29
- - On a consented report path, prepare or reuse privacy-scrubbed diagnostics. Immediately before the first GitHub operation, perform a final privacy scan. This scan precedes the definitive lookup, report creation, and occurrence comment. Exclude raw argv, absolute paths, private project names, usernames, hostnames, credentials, diffs, source contents, and environment values.
30
- 1. **Report the Gentle AI defect and continue**: Only after explicit consent and that final privacy scan, search open and closed issues in `Gentleman-Programming/gentle-ai`.
31
- - First, complete a definitive lookup across open and closed issues for an equivalent defect or canonical tracker. Equivalent means the same observable defect and affected contract, backed by concrete evidence rather than title similarity alone; a canonical tracker owns the causal class. A definitive lookup is a completed open+closed lookup with a classifiable result; incomplete, error, or unknown is not definitive.
32
- - Only a definitive lookup may branch to GitHub mutation. If no equivalent exists, create a new automated provider-defect report.
33
- - First establish that the equivalent has an identified fix verifiably contained by a published release. Then determine the installed build and derive its evidence channel only from its build string: the contract's recognized prerelease tags are `-rc.` and `-main.`; every other build is stable. That release is a relevant published fix only when it is in the installed build's evidence channel. A main-only commit, local/source build, unmerged PR, or unsupported assertion is not published-fix evidence, including for prerelease or main builds.
34
- - If the equivalent has no verifiable relevant published fix, add exactly one occurrence comment with observed evidence only on that exact canonical/equivalent issue; do not add, remove, or change any labels on it.
35
- - A fix published only to the other evidence channel is not a relevant published fix for this occurrence: add exactly one occurrence comment with observed evidence only on that exact canonical/equivalent issue and note where the fix is published. Do not recommend switching channels; channel choice is the user's. Do not add, remove, or change any labels on that issue.
36
- - If the installed build predates that release, recommend installing the published fix and reproducing; do not create or comment for that occurrence yet. If the installed build demonstrably contains the fix and still reproduces, treat it as a possible regression: reproduction on a build proven to contain that fix; comment on a suitable canonical tracker, or create a linked regression issue when that tracker is unsuitable. Never reopen automatically.
37
- - If search, comment, or creation fails, is ambiguous, incomplete, times out, lacks permission, or has an unknown outcome, perform no further GitHub mutation and no blind retry; preserve all consumer state, then execute the exact captured provider-owned decline invocation exactly once, validate it, re-enter native negotiated STATUS, and resume the already-held consumer continuation.
38
- - Confirmed creation requires the GitHub create operation to confirm a newly-created issue identity/URL. Never infer creation from output text alone. If creation fails, is ambiguous, incomplete, times out, lacks permission, or has an unknown outcome, preserve all consumer state; do not search, comment, update, or retry creation until the exact created issue identity is resolved, then use the uncertainty continuation below.
39
- - After a definitive successful report outcome, or any report-side uncertainty after stopping further GitHub mutation, execute the shared candidate-scoped continuation below.
40
- 2. **Continue without reporting**: Perform no GitHub search, write, comment, or label, and no report-side privacy scan is required. Execute the shared candidate-scoped continuation below.
41
- 3. **Stop here**: Perform no GitHub operation and no decline invocation; preserve all consumer state and STOP.
42
- - Both continue choices execute that exact captured decline invocation exactly once: use only the exact captured provider-owned `choices[answer="declined"].invocation` from the `gentle-ai.review-integration.consent/v3` envelope. Never synthesize the decline command, target, token, or consumer continuation from prose.
43
- - If the captured exact v3 decline invocation, exact target identity, or consumer continuation context is unavailable or ambiguous, fail closed with all consumer state preserved and do not run a substitute command.
44
- - On a successful exact decline, validate `action: "declined"`, `consent: "declined_this_candidate"`, and the exact target identity match; then re-enter through native negotiated STATUS, then resume the already-held consumer continuation.
45
- - The result carries no lineage or receipt; ordinary delivery is unmanaged by the candidate choice, and the next candidate asks again.
46
- - Unless the user explicitly asks, do not invoke `gentle-ai review mode disable` at clone or global scope or turn RDD off or on within this handoff.
47
- - Report observed evidence, not an unconfirmed root cause. Include or reuse sanitized version/build, OS/architecture/client, the operation shape without secrets, bounded attempts and outcomes, failure envelopes, mutation outcome, expected and actual behavior, a minimal reproduction, safe opaque reason/revision identifiers, and preserved-state evidence.
48
- - Resume after an installed published fix or an explicit maintainer-authorized, documented native recovery or reset that the runtime contract supports; then re-enter through native status. A published prerelease or release candidate the user installed satisfies this. Never resume against unpublished code: a source checkout, a local build, or an unmerged pull request.
20
+ Before losslessly relaying any blocking choice envelope, classify its semantic admissibility. **The test is what produced the failure, not what the work was doing when it happened.** When anything other than a Gentle AI invocation (its non-zero exit, typed envelope, refusal, or documented contract refusing) produced it, there is no report and no handoff: do not name the component you believe is responsible, suggest where else to file it, or ask; say plainly what blocked the work, then continue or stop as the workflow dictates. When a Gentle AI invocation produced it, load the `gentle-ai-provider-defect-report` skill by registry name and follow it before any report, consent prompt, or GitHub operation. If that skill is unavailable, file no report, open no consent prompt, and run no GitHub operation; tell the user the defect-report skill is not available and keep the evidence.
@@ -1,6 +1,6 @@
1
1
  # Orchestrator — ODD Tracking (lazy-loaded)
2
2
 
3
- Bind this to the parent Pi session only. Load it when a task is large (its resume test fails); a requested session task list alone needs no durable ODD document or memory mirror (see the always-on Task Size section).
3
+ Bind this to the parent Pi session only. Load it when a task is large (its resume test fails); a requested session task list alone needs no durable ODD document or memory mirror.
4
4
 
5
5
  ### Organic Driven Development (ODD)
6
6
 
@@ -10,7 +10,7 @@ These instructions apply to all development work. Preserve the existing direct/d
10
10
 
11
11
  Investigation, explanation, review, comparison, and proposal-only requests remain read-only: no writer, apply, or implementation artifacts. Ambiguous or conditional change intent (unclear whether a change is authorized at all) requires one clarification; stop and wait. Hedged delivery wording (the user may stop you, review commits one at a time, or pick the work up later) asks for resumable notes and separate commits, not a stop; complete every authorized task in the current turn unless the user explicitly says to wait. Research findings and automatic execution pace never authorize mutations.
12
12
 
13
- Size every task by the always-on Task Size section; small work creates no durable task artifacts, and counts of files, commands, tests, fixes, or lines never make it large. For large authorized implementation, automatically create the feature document after exploration, without a task or storage permission prompt. Follow `orchestrator-memory.md` for the file and full Engram recovery copy, automatic updates, truthful checkoffs, and resume. Keep the parent responsible for reconciliation; bounded workers receive the document locator, task IDs, linked `S#`, authorized scope and checks, not authority over unrelated tasks; they read the document until `## Log` before edits and report which `S#` they covered. A rejected or resumed handoff is repaired and resent with the same content, never shortened. Reproduce a user-reported failure by running the reported example before deciding it already works; reading code is not reproduction. Close gate: before the final answer, if any tracked task in the feature document or `todo` is still pending, continue it or quote the exact user sentence that orders the stop. One **Needs your decision** result naming the open blockers or missing proof is also a valid stop.
13
+ Size every task by the always-on Task Size section; small work creates no durable task artifacts, and file, command, test, fix, or line counts never make it large. For large authorized implementation, automatically create the feature document after exploration, without a task or storage permission prompt. Follow `orchestrator-memory.md` for the file and Engram recovery copy, automatic updates, truthful checkoffs, and resume. The parent owns reconciliation; bounded workers receive the document locator, task IDs, linked `S#`, authorized scope and checks, not unrelated authority; they read the document until `## Log` before edits and report which `S#` they covered. A rejected or resumed handoff is repaired and resent intact, never shortened. Reproduce a user-reported failure by running its example first; reading code is not reproduction. Close gate: continue every pending tracked task in the document or `todo` unless it waits on a launched child; an already-decided denial, missing consent, or exhausted limit applies to that affected work; the user stopped only that work; or a genuine human decision is open. Unrelated runnable authorized work continues while blockers or missing proof are reported.
14
14
 
15
15
  Use about 400 authored changed lines per ODD task only as a planning heuristic, counting additions plus deletions. Keep the smallest coherent behavior with its tests and docs. This is not a task acceptance criterion, hard cap, counter-trigger, automatic stop, forced split, or RDD trigger. If the correct clear solution naturally exceeds it, briefly explain why and continue without size-only rework loops. Never delete spaces, blank lines, or comments for cosmetic line savings; never omit tests, minify, add gratuitous abstractions, or split artificially to fit the heuristic. Forward this same advisory-only instruction when delegating tasks to subagents. The delivery budget below reads the accumulated branch, not this per-task heuristic. Existing PR size gates remain unchanged; follow repository policy. A user's line limit is a ceiling, never an exact-count gate; never invent acceptance gates the user did not ask for.
16
16
 
@@ -34,16 +34,16 @@ Run applicable functional checks per task; a TODO checkbox never triggers a revi
34
34
 
35
35
  #### Signaling the ODD phase to the Gentle prompt
36
36
 
37
- Cadence and use: the always-on Phase reporting line. Call `gentle_odd_phase` with `clear` only to leave the current phase before its turn ends.
37
+ Cadence: the always-on Phase reporting line; `gentle_odd_phase` is an optional refinement, never required per phase. Call `gentle_odd_phase` with `clear` only to leave the current phase before its turn ends.
38
38
 
39
39
  When RDD is enabled, the injected Gentle AI contract governs native review start, execution and consent; this module adds only assessment and commit boundaries. After each work-unit commit, assess it with `gentle_review` `{"operation":"assess"}` and `{"baseRef":"<last reviewed boundary>","committedOnly":true}`; start at the branch point; each reviewed boundary is the next base. A not-due `passive` commit needs no review and the boundary advances; `under_budget` stays pending in the slice until a later commit reaches the budget. Before a high-risk unit, assess any pending `under_budget` slice. Review the pending slice only when `reviewDue` is true or the user explicitly asks; otherwise preserve the pending boundary and proceed without review. A task boundary neither authorizes review nor advances a reviewed boundary. If assessment fails or is unavailable, report missing assessment proof; never infer `reviewDue`, construct a preflight transition, lower the tier or infer low risk. Record each commit's assessed tier, outcome (not due, granted, declined, unavailable) and `reviewDueReason`. Never replace assessment with model judgment, task size or defect severity. Raise known high-risk candidates with the assess `escalate` field (`orchestrator-verification.md`); never lower one. When RDD is disabled, do not start or prompt for RDD; ordinary checks remain. A checklist or assumption challenge never enables RDD, replaces its refuter, or answers consent.
40
40
 
41
- Delivery follows work units. At feature-document creation, forecast authored changed lines (additions plus deletions, generated files excluded) from the task list, and keep a running count from work-unit commits. Choose one delivery strategy per feature: `ask-on-risk` (default), `auto-chain`, `single-pr`, or `exception-ok`. When the forecast or the running count exceeds about 400 authored changed lines, apply the chosen strategy before the next commit: `ask-on-risk` asks once using the ordered oversized-delivery menu; `auto-chain` asks only for a missing chain strategy and slices automatically with a cached choice. When a choice is needed on either chaining path, offer exactly these three semantic outcomes in order:
41
+ Delivery follows work units. At feature-document creation, forecast authored changed lines (additions plus deletions, generated files excluded) from the task list, and keep a running count from work-unit commits. Choose one delivery strategy per feature: `ask-on-risk` (default), `auto-chain`, `single-pr`, or `exception-ok`. Past about 400 authored changed lines (forecast or running count), record the slice boundary in the feature document; apply the chosen strategy only when the user asks to publish (push or PR), never before a local work-unit commit. Local work-unit commits stay separate from publishing. `ask-on-risk` asks once using the ordered oversized-delivery menu; `auto-chain` asks only for a missing chain strategy and slices automatically with a cached choice. When a choice is needed on either chaining path, offer exactly these three semantic outcomes in order:
42
42
 
43
43
  1. **Feature/tracker branch chain** — `chain_strategy=feature-branch-chain`.
44
44
  2. **Verified default/main branch chain** — `chain_strategy=stacked-to-main`; verify the destination's default branch rather than assuming its name.
45
45
  3. **One single PR — least recommended** — `delivery_strategy=single-pr`.
46
46
 
47
- Generate the complete user-facing question and every option label, description, and recommendation marker in the active user's conversation language (English for an English user, Spanish for a Spanish user, etc.). Machine strategy tokens remain unchanged and untranslated. These English examples are illustrative and localizable, not mandatory copy.
47
+ Generate the complete user-facing question and every option label, description, and recommendation marker in the active user's conversation language. Machine strategy tokens remain unchanged and untranslated. These English examples are illustrative and localizable, not mandatory copy.
48
48
 
49
- The third choice overrides the pending chaining path: clear the chain choice as inapplicable and suppress later chain prompts. `single-pr` is not a `chain_strategy` token; do not automatically select `exception-ok`. Explain that an oversized single PR increases reviewer load, delays feedback, and couples rollback; least recommended applies only to this oversized menu, not focused ≤400-line single PRs. Follow the destination repository's documented contribution/size policy: `size:exception` is a Gentle-owned repository policy, not a universal label requirement. Never request or add it for generic users unless their destination policy uses it; preserve required maintainer acceptance and protected-label authorization. A single PR needs no tracker, child dependency diagram, or Chain Context. Shape selection does not authorize push, PR creation, merge, or review-mode/consent changes. Cache both choices, and record slice boundaries, which commits each pull request holds, in the feature document when chaining; for single PR, record the whole-PR scope instead. Resolve the `work-unit-commits` and `chained-pr` skills by registry name, never hardcode their paths.
49
+ The third choice overrides the pending chaining path: clear the chain choice as inapplicable and suppress later chain prompts. `single-pr` is not a `chain_strategy` token; do not automatically select `exception-ok`. An oversized single PR adds reviewer load, delays feedback, and couples rollback; least recommended applies only to this menu, not focused ≤400-line PRs. Follow the destination repository's documented contribution/size policy: `size:exception` is a Gentle-owned repository policy, not a universal label requirement. Never add it unless the destination policy uses it; preserve its maintainer acceptance and protected-label authorization. A single PR needs no tracker, child dependency diagram, or Chain Context. Shape selection does not authorize push, PR creation, merge, or review-mode/consent changes. Cache both choices, and record slice boundaries (which commits each PR holds) when chaining; for single PR, the whole-PR scope. Resolve the `work-unit-commits` and `chained-pr` skills by registry name, never hardcode their paths.
@@ -19,17 +19,17 @@ The independent verifier runs only when the change touches a named Task Size hig
19
19
 
20
20
  ## Agent escalation (gentle-shell#1494)
21
21
 
22
- For Task Size high-risk work when RDD is on or unknown, assess with `"escalate": {"item": <1-6>, "reason": "<one line>"}`. With validated RDD off, name the risk and run the independent verifier without requiring assess; a direct plan request can still pass the same escalation. It adds a verifier only when `escalate` names a Task Size high-risk item; raises to high, keeps `nativeRisk`, returns `agentEscalation`, never lowers a tier. Unsupported: raise this plan, not native review.
22
+ For Task Size high-risk work when RDD is on or unknown, assess with `"escalate": {"item": <1-6>, "reason": "<one line>"}`. With validated RDD off, name the risk and run the independent verifier without requiring assess. It adds a verifier only when `escalate` names a Task Size high-risk item; raises to high, keeps `nativeRisk`, returns `agentEscalation`, never lowers a tier.
23
23
 
24
24
  ## Verifier preparation failure
25
25
 
26
- A failed verifier setup is a preparation failure, not an unavailable verifier capability. A verifier's self-fix of its own setup error (one correction in the same verification) needs no decision; if it made none, relaunch once with the corrected command, unasked. If setup still fails or lacks prerequisites, stop: one **Needs your decision** naming the blocker and exact unrun checks as unverified; never repair helpers more or auto-relaunch for it. If setup fails before probes, preserve the failed attempt and report zero tests run; the checks remain unverified. Setup/infrastructure failures aren't code findings; tooling defects keep the correction bound. After a setup prerequisite is repaired, the human may explicitly request one new bounded verification attempt. This is a new request, not an automatic retry; it does not reset the prior attempt or unrelated budgets. Before proceeding, confirm no child is active or has an uncertain status. Never bypass consent, a denial, explicit one-run or no-retry limits, terminal native outcomes, or exhausted native budgets; on a relaunch, never blindly repeat an oversized copy. Follow **Authorized work continuity** for setup and worker recovery; scratch: `gentle-ai-verify`.
26
+ A failed verifier setup is a preparation failure, not an unavailable verifier capability. A verifier's self-fix of its own setup error (one correction in the same verification) needs no decision; if it made none, relaunch once with the corrected command, unasked. If setup still fails or lacks prerequisites, stop verifying: name the blocker and exact unrun checks as unverified; never repair helpers more or auto-relaunch for it. If setup fails before probes, preserve the failed attempt and report zero tests run; the checks remain unverified. Setup/infrastructure failures aren't code findings; tooling defects keep the correction bound. After a setup prerequisite is repaired, the human may explicitly request one new bounded verification attempt. This is a new request, not an automatic retry; it does not reset the prior attempt or unrelated budgets. Before proceeding, confirm no child is active or has an uncertain status. Never bypass consent, a denial, explicit one-run or no-retry limits, terminal native outcomes, or exhausted native budgets; on a relaunch, never blindly repeat an oversized copy. Follow **Authorized work continuity** for setup and worker recovery; scratch: `gentle-ai-verify`.
27
27
 
28
28
  When required proof is unobtainable, one terminal disposition closes a stopped verification: name the missing proof and resume authorized in-scope work at `status: partial` -- never PASS, never silently dropped (gentle-shell#3082).
29
29
 
30
30
  ## Verification proportionality
31
31
 
32
- Before adding or retaining an auxiliary gate, name its acceptance criterion, concrete threat, or authoritative contract; otherwise it must not become a delivery blocker. Do not build a framework for a bounded capability probe; use the existing command path and retain its observed result.
32
+ Worker, setup, recheck, native and user budgets stay separate; changed state earns a fresh check, not a reset. Before adding or retaining an auxiliary gate, name its acceptance criterion, concrete threat, or authoritative contract; otherwise it must not become a delivery blocker. Do not build a framework for a bounded capability probe; use the existing command path and retain its observed result.
33
33
 
34
34
  On overengineering warnings, remove or collapse optional artifacts and checks. State what was removed, what remains indispensable, and the next application outcome. Keep required functional checks, security controls, and native review authority intact; do not pass missing proof or weaken permissions.
35
35
 
@@ -39,4 +39,4 @@ On overengineering warnings, remove or collapse optional artifacts and checks. S
39
39
  2. **Independent verify per unit**, once, after its final self-review (never per worker cycle or retry), in parallel when several finish together, only when that unit is high risk: its Risk line, or, when RDD is on or unknown, `assess` over its actual diff or the worker's own `escalate` (high-risk list in Task Size), never inferred from the worker's summary alone. When on or unknown, assess via its work-unit commit (`{"baseRef":"<previous>","committedOnly":true}`) or its own isolated worktree. Parent-written code over several deliveries of one feature: one verify at the feature's end.
40
40
  3. **Seam check**: after parallel units finish, one full-suite command run by the parent (the parent spot check) catches seams between units.
41
41
  4. **Verify handoff**: the whole feature document, the assigned unit and its linked `S#` plus affected interactions, the baseline commit, and the probe command forms (tests, CLI, typecheck) for probes on isolated state in a fresh `mktemp -d` scratch copy, never just "read-only"; the runtime removes each subagent's own TMPDIR, which holds that copy; `gentle-ai-verify` holds the checklist. Name the change kind (external tool or environment, prompt or contract text, user-reported failure); for the last, pass verbatim its exact failing command, error text, tool versions and configuration. Run yourself any real-case check the verifier leaves unverified before calling the change verified. Future or unrelated requirements are out of scope, not unmet; final feature verification covers every `S#`. Resolve every in-scope unmet item before closing the unit; the writer adds its probes as regression tests; the parent commits when a commit is authorized.
42
- 5. **One correction**: verify blockers get one correction batch that fixes every reported blocker, then one re-verify limited to those blockers, never a new full sweep. Advisories never start a correction. A second correction runs automatically only when the recheck shows the same blocker still failing; a new finding never earns one. Blockers still open after that stop as one **Needs your decision**. A `partial` or `blocked` writer report gets only this correction, never an extra verify run beyond the risk tier's verifier; partial, blocked, unavailable, or exhausted proof left after it becomes that one **Needs your decision**.
42
+ 5. **One correction**: verify blockers get one correction batch that fixes every reported blocker, then one re-verify limited to those blockers, never a new full sweep. Advisories never start a correction. A second correction runs automatically only when the recheck shows the same blocker still failing; a new finding never earns one. Blockers still open after that leave the unit `status: partial`, naming any genuine human decision; independent authorized work continues. A `partial` or `blocked` writer report gets only this correction, never an extra verify run beyond the risk tier's verifier; leftover partial, blocked, unavailable, or exhausted proof likewise.
@@ -1,31 +1,31 @@
1
1
  # Orchestrator — Writer Handoff (lazy-loaded)
2
2
 
3
- Parent Pi session only. Load it when the Writer rule fires or an explicitly activated Judgment Day fix batch is dispatched; small tasks never need it. The Writer rule fires on a named reason (parallel units, the context backstop), never on size alone or a price ratio: a large task without a reason stays inline, following its logbook. Configured per-agent models (`subagents.json` `model_profiles`) still apply to every writer it launches. Each writer prompt requires the self-review of the Parallel review protocol in `orchestrator-verification.md`. A reason holds only when the launch delivers it:
3
+ Parent Pi session only. Load it when the Writer rule fires or for an explicitly activated Judgment Day fix batch. The Writer rule fires on a named reason (parallel units, the context backstop), never on size alone or a price ratio: a large task without one stays inline. Configured per-agent models (`subagents.json` `model_profiles`) still apply to every writer it launches. Writer prompts require the Parallel review protocol self-review (`orchestrator-verification.md`). A reason holds only when the launch delivers it:
4
4
 
5
- - **Invariants**: each writer prompt names the existing helpers its unit must reuse for shared state and the invariants they keep; units built in parallel cannot see each other, so this is the only place they learn them.
5
+ - **Invariants**: each writer prompt names the existing helpers its unit must reuse for shared state and the invariants they keep; units built in parallel cannot see each other.
6
6
  - **Size threshold**: a subagent costs one to two minutes of reading and setup before it writes anything; delegate a unit only when it needs several minutes of work (several files or roughly 100+ changed lines). Several small independent changes are faster inline, one after another.
7
7
  - **Parallelism**: a unit is one independent piece of behavior with its own code, tests, and docs; never split one behavior into a test writer, a docs writer, and inline code, and never delegate a unit that depends on another unit still in progress. In every mode, launch every independent unit in the same turn via `subagent_run` without `mode`, in one assistant message with no other tool call (in background when background mode is on), then wait for all completions before the Seam check; serial launches void the reason: if units cannot launch together, work inline.
8
8
 
9
9
  #### Allowed edit surfaces (MANDATORY)
10
10
 
11
- The bounded writer refuses to write outside the exact allowed edit surfaces and stops with `status: interaction_required` when they are missing. Every new writer launch carries the section (a continuation inherits it); after an admission rejection, repair what it names once, never relaunch the same prompt unchanged.
11
+ The writer refuses to write outside its exact surfaces and stops with `interaction_required` without them. Every new writer launch carries the section (a continuation inherits it); after an admission rejection, repair what it names once, never relaunch the same prompt unchanged, and never end the turn on one: take the next step it names.
12
12
 
13
- Before launching a bounded writer (`gentle-ai-worker`, a user-configured `worker`, or the native `Agent` fallback), derive the allowed edit surface from the delegated task — files the change must touch, plus directories where it authorizes new files — and pass it in the prompt under an `## Allowed edit surfaces` heading, in the exact-path form of `## Skills to load before work`:
13
+ Before launching any bounded writer, even the native `Agent` fallback, derive its surface from the task (files the change touches, plus directories where it authorizes new files) and pass it under `## Allowed edit surfaces`:
14
14
 
15
- - exact repository-relative paths or narrow globs, one per line; never `.` and never a bare repository root; paths containing whitespace require whole-entry backticks (for example, ``- `Directory With Spaces/note.md` ``); a list marker alone does not permit whitespace;
16
- - the section ends only at the next canonical ATX Markdown heading of any level (zero to three leading ASCII spaces, one to six `#`, then an ASCII space); every non-empty line before that heading must be a valid surface entry, so put explanatory prose under a following heading;
17
- - pre-existing untracked targets the writer may write, listed explicitly;
18
- - nothing beyond the delegated task — a surface wider than the task is the same defect as no surface at all.
15
+ - exact repository-relative paths or narrow globs, one per line; never `.` and never a bare repository root; whitespace needs whole-entry backticks (``- `My Dir/a.md` ``), not just a list marker;
16
+ - the section ends at the next heading of any level (0-3 leading ASCII spaces, 1-6 `#`, an ASCII space); every non-empty line before it must be an entry; prose goes under a later heading;
17
+ - pre-existing untracked targets it may write, listed explicitly;
18
+ - nothing beyond the task; wider is the same defect as none.
19
19
 
20
- Test scratch stays outside the worktree (`mktemp -d`), never in the repository (nor caches or `TMPDIR`); state needed inside uses an excluded path the test removes. The runtime owns session scratch; `/gentle:scratch` lists or cleans recorded clones and worktrees.
20
+ Test scratch stays outside the worktree (`mktemp -d`), never in the repository (nor caches or `TMPDIR`); inside state uses an excluded path the test removes. The runtime owns session scratch; `/gentle:scratch` lists or cleans recorded clones and worktrees.
21
21
 
22
- If the surface genuinely cannot be derived, do not launch the writer or ask the human to author paths. Derive a candidate set first — the exact paths this task would touch — and present that enumerated list as an approve/decline choice under the Lossless Blocking Prompts rules in `orchestrator-prompts.md`.
22
+ If the surface cannot be derived, do not launch or make the human author paths: offer the derived exact paths as an approve/decline choice (Lossless Blocking Prompts, `orchestrator-prompts.md`). Investigate technical route doubt; it is not a human question.
23
23
 
24
- Relay a writer's `interaction_required` payload about edit surfaces the same way: present its derived candidate paths as the choice, and add or drop paths only on the human's explicit instruction.
24
+ A writer never widens its surface; it reports exact candidate paths with reasons and awaits your replacement. Add a necessary path (test, helper) yourself, without the human, only in the authorized objective and repository, after checking ownership, existing work, risk, and concurrent writers and units; a cosmetic refactor never qualifies; an unresolved ownership or overlap conflict blocks it. New objective or scope, unapproved repository, private material, destructive or prohibited operation, missing consent, denial, or exhausted limit go to the human under existing protocols. Continue the same writer with a replacement, not a union: every still-needed path plus a concise reason, never repository-wide, no budget reset. A surface grants no repository authority or prohibited operation.
25
25
 
26
26
  #### Judgment Day fix dispatch
27
27
 
28
- Use `jd-fix-agent` only for an explicitly activated Judgment Day fix batch, never as a lexical or generic-writer fallback. Judgment Day is independent: it neither enables nor replaces ordinary review; a separately requested ordinary review remains independent. A standalone Judgment Day fix requires no graph-v1 or native review lineage. Its dispatch carries this exact runtime-accepted Markdown shape: `## Judgment Day activation` contains only `User explicitly requested Judgment Day.`. Replace the example ID, frozen ledger hash, row data, and surface with controller-authorized values. The correction batch contains only one round (`1 of 2` or `2 of 2`) and one lowercase SHA-256. The exact frozen finding rows are one JSON object per line, use only the canonical row fields, and exactly match the authorized IDs.
28
+ Use `jd-fix-agent` only for an explicitly activated Judgment Day fix batch, never as a lexical or generic-writer fallback. Judgment Day is independent: it neither enables nor replaces ordinary review; a separately requested ordinary review remains independent. A standalone Judgment Day fix requires no graph-v1 or native review lineage. Its dispatch has this exact runtime-accepted shape: `## Judgment Day activation` contains only `User explicitly requested Judgment Day.`. Replace example values with controller-authorized ones. The correction batch contains only one round (`1 of 2` or `2 of 2`) and one lowercase SHA-256. The exact frozen finding rows are one JSON object per line, use only the canonical row fields, and exactly match the authorized IDs.
29
29
 
30
30
  ```markdown
31
31
  ## Judgment Day activation
@@ -38,7 +38,7 @@ Before launching bounded writer (`gentle-ai-worker` or `worker`), derive nonempt
38
38
 
39
39
  Delegation Triggers — each mechanism turns on only when its own trigger condition truly holds, and only then is it mandatory; no trigger holds by default, and when in doubt work inline within the evidence budget (prefer `subagent_run`; role missing/unusable: native `Agent`, same read-only constraints; report fallback). Then re-evaluate task size.
40
40
 
41
- 1. **Ask** — open product or design decision → one focused question; stop and wait.
41
+ 1. **Ask** — open product or design decision, routed by ODD step 3; stop and wait.
42
42
  2. **Evidence-budget rule** — understanding needs more than one read batch or >3 lookups → stop and delegate one `gentle-ai-explore`, handoff at most ~2k tokens with `path:line` evidence; one spot check only. Reassess cumulative discovery each batch, never reset. A fired trigger overrides initial size, including read-only: it limits mutation, not routing. Exempt only preparation for an understood inline write, not discovery.
43
43
  3. **Verification rule** — only a named high-risk item (assess `escalate` when RDD is on or unknown) → independent `gentle-ai-verify`; else inline; runtime admission, gates/overengineering: `orchestrator-verification.md`.
44
44
  4. **Track** — large task → feature document, Engram mirror, `todo`, work-unit commits (`orchestrator-tracking.md`, `orchestrator-memory.md`).
@@ -82,5 +82,5 @@ While RDD is not off, this package injects the mirrored provider-bundle review e
82
82
  - Never commit unless the user explicitly asks, except the work-unit commits authorized large ODD implementation makes on its feature branch (ODD step 6).
83
83
  - Ask before destructive git operations, publishing, or irreversible file changes.
84
84
  - Parallel writers only with disjoint Allowed edit surfaces (runtime-enforced) or isolated worktrees.
85
- - Keep session work inside the project root and registered same-clone worktrees; ask before any read or write outside it, naming the absolute path. Exception: reading the task's exact resolved skill files needs no per-file question in any mode. Grants are per-target, per-session, never blanket: in-project scripts naming outside paths are not standing consent.
85
+ - Keep session work inside the project root and registered same-clone worktrees; ask before any read or write outside it, naming the absolute path. Exception: reading the task's exact resolved skill files needs no per-file question in any mode. Reading or writing the OS temp directory (session `TMPDIR`, `/tmp`, `/var/tmp`) needs none either; without asking, delete there only what this session or its tools created. Grants are per-target, per-session, never blanket: in-project scripts naming outside paths are not standing consent.
86
86
  - Preserve human control: user decisions beat agent momentum.
@@ -47,6 +47,7 @@ import {
47
47
  otherPackageInjections,
48
48
  parseLauncherArgs,
49
49
  parseLauncherConfig,
50
+ parseTowerArgs,
50
51
  parseRawLauncherConfig,
51
52
  planSpawn,
52
53
  POST_INSTALL_REMOVAL_SOURCES,
@@ -1876,6 +1877,66 @@ async function handleUpgradeCommand(commandArgs) {
1876
1877
  if (error instanceof MainChannelError) fail(`gentle-shell upgrade: ${error.message}`, error.code === "upgrade-usage" ? 2 : 1);
1877
1878
  throw error;
1878
1879
  }
1880
+ if (process.exitCode === 0) await refreshDesktopAfterUpgrade(undefined);
1881
+ }
1882
+
1883
+ // After a forward upgrade the new Gentle Shell refreshes Gentle Shell Desktop's
1884
+ // gentle-* mods and layout, only when `gentle-shell desktop` installed them (its
1885
+ // state file); a user who never ran desktop gets nothing installed. The old
1886
+ // process cannot do it: the new mods ship with the new package. A target
1887
+ // without the desktop command (an older release) would take `desktop` as a
1888
+ // prompt for the model, so it is never launched. `upgrade --rollback` never
1889
+ // calls this.
1890
+ async function refreshDesktopAfterUpgrade(bundled) {
1891
+ let stateFile;
1892
+ let supportsDesktop;
1893
+ try {
1894
+ // After an npm upgrade this package folder holds the new version, which may not ship desktop.
1895
+ const desktop = await import("../runtime/gentle-shell-desktop.mjs");
1896
+ stateFile = desktop.desktopPaths(process.env, homedir()).stateFile;
1897
+ supportsDesktop = desktop.supportsDesktop;
1898
+ } catch {
1899
+ return;
1900
+ }
1901
+ if (!existsSync(stateFile)) return;
1902
+ const warn = (reason) => process.stderr.write(`gentle-shell upgrade: could not refresh Gentle Shell Desktop's mods (${reason}); run 'gentle-shell desktop'.\n`);
1903
+ try {
1904
+ const next = bundled
1905
+ ? await resolveStartupRelaunch({ root: bundled.root, home: homedir(), platform: process.platform, env: process.env, argv: ["desktop", "--refresh"] })
1906
+ : { command: process.execPath, args: [join(packageRoot, "bin", "gentle-shell.mjs"), "desktop", "--refresh"], env: process.env };
1907
+ // next.args[0] is the target's bin/gentle-shell.mjs.
1908
+ if (!supportsDesktop(dirname(dirname(next.args[0])))) return;
1909
+ const result = spawnSync(next.command, next.args, { stdio: "inherit", env: next.env });
1910
+ if (result.error) warn(result.error.message);
1911
+ else if (result.status !== 0) warn(`exit ${result.status}`);
1912
+ } catch (error) {
1913
+ warn(error.message);
1914
+ }
1915
+ }
1916
+
1917
+ // `gentle-shell desktop` (Gentle Shell Desktop): before any Pi runtime check,
1918
+ // since it never runs Pi; lib/gentle-shell-desktop.ts owns the decisions.
1919
+ async function handleDesktopCommand(commandArgs) {
1920
+ const { nodeDesktopIO, runDesktop } = await import("../runtime/gentle-shell-desktop.mjs");
1921
+ const { askLine } = await import("../runtime/gentle-shell-uninstall.mjs");
1922
+ return runDesktop({
1923
+ args: commandArgs,
1924
+ env: process.env,
1925
+ home: homedir(),
1926
+ platform: process.platform,
1927
+ arch: process.arch,
1928
+ cwd: process.cwd(),
1929
+ interactive: process.stdin.isTTY === true && process.stdout.isTTY === true,
1930
+ packageRoot,
1931
+ shellVersion: ownPackageVersion(),
1932
+ io: {
1933
+ ...nodeDesktopIO(),
1934
+ // End of input or Ctrl+C answers No.
1935
+ ask: (question) => askLine(question, { input: process.stdin, output: process.stdout }).catch(() => ""),
1936
+ out: (line) => process.stdout.write(`${line}\n`),
1937
+ err: (line) => process.stderr.write(`${line}\n`),
1938
+ },
1939
+ });
1879
1940
  }
1880
1941
 
1881
1942
  // `gentle-shell upgrade` in a bundled install: the latest release installed
@@ -1906,11 +1967,12 @@ async function handleBundledUpgrade(bundled, commandArgs) {
1906
1967
  adapters: { latest: () => latestRelease(globalThis.fetch), distribution: (version) => fetchDistribution({ version }) },
1907
1968
  out,
1908
1969
  });
1909
- return 0;
1910
1970
  } catch (error) {
1911
1971
  process.stderr.write(`gentle-shell upgrade: ${error.message}${error.stderr ? `\n${error.stderr}` : ""}\n`);
1912
1972
  return 1;
1913
1973
  }
1974
+ await refreshDesktopAfterUpgrade(bundled);
1975
+ return 0;
1914
1976
  }
1915
1977
 
1916
1978
  // `gentle-shell update` in a bundled install: the newest published
@@ -2103,6 +2165,20 @@ async function main() {
2103
2165
  else handleHomeCommand(args.commandArgs);
2104
2166
  return;
2105
2167
  }
2168
+ if (args.command === "desktop") {
2169
+ process.exitCode = await handleDesktopCommand(args.commandArgs);
2170
+ return;
2171
+ }
2172
+ // `gentle-shell tower`: the same local web view as /gentle:tower, without a
2173
+ // session or a Pi runtime; serves until SIGINT/SIGTERM.
2174
+ if (args.command === "tower") {
2175
+ const tower = parseTowerArgs(args.commandArgs);
2176
+ if (tower.error !== undefined) fail(`gentle-shell tower: ${tower.error}\nRun 'gentle-shell --help' for usage.`, 2);
2177
+ const { runTower } = await import("../runtime/tower-open.mjs");
2178
+ process.exitCode = await runTower({ env: process.env, open: tower.open, port: tower.port,
2179
+ stdout: (text) => process.stdout.write(text), stderr: (text) => process.stderr.write(text) });
2180
+ return;
2181
+ }
2106
2182
  // The verification input applies to `--version` only (scripts/bundled-install.mjs upgradeBundled).
2107
2183
  const verifying = args.version && args.command === undefined ? process.env[BUNDLED_VERIFY_ENV] : undefined;
2108
2184
  const bundled = resolveBundledInstall({ packageRoot, platform: process.platform, fs: bundledFs, verifying });
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "schema": "gentle-pi.review-provider-contract-mirror-lock/v1",
3
3
  "acquisition": "field-test-local",
4
- "contract_semver": "1.5.0",
4
+ "contract_semver": "1.6.0",
5
5
  "source": {
6
6
  "kind": "tree"
7
7
  },
8
- "tree_sha256": "9e887fbded4a216aa89e8ec8818a6f4789d2b09cfff7fbd165fc1518a4d3d312",
8
+ "tree_sha256": "bda75839d0b345e63e876bc52c9c858802b1d54651703be4ca83fabb660f7e31",
9
9
  "entries": {
10
10
  "README.md": "3a655c2f19aee02636da062f0cae7a189b7e5f691c8ba8010f2ed50e5d8e8d70",
11
- "manifest.json": "cd8f2379a27b66877a77d7cf57ad21d4a19244baaa9929117183b0f6e5ae6d6d",
12
- "orchestration/pi.md": "c0e7c4c2ab07a695ecf108b476bee81e6d9ca553b7a3860299fe2870b68d8bfc",
13
- "routing/pi.md": "f34508b060197339fc73dd885565a24d037366c02b3f91b4db15431b42a5c573",
11
+ "manifest.json": "b25b3e22f95d624ca12cd4e78036abaf9080cc829271a5a82eef92bbe1277eae",
12
+ "orchestration/pi.md": "ee25b26c5e913008a115e1cde258288a2c4b1ad9a41cb0b040fab2b76561e124",
13
+ "routing/pi.md": "da52909e3b91b044d36556f7775d5d2b10410212b5c0466f267006fea16a58c3",
14
14
  "schemas/lens.schema.json": "9b8a2354a570888486015434501b66b51441a3baf5bf858635e4fff56b2e8298",
15
15
  "schemas/refuter.schema.json": "36f8267c6c3f04600b8f1cb77df70d90858611af822cc81922efd6b3502fb646",
16
16
  "schemas/targeted-validator.schema.json": "40e397195bdfbc6782fc3090f20c5be082e4d14d2855314f99ecb8506133eddc",
@@ -19,8 +19,8 @@
19
19
  "vectors/targeted-validator.json": "7b5a5165e3a913863fb98d2ba5387811860c21333b5c37e6ed3b4e0d121cf2fa"
20
20
  },
21
21
  "generated": {
22
- "generated/provider-capabilities.baseline.json": "f9b2e0f3600683e81d7e381ee24aa251e781a11e8cfc7fe12e476861354102ff",
23
- "generated/provider-roles.baseline.json": "f6a9c8b071d01266a7ba2a3c74ab54833cfd5b240abfe435ae931086e5397a8b"
22
+ "generated/provider-capabilities.baseline.json": "9f143c602b30fb4581dc8446441872fd9dca84ccdeb3a70719958e12b24040fb",
23
+ "generated/provider-roles.baseline.json": "05e945986453659180c1111988449a3ab0fb39cd44f3a3b7b9774a42cea47648"
24
24
  },
25
25
  "runtimes": [
26
26
  "claude-code",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": "gentle-ai.review-provider-contract-bundle/v1",
3
- "contract_semver": "1.5.0",
3
+ "contract_semver": "1.6.0",
4
4
  "transport_capability": "gentle-ai.provider-transport/v1",
5
5
  "runtimes": [
6
6
  "claude-code",
@@ -67,7 +67,7 @@
67
67
  "runtime": "pi",
68
68
  "file": {
69
69
  "path": "orchestration/pi.md",
70
- "sha256": "c0e7c4c2ab07a695ecf108b476bee81e6d9ca553b7a3860299fe2870b68d8bfc"
70
+ "sha256": "ee25b26c5e913008a115e1cde258288a2c4b1ad9a41cb0b040fab2b76561e124"
71
71
  }
72
72
  }
73
73
  ],
@@ -76,7 +76,7 @@
76
76
  "runtime": "pi",
77
77
  "file": {
78
78
  "path": "routing/pi.md",
79
- "sha256": "f34508b060197339fc73dd885565a24d037366c02b3f91b4db15431b42a5c573"
79
+ "sha256": "da52909e3b91b044d36556f7775d5d2b10410212b5c0466f267006fea16a58c3"
80
80
  }
81
81
  }
82
82
  ]
@@ -68,4 +68,4 @@ A `stop` ends its transition, never approves delivery. `D` means the human disab
68
68
 
69
69
  ## Delivery follows ordinary repository policy
70
70
 
71
- After exact acknowledgement burns terminal `approved` authority, the review lifecycle stops. Commit, push, PR, and release remain separate human decisions under ordinary repository policy. A review outcome is informational and never authorizes delivery.
71
+ After exact acknowledgement burns terminal `approved` authority, the review lifecycle stops. Commit, push, PR, and release remain separate human decisions under ordinary repository policy. A review outcome is informational and never authorizes delivery. With RDD on, the pre-delivery guard still blocks a foreground push or PR until the committed range is assessed and any due review is resolved, and never runs it beside candidate-changing or background commands.