@joshuafolkken/kit 1.1455.0 → 1.1514.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 (374) hide show
  1. package/.claude/settings.json +6 -6
  2. package/.claude/skills/dependency-update/SKILL.md +26 -55
  3. package/.claude/skills/epic-commands/SKILL.md +83 -156
  4. package/.claude/skills/epic-commands/epic-bundle.md +51 -79
  5. package/.claude/skills/epic-commands/execution-waves.md +43 -81
  6. package/.claude/skills/verify-ui/SKILL.md +24 -50
  7. package/.claude/skills/workflow-commands/SKILL.md +7 -9
  8. package/.claude/skills/workflow-commands/background-commands.md +31 -46
  9. package/.claude/skills/workflow-commands/backlogrun-child.md +65 -85
  10. package/.claude/skills/workflow-commands/backlogrun-lanes.md +86 -125
  11. package/.claude/skills/workflow-commands/backlogrun-park.md +68 -118
  12. package/.claude/skills/workflow-commands/backlogrun-progress.md +17 -28
  13. package/.claude/skills/workflow-commands/backlogrun-recovery.md +17 -26
  14. package/.claude/skills/workflow-commands/backlogrun-steps.md +35 -52
  15. package/.claude/skills/workflow-commands/backlogrun.md +31 -50
  16. package/.claude/skills/workflow-commands/chain-rule.md +31 -40
  17. package/.claude/skills/workflow-commands/delegation.md +12 -8
  18. package/.claude/skills/workflow-commands/entry-sequence.md +1 -3
  19. package/.claude/skills/workflow-commands/followup.md +55 -77
  20. package/.claude/skills/workflow-commands/fullrun-steps.md +3 -5
  21. package/.claude/skills/workflow-commands/fullrun.md +4 -6
  22. package/.claude/skills/workflow-commands/halfrun.md +3 -7
  23. package/.claude/skills/workflow-commands/into-target.md +1 -2
  24. package/.claude/skills/workflow-commands/issue-comments.md +43 -60
  25. package/.claude/skills/workflow-commands/issue-scout.md +3 -2
  26. package/.claude/skills/workflow-commands/kickoff.md +65 -74
  27. package/.claude/skills/workflow-commands/latest-gate.md +2 -6
  28. package/.claude/skills/workflow-commands/needs-human-review.md +2 -5
  29. package/.claude/skills/workflow-commands/observation-filing.md +59 -118
  30. package/.claude/skills/workflow-commands/observation-ledger.md +52 -112
  31. package/.claude/skills/workflow-commands/pre-gate-cut.md +88 -142
  32. package/.claude/skills/workflow-commands/prerequisite.md +11 -17
  33. package/.claude/skills/workflow-commands/progress-watcher.md +23 -33
  34. package/.claude/skills/workflow-commands/prrun.md +3 -5
  35. package/.claude/skills/workflow-commands/retrospective.md +35 -54
  36. package/.claude/skills/workflow-commands/split-assessment.md +32 -58
  37. package/.claude/skills/workflow-commands/target-repository.md +1 -2
  38. package/.claude/skills/workflow-commands/working-tree-hold.md +54 -73
  39. package/.codex/hooks.json +6 -6
  40. package/.github/actions/setup-node/action.yml +1 -1
  41. package/.github/workflows/ci.yml +1 -1
  42. package/.github/workflows/publish.yml +2 -2
  43. package/CLAUDE.md +7 -6
  44. package/cspell/index.yaml +7 -0
  45. package/dist/CLAUDE.md +7 -6
  46. package/dist/commands/document-section-cli.js +67 -34
  47. package/dist/hooks/batch-guard.js +6 -6
  48. package/dist/hooks/chunk-4KKD2UTK.js +66 -0
  49. package/dist/hooks/{chunk-GPLGZ6IC.js → chunk-6TS2JD6D.js} +14 -3
  50. package/dist/hooks/chunk-7DSBJVFH.js +50 -0
  51. package/dist/hooks/{chunk-5H4SSDSD.js → chunk-A65Y4YOR.js} +3 -3
  52. package/dist/hooks/{chunk-3C4XRYG6.js → chunk-APUO6U4J.js} +102 -19
  53. package/dist/hooks/{chunk-IX6TTTI6.js → chunk-EFXE6C37.js} +8 -22
  54. package/dist/hooks/chunk-GP4IEC4O.js +20 -0
  55. package/dist/hooks/chunk-JP45SOCJ.js +56 -0
  56. package/dist/hooks/{chunk-OLMO72ON.js → chunk-LAOV7NLM.js} +1 -1
  57. package/dist/hooks/chunk-M4HGZV7U.js +83 -0
  58. package/dist/hooks/{chunk-TBJFTSUY.js → chunk-O6GDRNJB.js} +9 -7
  59. package/dist/hooks/{chunk-HFGWYGUV.js → chunk-PF2NZL2A.js} +5 -5
  60. package/dist/hooks/{chunk-WNLVGT7E.js → chunk-PTICX4OL.js} +4 -5
  61. package/dist/hooks/{chunk-HHI6FO3R.js → chunk-RT27QRJW.js} +763 -1515
  62. package/dist/hooks/{chunk-7WQBPLUN.js → chunk-SYOTDYCI.js} +1149 -1095
  63. package/dist/hooks/{chunk-LIAFCXL7.js → chunk-TNUMY6NL.js} +1519 -1332
  64. package/dist/hooks/chunk-UPUZF3AN.js +279 -0
  65. package/dist/hooks/{chunk-Z4XI7CZS.js → chunk-WK6SMBIC.js} +1932 -784
  66. package/dist/hooks/codex-hook-adapter.js +17 -14
  67. package/dist/hooks/duplicate-read-guard.js +7 -7
  68. package/dist/hooks/format-edited.js +5 -4
  69. package/dist/hooks/inputs.json +302 -247
  70. package/dist/hooks/investigation-guard.js +8 -11
  71. package/dist/hooks/pretool-guard.js +16 -13
  72. package/dist/hooks/session-lang.js +372 -26
  73. package/dist/hooks/stop-guard.js +2593 -189
  74. package/dist/josh.js +2128 -282
  75. package/dist/managed-marker/index.js +1 -2
  76. package/dist/version/index.js +15 -12
  77. package/eslint/base.js +2 -1
  78. package/eslint/rules/unicorn.js +16 -0
  79. package/lefthook/base.yml +5 -3
  80. package/package.json +14 -12
  81. package/prompts/coding-standards.md +12 -22
  82. package/prompts/collaboration-workflow/file-edits.md +25 -45
  83. package/prompts/collaboration-workflow/gh-rest.md +19 -36
  84. package/prompts/collaboration-workflow/glossary.md +5 -7
  85. package/prompts/collaboration-workflow/issue-citation.md +6 -14
  86. package/prompts/collaboration-workflow/issue-template.md +40 -32
  87. package/prompts/collaboration-workflow/lane-instructions.md +35 -0
  88. package/prompts/collaboration-workflow/operating-rules.md +33 -46
  89. package/prompts/collaboration-workflow/output-bounds.md +15 -15
  90. package/prompts/collaboration-workflow/overview.md +14 -19
  91. package/prompts/collaboration-workflow/plan-comment.md +13 -13
  92. package/prompts/collaboration-workflow/principles.md +57 -54
  93. package/prompts/collaboration-workflow/proposal-request.md +1 -9
  94. package/prompts/collaboration-workflow/report-format.md +41 -49
  95. package/prompts/collaboration-workflow/residency.md +15 -11
  96. package/prompts/collaboration-workflow/rule-delivery.md +7 -15
  97. package/prompts/collaboration-workflow/shell-body.md +10 -20
  98. package/prompts/collaboration-workflow/turn-batching.md +8 -14
  99. package/prompts/collaboration-workflow/upstream-interrupt.md +26 -34
  100. package/prompts/collaboration-workflow/wip-cap.md +26 -32
  101. package/prompts/collaboration-workflow.md +25 -25
  102. package/prompts/refactoring.md +33 -43
  103. package/prompts/review-rubric.md +84 -129
  104. package/prompts/review.md +110 -141
  105. package/prompts/sonar-hotspot-handling.md +22 -50
  106. package/prompts/testing-guide.md +48 -99
  107. package/scripts/adopt/adopt-toolkits.ts +2 -4
  108. package/scripts/agent/agent-argv.ts +20 -4
  109. package/scripts/agent/agent-exit-record.ts +23 -1
  110. package/scripts/agent/agent-role-profile.ts +101 -45
  111. package/scripts/agent/agent-safe-text.ts +60 -0
  112. package/scripts/agent/claude-agent-argv.ts +14 -0
  113. package/scripts/agent/codex-agent-argv.ts +9 -2
  114. package/scripts/agent/lane-instructions.ts +144 -0
  115. package/scripts/backlog/backlog-budget-cli.ts +1 -2
  116. package/scripts/backlog/backlog-budget.ts +4 -4
  117. package/scripts/backlog/backlog-drive-carried.ts +26 -0
  118. package/scripts/backlog/backlog-drive-cli.ts +10 -5
  119. package/scripts/backlog/backlog-drive-named.ts +3 -5
  120. package/scripts/backlog/backlog-drive-restore.ts +28 -2
  121. package/scripts/backlog/backlog-drive-seats.ts +27 -0
  122. package/scripts/backlog/backlog-drive.ts +11 -6
  123. package/scripts/backlog/backlog-occupied.ts +56 -0
  124. package/scripts/backlog/backlog-ready.ts +59 -15
  125. package/scripts/behavior/behavior-rules.ts +3 -2
  126. package/scripts/cost-runtime/codex-usage.ts +4 -2
  127. package/scripts/cost-runtime/cost-cli.ts +1 -2
  128. package/scripts/delegation/duplicate-read-guard.ts +2 -2
  129. package/scripts/delegation/investigation-guard.ts +15 -65
  130. package/scripts/delegation/investigation-reads.ts +1 -2
  131. package/scripts/discovery/repo-discovery.ts +4 -2
  132. package/scripts/discovery/repo-origin.ts +2 -4
  133. package/scripts/doctor/doctor-logic.ts +6 -3
  134. package/scripts/document/document-byte-budget.ts +28 -27
  135. package/scripts/document/document-byte-check.ts +1 -2
  136. package/scripts/document/document-section-cli.ts +17 -5
  137. package/scripts/document/entry-read-budget.ts +3 -3
  138. package/scripts/document/read-set-cli.ts +4 -1
  139. package/scripts/epic/epic-audit-orphans.ts +5 -8
  140. package/scripts/epic/epic-audit-rationale.ts +8 -2
  141. package/scripts/epic/epic-audit.ts +52 -1
  142. package/scripts/epic/epic-bundle-cli.ts +1 -2
  143. package/scripts/epic/epic-bundle-evidence.ts +49 -26
  144. package/scripts/epic/epic-bundle-referenced.ts +14 -3
  145. package/scripts/epic/epic-bundle.ts +17 -9
  146. package/scripts/epic/epic-chains.ts +6 -2
  147. package/scripts/epic/epic-close-comment.ts +1 -2
  148. package/scripts/followup/git-followup-workflow.ts +19 -1
  149. package/scripts/gate/check-inputs.ts +129 -0
  150. package/scripts/gate/check-reuse.ts +162 -0
  151. package/scripts/gate/core-budget.ts +93 -44
  152. package/scripts/gate/core-wait.ts +130 -0
  153. package/scripts/gate/free-cores.ts +49 -0
  154. package/scripts/gate/gate-ledger.ts +17 -3
  155. package/scripts/gate/gate-plan.ts +23 -1
  156. package/scripts/gate/gate-report.ts +15 -2
  157. package/scripts/gate/gate-run-steps.ts +150 -0
  158. package/scripts/gate/held-mark.ts +55 -0
  159. package/scripts/gate/machine-capacity.ts +70 -11
  160. package/scripts/gate/pre-commit-type-check.ts +14 -1
  161. package/scripts/gate/verification-gate.ts +65 -127
  162. package/scripts/gh/git-gh-issue-rest.ts +1 -0
  163. package/scripts/gh/git-gh-issue-write.ts +24 -2
  164. package/scripts/gh/git-pr.ts +19 -3
  165. package/scripts/git/git-common-directory.ts +3 -3
  166. package/scripts/git/git-diff-reads.ts +16 -9
  167. package/scripts/git/git-execa-error.ts +1 -2
  168. package/scripts/git/main-merge-regenerate.ts +78 -0
  169. package/scripts/git/main-merge.ts +14 -5
  170. package/scripts/hooks/batch-guard.ts +5 -8
  171. package/scripts/hooks/format-edited-file.ts +10 -4
  172. package/scripts/hooks/pre-commit-lint.ts +91 -0
  173. package/scripts/hooks/pre-push-unit.ts +15 -4
  174. package/scripts/hooks/pretool-guard.ts +48 -79
  175. package/scripts/hooks/reserved-run.ts +1 -0
  176. package/scripts/hooks/run-hook.sh +10 -12
  177. package/scripts/hooks/step-zero-notice.ts +3 -2
  178. package/scripts/hooks/stop-actions.ts +204 -0
  179. package/scripts/hooks/stop-guard.ts +62 -21
  180. package/scripts/init/hook-command-rewrite.ts +6 -2
  181. package/scripts/init/hook-launch.ts +12 -7
  182. package/scripts/init/init-logic-deploy-vps.ts +4 -2
  183. package/scripts/issue/behavior-change-lint.ts +12 -6
  184. package/scripts/issue/expected-effect-lint.ts +59 -0
  185. package/scripts/issue/issue-cite-cli.ts +35 -15
  186. package/scripts/issue/issue-classification.ts +1 -1
  187. package/scripts/issue/issue-lint-cli.ts +5 -3
  188. package/scripts/issue/issue-scout-cli.ts +22 -16
  189. package/scripts/issue/markdown-section.ts +19 -5
  190. package/scripts/josh/command-usage.ts +110 -0
  191. package/scripts/josh/file-map-stamp.ts +1 -3
  192. package/scripts/josh/hook-decision.ts +17 -2
  193. package/scripts/josh/josh-command-map.ts +2 -0
  194. package/scripts/josh/josh-command-types.ts +55 -9
  195. package/scripts/josh/josh-commands-ai.ts +13 -0
  196. package/scripts/josh/josh-commands-development.ts +1 -1
  197. package/scripts/josh/josh-commands-hooks.ts +6 -0
  198. package/scripts/josh/josh-commands-lane.ts +10 -1
  199. package/scripts/josh/josh-commands-workflow.ts +5 -0
  200. package/scripts/josh/josh-logic.ts +6 -15
  201. package/scripts/josh/josh-usage-automation.ts +121 -0
  202. package/scripts/josh/josh-usage-backlog.ts +180 -0
  203. package/scripts/josh/josh-usage-developer.ts +230 -0
  204. package/scripts/josh/josh-usage-hooks.ts +38 -0
  205. package/scripts/josh/josh-usage-issue.ts +205 -0
  206. package/scripts/josh/josh-usage-review.ts +101 -0
  207. package/scripts/josh/josh-usage-run.ts +252 -0
  208. package/scripts/josh/josh-usage-session.ts +238 -0
  209. package/scripts/josh/josh-usage-workflow.ts +212 -0
  210. package/scripts/josh/josh.ts +14 -5
  211. package/scripts/josh/package-directory.ts +20 -0
  212. package/scripts/lane/lane-await.ts +3 -2
  213. package/scripts/lane/lane-capacity.ts +8 -2
  214. package/scripts/lane/lane-check-stats.ts +56 -0
  215. package/scripts/lane/lane-child-invocation.ts +49 -5
  216. package/scripts/lane/lane-dispatch.ts +3 -3
  217. package/scripts/lane/lane-guard-policy.ts +5 -5
  218. package/scripts/lane/lane-handoff.ts +8 -1
  219. package/scripts/lane/lane-install.ts +12 -4
  220. package/scripts/lane/lane-ledger.ts +52 -1
  221. package/scripts/lane/lane-limit-cli.ts +8 -9
  222. package/scripts/lane/lane-load.ts +9 -2
  223. package/scripts/lane/lane-measure-cli.ts +4 -0
  224. package/scripts/lane/lane-parked.ts +18 -0
  225. package/scripts/lane/lane-preserve.ts +29 -1
  226. package/scripts/lane/lane-process-load.ts +125 -0
  227. package/scripts/lane/lane-process-stats.ts +93 -0
  228. package/scripts/lane/lane-registry.ts +17 -10
  229. package/scripts/lane/lane-restart.ts +5 -26
  230. package/scripts/lane/lane-session-action.ts +146 -0
  231. package/scripts/lane/lane-session-broker.ts +68 -125
  232. package/scripts/lane/lane-spent.ts +14 -3
  233. package/scripts/lane/lane-stats.ts +1 -0
  234. package/scripts/lane/lane-withdraw-cli.ts +71 -0
  235. package/scripts/lane/lane-withdraw.ts +182 -0
  236. package/scripts/lint/format.ts +4 -4
  237. package/scripts/lint/lint-parallel.ts +10 -3
  238. package/scripts/lint/lint-related-scope.ts +4 -1
  239. package/scripts/managed-marker/managed-marker-logic.ts +1 -2
  240. package/scripts/notify/telegram-test.ts +10 -5
  241. package/scripts/overrides/lockfile-overrides.ts +1 -3
  242. package/scripts/propagate/propagate.ts +1 -2
  243. package/scripts/release/release-progress.ts +3 -2
  244. package/scripts/report/report-format-reference.ts +2 -0
  245. package/scripts/report/report-lint.ts +7 -4
  246. package/scripts/review/acceptance-map-check.ts +61 -0
  247. package/scripts/review/acceptance-map.ts +205 -0
  248. package/scripts/review/review-brief-cli.ts +1 -1
  249. package/scripts/review/review-record-cli.ts +6 -2
  250. package/scripts/rules/agent-model.ts +59 -0
  251. package/scripts/rules/delivered-rules.ts +11 -2
  252. package/scripts/rules/destructive-command.ts +6 -9
  253. package/scripts/rules/direct-filing.ts +3 -7
  254. package/scripts/rules/early-heartbeat.ts +7 -18
  255. package/scripts/rules/file-body.ts +6 -13
  256. package/scripts/rules/filing-cap.ts +4 -6
  257. package/scripts/rules/firing-point.ts +6 -5
  258. package/scripts/rules/git-force.ts +5 -9
  259. package/scripts/rules/guard-remedy.ts +117 -0
  260. package/scripts/rules/implementation-cut.ts +37 -35
  261. package/scripts/rules/index-guard.ts +4 -7
  262. package/scripts/rules/issue-comments.ts +67 -16
  263. package/scripts/rules/josh-git-bare.ts +3 -6
  264. package/scripts/rules/lane-background.ts +10 -21
  265. package/scripts/rules/lane-carry-conflict.ts +7 -17
  266. package/scripts/rules/lane-interactive-ask.ts +6 -11
  267. package/scripts/rules/lane-park.ts +5 -13
  268. package/scripts/rules/lane-split-park.ts +2 -7
  269. package/scripts/rules/lane-switch-main.ts +9 -12
  270. package/scripts/rules/last-prompt.ts +50 -5
  271. package/scripts/rules/oracle-consulted.ts +4 -5
  272. package/scripts/rules/oracle-list-cli.ts +7 -0
  273. package/scripts/rules/piped-verification.ts +84 -32
  274. package/scripts/rules/poll-loop.ts +7 -17
  275. package/scripts/rules/pre-gate-cut.ts +7 -21
  276. package/scripts/rules/prior-comment-read.ts +7 -5
  277. package/scripts/rules/protected-files.ts +5 -9
  278. package/scripts/rules/raw-field-body.ts +3 -7
  279. package/scripts/rules/rule-body-guard.ts +4 -11
  280. package/scripts/rules/rule-list.ts +4 -1
  281. package/scripts/rules/rule-registry-rows.ts +10 -0
  282. package/scripts/rules/rule-registry.ts +7 -4
  283. package/scripts/rules/rule-rewrite.ts +114 -0
  284. package/scripts/rules/rule-value.ts +7 -1
  285. package/scripts/rules/run-tail-rule.ts +6 -22
  286. package/scripts/rules/shell-body-trigger.ts +4 -6
  287. package/scripts/rules/shell-segments.ts +22 -0
  288. package/scripts/rules/stop-decision.ts +77 -0
  289. package/scripts/rules/stop-rules.ts +164 -77
  290. package/scripts/rules/tail-commands.ts +15 -1
  291. package/scripts/rules/test-declared-commit.ts +4 -10
  292. package/scripts/rules/third-party-write.ts +5 -10
  293. package/scripts/rules/worktree-guard.ts +5 -12
  294. package/scripts/run/board/run-board-cli.ts +2 -0
  295. package/scripts/run/board/run-board-closed.ts +8 -2
  296. package/scripts/run/board/run-board-github.ts +19 -3
  297. package/scripts/run/board/run-board-header.ts +4 -1
  298. package/scripts/run/board/run-board-idle.ts +31 -0
  299. package/scripts/run/board/run-board-labels.ts +2 -0
  300. package/scripts/run/board/run-board-layout.ts +1 -1
  301. package/scripts/run/board/run-board-read.ts +25 -12
  302. package/scripts/run/board/run-board-reason.ts +17 -4
  303. package/scripts/run/board/run-board-render-legend.ts +1 -0
  304. package/scripts/run/board/run-board-render-slot.ts +1 -1
  305. package/scripts/run/board/run-board-render-waits.ts +41 -0
  306. package/scripts/run/board/run-board-render.ts +6 -1
  307. package/scripts/run/board/run-board-row-yield.ts +1 -0
  308. package/scripts/run/board/run-board-state.ts +9 -0
  309. package/scripts/run/board/run-board-status.ts +89 -23
  310. package/scripts/run/board/run-board-thanks.ts +7 -2
  311. package/scripts/run/board/run-board-tick.ts +37 -8
  312. package/scripts/run/carry/run-carry-args.ts +1 -3
  313. package/scripts/run/carry/run-carry-conversation.ts +7 -2
  314. package/scripts/run/cut/run-cut-cli.ts +18 -22
  315. package/scripts/run/cut/run-cut-decline.ts +72 -0
  316. package/scripts/run/cut/run-cut-ready.ts +74 -0
  317. package/scripts/run/cut/run-cut-report.ts +29 -0
  318. package/scripts/run/cut/run-cut.ts +10 -1
  319. package/scripts/run/detached-launch.ts +23 -4
  320. package/scripts/run/entry/run-entry-cli.ts +8 -1
  321. package/scripts/run/event/run-event-render.ts +1 -0
  322. package/scripts/run/event/run-event-scope.ts +19 -1
  323. package/scripts/run/event/run-event-stream-emit.ts +13 -6
  324. package/scripts/run/event/run-event-stream.ts +4 -0
  325. package/scripts/run/hold/run-hold-cli.ts +14 -3
  326. package/scripts/run/hold/run-hold-session.ts +46 -0
  327. package/scripts/run/hold/run-hold.ts +13 -4
  328. package/scripts/run/launch-priority.ts +32 -0
  329. package/scripts/run/merge/run-merge-cli.ts +16 -42
  330. package/scripts/run/merge/run-merge-ship.ts +59 -1
  331. package/scripts/run/merge/run-merge-signals.ts +99 -0
  332. package/scripts/run/merge/run-merge-steps.ts +11 -1
  333. package/scripts/run/merge/run-merge.ts +22 -9
  334. package/scripts/run/run-ending.ts +31 -3
  335. package/scripts/run/run-liveness.ts +1 -1
  336. package/scripts/run/run-parent-cut-hook.ts +5 -10
  337. package/scripts/run/run-poll-hook.ts +157 -0
  338. package/scripts/run/run-preflight.ts +1 -2
  339. package/scripts/run/run-step-cli.ts +22 -15
  340. package/scripts/run/run-step-section.ts +85 -0
  341. package/scripts/run/run-stop-notify.ts +1 -2
  342. package/scripts/run/run-watcher-guard.ts +6 -3
  343. package/scripts/run/ship/run-ship-cli.ts +5 -12
  344. package/scripts/run/ship/run-ship-detach.ts +9 -0
  345. package/scripts/run/ship/run-ship-next.ts +10 -2
  346. package/scripts/run/ship/run-ship-overlap.ts +195 -0
  347. package/scripts/run/ship/run-ship-pre-detach.ts +33 -15
  348. package/scripts/run/ship/run-ship-preflight.ts +28 -2
  349. package/scripts/run/ship/run-ship-return.ts +31 -7
  350. package/scripts/run/ship/run-ship-review-steps.ts +25 -14
  351. package/scripts/run/ship/run-ship-review.ts +15 -2
  352. package/scripts/run/ship/run-ship-steps.ts +1 -1
  353. package/scripts/run/ship/run-ship-stop-context.ts +206 -0
  354. package/scripts/run/ship/run-ship-sync.ts +14 -6
  355. package/scripts/run/tidy/run-tidy-cli.ts +3 -3
  356. package/scripts/run/tidy/run-tidy-lanes.ts +3 -2
  357. package/scripts/safe-chain/project-config.ts +7 -2
  358. package/scripts/sync/sync-hook-safety.ts +8 -2
  359. package/scripts/test/test-e2e-guard.ts +30 -5
  360. package/scripts/test/test-unit-guard.ts +16 -1
  361. package/scripts/test/unit-worker-share.ts +26 -3
  362. package/scripts/time-runtime/time-batch-guard.ts +3 -3
  363. package/scripts/time-runtime/time-hook-transcript.ts +3 -2
  364. package/scripts/time-runtime/time-shell.ts +39 -4
  365. package/scripts/time-runtime/time-spans.ts +1 -0
  366. package/scripts/time-runtime/time-tool-call.ts +7 -0
  367. package/scripts/version/effective-upstream.ts +3 -4
  368. package/scripts/version/kit-version-config.ts +8 -2
  369. package/scripts/version/latest-corepack.ts +1 -2
  370. package/scripts/version/release-hold.ts +11 -4
  371. package/scripts/version/version-commands.ts +12 -4
  372. package/templates/gitignore +6 -2
  373. package/dist/hooks/chunk-D5QBTOCZ.js +0 -68
  374. package/dist/hooks/chunk-UT7YC3N2.js +0 -56
