gentle-pi 3.6.0 → 4.0.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 (320) hide show
  1. package/README.md +37 -6
  2. package/assets/agents/gentle-ai-explore.md +4 -4
  3. package/assets/agents/gentle-ai-verify.md +6 -4
  4. package/assets/agents/gentle-ai-worker.md +7 -9
  5. package/assets/orchestrator-delegation.md +40 -41
  6. package/assets/orchestrator-memory.md +1 -22
  7. package/assets/orchestrator-skills.md +1 -1
  8. package/assets/orchestrator.md +12 -24
  9. package/assets/support/strict-tdd-verify.md +4 -266
  10. package/assets/support/strict-tdd.md +8 -360
  11. package/bin/gentle-shell.mjs +254 -29
  12. package/docs/delegated-verification.md +26 -1
  13. package/docs/gentle-agents-activity.md +24 -0
  14. package/docs/gentle-shell.md +95 -30
  15. package/docs/native-authority-architecture.md +2 -2
  16. package/docs/prompt-history.md +280 -0
  17. package/docs/readme-reference.md +117 -235
  18. package/docs/telemetry.md +1 -1
  19. package/docs/yolo-mode.md +86 -0
  20. package/extensions/child-context.ts +26 -0
  21. package/extensions/child-safety.ts +23 -0
  22. package/extensions/gentle-agents.ts +509 -275
  23. package/extensions/gentle-ai.ts +781 -683
  24. package/extensions/gentle-shell.ts +1375 -88
  25. package/extensions/gentle-stats.ts +101 -0
  26. package/extensions/gentle-todo.ts +18 -7
  27. package/extensions/history/atomic-write.ts +38 -0
  28. package/extensions/history/hide-prompts.ts +183 -0
  29. package/extensions/history/index.ts +1419 -0
  30. package/extensions/history/load-shared-history.ts +39 -0
  31. package/extensions/history/selector-helpers.ts +538 -0
  32. package/extensions/history/session-scan.ts +233 -0
  33. package/extensions/history/store.ts +1119 -0
  34. package/extensions/nan-provider.ts +6 -0
  35. package/extensions/quiet-tools.ts +179 -87
  36. package/extensions/resume-hint.ts +60 -0
  37. package/extensions/skill-registry.ts +16 -12
  38. package/extensions/startup-banner.ts +60 -31
  39. package/lib/agent-assets.ts +604 -0
  40. package/lib/agent-profile-pin.ts +12 -0
  41. package/lib/agents-message-delivery.ts +181 -0
  42. package/lib/agents-protocol.ts +60 -0
  43. package/lib/agents-runner.ts +105 -98
  44. package/lib/agents-view.ts +26 -3
  45. package/lib/agents-widget.ts +16 -9
  46. package/lib/append-system-prompt.ts +21 -0
  47. package/lib/bounded-writer-admission.ts +147 -0
  48. package/lib/card-style-policy.ts +60 -0
  49. package/lib/child-context-files.ts +166 -0
  50. package/lib/codemode-renderer.ts +185 -0
  51. package/lib/command-palette-catalog.ts +3 -9
  52. package/lib/command-palette.ts +25 -14
  53. package/lib/destructive-command-guard.ts +144 -0
  54. package/lib/foreign-target-grants.ts +32 -0
  55. package/lib/gentle-ai-elapsed-store.ts +87 -0
  56. package/lib/gentle-ai-renderer.ts +196 -39
  57. package/lib/gentle-shell-launcher.ts +24 -13
  58. package/lib/gentle-shell-resume-hint.ts +176 -0
  59. package/lib/history-capture-policy.ts +95 -0
  60. package/lib/model-routing-authority.ts +5 -1
  61. package/lib/nan-provider.ts +227 -0
  62. package/lib/native-review-cli.ts +53 -108
  63. package/lib/odd-phase-inference.ts +231 -0
  64. package/lib/odd-phase.ts +141 -0
  65. package/lib/overlay-repaint.ts +26 -0
  66. package/lib/pi-tui-keys.ts +53 -0
  67. package/lib/review-candidate-view-owner.ts +67 -17
  68. package/lib/review-candidate-view.ts +112 -25
  69. package/lib/review-reminder-receipt.ts +48 -8
  70. package/lib/review-risk-assessment.ts +156 -11
  71. package/lib/review-sidebar-state.ts +223 -0
  72. package/lib/selection-engine.ts +515 -0
  73. package/lib/session-change-capture.ts +10 -1
  74. package/lib/session-messaging-grants.ts +135 -0
  75. package/lib/session-worktree-registry.ts +14 -2
  76. package/lib/shell-bar.ts +179 -24
  77. package/lib/shell-card.ts +287 -18
  78. package/lib/shell-changes-view.ts +2 -1
  79. package/lib/shell-prompt.ts +102 -6
  80. package/lib/shell-sidebar-layout.ts +78 -14
  81. package/lib/shell-sidebar.ts +15 -1
  82. package/lib/shell-todo.ts +23 -13
  83. package/lib/shell-usage-view.ts +9 -4
  84. package/lib/shell-usage.ts +66 -10
  85. package/lib/stats-collector.ts +381 -0
  86. package/lib/stats-view.ts +431 -0
  87. package/lib/theme-customization.ts +52 -0
  88. package/lib/vim-editor-adapter.ts +379 -0
  89. package/lib/vim-normal-engine.ts +154 -0
  90. package/lib/vim-operator-engine.ts +416 -0
  91. package/lib/vim-policy.ts +49 -0
  92. package/lib/vim-visual-engine.ts +107 -0
  93. package/lib/visual-customization-policy.ts +108 -0
  94. package/lib/visual-customize-view.ts +330 -0
  95. package/lib/visual-profiles.ts +228 -0
  96. package/lib/yolo-session-policy.ts +240 -0
  97. package/package.json +20 -8
  98. package/runtime/gentle-shell-launcher.mjs +23 -12
  99. package/runtime/gentle-shell-resume-hint.mjs +177 -0
  100. package/runtime/native-review-cli.mjs +53 -108
  101. package/runtime/review-risk-assessment.mjs +154 -9
  102. package/scripts/build-runtime-modules.mjs +1 -0
  103. package/scripts/gentle-ai-installer.mjs +14 -13
  104. package/scripts/mirror-odd-routing.mjs +2 -2
  105. package/scripts/run-test-suite.mjs +76 -0
  106. package/scripts/test-packed-runner.mjs +31 -14
  107. package/scripts/verify-package-files.mjs +11 -22
  108. package/skills/branch-pr/SKILL.md +24 -52
  109. package/skills/chained-pr/SKILL.md +31 -15
  110. package/skills/chained-pr/references/chaining-details.md +31 -20
  111. package/skills/gentle-ai/SKILL.md +9 -15
  112. package/skills/issue-creation/SKILL.md +8 -2
  113. package/skills/issue-creation/references/delegated-workflow-actions.md +19 -0
  114. package/skills/work-unit-commits/SKILL.md +4 -3
  115. package/tests/agent-profiles.test.ts +18 -0
  116. package/tests/agents-fake-child.ts +2 -2
  117. package/tests/agents-message-delivery.test.ts +106 -0
  118. package/tests/agents-protocol.test.ts +40 -0
  119. package/tests/agents-runner.test.ts +400 -89
  120. package/tests/agents-view-thread-identity.test.ts +169 -0
  121. package/tests/agents-view.test.ts +8 -2
  122. package/tests/agents-widget.test.ts +154 -15
  123. package/tests/append-system-prompt-route.test.ts +160 -0
  124. package/tests/append-system-prompt.test.ts +46 -0
  125. package/tests/artifact-language.test.ts +19 -213
  126. package/tests/ask-user-question.test.ts +44 -1
  127. package/tests/asset-installation-runtime.test.ts +5 -16
  128. package/tests/autonomous-guard.test.ts +69 -1
  129. package/tests/bounded-writer-admission.test.ts +95 -0
  130. package/tests/branch-pr-skill.test.ts +43 -0
  131. package/tests/card-style-policy.test.ts +55 -0
  132. package/tests/chained-pr-skill.test.ts +124 -0
  133. package/tests/child-context-files.test.ts +255 -0
  134. package/tests/child-safety.test.ts +82 -0
  135. package/tests/codemode-rendering.test.ts +491 -0
  136. package/tests/command-palette.test.ts +39 -3
  137. package/tests/delegated-key-learnings-contract.test.ts +0 -76
  138. package/tests/destructive-command-guard.test.ts +84 -0
  139. package/tests/devbinary/native-review-parity.devtest.ts +170 -2
  140. package/tests/devbinary/non-git-subagent-bootstrap.devtest.ts +193 -0
  141. package/tests/fixtures/stats/sessions/--work-alpha--/2026-09-28T10-00-00-000Z_aaa.jsonl +7 -0
  142. package/tests/fixtures/stats/sessions/--work-alpha--/2026-09-29T23-00-00-000Z_bbb.jsonl +3 -0
  143. package/tests/fixtures/stats/sessions/--work-alpha--/2026-09-30T08-00-00-000Z_ddd.jsonl +2 -0
  144. package/tests/fixtures/stats/sessions/--work-alpha--/2026-09-30T09-00-00-000Z_eee.jsonl +3 -0
  145. package/tests/fixtures/stats/sessions/--work-alpha--/run-1/session.jsonl +2 -0
  146. package/tests/fixtures/stats/sessions/--work-beta--/2026-09-01T12-00-00-000Z_ccc.jsonl +2 -0
  147. package/tests/fixtures/stats/user-pi/sessions/--work-alpha--/2026-09-28T10-00-00-000Z_aaa.jsonl +2 -0
  148. package/tests/fixtures/stats/user-pi/sessions/--work-alpha--/2026-09-29T23-00-00-000Z_bbb.jsonl +4 -0
  149. package/tests/fixtures/stats/user-pi/sessions/--work-gamma--/2026-09-20T09-00-00-000Z_fff.jsonl +3 -0
  150. package/tests/foreign-target-grants.test.ts +58 -0
  151. package/tests/generic-agent-tools.test.ts +54 -0
  152. package/tests/gentle-agents.test.ts +1411 -256
  153. package/tests/gentle-ai-binary.test.ts +3 -3
  154. package/tests/gentle-ai-elapsed-store.test.ts +68 -0
  155. package/tests/gentle-ai-installer.test.ts +68 -54
  156. package/tests/gentle-ai-renderer.test.ts +487 -8
  157. package/tests/gentle-ai.test.ts +288 -65
  158. package/tests/gentle-card-text.ts +2 -1
  159. package/tests/gentle-shell-bin.test.ts +651 -114
  160. package/tests/gentle-shell-launcher.test.ts +99 -52
  161. package/tests/gentle-shell-resume-hint.test.ts +270 -0
  162. package/tests/gentle-shell.test.ts +3839 -187
  163. package/tests/gentle-stats.test.ts +152 -0
  164. package/tests/gentle-theme.test.ts +4 -1
  165. package/tests/gentle-todo.test.ts +80 -8
  166. package/tests/history-atomic-write.test.ts +57 -0
  167. package/tests/history-capture-policy.test.ts +102 -0
  168. package/tests/history-command-registration.test.ts +164 -0
  169. package/tests/history-dedupe-entries.test.ts +123 -0
  170. package/tests/history-delete-backfill.test.ts +190 -0
  171. package/tests/history-delete-confirm.test.ts +460 -0
  172. package/tests/history-dispatch.test.ts +180 -0
  173. package/tests/history-drain-hidden.test.ts +110 -0
  174. package/tests/history-drain-order.test.ts +98 -0
  175. package/tests/history-expanded-globals.test.ts +62 -0
  176. package/tests/history-gc.test.ts +832 -0
  177. package/tests/history-header-layout.test.ts +265 -0
  178. package/tests/history-hide-prompts.test.ts +275 -0
  179. package/tests/history-lazy-windowing.test.ts +508 -0
  180. package/tests/history-legacy-migrate-v2.test.ts +297 -0
  181. package/tests/history-load-shared-history.test.ts +53 -0
  182. package/tests/history-max-results-cap.test.ts +76 -0
  183. package/tests/history-multi-reader.test.ts +203 -0
  184. package/tests/history-off-path.test.ts +170 -0
  185. package/tests/history-openflow-integration.test.ts +173 -0
  186. package/tests/history-overlay-margin.test.ts +326 -0
  187. package/tests/history-preview-layout.test.ts +93 -0
  188. package/tests/history-registry.test.ts +143 -0
  189. package/tests/history-scope-delete.test.ts +411 -0
  190. package/tests/history-search-caret-keys.test.ts +142 -0
  191. package/tests/history-seed-bootstrap.test.ts +170 -0
  192. package/tests/history-seed-regen.test.ts +129 -0
  193. package/tests/history-selector-windowing.test.ts +94 -0
  194. package/tests/history-session-scan-directory.test.ts +87 -0
  195. package/tests/history-session-scan-extract.test.ts +583 -0
  196. package/tests/history-session-writer.test.ts +351 -0
  197. package/tests/history-store-paths.test.ts +79 -0
  198. package/tests/history-tombstone-exact.test.ts +139 -0
  199. package/tests/history-wheel-mouse.test.ts +242 -0
  200. package/tests/inprocess-reviewer.test.ts +29 -19
  201. package/tests/issue-creation-skill.test.ts +61 -0
  202. package/tests/model-routing-authority.test.ts +16 -0
  203. package/tests/nan-provider.test.ts +471 -0
  204. package/tests/native-review-capability-contract.test.ts +13 -1
  205. package/tests/native-review-cli.test.ts +6 -120
  206. package/tests/native-review-parity-runtime.test.ts +100 -3
  207. package/tests/odd-integration.test.ts +67 -0
  208. package/tests/odd-phase-inference.test.ts +213 -0
  209. package/tests/odd-phase-loader.test.ts +253 -0
  210. package/tests/odd-phase.test.ts +307 -0
  211. package/tests/odd-routing-canonical-ratchet.test.ts +11 -6
  212. package/tests/odd-routing-contract.test.ts +86 -35
  213. package/tests/orchestrator-budget.test.ts +14 -39
  214. package/tests/orchestrator-rdd-ownership.test.ts +3 -3
  215. package/tests/overlay-repaint.test.ts +74 -0
  216. package/tests/package-manifest.test.ts +252 -115
  217. package/tests/packed-runner-owned-path.test.ts +46 -0
  218. package/tests/persona-single-channel.test.ts +6 -6
  219. package/tests/provider-defect-handoff.test.ts +3 -11
  220. package/tests/quiet-bash-runtime.test.ts +76 -0
  221. package/tests/quiet-tool-rendering.test.ts +409 -184
  222. package/tests/rdd-aware-verification-contract.test.ts +76 -1
  223. package/tests/rdd-status-line.test.ts +9 -4
  224. package/tests/resume-hint-extension.test.ts +122 -0
  225. package/tests/review-agent-end-preflight.test.ts +176 -12
  226. package/tests/review-candidate-owner-retry.test.ts +22 -1
  227. package/tests/review-candidate-view.test.ts +298 -0
  228. package/tests/review-contract-prompt.test.ts +108 -43
  229. package/tests/review-controller-lock-status.test.ts +0 -1
  230. package/tests/review-controller-native-routing.test.ts +611 -5
  231. package/tests/review-controller-workspace-root.test.ts +163 -4
  232. package/tests/review-host-relay-routing.test.ts +338 -2
  233. package/tests/review-integration-v2-forward.test.ts +200 -0
  234. package/tests/review-ledger-contract.test.ts +10 -34
  235. package/tests/review-reminder-receipt.test.ts +47 -1
  236. package/tests/review-risk-assessment.test.ts +498 -6
  237. package/tests/review-sidebar-state.test.ts +402 -0
  238. package/tests/run-test-suite.test.ts +124 -0
  239. package/tests/runtime-harness.mjs +145 -786
  240. package/tests/runtime-metrics-children.test.ts +16 -23
  241. package/tests/selection-engine.test.ts +421 -0
  242. package/tests/session-change-capture.test.ts +12 -1
  243. package/tests/session-messaging-grants.test.ts +255 -0
  244. package/tests/session-worktree-registry.test.ts +77 -0
  245. package/tests/shell-bar.test.ts +382 -1
  246. package/tests/shell-card.test.ts +353 -1
  247. package/tests/shell-changes-view.test.ts +52 -0
  248. package/tests/shell-prompt.test.ts +94 -2
  249. package/tests/shell-sidebar-layout.test.ts +325 -21
  250. package/tests/shell-sidebar-scroll-benchmark.test.ts +255 -0
  251. package/tests/shell-todo.test.ts +87 -1
  252. package/tests/shell-usage-view.test.ts +27 -0
  253. package/tests/shell-usage.test.ts +73 -0
  254. package/tests/skill-registry.test.ts +50 -1
  255. package/tests/startup-banner.test.ts +130 -2
  256. package/tests/stats-collector.test.ts +195 -0
  257. package/tests/stats-view.test.ts +202 -0
  258. package/tests/telemetry-trigger.test.ts +81 -20
  259. package/tests/theme-customization.test.ts +72 -0
  260. package/tests/vim-editor-adapter-host-resolution.test.ts +37 -0
  261. package/tests/vim-editor-adapter.test.ts +804 -0
  262. package/tests/vim-normal-engine.test.ts +101 -0
  263. package/tests/vim-operator-engine.test.ts +215 -0
  264. package/tests/vim-policy.test.ts +19 -0
  265. package/tests/vim-visual-engine.test.ts +52 -0
  266. package/tests/visual-customization-policy.test.ts +110 -0
  267. package/tests/visual-customize-view.test.ts +418 -0
  268. package/tests/visual-profiles.test.ts +87 -0
  269. package/tests/yolo-customize.test.ts +256 -0
  270. package/tests/yolo-mode-runtime.test.ts +161 -0
  271. package/tests/yolo-mode.test.ts +261 -0
  272. package/tests/yolo-session-policy.test.ts +59 -0
  273. package/themes/Gentle.json +2 -1
  274. package/themes/Gentleman-Cute.json +2 -1
  275. package/themes/Gentleman-Sexy.json +2 -1
  276. package/assets/agents/sdd-apply.md +0 -159
  277. package/assets/agents/sdd-archive.md +0 -228
  278. package/assets/agents/sdd-design.md +0 -49
  279. package/assets/agents/sdd-explore.md +0 -48
  280. package/assets/agents/sdd-init.md +0 -56
  281. package/assets/agents/sdd-onboard.md +0 -52
  282. package/assets/agents/sdd-proposal.md +0 -64
  283. package/assets/agents/sdd-remediate.md +0 -37
  284. package/assets/agents/sdd-research.md +0 -49
  285. package/assets/agents/sdd-spec.md +0 -192
  286. package/assets/agents/sdd-status.md +0 -54
  287. package/assets/agents/sdd-tasks.md +0 -108
  288. package/assets/agents/sdd-verify.md +0 -124
  289. package/assets/chains/sdd-full.chain.md +0 -83
  290. package/assets/chains/sdd-plan.chain.md +0 -56
  291. package/assets/chains/sdd-verify.chain.md +0 -43
  292. package/assets/sdd-orchestrator-workflow.md +0 -319
  293. package/assets/support/sdd-status-contract.md +0 -77
  294. package/docs/assets/diagrams/sdd-cycle.svg +0 -14
  295. package/extensions/sdd-init.ts +0 -816
  296. package/lib/openspec-deltas.ts +0 -156
  297. package/lib/sdd-preflight.ts +0 -1066
  298. package/lib/sdd-research-capabilities.ts +0 -94
  299. package/lib/sdd-status.ts +0 -26
  300. package/tests/fixtures/legacy/sdd-research-v2.5.0.md +0 -54
  301. package/tests/fixtures/native-review-cli/v2.1.3/bind-sdd.json +0 -25
  302. package/tests/fixtures/v0.10.7/assets/agents/sdd-apply.md +0 -132
  303. package/tests/openspec-deltas.test.ts +0 -209
  304. package/tests/sdd-agent-tools.test.ts +0 -156
  305. package/tests/sdd-archive-replay.test.ts +0 -82
  306. package/tests/sdd-classical-continuation.test.ts +0 -74
  307. package/tests/sdd-execution-routing-contract.test.ts +0 -44
  308. package/tests/sdd-managed-runtime-settlement.test.ts +0 -155
  309. package/tests/sdd-native-managed-uptake.test.ts +0 -243
  310. package/tests/sdd-no-attempts-contract.test.ts +0 -15
  311. package/tests/sdd-odd-integration.test.ts +0 -33
  312. package/tests/sdd-optional-research.test.ts +0 -124
  313. package/tests/sdd-planning-routing-contract.test.ts +0 -45
  314. package/tests/sdd-preflight-rpc-input.test.ts +0 -125
  315. package/tests/sdd-preflight.test.ts +0 -541
  316. package/tests/sdd-research-capabilities.test.ts +0 -114
  317. package/tests/sdd-research-live.test.ts +0 -241
  318. package/tests/sdd-selection-transport.test.ts +0 -653
  319. package/tests/sdd-status.test.ts +0 -9
  320. package/tests/sdd-task-truth.test.ts +0 -43