@@ -1,215 +1,161 @@
1
1
  # The pre-gate cut — a lane child ends its turn before the gate
2
2
 
3
- A lane child is a detached `fullrun #<N>` process, and the thinking it accumulates while implementing
4
- rides on every later API call in the same session. The **pre-gate cut** drops that accumulation: the
5
- child ends its process the moment implementation is done, and a **fresh** process resumes the same lane
6
- from the gate onward. Rationale: `docs/maintainers/pre-gate-cut-rationale.md` → "Why the cut exists".
3
+ The **pre-gate cut**: a dispatched lane child ends its process the moment implementation is done, and a
4
+ **fresh** process resumes the same lane from the gate onward, without the implementation's accumulated
5
+ context.
7
6
 
8
- This file is the single source of the boundary. `run:cut` takes it, and `run:cut --resume` is the
9
- check a fresh process makes at its own entry. **A second boundary is added below** — the
10
- implementation-phase cut, at a context threshold _during_ implementation.
11
- Everything through "What is carried" describes the pre-gate cut; the later section states only what
12
- differs.
7
+ `run:cut` takes the boundary, `run:cut --resume` is the fresh
8
+ process's entry check. A second boundary — the implementation-phase cut, _during_ implementation — is
9
+ below; it states only what differs.
13
10
 