@@ -845,7 +845,32 @@ function assertNoNativeInstallerArtifacts(packageRoot, consumerDirectory, receip
845
845
  if (existsSync(join(consumerDirectory, "node_modules", ".bin", nativeCommand))) throw new Error("unhooked install unexpectedly exposed a native Gentle AI executable");
846
846
  }
847
847
 
848
- function resolveInstalledJitiStaticEntry(consumerDirectory, sdkPackageJson, sdkVersion, selectCheck, checkIds) {
848
+ function compareRelease(left, right) {
849
+ const a = left.split(".").map(Number);
850
+ const b = right.split(".").map(Number);
851
+ for (let index = 0; index < 3; index++) if (a[index] !== b[index]) return a[index] - b[index];
852
+ return 0;
853
+ }
854
+
855
+ // The manifest's devDependency is a policy specifier (an open `>=` range), not
856
+ // a version. Probes install the exact SDK release this checkout resolved, so
857
+ // the consumer reproduces the tested runtime instead of the newest match.
858
+ export function resolveProjectPiSdkVersion(projectRoot, probe = "packed probe") {
859
+ const manifest = safeJson(readFileSync(join(projectRoot, "package.json")), "project package manifest");
860
+ const range = manifest?.devDependencies?.["@earendil-works/pi-coding-agent"];
861
+ const policy = typeof range === "string" ? /^(>=)?(\d+\.\d+\.\d+)$/.exec(range) : null;
862
+ if (policy === null) throw new Error(`${probe} requires an exact or >= Pi SDK development range`);
863
+ const installed = safeJson(readFileSync(join(projectRoot, "node_modules", "@earendil-works", "pi-coding-agent", "package.json")), "project-installed Pi SDK manifest");
864
+ const version = installed?.version;
865
+ if (installed?.name !== "@earendil-works/pi-coding-agent" || typeof version !== "string" || !/^\d+\.\d+\.\d+$/.test(version)) {
866
+ throw new Error(`${probe} requires a project-installed Pi SDK with an exact release version`);
867
+ }
868
+ const order = compareRelease(version, policy[2]);
869
+ if (policy[1] === ">=" ? order < 0 : order !== 0) throw new Error(`${probe}: project-installed Pi SDK ${version} does not satisfy ${range}`);
870
+ return version;
871
+ }
872
+
873
+ export function resolveInstalledJitiStaticEntry(consumerDirectory, sdkPackageJson, sdkVersion, selectCheck, checkIds) {
849
874
  selectCheck(checkIds.sdkManifest);
850
875
  const checkedSdkPackageJson = assertOwnedRegularFile(consumerDirectory, relative(consumerDirectory, sdkPackageJson));
851
876
  const sdkRequire = createRequire(checkedSdkPackageJson);
@@ -855,7 +880,7 @@ function resolveInstalledJitiStaticEntry(consumerDirectory, sdkPackageJson, sdkV
855
880
  const declaredJiti = installedSdk?.dependencies?.jiti;
856
881
  selectCheck(checkIds.jitiManifest);
857
882
  const jitiManifest = sdkRequire.resolve("jiti/package.json");
858
- const checkedJitiPackageJson = assertOwnedRegularFile(consumerDirectory, relative(consumerDirectory, jitiManifest));
883
+ const checkedJitiPackageJson = assertOwnedRegularFile(consumerDirectory, relative(realpathSync.native(consumerDirectory), jitiManifest));
859
884
  const jitiPackage = safeJson(readFileSync(checkedJitiPackageJson), "jiti package manifest");
860
885
  selectCheck(checkIds.jitiStaticExport);
861
886
  const staticExport = jitiPackage?.exports?.["./static"];
@@ -1404,9 +1429,7 @@ async function testSdkLifecyclePackedSession() {
1404
1429
  const { env } = isolatedUnhookedEnvironment(temporary);
1405
1430
  Object.assign(env, { GENTLE_PI_AGENTS: "1", PI_OFFLINE: "1" });
1406
1431
  selectSdkLifecycleCheck(receipt, "project-sdk-version");
1407
- const manifest = safeJson(readFileSync(join(root, "package.json")), "project package manifest");
1408
- const sdkVersion = manifest?.devDependencies?.["@earendil-works/pi-coding-agent"];
1409
- if (sdkVersion !== "0.85.1") throw new Error("SDK lifecycle probe requires the project-pinned Pi SDK");
1432
+ const sdkVersion = resolveProjectPiSdkVersion(root, "SDK lifecycle probe");
1410
1433
  selectSdkLifecycleCheck(receipt, "pack-command");
1411
1434
  const packed = safeJson(runBoundedNpm("pack", ["pack", "--ignore-scripts", "--json", "--pack-destination", packDirectory], env, root), "npm pack output");
1412
1435
  stage = "pack-result";
@@ -1479,9 +1502,7 @@ async function testWindowsStartupTimingPackedHelper() {
1479
1502
  const { env } = isolatedUnhookedEnvironment(temporary);
1480
1503
  Object.assign(env, { GENTLE_PI_AGENTS: "1", PI_OFFLINE: "1" });
1481
1504
  selectWindowsStartupTimingCheck(receipt, "project-sdk-version");
1482
- const manifest = safeJson(readFileSync(join(root, "package.json")), "project package manifest");
1483
- const sdkVersion = manifest?.devDependencies?.["@earendil-works/pi-coding-agent"];
1484
- if (sdkVersion !== "0.85.1") throw new Error("Windows startup timing probe requires the project-pinned Pi SDK");
1505
+ const sdkVersion = resolveProjectPiSdkVersion(root, "Windows startup timing probe");
1485
1506
  selectWindowsStartupTimingCheck(receipt, "pack-command");
1486
1507
  const packed = safeJson(runBoundedNpm("pack", ["pack", "--ignore-scripts", "--json", "--pack-destination", packDirectory], env, root), "npm pack output");
1487
1508
  stage = "pack-result";
@@ -1557,9 +1578,7 @@ async function testWindowsStartupTimingEnvironmentExperiment() {
1557
1578
  const pathDelta = deriveWindowsStartupTimingPathDelta(process.env);
1558
1579
  const treatmentPathDelta = validateWindowsStartupTimingMachinePaths(pathDelta) ? pathDelta : undefined;
1559
1580
  selectWindowsStartupTimingCheck(receipt, "project-sdk-version");
1560
- const manifest = safeJson(readFileSync(join(root, "package.json")), "project package manifest");
1561
- const sdkVersion = manifest?.devDependencies?.["@earendil-works/pi-coding-agent"];
1562
- if (sdkVersion !== "0.85.1") throw new Error("Windows startup environment experiment requires the project-pinned Pi SDK");
1581
+ const sdkVersion = resolveProjectPiSdkVersion(root, "Windows startup environment experiment");
1563
1582
  selectWindowsStartupTimingCheck(receipt, "pack-command");
1564
1583
  const packed = safeJson(runBoundedNpm("pack", ["pack", "--ignore-scripts", "--json", "--pack-destination", packDirectory], isolatedEnv, root), "npm pack output");
1565
1584
  stage = "pack-result";
@@ -1656,9 +1675,7 @@ async function testUnhookedPackedImports() {
1656
1675
  mkdirSync(consumerDirectory);
1657
1676
  const { env, homes } = isolatedUnhookedEnvironment(temporary);
1658
1677
  selectUnhookedCheck(receipt, "project-sdk-version");
1659
- const manifest = safeJson(readFileSync(join(root, "package.json")), "project package manifest");
1660
- const sdkVersion = manifest?.devDependencies?.["@earendil-works/pi-coding-agent"];
1661
- if (sdkVersion !== "0.85.1") throw new Error("unhooked probe requires the project-pinned Pi SDK");
1678
+ const sdkVersion = resolveProjectPiSdkVersion(root, "unhooked probe");
1662
1679
  selectUnhookedCheck(receipt, "pack-command");
1663
1680
  const packOutput = runBoundedNpm("pack", ["pack", "--ignore-scripts", "--json", "--pack-destination", packDirectory], env, root);
1664
1681
  stage = "pack-result";
@@ -13,7 +13,6 @@ const requiredPaths = [
13
13
  "assets/orchestrator-delegation.md",
14
14
  "assets/orchestrator-memory.md",
15
15
  "assets/orchestrator-skills.md",
16
- "assets/sdd-orchestrator-workflow.md",
17
16
  "assets/agents/gentle-ai-explore.md",
18
17
  "assets/agents/gentle-ai-verify.md",
19
18
  "assets/agents/gentle-ai-worker.md",
@@ -24,27 +23,10 @@ const requiredPaths = [
24
23
  "assets/agents/review-reliability.md",
25
24
  "assets/agents/review-resilience.md",
26
25
  "assets/agents/review-risk.md",
27
- "assets/agents/sdd-apply.md",
28
- "assets/agents/sdd-archive.md",
29
- "assets/agents/sdd-design.md",
30
- "assets/agents/sdd-explore.md",
31
- "assets/agents/sdd-init.md",
32
- "assets/agents/sdd-onboard.md",
33
- "assets/agents/sdd-proposal.md",
34
- "assets/agents/sdd-remediate.md",
35
- "assets/agents/sdd-research.md",
36
- "assets/agents/sdd-spec.md",
37
- "assets/agents/sdd-status.md",
38
- "assets/agents/sdd-tasks.md",
39
- "assets/agents/sdd-verify.md",
40
26
  "assets/chains/4r-review.chain.md",
41
- "assets/chains/sdd-full.chain.md",
42
- "assets/chains/sdd-plan.chain.md",
43
- "assets/chains/sdd-verify.chain.md",
44
27
  "assets/migrations/managed-assets-v0.10.7.json",
45
28
  "assets/migrations/managed-assets-v0.13.json",
46
29
  "assets/migrations/managed-assets-v0.14.json",
47
- "assets/support/sdd-status-contract.md",
48
30
  "assets/support/strict-tdd.md",
49
31
  "assets/support/strict-tdd-verify.md",
50
32
  "docs/delegated-verification.md",
@@ -52,19 +34,21 @@ const requiredPaths = [
52
34
  "docs/skill-style-guide.md",
53
35
  "docs/review-integration.md",
54
36
  "extensions/gentle-ai.ts",
55
- "extensions/sdd-init.ts",
37
+ "extensions/resume-hint.ts",
56
38
  "extensions/skill-registry.ts",
57
39
  "lib/gentle-ai-binary.ts",
58
40
  "lib/gentle-shell-launcher.ts",
41
+ "lib/gentle-shell-resume-hint.ts",
59
42
  "lib/native-review-cli.ts",
60
43
  "lib/provider-contract-bundle.ts",
61
44
  "lib/review-host-relay.ts",
62
45
  "lib/review-integration-v2.ts",
63
46
  "lib/review-relay-contract.ts",
64
- "lib/sdd-preflight.ts",
47
+ "lib/agent-assets.ts",
65
48
  "lib/telemetry-trigger.ts",
66
49
  "runtime/gentle-ai-binary.mjs",
67
50
  "runtime/gentle-shell-launcher.mjs",
51
+ "runtime/gentle-shell-resume-hint.mjs",
68
52
  "runtime/native-review-cli.mjs",
69
53
  "runtime/review-integration-v2.mjs",
70
54
  "runtime/review-risk-assessment.mjs",
@@ -298,6 +282,11 @@ export function reconcileGeneratedRuntimeSources(packageRoot, sources, paths) {
298
282
  }
299
283
 
300
284
  async function main() {
285
+ if (existsSync(join(root, "extensions/sdd-init.ts"))) {
286
+ console.error("gentle-pi package must not restore the retired SDD init extension");
287
+ process.exit(1);
288
+ }
289
+
301
290
  const missing = requiredPaths.filter((relativePath) => {
302
291
  const absolutePath = join(root, relativePath);
303
292
  return !existsSync(absolutePath) || !statSync(absolutePath).isFile();
@@ -342,7 +331,7 @@ async function main() {
342
331
  });
343
332
 
344
333
  if (driftedContracts.length > 0) {
345
- console.error("gentle-pi packaged review-integration/v1 and review-integration/v2 contract bytes drifted from the pinned v3.6.1 runtime's vendored Gentle AI contract artifacts:");
334
+ console.error("gentle-pi packaged review-integration/v1 and review-integration/v2 contract bytes drifted from the pinned v4.0.0 runtime's vendored Gentle AI contract artifacts:");
346
335
  for (const drift of driftedContracts) console.error(`- ${drift.relativePath}: expected ${drift.expected}, got ${drift.actual}`);
347
336
  process.exit(1);
348
337
  }
@@ -387,7 +376,7 @@ async function main() {
387
376
  process.exit(1);
388
377
  }
389
378
 
390
- console.log(`gentle-pi package resource check passed (${requiredPaths.length} files; ${Object.keys(contractHashes).length} exact byte-pinned contract artifacts for the v3.6.1 runtime).`);
379
+ console.log(`gentle-pi package resource check passed (${requiredPaths.length} files; ${Object.keys(contractHashes).length} exact byte-pinned contract artifacts for the v4.0.0 runtime).`);
391
380
  }
392
381
 
393
382
  const isMainModule = process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href;
@@ -20,22 +20,25 @@ Use this skill when:
20
20
 
21
21
  1. **Every PR MUST link an approved issue** — no exceptions
22
22
  2. **Every PR MUST have exactly one `type:*` label**
23
- 3. **Automated checks must pass** before merge is possible
23
+ 3. **REQUIRED CI must pass according to target policy** before merge; CodeRabbit is optional unless required by that policy
24
24
  4. **Blank PRs without issue linkage will be blocked** by GitHub Actions
25
25
 
26
26
  ---
27
27
 
28
+ ## Target and Authorization
29
+
30
+ - Inspect `origin` locally (`git remote get-url origin`) and establish one unambiguous target host and `owner/repo`. Do not infer the target from the cwd or assume `main`. Stop if ambiguous.
31
+ - Obtain explicit remote destination, operation and credential/session authorization before any target-host reads, including `gh auth status` or repository metadata. Do not inspect or reuse an ambient SSH agent. Permission for a read does not authorize a write; confirm each remote operation is within the grant.
32
+ - Once authorized, reuse fresh target-bound issue, default branch, type labels and checks evidence from this session instead of repeating discovery. Refresh stale or mismatched evidence; do not substitute another host's data. Resolve the base from the authorized target's default branch or a human-selected base.
33
+ - Do not automatically commit, push, open a PR or merge. Prepare and report a candidate; perform each action only with its own authorization. Local preparation is not permission for remote delivery.
34
+
28
35
  ## Workflow
29
36
 
30
- ```
31
- 1. Verify issue has `status:approved` label
32
- 2. Create branch: type/description (see Branch Naming below)
33
- 3. Implement changes with conventional commits
34
- 4. Run shellcheck on modified scripts
35
- 5. Open PR using the template
36
- 6. Add exactly one type:* label
37
- 7. Wait for automated checks to pass
38
- ```
37
+ 1. Identify the authorized target and verify that the linked issue is approved; choose with the human whether the reference closes it or is nonclosing.
38
+ 2. Select the base from target metadata and prepare a `type/description` branch only when requested.
39
+ 3. Implement in work units with conventional commits when authorized; follow the merged ODD applicable test-first policy, run applicable tests, shellcheck on modified scripts, and test changed skills in at least one agent when relevant. The per-task advisory 400 authored-line heuristic is not an automatic split or a reason to omit tests or docs.
40
+ 4. Prepare the PR body from the target template and evidence. On separate authorization, open the PR and add exactly one `type:*` label.
41
+ 5. Check target-policy required CI and report pending/failing checks rather than declaring merge-ready.
39
42
 
40
43
  ---
41
44
 
@@ -67,16 +70,11 @@ Branch names MUST match this regex:
67
70
 
68
71
  ## PR Body Format
69
72
 
70
- The PR template is at `.github/PULL_REQUEST_TEMPLATE.md`. Every PR body MUST contain:
73
+ Use the authorized target's `.github/PULL_REQUEST_TEMPLATE.md`. Fill it from observed evidence, retaining its required sections.
71
74
 
72
75
  ### 1. Linked Issue (REQUIRED)
73
76
 
74
- ```markdown
75
- Closes #<issue-number>
76
- ```
77
-
78
- Valid keywords: `Closes #N`, `Fixes #N`, `Resolves #N` (case insensitive).
79
- The linked issue MUST have the `status:approved` label.
77
+ Use the human-selected closing (`Closes #N`, `Fixes #N`, or `Resolves #N`) or nonclosing `Refs #N` reference. Do not turn `Refs` into an automatic close. The linked issue MUST have the `status:approved` label; reuse fresh target-bound verification.
80
78
 
81
79
  ### 2. PR Type (REQUIRED)
82
80
 
@@ -105,33 +103,20 @@ Check exactly ONE in the template and add the matching label:
105
103
 
106
104
  ### 5. Test Plan
107
105
 
108
- ```markdown
109
- - [x] Scripts run without errors: `shellcheck scripts/*.sh`
110
- - [x] Manually tested the affected functionality
111
- - [x] Skills load correctly in target agent
112
- ```
106
+ Record actual commands and outcomes, including shellcheck on modified scripts, manual testing of affected functionality, and whether changed skills load in at least one agent. Mark inapplicable checks as such; do not invent successful runs.
113
107
 
114
108
  ### 6. Contributor Checklist
115
109
 
116
- All boxes must be checked:
117
- - Linked an approved issue
118
- - Added exactly one `type:*` label
119
- - Ran shellcheck on modified scripts
120
- - Skills tested in at least one agent
121
- - Docs updated if behavior changed
122
- - Conventional commit format
123
- - No `Co-Authored-By` trailers
110
+ Do not mark an unverified `[x]` checkbox. Check each item only after evidence supports it; leave pending items unchecked, including approved issue, exactly one `type:*` label, applicable shellcheck, skills tested in at least one agent, docs updated if behavior changed, conventional commit format, and no `Co-Authored-By` trailers. If a template demands every box checked, resolve outstanding items before submission rather than falsely attesting.
124
111
 
125
112
  ---
126
113
 
127
- ## Automated Checks (all must pass)
114
+ ## Labels and Automated Checks
128
115
 
129
- | Check | Job name | What it verifies |
130
- |-------|----------|-----------------|
131
- | PR Validation | `Check Issue Reference` | Body contains `Closes/Fixes/Resolves #N` |
132
- | PR Validation | `Check Issue Has status:approved` | Linked issue has `status:approved` |
133
- | PR Validation | `Check PR Has type:* Label` | PR has exactly one `type:*` label |
134
- | CI | `Shellcheck` | Shell scripts pass `shellcheck` |
116
+ - Apply exactly one `type:*` label from the authorized target's available labels. A commit-type mapping below is a suggestion, not proof of label availability or permission.
117
+ - Protected labels require an exact direct instruction naming the label and an actor with MAINTAIN/ADMIN permission. Do not infer authorization from a general request to prepare or open a PR.
118
+ - For a PR above the advisory 400 authored-line review budget, follow the destination repository's documented contribution/size policy. `size:exception` is a Gentle-owned repository policy, not a universal label requirement. Never request, create, or add the label for generic users unless their destination policy uses it. Only when that policy uses `size:exception`, record the human-selected `size:exception` rationale if that route was selected; no separate instructor proof is required. Preserve actual policy acceptance gates and apply the protected label only under the same direct-instruction and actor rule. Choosing `single-pr` does not waive policy gates or label authorization, nor automatically select `exception-ok`. Do not code-golf or omit tests to meet the budget.
119
+ - REQUIRED CI is determined by target policy, not a fixed list of job names. Check issue-reference validation (including target-supported `Refs`), issue approval, exactly one type label and shellcheck where the target requires them. CodeRabbit is optional unless required by target policy. Report required pending or failing checks; never merge on an unverified green claim.
135
120
 
136
121
  ---
137
122
 
@@ -170,7 +155,7 @@ Type-to-label mapping:
170
155
  Examples:
171
156
  ```
172
157
  feat(scripts): add Codex support to setup.sh
173
- fix(skills): correct topic key format in sdd-apply
158
+ fix(skills): correct branch name guidance
174
159
  docs(readme): update multi-model configuration guide
175
160
  refactor(skills): extract shared persistence logic
176
161
  chore(ci): add shellcheck to PR validation workflow
@@ -186,17 +171,4 @@ feat!: redesign skill loading system
186
171
 
187
172
  ## Commands
188
173
 
189
- ```bash
190
- # Create branch
191
- git checkout -b feat/my-feature main
192
-
193
- # Run shellcheck before pushing
194
- shellcheck scripts/*.sh
195
-
196
- # Push and create PR
197
- git push -u origin feat/my-feature
198
- gh pr create --title "feat(scope): description" --body "Closes #N"
199
-
200
- # Add type label to PR
201
- gh pr edit <pr-number> --add-label "type:feature"
202
- ```
174
+ Local target inspection may use `git remote get-url origin`. After explicit target-host read authorization, verify target metadata and the default branch with target-bound `gh` calls; never use implicit cwd targeting. Run applicable local checks before proposing delivery. Only with separate authorization for the verified destination, operation and credential/session may you push, create or edit a PR. Pass the verified `--repo` and `--base` explicitly, and use the human-selected issue-reference form in the body. Do not execute a command block as an automatic workflow.
@@ -9,45 +9,61 @@ metadata:
9
9
 
10
10
  ## Activation Contract
11
11
 
12
- Load this skill when a planned PR may exceed **400 changed lines**, SDD forecasts `400-line budget risk: High` or `Chained PRs recommended: Yes`, an ODD feature's forecast or running authored changed-line count from work-unit commits exceeds about 400, or the user asks for chained/stacked PRs, review slices, or reviewer-load control.
12
+ Load this skill when a planned PR may exceed **400 changed lines**, an ODD feature's forecast or running authored changed-line count from work-unit commits exceeds about 400, or the user asks for chained/stacked PRs, review slices, or reviewer-load control. The per-task advisory 400 authored-line heuristic does not itself require a PR split.
13
13
 
14
14
  ## Hard Rules
15
15
 
16
- - Split PRs over **400 changed lines** unless a maintainer explicitly accepts `size:exception`.
16
+ - Recommend slicing PRs over **400 changed lines**; offer the ordered oversized-delivery menu below and follow the user's selection subject to the destination repository's documented contribution/size policy.
17
+ - `size:exception` is a Gentle-owned repository policy, not a universal label requirement. Never request, create, or add this label for generic users unless the destination policy uses it. Preserve that policy's maintainer acceptance gates and protected-label human authorization; selection alone grants neither.
17
18
  - The budget constrains how work is **sliced**, never the code itself. Never delete comments, blank lines, docs, or tests, and never compress or restyle code, to fit under the budget.
18
- - Slicing is bounded: make **one** honest slicing pass. If no cohesive split brings every slice within budget, stop iterating, keep the best cohesive split, and report the final line count with a `size:exception` recommendation.
19
+ - Slicing is bounded: make **one** honest slicing pass. If no cohesive split brings every slice within budget, stop iterating, keep the best cohesive split, and report the final line count and rationale. Recommend a size exception only when the destination policy provides that route.
19
20
  - Keep each PR reviewable in about **≤60 minutes**.
20
- - Use one deliverable work unit per PR; keep tests/docs with the unit they verify.
21
+ - In a chain, use one deliverable work unit per PR; keep tests/docs with the unit they verify. A selected single PR may contain multiple coherent work-unit commits.
21
22
  - State start, end, prior dependencies, follow-up work, and out-of-scope items in every chained PR.
22
23
  - Every child PR must include a dependency diagram marking the current PR with `📍`.
23
24
  - In Feature Branch Chain, create a draft/no-merge tracker PR; child PR #1 targets the tracker branch, later children target the immediate parent branch.
24
25
  - Treat polluted diffs as base bugs: retarget or rebase until only the current work unit appears.
25
26
  - Do not mix chain strategies after the user chooses one.
27
+ - Before creating branches or PRs, verify the target repository's default branch; use it as the integration base, not an assumed `main`. `stacked-to-main` is the historical strategy token even when the default branch has another name.
28
+
29
+ ## Oversized Delivery Menu
30
+
31
+ Offer exactly three choices in this semantic order; English examples are illustrative and localizable, not mandatory copy. Generate the complete user-facing question, 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.
32
+
33
+ 1. **Feature/tracker branch chain** — `chain_strategy=feature-branch-chain`; review child slices before final feature integration.
34
+ 2. **Verified default/main branch chain** — `chain_strategy=stacked-to-main`; land independently reviewable slices in order on the verified default branch, whatever its name.
35
+ 3. **One single PR — least recommended** — `delivery_strategy=single-pr`; keep the entire change in one PR rather than a chain.
36
+
37
+ 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` or imply an accepted policy exception.
38
+
39
+ The least recommended marker applies only to this oversized menu. An oversized single PR increases reviewer cognitive load, slows feedback, and couples rollback of otherwise separable work; a focused single PR within 400 changed lines remains reasonable. Delivery selection does not authorize push, PR creation, merge, or changes to review mode or candidate consent.
26
40
 
27
41
  ## Decision Gates
28
42
 
29
43
  | Condition | Action |
30
44
  |---|---|
31
45
  | PR ≤400 changed lines and focused | Keep single PR. |
32
- | PR >400, each slice can land independently | Use Stacked PRs to main. |
33
- | PR >400, feature must integrate before main | Use Feature Branch Chain with tracker. |
34
- | Generated/vendor/migration diff cannot split cleanly | Ask maintainer for `size:exception`. |
35
- | No cohesive split fits the budget after one slicing pass | Stop; deliver the best split, report the overage and why it cannot shrink further, and recommend `size:exception`. |
36
- | SDD provides `delivery_strategy` | Follow it before apply/PR creation. |
37
- | ODD provides `delivery_strategy` and `chain_strategy` | Follow them before the next work-unit commit or PR creation. |
46
+ | PR >400, each slice can land independently | Recommend Stacked PRs to the verified default branch; respect the selected delivery strategy. |
47
+ | PR >400, feature must integrate before the default branch | Recommend Feature Branch Chain with tracker; respect the selected delivery strategy. |
48
+ | Generated/vendor/migration diff cannot split cleanly | Report the overage; follow destination policy for any required exception. |
49
+ | No cohesive split fits the budget after one slicing pass | Stop slicing; report the best cohesive split and why it cannot shrink further, then apply the selected delivery strategy and destination policy. |
50
+ | ODD `delivery_strategy` is `ask-on-risk` | When the budget is exceeded, ask once using the menu above for a chain strategy or single PR before the next work-unit commit. |
51
+ | ODD `delivery_strategy` is `auto-chain` | Ask for a chain strategy only when missing; otherwise use the cached choice. |
52
+ | ODD `delivery_strategy` is `single-pr` | Follow the destination repository's documented contribution/size policy for the overage; do not ask for a chain strategy. |
53
+ | ODD `delivery_strategy` is `exception-ok` | Record the explicitly accepted exception under destination policy, including `size:exception` only where applicable; do not ask for a chain strategy. |
38
54
 
39
55
  ## Execution Steps
40
56
 
41
57
  1. Estimate changed lines and identify independent work units.
42
- 2. Ask for a chain strategy when none is cached and the budget is exceeded.
43
- 3. Create branches/PRs using the chosen strategy only.
44
- 4. Add Chain Context to each PR without replacing the repo PR template.
58
+ 2. Apply the delivery-strategy gate above; offer the menu only on a chaining path that needs a choice. For `auto-chain`, use a cached chain strategy without prompting again; if missing, offer all three choices.
59
+ 3. Verify the target repository's default branch before creating branches/PRs; use the chosen strategy only.
60
+ 4. On chaining paths only, add Chain Context to each child PR without replacing the repo PR template.
45
61
  5. Verify each PR independently: CI/tests/docs/manual checks, rollback scope, and clean diff.
46
- 6. Keep tracker PR draft/no-merge until all child PRs are reviewed and integrated.
62
+ 6. For Feature Branch Chain only, keep tracker PR draft/no-merge until all child PRs are reviewed and integrated.
47
63
 
48
64
  ## Output Contract
49
65
 
50
- Return the chosen strategy, PR order, current PR boundary, dependency diagram, review budget (`additions + deletions`), verification plan, and any `size:exception` rationale.
66
+ Return the chosen delivery strategy, review budget (`additions + deletions`), scope, verification plan, and any destination-policy exception rationale. For chaining, also return PR order, current PR boundary, and dependency diagram. For `single-pr`, require no tracker, child dependency diagram, or Chain Context; use the destination PR template without chain-only artifacts.
51
67
 
52
68
  ## References
53
69
 
@@ -2,19 +2,28 @@
2
2
 
3
3
  ## Strategy Notes
4
4
 
5
- | | Stacked PRs to main | Feature Branch Chain |
6
- |---|---|---|
7
- | Speed | Each slice can ship in order | Full feature waits for tracker merge |
8
- | Rollback | Revert individual main PRs | Revert/hold the whole feature branch |
9
- | Risk | Partial behavior may land | Nothing lands until the chain completes |
10
- | Complexity | Simpler retarget/rebase flow | Requires tracker and strict diff hygiene |
5
+ Before creating branches or PRs, verify the target repository's default branch and use it as `<default branch>` throughout these examples. Do not infer it from the current local branch. The historical strategy token `stacked-to-main` means stacking onto that verified default branch, even when its name is not `main`.
6
+
7
+ The oversized menu has exactly three outcomes in the order below. English examples are illustrative and localizable, not mandatory copy. Generate the complete user-facing question, 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.
8
+
9
+ | Ordered outcome | Feature/tracker branch chain | Default/main branch chain | One single PR — least recommended |
10
+ |---|---|---|---|
11
+ | Mapping | `chain_strategy=feature-branch-chain` | `chain_strategy=stacked-to-main` | `delivery_strategy=single-pr` |
12
+ | Speed | Full feature waits for tracker merge | Each slice can ship in order | All feedback and delivery wait on one large review |
13
+ | Rollback | Revert/hold the whole feature branch | Revert individual merged PRs | Revert the combined change |
14
+ | Risk | Nothing lands until the chain completes | Partial behavior may land | Higher reviewer load and coupled scope |
15
+ | Complexity | Requires tracker and strict diff hygiene | Retarget/rebase after parent merges | No chain artifacts, but harder review isolation |
16
+
17
+ Selecting single PR overrides the pending chaining path: clear the chain choice as inapplicable and suppress later chain prompts. It is not a chain strategy and does not select `exception-ok`. Least recommended applies only to this oversized menu; focused ≤400-line single PRs remain reasonable. Use the destination PR template with scope, changed-line count, verification, and any applicable exception rationale; do not require a tracker, child dependency diagram, or Chain Context.
18
+
19
+ Follow the destination repository's documented contribution/size policy. `size:exception` is a Gentle-owned repository policy, not a universal label requirement. Never request, create, or add the label for generic users unless the destination policy uses it. Preserve applicable maintainer acceptance and protected-label authorization. Delivery selection does not authorize push, PR creation, merge, or review-mode/consent changes.
11
20
 
12
21
  ## Feature Branch Chain
13
22
 
14
23
  Use when the feature branch accumulates the final integration while child PRs are reviewed as focused slices.
15
24
 
16
25
  ```text
17
- main
26
+ <default branch>
18
27
  └── feat/my-feature ← tracker/final integration branch
19
28
  ↑ PR #1 base: feat/my-feature
20
29
  └── feat/my-feature-01-core
@@ -26,27 +35,27 @@ main
26
35
 
27
36
  Steps:
28
37
 
29
- 1. Create the feature/tracker branch from `main`.
30
- 2. Open the tracker PR to `main`; mark it draft/no-merge.
38
+ 1. Create the feature/tracker branch from the verified `<default branch>`.
39
+ 2. Open the tracker PR to `<default branch>`; mark it draft/no-merge.
31
40
  3. Create PR #1 from a child branch and target it to the tracker branch.
32
41
  4. Create each later child branch from the previous PR branch and target it to that parent branch.
33
42
  5. Merge/integrate children in order; merge the tracker only after the chain is complete.
34
43
 
35
- ## Stacked PRs to Main
44
+ ## Stacked PRs to Default Branch
36
45
 
37
- Use when each slice can land on `main` in order.
46
+ Use when each slice can land on the verified `<default branch>` in order.
38
47
 
39
48
  ```text
40
- main <- PR 1: foundation
49
+ <default branch> <- PR 1: foundation
41
50
  └── PR 2: feature slice built on PR 1
42
51
  └── PR 3: docs/tests built on PR 2
43
52
  ```
44
53
 
45
- After a parent PR merges, rebase/retarget the next PR so GitHub shows only the current slice.
54
+ Base PR #1 on the verified `<default branch>`; base each subsequent PR on its immediate parent until that parent merges. After a parent PR merges, rebase/retarget the next PR so GitHub shows only the current slice.
46
55
 
47
56
  ## Chain Context Section
48
57
 
49
- Append this section to the repo PR template; do not replace required issue/checklist sections.
58
+ On chaining paths only, append this section to the repo PR template; do not replace required issue/checklist sections. Skip this entire section for a single PR.
50
59
 
51
60
  ```markdown
52
61
  ## Chain Context
@@ -66,7 +75,7 @@ Append this section to the repo PR template; do not replace required issue/check
66
75
  ### Chain Overview
67
76
 
68
77
  ```text
69
- main
78
+ <default branch>
70
79
  └── #NNN Previous PR
71
80
  └── 📍 #NNN This PR
72
81
  └── #NNN Next PR
@@ -85,15 +94,17 @@ main
85
94
 
86
95
  ## Commands
87
96
 
97
+ Before any remote read or PR creation, require explicit human authorization for the destination (exact host/repository), operation (PR read or creation), and credential/session. Do not probe credentials or remote targets to resolve ambiguity. Verify the target repository and its default branch using only the authorized session and destination; set `TARGET` to that verified host/repository. Stop if authorization or verification is missing. Each command below binds to that same verified target; the base branches must belong to it.
98
+
88
99
  ```bash
89
- gh pr view <PR_NUMBER> --json additions,deletions,changedFiles,title,url
90
- gh pr create --base feat/my-feature --title "feat(scope): focused slice" --body-file pr-body.md
91
- gh pr create --base feat/my-feature-01-core --title "feat(scope): next focused slice" --body-file pr-body.md
100
+ gh pr view <PR_NUMBER> --repo "$TARGET" --json additions,deletions,changedFiles,title,url
101
+ gh pr create --repo "$TARGET" --base feat/my-feature --title "feat(scope): focused slice" --body-file pr-body.md
102
+ gh pr create --repo "$TARGET" --base feat/my-feature-01-core --title "feat(scope): next focused slice" --body-file pr-body.md
92
103
  ```
93
104
 
94
105
  ## Reviewer Guidance
95
106
 
96
- - Ask for a split when a PR exceeds 400 changed lines without `size:exception`.
97
- - Recommend Feature Branch Chain when work must integrate before `main`.
107
+ - Recommend a split when a PR exceeds 400 changed lines; respect the selected delivery shape and enforce only the destination's documented size/exception policy.
108
+ - Recommend Feature Branch Chain when work must integrate before the verified `<default branch>`.
98
109
  - Recommend stacked PRs when each slice can merge independently.
99
110
  - Review child PRs against immediate parent branches; a polluted diff is a branching bug.
@@ -1,23 +1,23 @@
1
1
  ---
2
2
  name: gentle-ai
3
- description: "Use Gentle AI harness discipline for Pi work: clarify first, preserve OpenSpec artifacts, use strict TDD where available, delegate through subagents when useful, and protect review workload."
3
+ description: "Use Gentle AI harness discipline for Pi work: clarify first, track ODD work, use applicable test-first development by default, delegate when useful, and protect review workload."
4
4
  ---
5
5
 
6
6
  # el Gentleman Harness
7
7
 
8
- Use this skill when work is non-trivial, risky, multi-step, or likely to benefit from SDD/OpenSpec artifacts.
8
+ Use this skill for non-trivial, risky, or multi-step ODD work.
9
9
 
10
10
  ## Identity Rule
11
11
 
12
- When asked who or what you are, answer as el Gentleman: a Pi-specific coding-agent harness with senior architect persona, SDD/OpenSpec artifacts, and subagent coordination. Do not answer as a generic assistant.
12
+ When asked who or what you are, answer as el Gentleman: a Pi-specific coding-agent harness with senior architect persona, ODD by default, and subagent coordination. Do not answer as a generic assistant.
13
13
 
14
14
  ## Compact Rules
15
15
 
16
16
  - Clarify scope, constraints, acceptance criteria, and non-goals before implementation.
17
- - Use OpenSpec-style artifacts for proposal, specs, design, tasks, apply progress, verify report, and archive notes.
18
- - If tests exist, follow strict TDD: RED, GREEN, TRIANGULATE, REFACTOR, and record evidence.
17
+ - For substantial authorized ODD work, track the feature in its task document and mirror.
18
+ - For behavior changes with applicable runnable deterministic tests and a clear expected outcome, use test-first by default: observe RED, GREEN, relevant alternate cases, then REFACTOR and record evidence. Test presence alone does not establish applicability. For passive documentation, non-testable changes, an unavailable runner, or no meaningful RED, state why and run proportionate ordinary functional or structural verification. Never invent RED/GREEN, skip checks, or require a chat/TUI toggle.
19
19
  - Keep one parent session responsible for orchestration; child subagents should receive concrete phase work and must not spawn more subagents.
20
- - Parent-only delegation triggers apply after complexity appears: 4+ files for understanding, 2+ non-trivial files to write, tooling/worktree incidents, or long sessions with accumulating complexity.
20
+ - Parent-only delegation triggers apply after complexity appears: reading beyond the evidence budget, 2+ non-trivial files to write, tooling/worktree incidents, or a parent context past the context backstop.
21
21
  - Keep writes single-threaded unless the user explicitly approves isolated parallel worktrees.
22
22
  - Forecast review workload before large changes; ask before producing oversized or multi-area diffs.
23
23
  - Keep dangerous-command safety independent and authoritative.
@@ -32,13 +32,7 @@ Use the smallest safe harness:
32
32
  ```text
33
33
  small + known context → inline direct
34
34
  unknown / context-heavy → simple delegation
35
- large / ambiguous / risky → SDD
36
- ```
37
-
38
- For substantial changes:
39
-
40
- ```text
41
- clarify → explore → proposal → spec → design → tasks → apply → verify → archive
35
+ substantial authorized work → track ODD tasks and implement by work unit
42
36
  ```
43
37
 
44
38
  For bounded implementation with subagents:
@@ -49,10 +43,10 @@ clarify → scout/context-builder when context-heavy → one worker → verify
49
43
 
50
44
  Hard delegation triggers:
51
45
 
52
- - **4-file rule**: reading 4+ files to understand means delegate exploration.
46
+ - **Evidence-budget rule**: read inline only when the evidence fits one parallel batch of at most 3 calls, ~10k tokens (grep and line ranges, never whole large files). Larger reading, more than ~5 sequential lookups, or a long session ahead means delegate one explorer that returns a handoff of at most ~2k tokens with `path:line` evidence. Never force delegation for a small targeted question; do not re-read what the handoff covered beyond one spot check.
53
47
  - **Multi-file write rule**: touching 2+ non-trivial files means use one worker.
54
48
  - **Incident rule**: after wrong cwd, accidental worktree/repo mutation, merge recovery, confusing test command, or environment workaround, diagnose separately.
55
- - **Long-session rule**: after roughly 20 tool calls, 5 exploratory reads, or 2 non-mechanical edits with no delegation and accumulating complexity, pause and choose a non-review subagent or justify not doing so.
49
+ - **Context backstop**: when the parent context passes ~150k tokens, pause and delegate the next bounded unit of work to a non-review subagent. Keep command output bounded (counts, `--stat`, `tail`) and send full suites and builds to a verifier.
56
50
 
57
51
  ## Review Lens Selection
58
52
 
@@ -15,7 +15,9 @@ Discover the target repository's contribution workflow before proposing or publi
15
15
 
16
16
  ## Safe Discovery
17
17
 
18
- Run read-only checks first:
18
+ Before any `gh auth status` or target read, require explicit human authorization for the remote destination (exact host and repository), operation (including discovery and intended issue creation), and credential/session to use. A local checkout is not authorization. If any is missing or ambiguous, stop locally; never probe credentials or sessions to resolve ambiguity. Run the checks below only with the authorized credential/session against the authorized destination; if `gh auth status` would inspect other credentials/sessions, do not run it. Verify the discovered `REPO`, `HOST`, and `TARGET` match the authorized destination before continuing; never switch identities or targets implicitly.
19
+
20
+ After that gate, run read-only checks:
19
21
 
20
22
  ```bash
21
23
  gh auth status
@@ -31,6 +33,8 @@ gh api --hostname "$HOST" --paginate "repos/$REPO/labels?per_page=100" --jq '.[]
31
33
 
32
34
  Inspect `README.md`, contribution instructions, `.github/ISSUE_TEMPLATE/config.yml` contact links, forms, labels, and open and closed issues. For questions/support, follow repository-prescribed Discussions/contact routing when available; otherwise ask or stop. Complete target verification for `REPO`, `HOST`, and `TARGET`. Fail closed before mutation when authentication, target verification, issue availability, policy, form selection, or required metadata is missing or ambiguous. A blank fallback is allowed only when `isBlankIssuesEnabled` is explicitly true.
33
35
 
36
+ Before building `LABEL_ARGS`, inspect labels declared by the selected YAML form as well as any manually selected labels. Treat `status:approved`, `size:exception`, and any repository-protected label as protected form labels at create-time. Include a protected label only with a current, exact label-specific direct human instruction for this target and creation action, authenticated actor target-host `viewerPermission` of `MAINTAIN` or `ADMIN`, and repository policy permission; do not infer authority from YAML, a publication request, or local credentials. If this proof is missing, skip the protected label only when the form and repository policy permit omitting it; if the protected label is required, fail closed without creating the issue. Do not replace it with another label or use a write to probe permission. For `size:exception`, also require the current human-approved rationale; if recording it needs an unauthorized extra action, stop. This create-time gate does not change post-publication actions.
37
+
34
38
  Build `LABEL_ARGS` only from reviewed labels that exist and policy permits the actor to apply:
35
39
 
36
40
  ```bash
@@ -104,6 +108,8 @@ gh issue view "$NUMBER" --repo "$TARGET" --json number,url,title,body,state,labe
104
108
 
105
109
  Confirm that read-back identifies the target-host issue and that title and body match after only CRLF-to-LF and trailing-final-newline normalization. Report `confirmed` only after this target-host read-back. Otherwise report `no_write` when an authoritative rejection proves no issue was created, or `unknown` and stop all later mutations.
106
110
 
107
- ## Triage
111
+ ## Triage And Later Actions
108
112
 
109
113
  Before approving or closing an issue, verify it is concrete, non-duplicate, sufficiently evidenced, in scope, and consistent with repository label/status policy. If any point is uncertain, retain the repository review state and request the smallest missing evidence.
114
+
115
+ For any post-publication label/status mutation, follow [delegated workflow actions](references/delegated-workflow-actions.md). Publication is not authorization for a later action. Keep the automated YAML Form path and conditional blank/browser fallback above unchanged.
@@ -0,0 +1,19 @@
1
+ # Delegated post-publication issue/PR actions
2
+
3
+ This guidance applies after publication only. Remote work still requires separate authorization for destination, operation, and credential/session; this document grants none. Keep the YAML Issue Form, conditional blank fallback, and browser handoff in the creation workflow unchanged.
4
+
5
+ ## Authority and capability
6
+
7
+ - Require a current direct human instruction binding exact `HOST`, `REPO`, issue-or-PR number, and action, including exact labels to add/remove or the status transition. Never infer these from generated plans, issue text, memory, or a prior publication. Stop when the instruction is missing or ambiguous.
8
+ - Before any mutation, verify the authenticated actor, target host/repository, object type and number, existing labels, and repository policy through target-host reads. Do not switch hosts or identities to gain permission; a local credential alone proves nothing about the target.
9
+ - For protected labels (`status:approved`, `size:exception`, and any repository-protected label), require the authenticated actor's target-host `viewerPermission` to be `MAINTAIN` or `ADMIN` and the direct instruction above. There is no separate target-host proof of the instruction-giver's identity. If permission is unavailable, insufficient, or policy disallows the action, stop without probing capability through a write.
10
+ - For unprotected labels, require that each exact label already exists and that the authenticated actor may apply it under repository policy. Do not create, rename, or substitute a label. A comment, closure, body edit, or unrelated label change requires its own direct instruction.
11
+
12
+ ## One bounded action
13
+
14
+ 1. Pre-read the exact target-host object, including identity, state, relevant title/body and all labels, plus the existing-label list and actor permission. Check the proposed transition against policy; if already satisfied, report a no-op. For approval, establish concrete, non-duplicate, sufficiently evidenced, in-scope findings first; uncertainty preserves the review state. For `size:exception`, require a current human-approved rationale for the exception and preserve its meaning in the intended record. Never infer approval or rationale from diff size. The roughly 400-line review heuristic is advisory, not authorization to apply the label.
15
+ 2. Build only the instructed existing-label changes. A `status:approved` transition must be an atomic update removing observed conflicting status labels and adding `status:approved`, without dropping unrelated labels or exposing an intermediate status. Stop if the target-host API cannot guarantee that update or concurrent state has changed. If recording the `size:exception` rationale requires an additional unauthorized action, stop and seek a scoped instruction instead of silently posting it.
16
+ 3. Immediately before posting text, scan and redact the exact text for credentials, private project names, usernames, hostnames, home paths, and private addresses. Use a verified target-host API that supports the intended action, not a guessed CLI sequence. Make one mutation attempt; never retry timeouts or uncertain responses.
17
+ 4. Post-read the same target-host object once and compare its identity and requested labels/status against the pre-read, including preservation of unrelated labels. Report `confirmed` only after an unambiguous matching target-host post-readback, `no_write` only after authoritative rejection proving no write, or `unknown` for a timeout, missing identity, conflict, or failed/ambiguous readback. On `unknown`, stop all further mutations; command output alone cannot establish success.
18
+
19
+ Report the exact target/action, actor capability evidence, pre/post-readback outcome, and exception rationale when applicable without leaking private text. Operational checkboxes in the publication form may be marked only from retained agent evidence; personal, legal and user-consent declarations require explicit first-person user affirmation, never a delegated label action or the publication request. For implementation work leading to an issue or PR, retain the applicable ODD default and test-first checks; this action guide does not replace them.