14
11
  ## Where the boundary is
15
12
 
16
- **After implementation and the refactor, before `pnpm josh gate`**: implementation complete, nothing
17
- committed, the gate not started. Everything after it (gate → review → commit → push → merge) is
18
- verification the fresh process runs on the tree.
19
-
20
- **A lane child first hands it to a detached supervisor** (`chain-rule.md` step 0); the cut is the fallback.
13
+ **After implementation and the refactor, before `pnpm josh gate`**: nothing committed, the gate not
14
+ started. **A lane child first hands it to a detached supervisor** (`chain-rule.md` step 0); the cut is
15
+ the fallback.
21
16
 
22
17
  ## It applies to a dispatched lane child, and to nothing else
23
18
 
24
- The cut is for a **detached** `fullrun` a lane dispatched; a person's interactive `fullrun` never
25
- relaunches itself. A dispatched child is told apart **mechanically, by a mark the dispatch sets** — never
26
- by the model reading the shape of its own prompt.
19
+ A person's interactive `fullrun` never relaunches itself. A dispatched child is told apart
20
+ **mechanically, by a mark the dispatch sets** — never by reading its own prompt.
27
21
 
28
22
  ### The dispatch mark
29
23
 
30
- `lane:dispatch` starts each child generation with the environment variable **`JOSH_LANE_CHILD`** set
31
- to the lane's issue number. `scripts/lane/lane-child-marker.ts` is its one definition.
24
+ `lane:dispatch` starts each child generation with **`JOSH_LANE_CHILD`** set to the lane's issue number
25
+ (`scripts/lane/lane-child-marker.ts`).
32
26
 
33
27
  - **Meaning**: "this session was launched for issue `<N>`, not typed by a person."
34
- - **Lifetime**: the child process — set at launch, read at the gate, never written by the run itself.
35
- - **Trust**: only where its value equals the lane's own issue. A mark that leaked in from a parent
36
- session — naming another issue, or none — is read as a person, so a leak cannot make the guard fire
37
- on a checkout it does not belong to.
38
-
39
- The name, meaning and lifetime are documented here and nowhere else.
28
+ - **Lifetime**: the child process — set at launch, never written by the run itself.
29
+ - **Trust**: only where its value equals the lane's own issue; a leaked mark naming another issue, or
30
+ none, is read as a person. An interactive `fullrun` carries no mark.
40
31
 
41
- `run:cut` decides the same fact its own way: it looks for an **open lane** for the issue, answering a
42
- checkout with none `not-a-lane`. So the command is safe to issue unconditionally — a no-op in the main
43
- checkout, a cut in a lane.
32
+ The name, meaning and lifetime are documented here and nowhere else. `run:cut` itself looks for an
33
+ **open lane** for the issue instead (`not-a-lane` otherwise), so it is safe to issue unconditionally.
44
34
 
45
35
  ## Taking the cut
46
36
 
47
- **The order is fixed in the chain**: `chain-rule.md` step 1 issues
48
- `pnpm josh run:cut <N>` after `pnpm josh main:merge`, before the scoped pair and the gate. **The command
49
- is issued unconditionally**; `run:cut` itself decides whether the cut is warranted, so a short lane with nothing to drop is answered `under-threshold` and walks on
50
- to the gate rather than relaunching.
51
-
52
- At the pre-gate boundary, issue:
37
+ `chain-rule.md` step 1 issues it after `pnpm josh main:merge`, before the scoped pair and the gate —
38
+ **unconditionally**:
53
39
 
54
40
  ```bash
55
41
  pnpm josh run:cut <N>
56
42
  ```
57
43
 
58
44
  - `cut` (0) — record written and handed to the lane's launch owner (OpenAI supervisor starts the
59
- successor after this process exits; Anthropic relaunches directly). **End the turn immediately** —
60
- the fresh process owns the run.
61
- - `under-threshold` (0) — the newest request's billed input is under the shared `CONTEXT_CUT_THRESHOLD`,
62
- so nothing was cut; **continue to the gate.**
63
- - `not-a-lane` (0) — no open lane for this issue, so not a dispatched child. **Continue to the gate.**
64
- - `unready` (1) — the tree is clean or on the default branch, nothing to carry. Continue to the gate.
65
- - `busy` (1) — a cut is already in flight for this tree (the double-cut guard). Do not relaunch.
45
+ successor after this process exits; Anthropic relaunches directly). **End the turn immediately.**
46
+ - `under-threshold` (0) — the newest request's billed input is under `CONTEXT_CUT_THRESHOLD`; **continue to the gate.**
47
+ - `not-a-lane` (0) — not a dispatched child. **Continue to the gate.**
48
+ - `unready` (1) — the tree is clean or on the default branch. Continue to the gate.
49
+ - `busy` (1) — a cut is already in flight for this tree. Do not relaunch.
66
50
  - `failed` (1) — no live OpenAI supervisor, or the Anthropic relaunch could not start. Continue.
67
51
  - `unknown` (1) — the git directory could not be read. Continue to the gate.
68
52
 
69
- **`cut` is the only verdict that ends the turn.** Every other one — `under-threshold` included — leaves
70
- the current process to carry the run on itself.
53
+ **`cut` is the only verdict that ends the turn.**
71
54
 
72
55
  ### The gate refuses until the cut has been taken
73
56
 
74
- `pnpm josh rule:guard` **refuses `pnpm josh gate`** while this checkout is a lane and no cut record is
75
- carried, handing back the command above. Rationale:
76
- `docs/maintainers/pre-gate-cut-rationale.md` → "Why the rules are guards, not prose".
57
+ `pnpm josh rule:guard` **refuses `pnpm josh gate`** in a lane with no cut record carried, handing back
58
+ the command above.
77
59
 
78
- - **It fires for a marked child and nowhere else**: the working directory is a lane —
79
- `<lane root>/<issue number>` — **and** `JOSH_LANE_CHILD` names that same issue. An interactive
80
- `fullrun` carries no mark and runs its gate untouched. `run:cut` uses an open-lane lookup instead, so
60
+ - **It fires for a marked child and nowhere else**: the working directory is `<lane root>/<issue
61
+ number>` **and** `JOSH_LANE_CHILD` names that issue. `run:cut` uses an open-lane lookup instead, so
81
62
  the guard and the command need not agree byte for byte.
82
- - **It fires only when the current context warrants a cut**. The guard
83
- reads the same `cost_cli.session_verdict` `run:cut` reads, so an `under`-threshold lane is let through
84
- to the gate rather than refused.
85
- - **It is silent once the cut is carried**, so the resumed process goes straight to the gate.
63
+ - **It fires only when the current context warrants a cut** (`cost_cli.session_verdict`, as `run:cut`).
64
+ - **It is silent once the cut is carried**.
86
65
  - **It fires once per run.**
87
66
  - **`--resume`, `--end` and `--json` do not count as taking the cut.**
88
67
 
89
- The row, its trigger and the enumeration it joins are
90
- `prompts/collaboration-workflow/rule-delivery.md`. The suites that pin this and the three guards below:
91
- `docs/maintainers/pre-gate-cut-rationale.md` → "Which suites pin each guard".
68
+ Its row: `prompts/collaboration-workflow/rule-delivery.md`.
92
69
 
93
70
  ## Resuming — the fresh process's entry check
94
71
 
95
- A fresh `fullrun #<N>` runs this **at its entry, before `run:hold` and the session-boundary check**,
96
- because whether it is fresh or resumed decides everything that follows:
72
+ A fresh `fullrun #<N>` runs this **at its entry, before `run:hold` and the session-boundary check**:
97
73
 
98
74
  ```bash
99
75
  pnpm josh run:cut --resume <N>
100
76
  ```
101
77
 
102
- - `fresh` (0) — no cut record, an ordinary run. Proceed with the normal entry: claim the hold, ask the
103
- session boundary, read the issue, implement.
104
- - `resume` (0) — a declared pre-gate cut whose tree matches was verified and taken over. **Skip the
105
- title, the plan, the fresh hold claim and the implementation**; re-read the issue body and comments
106
- for the plan and the recorded decisions, then go straight to `pnpm josh gate`.
107
- - `resume-impl` (0) — like `resume`, but the cut was taken **during** implementation. Skip the title, the plan, the fresh hold claim and the split assessment,
108
- re-read the plan, then **continue implementation** — do **not** go straight to the gate.
109
- - `handed-off` (0) — a successor has already adopted this cut, `is_handed_off` is spent.
110
- This process was woken **after** its own cut. **End the turn quietly and do
111
- nothing**: a benign stop, no Telegram owed.
112
- - `stale` (1) — the record does not match the tree (wrong branch, a clean tree, an expired record, or
113
- an unknown hand-off state). **A resume failure**: send a `confirmation` Telegram and stop; never gate
114
- the wrong tree.
115
- - `busy` (1) — another process already owns the resume. Send a `confirmation` Telegram and stop.
116
-
117
- **A resume is never reported as a success it did not earn**: `stale` and `busy` stop the run rather
118
- than gating.
78
+ - `fresh` (0) — an ordinary run; normal entry.
79
+ - `resume` (0) — a verified pre-gate cut. **Skip the title, the plan, the fresh hold claim and the
80
+ implementation**; re-read the issue body and comments, then go straight to `pnpm josh gate`.
81
+ - `resume-impl` (0) — the cut was taken **during** implementation. Skip the title, the plan, the
82
+ fresh hold claim and the split assessment, re-read the plan, then **continue implementation** — do
83
+ **not** go straight to the gate.
84
+ - `handed-off` (0) — a successor already adopted this cut. **End the turn quietly and do nothing**;
85
+ no Telegram owed.
86
+ - `stale` (1) — the record does not match the tree (branch, clean tree, expired, or unknown hand-off).
87
+ **A resume failure**: send a `confirmation` Telegram and stop; never gate the wrong tree.
88
+ - `busy` (1) — another process owns the resume. Send a `confirmation` Telegram and stop.
119
89
 
120
90
  ### The stage is passed to the resumed child, not reconstructed by it
121
91
 
122
- A resumed child arrives with `JOSH_LANE_CHILD` still set and `run:cut --resume` reads the record the cut
123
- left, so it learns _where to resume from_ at its entry. **Skip the entry it has already done**: do not
124
- re-read the workflow skill, repeat the split assessment or re-normalize the title; the plan and
125
- decisions are read back from the issue. Rationale:
126
- `docs/maintainers/pre-gate-cut-rationale.md` → "Why the resume carries what it carries".
92
+ **Skip the entry it has already done**: do not re-read the workflow skill, repeat the split assessment
93
+ or re-normalize the title; the plan and decisions are read back from the issue.
127
94
 
128
95
  ## What is carried, and what is not
129
96
 
130
- - **The working tree is not in the record, because it never left the disk.** The record carries only
131
- what a fresh process cannot recover — the issue, the branch, the invocation, and that a **declared
132
- cut** put it here. **The conversation is not carried**; the fresh process reads the plan and
133
- auto-decisions back off GitHub.
134
- - **The hold is kept, not released** — the resumed process adopts the `run:hold` record and
135
- `pnpm josh followup` releases it at the merge.
136
- - **The dispatch mark is re-applied, not inherited**: the relaunch strips the parent's environment and
137
- sets `JOSH_LANE_CHILD` afresh from the lane's issue.
97
+ - **The working tree is not in the record, because it never left the disk.** The record carries the
98
+ issue, branch, invocation, and that a **declared cut** put it there. **The conversation is not
99
+ carried**; plan and auto-decisions are read back off GitHub.
100
+ - **The hold is kept, not released** — `pnpm josh followup` releases it at the merge.
101
+ - **The dispatch mark is re-applied, not inherited.**
138
102
 
139
103
  ## Verification, uniqueness and double-launch
140
104
 
141
- - **The resume verifies the tree against the record**: the branch matches, the tree is dirty, the
142
- issue matches, and the tree is still under the cutting run's hold. Any mismatch is `stale`.
143
- - **No owner is recorded on the cut** — the cut is the stage hand-off alone (OpenAI keeps its
144
- supervisor owner separately).
145
- - **The cut is exclusive** — `run:cut` writes the record with an exclusive create, so a second cut on
146
- the same tree is refused `busy`.
147
- - **The resume is unique.** Taking the hand-off over spends it — a second `run:cut --resume` reads a
148
- spent record and is answered `handed-off`, and the take-over is itself an
149
- exclusive create, so two resumes racing cannot both win. One lane crosses the pre-gate boundary
150
- exactly once.
105
+ - **The resume verifies the tree against the record**: branch, dirty tree, issue, and the cutting
106
+ run's hold. Any mismatch is `stale`.
107
+ - **No owner is recorded on the cut** (OpenAI keeps its supervisor owner separately).
108
+ - **The cut is exclusive** — a second cut on the same tree is `busy`.
109
+ - **The resume is unique** — a spent record answers `handed-off`, and the take-over is an exclusive
110
+ create. One lane crosses the pre-gate boundary exactly once.
151
111
 
152
112
  ## The implementation-phase cut — a lane child cuts before the gate too
153
113
 
154
- The **implementation-phase cut** caps the context accumulated _during_
155
- implementation — the child ends mid-implementation and a fresh one resumes the lane **back into
156
- implementation**.
114
+ The child ends mid-implementation and a fresh one resumes **back into implementation**.
157
115
 
158
116
  ### The measurement is the parent hand-off's, never a second one
159
117
 
160
- The guard below refuses on the same measurement the parent uses between children —
161
- `cost_verdict.per_request_cost`, read through `cost_cli.session_verdict` (the read-only form of
162
- `pnpm josh cost --cut`), single-sourced at `backlogrun-progress.md` → "The
163
- hand-off". The parent's seam and the child's `run_cut.IMPLEMENTATION_CONTEXT_THRESHOLD` share the
164
- **135_000** `CONTEXT_CUT_THRESHOLD` (aliased so the tests cannot drift). No separate measurement is
165
- built for the lane child.
118
+ Same `cost_verdict.per_request_cost` through `cost_cli.session_verdict` as `backlogrun-progress.md` →
119
+ "The hand-off"; `run_cut.IMPLEMENTATION_CONTEXT_THRESHOLD` aliases the **135_000**
120
+ `CONTEXT_CUT_THRESHOLD`.
166
121
 
167
122
  ### It is a guard, fired at the edit that crosses the threshold
168
123
 
169
- **The trigger**: `pnpm josh rule:guard` refuses an `Edit` / `Write` in a dispatched lane child whose
170
- recent-context cost is over threshold, handing back `pnpm josh run:cut --impl <N> --handoff <path>`.
171
- `cut` ends the turn; a fresh process's `run:cut --resume <N>` answers `resume-impl` and continues
172
- implementation — **the implementation resume clears the record**, so the cut may fire again. **A cut
173
- that relaunches its successor owes no Telegram**, the pre-gate cut as much as this one: nobody has
174
- anything to act on, and a resume answering `stale` / `busy` sends its own. Outside a lane nothing is
175
- relaunched, so `run:cut --impl` prints the held run's instruction — on a measured `over` that run
176
- keeps the hold, sends a `confirmation` Telegram naming `fullrun #<N>` and ends the turn. The refusal states the rest — **It fires on every threshold crossing,
124
+ **The trigger**: `pnpm josh rule:guard` refuses an `Edit` / `Write` in a dispatched lane child over
125
+ threshold, handing back `pnpm josh run:cut --impl <N> --handoff <path>`. `cut` ends the turn; the
126
+ fresh process's `run:cut --resume <N>` answers `resume-impl` — **the implementation resume clears the
127
+ record**, so the cut may fire again. **A cut that relaunches its successor owes no Telegram** — the
128
+ `Stop` hook reads the relaunch off the turn's own `run:cut` output, not off the record the resume
129
+ clears. Outside a
130
+ lane, `run:cut --impl` prints the held run's instruction: on `over`, keep the hold, send a
131
+ `confirmation` Telegram naming `fullrun #<N>`, end the turn. **It fires on every threshold crossing,
177
132
  not once per run**; **An edit reissued right after a refusal passes**; **An unmeasurable session
178
- warrants the cut**; **It is silent between a cut and its resume**. Rationale:
179
- `docs/maintainers/pre-gate-cut-rationale.md` → "Why the rules are guards, not prose";
180
- `scripts/rules/implementation-cut.ts` implements it. A child that ended without cutting is detected
181
- after the fact by `pnpm josh run:ending <N> --output <path>`.
133
+ warrants the cut**; **It is silent between a cut and its resume** (`scripts/rules/implementation-cut.ts`).
134
+ A child that ended without cutting is detected by
135
+ `pnpm josh run:ending <N> --output <path>`.
182
136
 
183
137
  ## The threshold
184
138
 
185
- `CONTEXT_CUT_THRESHOLD` and `cost_verdict.per_request_cost` (the newest request's billed input)
186
- are computed by `scripts/cost-runtime/context-cut-payback.ts`, their
187
- single source; both cuts and the parent hand-off read the same verdict, and an unmeasurable session is
188
- always cut. Rationale: `docs/maintainers/pre-gate-cut-rationale.md` → "Why the threshold is a
189
- break-even". Both cuts end the turn **before** the gate, in the same act that starts the successor, so
190
- the push is never a turn boundary (`chain-rule.md`).
139
+ `CONTEXT_CUT_THRESHOLD` and `cost_verdict.per_request_cost` live in
140
+ `scripts/cost-runtime/context-cut-payback.ts`; both cuts and the parent hand-off read the same verdict,
141
+ and an unmeasurable session is always cut. Both cuts end the turn **before** the gate, so the push is never a
142
+ turn boundary (`chain-rule.md`).
191
143
 
192
144
  ## A lane child records its park before it stops
193
145
 
194
- **The trigger**: a dispatched lane child about to stop for a decision (a Tier B toss-up, a Tier C
195
- action, an upstream defect) parks its own Issue first — `backlogrun-park.md` → "park and
196
- continue" — so the parent's `pnpm josh run:liveness` reads it `settled`. A `needs-human-review` or `already-done` stop already carries its label.
197
- `pnpm josh rule:guard` refuses `pnpm josh notify --task-type confirmation` from a marked child until
198
- then — **It fires once per run.**, and a person's own `fullrun` is never refused
199
- (`scripts/rules/lane-park.ts`).
146
+ **The trigger**: a dispatched lane child about to stop for a decision (Tier B, Tier C, an upstream
147
+ defect) parks its own Issue first — `backlogrun-park.md` → "park and continue" — so `pnpm josh
148
+ run:liveness` reads it `settled`. A `needs-human-review` or `already-done` stop already carries its
149
+ label. `pnpm josh rule:guard` refuses `pnpm josh notify --task-type confirmation` from a marked child
150
+ until then — **It fires once per run.** (`scripts/rules/lane-park.ts`).
200
151
 
201
- **A split is not a park**: the parent reads an open Issue carrying `epic` as
202
- a split, so a child that promoted its Issue stops without `needs-decision` — `backlogrun-park.md` →
203
- "Splitting a child mid-run". `pnpm josh rule:guard` refuses a `needs-decision` write onto the epic
204
- the child promoted this run, on every occurrence (`scripts/rules/lane-split-park.ts`).
152
+ **A split is not a park**: a child that promoted its Issue to an `epic` stops without
153
+ `needs-decision` — `backlogrun-park.md` → "Splitting a child mid-run". `pnpm josh rule:guard` refuses a
154
+ `needs-decision` write onto that epic, on every occurrence (`scripts/rules/lane-split-park.ts`).
205
155
 
206
156
  ### The interactive ask is refused one call earlier
207
157
 
208
158
  **The trigger**: a headless session ends the turn on an interactive ask, so the notify guard never
209
- fires. `pnpm josh rule:guard` therefore refuses `AskUserQuestion` for a marked lane child on
210
- every occurrence — park the question instead.
211
- A child that slips past is recovered by `pnpm josh run:ending`, which lifts
212
- the refused ask into the park basis; `scripts/rules/lane-interactive-ask.ts` and the shared
213
- `scripts/agent/interactive-ask.ts` implement it.
214
-
215
- Provenance of each rule: `docs/maintainers/pre-gate-cut-rationale.md` → "Where each rule came from".
159
+ fires; `pnpm josh rule:guard` refuses `AskUserQuestion` for a marked lane child on every occurrence — park the question instead.
160
+ `pnpm josh run:ending` lifts a slipped ask into the park basis (`scripts/rules/lane-interactive-ask.ts`,
161
+ `scripts/agent/interactive-ask.ts`).
@@ -1,8 +1,7 @@
1
1
  # A prerequisite discovered mid-run — a dependency, not a park
2
2
 
3
3
  **The single source of the prerequisite branch**, read at its point of use — the moment a run
4
- discovers that another Issue in this repository has to land first. History:
5
- `docs/maintainers/prerequisite-rationale.md` → "Where each rule came from".
4
+ discovers that another Issue in this repository has to land first.
6
5
 
7
6
  **A prerequisite discovered mid-run is a dependency, not a park** — the Issue in hand is still one
8
7
  deliverable, it just needs another one before it.
@@ -34,10 +33,8 @@ open), then stash, comment and `pnpm josh run:release <M>` as for a prerequisite
34
33
  `halfrun` stop, `backlogrun` continues. Closing the release Issue once a person has published it hands
35
34
  `<M>` back to `backlog:next` (`docs/josh-commands-backlog.md` → `josh issue:release`).
36
35
 
37
- **File the prerequisite with the `route:tier-a` label**, so a Tier A filing made during implementation
38
- stays countable by filing route afterwards. **This paragraph belongs to the prerequisite row, not to
39
- the table** — the label means a filing the run is *blocked by*, so the observation row carries no
40
- `route:` label of its own (`observation-filing.md`):
36
+ **File the prerequisite with the `route:tier-a` label** — it means a filing the run is *blocked by*,
37
+ so the observation row carries no `route:` label (`observation-filing.md`):
41
38
 
42
39
  ```bash
43
40
  pnpm josh issue:file "<title>" --body-file <body-file> --depth <n> --route tier-a
@@ -47,9 +44,9 @@ The command lints the body against `prompts/collaboration-workflow/issue-templat
47
44
  classification labels it declares, and runs the duplicate scan and `epic:bundle` itself
48
45
  (`docs/josh-commands-backlog.md` → `josh issue:file`).
49
46
 
50
- Every *file the prerequisite* step below means that labelled filing, and it always happens **first**: the
51
- steps after it name a number that does not exist until it is. **Its duplicate scan is read exactly as
52
- it is for a `new` entry** (`issue-scout.md`): a filing made mid-run is the one most likely to duplicate something.
47
+ Every *file the prerequisite* step below means that filing, and it always happens **first** — the
48
+ later steps name its number. **Its duplicate scan is read exactly as it is for a `new` entry**
49
+ (`issue-scout.md`).
53
50
 
54
51
  **Each entry point's own branch stays in that entry's file:**
55
52
 
@@ -63,16 +60,13 @@ it is for a `new` entry** (`issue-scout.md`): a filing made mid-run is the one m
63
60
  command to type (`fullrun.md` / `halfrun.md`). Typing `fullrun` approved implementing **one** Issue;
64
61
  a batch is a different authorization, so the stop stays.
65
62
 
66
- **Two steps every entry's procedure turns on**, both load-bearing rather than tidy-up:
63
+ **Two steps every entry's procedure turns on:**
67
64
 
68
65
  - **`git stash push -u` — the `-u` is not optional.** The work in progress almost always includes a
69
- new `*.test.ts`, which is untracked, and a stash without `-u` leaves exactly those files in the tree
70
- for the next child's `pnpm josh ms` to refuse.
71
- - **The Issue comment is what gets the stash popped, not the Telegram.** The run that later picks the
72
- paused Issue up reads that comment and pops before implementing — **by message,
73
- `pnpm josh stash:pop "<the -m message>"`, never a positional `git stash pop`**, because the stash is
74
- a repository-wide stack every lane shares and a positional pop takes whichever lane last pushed. Say
75
- it in the Telegram too — the comment is the record.
66
+ new, untracked `*.test.ts`, which a stash without `-u` leaves for the next `pnpm josh ms` to refuse.
67
+ - **The Issue comment is what gets the stash popped, not the Telegram.** The run that picks the Issue up
68
+ reads it and pops before implementing — **by message, `pnpm josh stash:pop "<the -m message>"`, never
69
+ a positional `git stash pop`** (the stack is shared by every lane). Say it in the Telegram too.
76
70
 
77
71
  **Automatic filing is capped at 10 Issues per run** at every entry point; `pnpm josh rule:guard`
78
72
  refuses the eleventh filing (`prompts/collaboration-workflow/rule-delivery.md`). On reaching it, stop
@@ -13,9 +13,8 @@ point-of-use document, never an entry read, and the single source of the heartbe
13
13
  pnpm josh run:progress --wait --output <the transcript path of each delegated unit> # in the background
14
14
  ```
15
15
 
16
- **Start it once; it reports by itself.** Each silence interval appends the
17
- five labelled lines to the run's event stream as a heartbeat and to the ambient log, prints nothing to
18
- standard output and keeps running — so a scheduled report never wakes the session, and the session
16
+ **Start it once; it reports by itself.** Each silence interval appends the five labelled lines to the
17
+ event stream and the ambient log, prints nothing to standard output and keeps running — the session
19
18
  relays none. **It exits only on one of three, and the command computes which:**
20
19
 
21
20
  | Exit | What the session does |
@@ -27,23 +26,20 @@ relays none. **It exits only on one of three, and the command computes which:**
27
26
  **A report is not an exit, and neither is a decline** — with no run recorded it keeps waiting, and the
28
27
  `--hours` exit says so on standard error.
29
28
 
30
- **`pnpm josh run:watcher:guard` detects a missed restart**: wired into
31
- `pretool-guard`, it refuses the next tool call while lane children are in
32
- flight and the watcher's life record has gone stale — once per run, so the restart is not blocked.
29
+ **`pnpm josh run:watcher:guard` detects a missed restart** — via `pretool-guard` it refuses the next
30
+ tool call while lane children are in flight and the watcher's record is stale, once per run.
33
31
 
34
- **`--mark` at every real report.** Whenever the run reports something of its own, run
35
- `pnpm josh run:progress --mark` in the same turn to restart the silence clock. The clock is silence,
36
- never a timer (`docs/josh-commands-run.md` → "`josh run:progress`").
32
+ **`--mark` at every real report** — `pnpm josh run:progress --mark` in the same turn restarts the
33
+ silence clock (`docs/josh-commands-run.md` → "`josh run:progress`").
37
34
 
38
- **Do not keep a progress clock of your own** — the hook refuses the arm rather than asking
35
+ **Do not keep a progress clock of your own** — the hook refuses the arm
39
36
  (`scripts/rules/early-heartbeat.ts` → `decide`), though a single correctly-spaced arm is allowed.
40
37
  `--wait` is not a wait timer.
41
38
 
42
39
  **The default interval is twenty minutes, overridable — by the person, not the run.**
43
- `JOSH_PROGRESS_INTERVAL_MINUTES` moves both sides (the guard reads it through the watcher's reader);
44
- `josh` → `progress_interval_minutes` in `package.json` sits one step below the variable. **`--interval`
45
- moves the watcher alone** — it makes the watcher quieter than the floor, never the guard stricter.
46
- Rationale: `docs/maintainers/progress-watcher-rationale.md` → "Why the heartbeat reads as it does".
40
+ `JOSH_PROGRESS_INTERVAL_MINUTES` moves both sides; `josh` → `progress_interval_minutes` in
41
+ `package.json` sits one step below it. **`--interval` moves the watcher alone** — quieter, never the
42
+ guard stricter.
47
43
 
48
44
  ### What a report says
49
45
 
@@ -64,8 +60,7 @@ off-screen, start `pnpm josh run:board --every <minutes>` in the background (`do
64
60
 
65
61
  **A stop is the only interrupt**: a `backlogrun` that has stopped ends with
66
62
  `pnpm josh run:carry --end --stopped "<reason>"`, which sends one ⏸️ confirmation; a parked child sends
67
- its own (`backlogrun-park.md`). Rationale: `docs/maintainers/progress-watcher-rationale.md` → "Why the
68
- signal tiers are split this way".
63
+ its own (`backlogrun-park.md`).
69
64
 
70
65
  ### Who starts it, and what counts as a report
71
66
 
@@ -75,22 +70,17 @@ signal tiers are split this way".
75
70
  `JOSH_LANE_CHILD` mark** — it still runs `--mark` for the parent's clock, but every reporting form
76
71
  (`--wait`, `--once`, the default watch) exits at once with a notice.
77
72
 
78
- **It is started in the target repository's checkout, and `--mark` is run there too.** A heartbeat is
79
- emitted from the moment a run has started — a registered lane, a held work tree or a carried budget —
80
- even before any child carries `in-progress`; only a checkout with no run recorded stays silent.
73
+ **It is started in the target repository's checkout, and `--mark` is run there too.** It beats from the
74
+ moment a run has started — a registered lane, a held work tree or a carried budget; only a checkout
75
+ with no run recorded stays silent.
81
76
 
82
77
  **In a single-issue run, a real report is any turn that puts a progress statement in front of the
83
- person** — four of them, `--mark` run in the same turn as each: **the Step 0 work summary, the pull
84
- request opening, each review round's verdict, and any `confirmation` / `failure` / `completion`
85
- notification or stop.** **A tool result only you read is not one** — a gate run, a `gh` read, an edit.
86
- `--output` is omitted there, and `record` reads `unread`. In a `backlogrun`, a child merged, parked or
87
- stopped is the report.
88
-
89
- **A run that merges needs no teardown; a run that stops has to end the reporting itself.** A stop
90
- keeps the `in-progress` label on purpose, so **no further `--wait` is started** after the stop
91
- notification, and the running `--wait` is stopped in the same turn, since no report ends it. That
92
- covers `halfrun`'s stop before commit, a `needs-human-review` stop, a split or prerequisite stop, and a
93
- `backlogrun` named issue's failure stop. Rationale: `docs/maintainers/progress-watcher-rationale.md` →
94
- "Why the watcher runs where it does".
95
-
96
- Provenance of each rule: `docs/maintainers/progress-watcher-rationale.md` → "Where each rule came from".
78
+ person** — `--mark` in the same turn as each: **the Step 0 work summary, the pull request opening, each
79
+ review round's verdict, and any `confirmation` / `failure` / `completion` notification or stop.** **A
80
+ tool result only you read is not one.** `--output` is omitted there, and `record` reads `unread`. In a
81
+ `backlogrun`, a child merged, parked or stopped is the report.
82
+
83
+ **A run that merges needs no teardown; a run that stops has to end the reporting itself** — **no
84
+ further `--wait` is started** after the stop notification, and the running one is stopped in the same
85
+ turn: `halfrun`'s stop before commit, a `needs-human-review`, split or prerequisite stop, a
86
+ `backlogrun` named issue's failure stop.
@@ -1,10 +1,8 @@
1
1
  # `prrun` — the manifest (plan → implement → PR → green → stop, a person merges)
2
2
 
3
- `prrun` sits between `halfrun` (stop before commit) and `fullrun` (auto-merge). It runs `fullrun`
4
- up to a green, mergeable pull request and **stops before the merge**, so a person merges by hand.
5
- **Read `fullrun.md` and `entry-sequence.md` for every step** — the entry
6
- sequence, the step lists, the gate, the review and the stop branches are `fullrun`'s, unchanged. This
7
- file names only the difference.
3
+ `prrun` runs `fullrun` up to a green, mergeable pull request and **stops before the merge**, so a
4
+ person merges by hand. **Read `fullrun.md` and `entry-sequence.md` for every step** — the entry
5
+ sequence, the step lists, the gate, the review and the stop branches are `fullrun`'s, unchanged.
8
6
 
9
7
  ## The difference — the entry
10
8
 
@@ -1,75 +1,56 @@
1
1
  # The end-of-run retrospective
2
2
 
3
- **This is the retrospective's procedure, and it is read when `run:step` prints the retrospective step —
4
- not at the entry.** `SKILL.md` → §2's table keeps the rule itself: run what `run:step` prints once,
5
- file the improvements worth carrying into the next run, stack the rest, and mark the step done.
6
- Everything that decides *how* — what the four sections mean, how the top two are chosen, the
7
- exclusions, and the `auto-ok` judgement — is here. Read it in full, in the same turn, before filing.
3
+ **Read it when `run:step` prints the retrospective step — not at the entry.** `SKILL.md` → §2's table
4
+ keeps the rule: run what `run:step` prints once, file the improvements worth carrying, stack the rest,
5
+ mark the step done. Read this file in full, in the same turn, before filing.
8
6
 
9
- **When it fires is not this file's, and not a judgement.** The run driver prints the step the moment the
10
- backlog drains — `backlog:offer` marks that drain on the event stream and `run:step` fires the
11
- retrospective at it, *before* the idle watch, so the improvement issues it files are what the watch then
12
- picks up; a run that stops without draining — the failure guard, `--idle 0` — still prints it at the
13
- stop position. It is kit-only — `run:step` prints the step only in the kit repository.
14
-
15
- Rationale: `docs/maintainers/retrospective-rationale.md` → "Why the retrospective is read at its step";
16
- provenance: `docs/maintainers/retrospective-rationale.md` → "Where each rule came from".
7
+ **When it fires is not a judgement.** `run:step` prints the step when `backlog:offer` marks the backlog
8
+ drained, *before* the idle watch, so the watch picks up what it files; a run that stops without
9
+ draining — the failure guard, `--idle 0` — still prints it at the stop position. Kit-only.
17
10
 
18
11
  ## The digest is read, not skimmed
19
12
 
20
- The command `run:step` prints folds four measurements that already exist into one digest — it adds no
21
- new measurement (the observation-filing rule against readerless numbers). Read each section for what it
22
- is for:
13
+ The command `run:step` prints folds four existing measurements into one digest — it adds none:
23
14
 
24
- - **Run cost & time by role.** A role whose share of the wall clock runs ahead of its share of the cost
25
- is marked `waiting-heavy` — the run spent that time waiting rather than working. That gap is a
26
- candidate improvement, not a verdict: a role that waits by design is not a defect.
27
- - **Recurring review findings.** A category that keeps coming back across rounds is friction in the
28
- code or the rules the reviews keep catching; the zero-finding denominator tells a genuinely quiet
29
- category apart from one nobody looked at.
30
- - **Observation ledger.** How many observations are already held without being filed — a reminder to
31
- promote one a second sighting has now earned, rather than a fresh finding.
32
- - **Run events.** The parks, outages, cuts and review rounds the run hit — where it did not run
33
- straight through.
15
+ - **Run cost & time by role.** A role whose wall-clock share runs ahead of its cost share is marked
16
+ `waiting-heavy` — a candidate improvement, not a verdict: some roles wait by design.
17
+ - **Recurring review findings.** A category that keeps coming back is friction the reviews keep
18
+ catching; the zero-finding denominator separates a quiet category from an unexamined one.
19
+ - **Observation ledger.** Observations held without being filed — promote one a second sighting earned.
20
+ - **Run events.** The parks, outages, cuts and review rounds — where the run did not run straight through.
34
21
 
35
- The digest closes by pointing back here; the two targets it names are **the run itself** (the first,
36
- third and fourth sections) and **the repository** (the second, and anything the run surfaced that lives
37
- outside it).
22
+ The two targets are **the run itself** (sections one, three, four) and **the repository** (section two,
23
+ and anything the run surfaced that lives outside it).
38
24
 
39
25
  ## What to file, and how the top two are chosen
40
26
 
41
- **The filing condition is the existing depth test, unchanged** — a filing cites the product work it
42
- improves, and a `depth:2` finding names which decision it turns on (`observation-filing.md` → "The depth
43
- test"). An improvement that cannot pass the test is not filed; it is not a shortfall of the two-item
44
- count, it simply is not yet a finding.
27
+ **The filing condition is the existing depth test, unchanged** (`observation-filing.md` → "The depth
28
+ test"). What cannot pass it is not filed — not a shortfall, just not yet a finding.
29
+
30
+ **A cost regression is filed.** The digest's `File a cost regression: …` line passes the depth test as
31
+ printed — measured, with the command it names as the reproduction — and ranks first: one Issue names
32
+ every regressed row, and the scout keeps a repeat sighting from filing twice.
45
33
 
46
34
  **Order what passes by effect, and file the top two.** **The third onward is stacked in the observation
47
- ledger**, on the same append path `pnpm josh observations:flush` already drains. **File nothing when
48
- nothing passes** — a run whose measurements show no improvement worth carrying files zero Issues.
49
- `docs/maintainers/retrospective-rationale.md` → "Why the top two are a selection, not a ration".
35
+ ledger** (drained by `pnpm josh observations:flush`). **File nothing when nothing passes.**
50
36
 
51
- **Exclude what is already filed or already done, through the existing scout** (`issue-scout.md`). File
52
- each with `pnpm josh issue:file`, which runs the scout before creating anything: an **open** candidate
53
- covering the same work means do not file it, and a `(closed)` candidate covering it means the work is
54
- already merged. Neither exclusion is a new mechanism. The same call runs `epic:bundle` on each new
55
- Issue, as after any filing.
37
+ **Exclude what is already filed or already done, through the existing scout** (`issue-scout.md`): file
38
+ with `pnpm josh issue:file`, which scouts first — an **open** candidate covering it means do not file, a
39
+ `(closed)` one means already merged. It also runs `epic:bundle` on each new Issue.
56
40
 
57
41
  ## `auto-ok`, and closing the step
58
42
 
59
- **What a retrospective files is judged for `auto-ok`** — an improvement that needs no person's
60
- judgement declares `- 人の判断: 不要`, so `issue:file` applies the label (with the run label `prompts/collaboration-workflow/issue-template.md` requires) and the next run picks it up
61
- without waiting for a person. **`backlogrun-steps.md` → "What one invocation approves" is that
62
- judgement's single source**; it is written there, beside the brakes that bound it, rather than restated here. Every brake still counts a retrospective's filings: the
43
+ **What a retrospective files is judged for `auto-ok`** — one needing no person's judgement declares
44
+ `- 人の判断: 不要`, so `issue:file` applies the label (with the run label
45
+ `prompts/collaboration-workflow/issue-template.md` requires). **`backlogrun-steps.md` → "What one
46
+ invocation approves" is that judgement's single source.** Every brake still counts these filings: the
63
47
  ten-per-invocation ceiling, the WIP cap, `--max` and the 150,000-token session budget.
64
48
 
65
49
  **Close with `pnpm josh run:carry --retrospective --summary "<result>" --owner "$PPID"`.** It marks the
66
- retrospective run on the carry record, so `run:step` prints `stop` from then on rather than the step a
67
- second time. The mark rides the record across a session cut and is removed with the record at
68
- `pnpm josh run:carry --end`, so one invocation runs the retrospective exactly once whether or not it was
69
- cut. **`--summary` is required** — the same close writes it as one `retrospective` event on the event
70
- stream, so a zero-filing retrospective differs from one that never ran; name
71
- the issues filed (or that none were) and the candidates dropped with why.
50
+ carry record so `run:step` prints `stop` from then on; the mark survives a session cut and is removed at
51
+ `pnpm josh run:carry --end`, so one invocation runs it exactly once. **`--summary` is required** — it is
52
+ written as a `retrospective` event, so a zero-filing retrospective differs from one that never ran; name
53
+ the issues filed (or none) and the candidates dropped with why.
72
54
 
73
- **A dispatched lane child never reaches any of this** — the batch runs the retrospective at its own end,
74
- never a child's, exactly as it asks `release:scope` once at the batch's end. `run:step` already answers
75
- `stop` for a lane child at the stop position, so a child never prints the step to begin with.
55
+ **A dispatched lane child never reaches any of this** — the batch runs it at its own end; `run:step`
56
+ answers `stop` for a lane child at the stop position.