@joshuafolkken/kit 1.1387.0 → 1.1453.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 (278) hide show
  1. package/.claude/skills/epic-commands/SKILL.md +1 -1
  2. package/.claude/skills/epic-commands/epic-bundle.md +5 -0
  3. package/.claude/skills/workflow-commands/backlogrun-lanes.md +5 -3
  4. package/.claude/skills/workflow-commands/backlogrun-park.md +2 -0
  5. package/.claude/skills/workflow-commands/backlogrun-steps.md +13 -10
  6. package/.claude/skills/workflow-commands/backlogrun.md +3 -2
  7. package/.claude/skills/workflow-commands/chain-rule.md +4 -2
  8. package/.claude/skills/workflow-commands/fullrun-steps.md +1 -1
  9. package/.claude/skills/workflow-commands/halfrun.md +1 -1
  10. package/.claude/skills/workflow-commands/issue-comments.md +6 -0
  11. package/.claude/skills/workflow-commands/kickoff.md +12 -13
  12. package/.claude/skills/workflow-commands/observation-filing.md +1 -1
  13. package/.claude/skills/workflow-commands/observation-ledger.md +3 -2
  14. package/.claude/skills/workflow-commands/pre-gate-cut.md +5 -3
  15. package/.claude/skills/workflow-commands/prerequisite.md +6 -0
  16. package/.claude/skills/workflow-commands/retrospective.md +5 -5
  17. package/.claude/skills/workflow-commands/split-assessment.md +2 -2
  18. package/README.md +27 -4
  19. package/dist/hooks/audit-provision.js +2 -2
  20. package/dist/hooks/batch-guard.js +7 -7
  21. package/dist/hooks/{chunk-2YSW3CXH.js → chunk-3C4XRYG6.js} +35 -11
  22. package/dist/hooks/{chunk-GJ7JPIHN.js → chunk-5C7L6FRC.js} +2704 -190
  23. package/dist/hooks/{chunk-FZ6FUSBM.js → chunk-723HKZO5.js} +1 -1
  24. package/dist/hooks/{chunk-STDSEPWU.js → chunk-D3NJXN5M.js} +4 -4
  25. package/dist/hooks/{chunk-NEC4AT4Z.js → chunk-DGT54IH5.js} +4 -0
  26. package/dist/hooks/{chunk-LMWBRJIP.js → chunk-EF5GQ6WS.js} +3 -3
  27. package/dist/hooks/{chunk-JBBMAPC4.js → chunk-IX6TTTI6.js} +4 -0
  28. package/dist/hooks/{chunk-IYVOLN6A.js → chunk-LBFYEOXJ.js} +3 -3
  29. package/dist/hooks/{chunk-SL4GQ2XP.js → chunk-MBJYQPEK.js} +106 -23
  30. package/dist/hooks/{chunk-WNFJLBXI.js → chunk-NO4AALP5.js} +3 -3
  31. package/dist/hooks/{chunk-J3KSS7II.js → chunk-OLMO72ON.js} +1 -1
  32. package/dist/hooks/{chunk-DCY2GWHC.js → chunk-SHYUQOIS.js} +5 -5
  33. package/dist/hooks/{chunk-EAQEGME7.js → chunk-UT7YC3N2.js} +1 -1
  34. package/dist/hooks/{chunk-EBSHN25W.js → chunk-W5ZKGTSY.js} +4 -4
  35. package/dist/hooks/{chunk-GNDJ7NJ7.js → chunk-Y3GKIKGW.js} +209 -56
  36. package/dist/hooks/{chunk-U32VSRNG.js → chunk-Z4XI7CZS.js} +89 -34
  37. package/dist/hooks/codex-hook-adapter.js +15 -15
  38. package/dist/hooks/duplicate-read-guard.js +8 -8
  39. package/dist/hooks/format-edited.js +5 -5
  40. package/dist/hooks/inputs.json +261 -201
  41. package/dist/hooks/investigation-guard.js +8 -8
  42. package/dist/hooks/pretool-guard.js +14 -14
  43. package/dist/hooks/session-lang.js +69 -16
  44. package/dist/hooks/stop-guard.js +13 -38
  45. package/dist/josh.js +95 -19
  46. package/package.json +4 -3
  47. package/prompts/collaboration-workflow/issue-template.md +10 -8
  48. package/prompts/review.md +30 -4
  49. package/scripts/agent/claude-agent-argv.ts +13 -1
  50. package/scripts/auth/auth-setup-cli.ts +101 -0
  51. package/scripts/auth/claude-token-output.ts +78 -0
  52. package/scripts/auth/claude-token.ts +68 -0
  53. package/scripts/auto-ok/auto-ok-judge-cli.ts +125 -0
  54. package/scripts/auto-ok/auto-ok-judge-read.ts +95 -0
  55. package/scripts/auto-ok/auto-ok-judge-write.ts +109 -0
  56. package/scripts/auto-ok/auto-ok-judge.ts +67 -0
  57. package/scripts/backlog/backlog-drive-cli.ts +14 -0
  58. package/scripts/backlog/backlog-drive-epic.ts +24 -8
  59. package/scripts/backlog/backlog-drive-launch.ts +3 -0
  60. package/scripts/backlog/backlog-drive-named-offer.ts +7 -2
  61. package/scripts/backlog/backlog-drive-named.ts +4 -2
  62. package/scripts/backlog/backlog-drive-unread.ts +56 -0
  63. package/scripts/backlog/backlog-drive.ts +38 -11
  64. package/scripts/backlog/backlog-overlap.ts +22 -5
  65. package/scripts/backlog/backlog-ready.ts +1 -3
  66. package/scripts/backlog/backlogrun-args.ts +13 -2
  67. package/scripts/backlog/backlogrun-cli.ts +91 -19
  68. package/scripts/backlog/backlogrun-launch.ts +24 -0
  69. package/scripts/backlog/backlogrun-replace.ts +166 -0
  70. package/scripts/backlog/backlogrun-stop.ts +178 -0
  71. package/scripts/behavior/behavior-cli.ts +6 -1
  72. package/scripts/doctor/doctor-io.ts +60 -9
  73. package/scripts/doctor/doctor.ts +20 -1
  74. package/scripts/document/document-byte-budget.ts +3 -3
  75. package/scripts/epic/epic-bundle-cli.ts +8 -8
  76. package/scripts/epic/epic-bundle-referenced.ts +2 -5
  77. package/scripts/epic/epic-bundle.ts +39 -4
  78. package/scripts/exports/unused-members-cli.ts +2 -1
  79. package/scripts/followup/followup-checks-event.ts +82 -0
  80. package/scripts/followup/git-followup-finish.ts +16 -2
  81. package/scripts/followup/git-followup-workflow.ts +5 -2
  82. package/scripts/followup/git-pr-followup-checks.ts +18 -4
  83. package/scripts/followup/git-pr-followup-wrapup.ts +5 -0
  84. package/scripts/followup/git-pr-followup.ts +4 -1
  85. package/scripts/fresh-machine/fresh-machine-cli.ts +204 -0
  86. package/scripts/fresh-machine/fresh-machine-docker.ts +65 -0
  87. package/scripts/fresh-machine/fresh-machine-image.ts +62 -0
  88. package/scripts/fresh-machine/fresh-machine-log.ts +61 -0
  89. package/scripts/fresh-machine/fresh-machine-patterns.ts +175 -0
  90. package/scripts/fresh-machine/fresh-machine-run.ts +215 -0
  91. package/scripts/fresh-machine/fresh-machine-script.ts +45 -0
  92. package/scripts/fresh-machine/fresh-machine-spec.ts +57 -0
  93. package/scripts/fresh-machine/specs/kit-test-backlogrun-python.json +34 -0
  94. package/scripts/fresh-machine/specs/kit-test-backlogrun.json +31 -0
  95. package/scripts/gate/gate-report.ts +70 -15
  96. package/scripts/gate/project-checks.ts +18 -4
  97. package/scripts/gate/scoped-green.ts +2 -1
  98. package/scripts/gate/verification-gate.ts +4 -3
  99. package/scripts/gh/gh-author-association.ts +14 -0
  100. package/scripts/gh/git-gh-conditional.ts +66 -0
  101. package/scripts/gh/git-gh-exec.ts +1 -1
  102. package/scripts/gh/git-gh-issue-read.ts +6 -3
  103. package/scripts/gh/git-gh-issue-rest.ts +1 -0
  104. package/scripts/gh/git-gh-issue-write.ts +5 -1
  105. package/scripts/gh/git-gh-issue.ts +13 -1
  106. package/scripts/gh/git-pr-checks-eval.ts +13 -0
  107. package/scripts/gh/git-pr-checks-parse.ts +8 -1
  108. package/scripts/gh/git-pr-checks-watch.ts +11 -4
  109. package/scripts/gh/git-pr-checks.ts +36 -2
  110. package/scripts/git/git-command.ts +16 -4
  111. package/scripts/git/git-schemas.ts +1 -0
  112. package/scripts/git/git-spawn-sync.ts +1 -1
  113. package/scripts/hooks/pretool-guard.ts +3 -1
  114. package/scripts/init/hook-command-rewrite.ts +31 -0
  115. package/scripts/init/init-actions.ts +7 -4
  116. package/scripts/init/init-ai-copy.ts +34 -11
  117. package/scripts/init/init-basic.ts +9 -4
  118. package/scripts/init/init-bootstrap.ts +6 -2
  119. package/scripts/init/init-dry-run-report.ts +150 -0
  120. package/scripts/init/init-dry-run.ts +189 -0
  121. package/scripts/init/init-install.ts +8 -1
  122. package/scripts/init/init-logic-toolchain.ts +76 -0
  123. package/scripts/init/init-logic.ts +2 -0
  124. package/scripts/init/init.ts +62 -42
  125. package/scripts/init/kit-setup-state.ts +11 -17
  126. package/scripts/init/own-formatter.ts +21 -0
  127. package/scripts/init/project-profile.ts +60 -12
  128. package/scripts/init/start-dry-run.ts +70 -0
  129. package/scripts/init/start-exec.ts +27 -1
  130. package/scripts/init/start-plan.ts +23 -3
  131. package/scripts/init/start-setup-pr.ts +13 -24
  132. package/scripts/init/start-steps.ts +62 -1
  133. package/scripts/init/start.ts +38 -17
  134. package/scripts/init/workflow-mark.ts +35 -0
  135. package/scripts/init/working-tree.ts +116 -0
  136. package/scripts/issue/issue-ack-cli.ts +84 -0
  137. package/scripts/issue/issue-auto-ok.ts +68 -99
  138. package/scripts/issue/issue-file-cli.ts +17 -17
  139. package/scripts/issue/issue-file.ts +1 -6
  140. package/scripts/issue/issue-labels.ts +46 -10
  141. package/scripts/issue/issue-release-cli.ts +69 -23
  142. package/scripts/issue/issue-release.ts +3 -1
  143. package/scripts/issue/issue-state-cli.ts +14 -4
  144. package/scripts/issue/issue-watch-diff.ts +152 -0
  145. package/scripts/issue/issue-watch-gate.ts +81 -0
  146. package/scripts/issue/issue-watch-hook.ts +54 -0
  147. package/scripts/issue/issue-watch.ts +240 -0
  148. package/scripts/issue/measure-rerun-cli.ts +3 -4
  149. package/scripts/josh/josh-command-map.ts +4 -0
  150. package/scripts/josh/josh-commands-ai.ts +11 -0
  151. package/scripts/josh/josh-commands-backlog.ts +2 -2
  152. package/scripts/josh/josh-commands-development.ts +1 -1
  153. package/scripts/josh/josh-commands-issue.ts +10 -3
  154. package/scripts/josh/josh-commands-lane.ts +11 -2
  155. package/scripts/josh/josh-commands-project.ts +26 -2
  156. package/scripts/josh/josh-verdict.ts +33 -4
  157. package/scripts/josh/process-identity.ts +32 -6
  158. package/scripts/lane/claude-lane-broker.ts +142 -0
  159. package/scripts/lane/lane-await.ts +6 -2
  160. package/scripts/lane/lane-broker-server.ts +69 -0
  161. package/scripts/lane/lane-cache.ts +37 -7
  162. package/scripts/lane/lane-capacity.ts +8 -6
  163. package/scripts/lane/lane-child-invocation.ts +1 -0
  164. package/scripts/lane/lane-cli.ts +15 -1
  165. package/scripts/lane/lane-close.ts +15 -6
  166. package/scripts/lane/lane-dispatch.ts +36 -10
  167. package/scripts/lane/lane-environment.ts +1 -1
  168. package/scripts/lane/lane-launch-cli.ts +13 -4
  169. package/scripts/lane/lane-ledger.ts +21 -3
  170. package/scripts/lane/lane-measure-cli.ts +10 -2
  171. package/scripts/lane/lane-open.ts +9 -1
  172. package/scripts/lane/lane-preserve.ts +49 -0
  173. package/scripts/lane/lane-reap.ts +20 -5
  174. package/scripts/lane/lane-registry.ts +6 -0
  175. package/scripts/lane/lane-restart-cli.ts +51 -0
  176. package/scripts/lane/lane-restart.ts +175 -0
  177. package/scripts/lane/lane-session-broker.ts +363 -0
  178. package/scripts/lane/lane-spent.ts +195 -0
  179. package/scripts/lane/lane-stage-stats.ts +27 -3
  180. package/scripts/lane/lane-stop-stats.ts +96 -0
  181. package/scripts/lane/openai-lane-supervisor.ts +2 -2
  182. package/scripts/lane/process-tools.ts +31 -0
  183. package/scripts/lib/buffered-process.ts +36 -2
  184. package/scripts/lib/pnpm-reach.ts +27 -0
  185. package/scripts/lib/status-icons.ts +5 -1
  186. package/scripts/lint/lint-parallel.ts +19 -2
  187. package/scripts/observations/observation-ledger-home.ts +1 -0
  188. package/scripts/observations/observation-ledger-migrate.ts +3 -15
  189. package/scripts/release/release-issue-close.ts +133 -0
  190. package/scripts/release/release-publish.ts +12 -1
  191. package/scripts/repo/repository-labels.ts +11 -1
  192. package/scripts/review/comment-ranges.ts +199 -0
  193. package/scripts/review/review-attest-cli.ts +21 -6
  194. package/scripts/review/review-brief-cli.ts +24 -7
  195. package/scripts/review/review-code-tree.ts +119 -0
  196. package/scripts/review/review-comment-round.ts +114 -0
  197. package/scripts/review/review-record-cli.ts +39 -17
  198. package/scripts/review/review-round2-cli.ts +16 -5
  199. package/scripts/review/review-round2.ts +30 -10
  200. package/scripts/review/review-stamps.ts +22 -1
  201. package/scripts/rules/implementation-cut.ts +3 -3
  202. package/scripts/rules/pre-gate-cut.ts +1 -1
  203. package/scripts/run/board/run-board-checks.ts +42 -0
  204. package/scripts/run/board/run-board-cli.ts +2 -0
  205. package/scripts/run/board/run-board-every.ts +3 -1
  206. package/scripts/run/board/run-board-fit.ts +16 -5
  207. package/scripts/run/board/run-board-fresh.ts +64 -0
  208. package/scripts/run/board/run-board-header.ts +129 -53
  209. package/scripts/run/board/run-board-labels.ts +47 -4
  210. package/scripts/run/board/run-board-lane-event.ts +66 -0
  211. package/scripts/run/board/run-board-layout.ts +57 -9
  212. package/scripts/run/board/run-board-now.ts +234 -0
  213. package/scripts/run/board/run-board-operation-read.ts +75 -0
  214. package/scripts/run/board/run-board-operation.ts +150 -0
  215. package/scripts/run/board/run-board-phase.ts +26 -1
  216. package/scripts/run/board/run-board-plan.ts +4 -6
  217. package/scripts/run/board/run-board-read.ts +49 -3
  218. package/scripts/run/board/run-board-reason.ts +124 -0
  219. package/scripts/run/board/run-board-render-checks.ts +55 -0
  220. package/scripts/run/board/run-board-render-legend.ts +12 -3
  221. package/scripts/run/board/run-board-render-slot.ts +2 -2
  222. package/scripts/run/board/run-board-render-tail.ts +128 -0
  223. package/scripts/run/board/run-board-render-thanks.ts +50 -0
  224. package/scripts/run/board/run-board-render-title.ts +58 -0
  225. package/scripts/run/board/run-board-render.ts +96 -80
  226. package/scripts/run/board/run-board-row-yield.ts +32 -0
  227. package/scripts/run/board/run-board-setup.ts +61 -13
  228. package/scripts/run/board/run-board-state.ts +10 -0
  229. package/scripts/run/board/run-board-status.ts +66 -7
  230. package/scripts/run/board/run-board-thanks-csv.ts +71 -0
  231. package/scripts/run/board/run-board-thanks-read.ts +112 -0
  232. package/scripts/run/board/run-board-thanks.ts +53 -0
  233. package/scripts/run/board/run-board-tick.ts +50 -21
  234. package/scripts/run/board/run-board-usual.ts +44 -0
  235. package/scripts/run/carry/run-carry-args.ts +9 -1
  236. package/scripts/run/carry/run-carry-cli.ts +2 -45
  237. package/scripts/run/carry/run-carry-end.ts +73 -0
  238. package/scripts/run/carry/run-carry.ts +8 -1
  239. package/scripts/run/entry/run-entry-cli.ts +5 -0
  240. package/scripts/run/event/run-event-checks.ts +54 -0
  241. package/scripts/run/event/run-event-render.ts +2 -0
  242. package/scripts/run/event/run-event-scope.ts +1 -0
  243. package/scripts/run/event/run-event-setup.ts +55 -11
  244. package/scripts/run/event/run-event-stream.ts +27 -11
  245. package/scripts/run/merge/run-merge-cli.ts +7 -4
  246. package/scripts/run/merge/run-merge-ship.ts +61 -0
  247. package/scripts/run/merge/run-merge-steps.ts +7 -14
  248. package/scripts/run/merge/run-merge-token.ts +16 -2
  249. package/scripts/run/run-headless.ts +1 -0
  250. package/scripts/run/run-step.ts +2 -0
  251. package/scripts/run/ship/run-ship-cli.ts +22 -2
  252. package/scripts/run/ship/run-ship-return.ts +31 -13
  253. package/scripts/run/ship/run-ship-review-steps.ts +17 -4
  254. package/scripts/run/ship/run-ship-stage.ts +1 -0
  255. package/scripts/run/wake/run-wake-await.ts +130 -0
  256. package/scripts/run/wake/run-wake-cli.ts +60 -71
  257. package/scripts/run/wake/run-wake-describe.ts +34 -2
  258. package/scripts/run/wake/run-wake-driver.ts +11 -4
  259. package/scripts/run/wake/run-wake-session.ts +20 -3
  260. package/scripts/run/wake/run-wake-stop.ts +37 -0
  261. package/scripts/run/wake/run-wake-supervise.ts +44 -0
  262. package/scripts/sync/claude-settings-merge.ts +144 -0
  263. package/scripts/sync/sync-ai-files.ts +28 -3
  264. package/scripts/sync/sync.ts +15 -0
  265. package/scripts/test/project-test-script.ts +73 -0
  266. package/scripts/test/skip-marker.ts +14 -1
  267. package/scripts/test/test-related.ts +3 -2
  268. package/scripts/test/test-unit-guard.ts +78 -14
  269. package/scripts/time-runtime/time-reported-failure.ts +11 -3
  270. package/scripts/uninstall/distributed-files.ts +92 -0
  271. package/scripts/uninstall/uninstall-plan.ts +119 -0
  272. package/scripts/uninstall/uninstall-report.ts +61 -0
  273. package/scripts/uninstall/uninstall.ts +206 -0
  274. package/templates/AGENTS.basic.md +4 -0
  275. package/templates/GEMINI.basic.md +6 -0
  276. package/dist/hooks/chunk-6V5OPIUU.js +0 -13
  277. package/scripts/lane/openai-review-broker.ts +0 -262
  278. package/scripts/run/board/run-board-track.ts +0 -22
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-CDY4NFQG.js";
4
4
  import {
5
5
  lane_child_marker
6
- } from "./chunk-J3KSS7II.js";
6
+ } from "./chunk-OLMO72ON.js";
7
7
  import {
8
8
  ENV_FILE_NAME,
9
9
  GIT_LOCATION_VARIABLES,
@@ -23,14 +23,14 @@ import {
23
23
  process_identity,
24
24
  process_owner_schema,
25
25
  run_carry
26
- } from "./chunk-2YSW3CXH.js";
26
+ } from "./chunk-3C4XRYG6.js";
27
27
  import {
28
28
  INSTALL_TIMEOUT_MS,
29
29
  PLATFORM_TEMP_ROOT,
30
30
  PROBE_TIMEOUT_MS,
31
31
  SUITE_TIMEOUT_MS,
32
32
  stamp_file
33
- } from "./chunk-NEC4AT4Z.js";
33
+ } from "./chunk-DGT54IH5.js";
34
34
 
35
35
  // scripts/agent/agent-headless.ts
36
36
  var KEY = "JOSH_AGENT_HEADLESS";
@@ -43,6 +43,16 @@ function is_headless(source = process.env) {
43
43
  }
44
44
  var agent_headless = { KEY, environment, is_headless };
45
45
 
46
+ // scripts/josh/session-language.ts
47
+ var ENV_KEY = "JOSH_SESSION_LANG";
48
+ var DEFAULT_SESSION_LANG = "ja";
49
+ function resolve_session_lang() {
50
+ const value = process.env[ENV_KEY]?.trim();
51
+ if (value) return { lang: value, is_default: false };
52
+ return { lang: DEFAULT_SESSION_LANG, is_default: true };
53
+ }
54
+ var session_language = { DEFAULT_SESSION_LANG, ENV_KEY, resolve_session_lang };
55
+
46
56
  // scripts/lane/lane-reap.ts
47
57
  import { execFileSync } from "node:child_process";
48
58
 
@@ -216,6 +226,7 @@ function stop_reason(stage, conflicts = []) {
216
226
  return conflicts.length > 0 ? CONFLICT : stage;
217
227
  }
218
228
  var run_ship_stage = {
229
+ CONFLICT,
219
230
  PHASE,
220
231
  STAGE,
221
232
  clear,
@@ -319,6 +330,21 @@ var lane_child_invocation = {
319
330
  ship_stop_invocation
320
331
  };
321
332
 
333
+ // scripts/lane/process-tools.ts
334
+ import path from "node:path";
335
+ var NOT_FOUND_CODE = "ENOENT";
336
+ var PACKAGE_HINT = "install the package that provides it (procps on Debian/Ubuntu: `apt-get install procps`)";
337
+ function is_not_found(error) {
338
+ return error instanceof Error && "code" in error && error.code === NOT_FOUND_CODE;
339
+ }
340
+ function missing_notice(command) {
341
+ return `\`${path.basename(command)}\` is not installed \u2014 kit's lane commands read processes with ps and pgrep; ${PACKAGE_HINT}`;
342
+ }
343
+ function throw_if_missing(command, error) {
344
+ if (is_not_found(error)) throw new Error(missing_notice(command), { cause: error });
345
+ }
346
+ var process_tools = { missing_notice, throw_if_missing };
347
+
322
348
  // scripts/lane/lane-reap.ts
323
349
  var PGREP_COMMAND = "pgrep";
324
350
  var MATCH_FULL_COMMAND_LINE = "-f";
@@ -337,7 +363,8 @@ function run_probe(command, args) {
337
363
  timeout: PROBE_TIMEOUT_MS,
338
364
  stdio: ["ignore", "pipe", "ignore"]
339
365
  });
340
- } catch {
366
+ } catch (error) {
367
+ process_tools.throw_if_missing(command, error);
341
368
  return "";
342
369
  }
343
370
  }
@@ -383,14 +410,20 @@ function tree_of(roots, probes) {
383
410
  }
384
411
  return tree;
385
412
  }
413
+ function roots_of(issue, own2, probes) {
414
+ const pattern = lane_child_invocation.process_pattern(issue);
415
+ return probes.matching(pattern).filter((pid) => !own2.has(pid));
416
+ }
386
417
  function reap_child(issue, probes = SYSTEM_PROBES) {
387
418
  const own2 = own_ancestry(probes);
388
- const pattern = lane_child_invocation.process_pattern(issue);
389
- const roots = probes.matching(pattern).filter((pid) => !own2.has(pid));
390
- const doomed = tree_of(roots, probes).filter((pid) => !own2.has(pid));
419
+ const doomed = tree_of(roots_of(issue, own2, probes), probes).filter((pid) => !own2.has(pid));
391
420
  return doomed.filter((pid) => probes.terminate(pid));
392
421
  }
422
+ function is_child_running(issue, probes = SYSTEM_PROBES) {
423
+ return roots_of(issue, own_ancestry(probes), probes).length > 0;
424
+ }
393
425
  var lane_reap = {
426
+ is_child_running,
394
427
  own_ancestry,
395
428
  parse_pids,
396
429
  reap_child
@@ -398,11 +431,11 @@ var lane_reap = {
398
431
 
399
432
  // scripts/lane/lane-registry.ts
400
433
  import { existsSync as existsSync2 } from "node:fs";
401
- import path2 from "node:path";
434
+ import path3 from "node:path";
402
435
 
403
436
  // scripts/discovery/repo-discovery.ts
404
437
  import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
405
- import path from "node:path";
438
+ import path2 from "node:path";
406
439
 
407
440
  // scripts/discovery/repo-origin.ts
408
441
  var GITHUB_HOST = "github.com";
@@ -549,10 +582,10 @@ var GITDIR_PREFIX = "gitdir:";
549
582
  var COMMON_DIRECTORY_FILE = "commondir";
550
583
  var OVERRIDE_ENV_KEY = "JOSH_REPO_PATHS";
551
584
  function resolve_common_directory(git_directory) {
552
- const pointer = path.join(git_directory, COMMON_DIRECTORY_FILE);
585
+ const pointer = path2.join(git_directory, COMMON_DIRECTORY_FILE);
553
586
  if (!existsSync(pointer)) return git_directory;
554
587
  try {
555
- return path.resolve(git_directory, readFileSync(pointer, "utf8").trim());
588
+ return path2.resolve(git_directory, readFileSync(pointer, "utf8").trim());
556
589
  } catch {
557
590
  return git_directory;
558
591
  }
@@ -560,10 +593,10 @@ function resolve_common_directory(git_directory) {
560
593
  function follow_git_file(repository_path, git_file) {
561
594
  const pointer = readFileSync(git_file, "utf8").trim();
562
595
  if (!pointer.startsWith(GITDIR_PREFIX)) return void 0;
563
- return path.resolve(repository_path, pointer.slice(GITDIR_PREFIX.length).trim());
596
+ return path2.resolve(repository_path, pointer.slice(GITDIR_PREFIX.length).trim());
564
597
  }
565
598
  function resolve_git_directory(repository_path) {
566
- const candidate = path.join(repository_path, GIT_DIRECTORY);
599
+ const candidate = path2.join(repository_path, GIT_DIRECTORY);
567
600
  if (!existsSync(candidate)) return void 0;
568
601
  try {
569
602
  if (statSync(candidate).isDirectory()) return candidate;
@@ -577,7 +610,7 @@ function read_config(repository_path) {
577
610
  const git_directory = resolve_git_directory(repository_path);
578
611
  if (git_directory === void 0) return void 0;
579
612
  try {
580
- return readFileSync(path.join(git_directory, GIT_CONFIG), "utf8");
613
+ return readFileSync(path2.join(git_directory, GIT_CONFIG), "utf8");
581
614
  } catch {
582
615
  return void 0;
583
616
  }
@@ -592,7 +625,7 @@ function read_remote_urls(repository_path) {
592
625
  }
593
626
  function sibling_directories(parent) {
594
627
  try {
595
- return readdirSync(parent, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => path.join(parent, entry.name)).toSorted((left, right) => left.localeCompare(right));
628
+ return readdirSync(parent, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => path2.join(parent, entry.name)).toSorted((left, right) => left.localeCompare(right));
596
629
  } catch {
597
630
  return [];
598
631
  }
@@ -611,15 +644,15 @@ function resolve_current_owner(repository_path) {
611
644
  function main_worktree(repository_path) {
612
645
  const git_directory = resolve_git_directory(repository_path);
613
646
  if (git_directory === void 0) return repository_path;
614
- if (path.basename(git_directory) !== GIT_DIRECTORY) return repository_path;
615
- return path.dirname(git_directory);
647
+ if (path2.basename(git_directory) !== GIT_DIRECTORY) return repository_path;
648
+ return path2.dirname(git_directory);
616
649
  }
617
650
  function discover_repositories(repository_path, environment3 = process.env) {
618
651
  const main = main_worktree(repository_path);
619
652
  const current_owner = resolve_current_owner(main);
620
653
  if (current_owner === void 0) return /* @__PURE__ */ new Map();
621
654
  return repo_map_logic.build_repository_map(
622
- scan_siblings(path.dirname(main)),
655
+ scan_siblings(path2.dirname(main)),
623
656
  current_owner,
624
657
  environment3[OVERRIDE_ENV_KEY]
625
658
  );
@@ -1185,7 +1218,7 @@ function held_seat(content) {
1185
1218
  return seat_from_content(content) ?? EMPTY_SEAT;
1186
1219
  }
1187
1220
  function read_environment(directory) {
1188
- return file_reader.read_if_readable(path2.join(directory, ENV_FILE_NAME));
1221
+ return file_reader.read_if_readable(path3.join(directory, ENV_FILE_NAME));
1189
1222
  }
1190
1223
  function branch_issue(branch) {
1191
1224
  if (!branch?.endsWith(lane_paths.LANE_BRANCH_SUFFIX)) return void 0;
@@ -1248,6 +1281,9 @@ async function has_lanes_in_flight() {
1248
1281
  const lanes = await list_lanes();
1249
1282
  return lanes.some((lane) => !lane.is_stranded);
1250
1283
  }
1284
+ function live_count(lanes) {
1285
+ return lanes.filter((lane) => !lane.is_stranded).length;
1286
+ }
1251
1287
  function used_seats(lanes) {
1252
1288
  return lanes.map((lane) => lane.seat).filter((seat) => seat !== void 0);
1253
1289
  }
@@ -1265,6 +1301,7 @@ var lane_registry = {
1265
1301
  find_open_lane,
1266
1302
  has_lanes_in_flight,
1267
1303
  list_lanes,
1304
+ live_count,
1268
1305
  main_repository_root,
1269
1306
  parse_block,
1270
1307
  read_environment,
@@ -1326,6 +1363,7 @@ var run_headless = {
1326
1363
  is_backlog_parent,
1327
1364
  is_cut_capped,
1328
1365
  is_headless: is_headless2,
1366
+ is_headless_parent,
1329
1367
  is_owned_here,
1330
1368
  must_keep_waiting
1331
1369
  };
@@ -1354,6 +1392,10 @@ var EVENT_KIND = {
1354
1392
  // resume clears the cut record, so without this the `cut` would stay the newest position and
1355
1393
  // `run:step` would keep answering the resume command it had just run.
1356
1394
  RESUME: "resume",
1395
+ // A person stopped a running lane child and re-dispatched its issue in a fresh session
1396
+ // (`lane:restart`). It follows the fresh dispatch's `CHILD_LAUNCH`, so it is a launch to the parent and
1397
+ // the board, and — like that launch — a batch record a lane child never reads as its own position.
1398
+ RESTART: "restart",
1357
1399
  // The backlog emptied while nothing of the run's own was in flight — the drain. It marks the position
1358
1400
  // at which the end-of-run retrospective is owed, *before* the idle watch opens, so `run:step` fires
1359
1401
  // the retrospective at the drain rather than after the watch runs its course. It is not itself a
@@ -1420,10 +1462,15 @@ var EVENT_KIND = {
1420
1462
  // already holds. A trace: it says the run gained room, not where the run is.
1421
1463
  LANE_LIMIT: "lane-limit",
1422
1464
  // One stage of the run's start — the session starting, the plan, the hand-off to the supervisor, a
1423
- // lane opening (`run-event-setup.ts`). `run:board` draws it until the first child launches, so the
1465
+ // lane opening (`run-event-setup.ts`). `run:board` draws it while the run stands at it, so the
1424
1466
  // minutes before one read as work rather than as a run that has stopped. A trace: it says the run is
1425
1467
  // getting ready, not where the run is.
1426
- SETUP: "setup"
1468
+ SETUP: "setup",
1469
+ // A child's pull request checks as `josh followup` last polled them — the CI counts and CodeRabbit's
1470
+ // state (`run-event-checks.ts`), written only when they change, so `run:board` draws a child waiting
1471
+ // in followup without asking GitHub (joshuafolkken/kit#3770). A trace: it says how the checks stand,
1472
+ // not where the run is.
1473
+ PR_CHECKS: "pr-checks"
1427
1474
  };
1428
1475
  var EVENT_KINDS = Object.values(EVENT_KIND);
1429
1476
  var TRACE_KINDS = /* @__PURE__ */ new Set([
@@ -1434,12 +1481,14 @@ var TRACE_KINDS = /* @__PURE__ */ new Set([
1434
1481
  EVENT_KIND.LANE_PHASE,
1435
1482
  EVENT_KIND.ADD,
1436
1483
  EVENT_KIND.LANE_LIMIT,
1437
- EVENT_KIND.SETUP
1484
+ EVENT_KIND.SETUP,
1485
+ EVENT_KIND.PR_CHECKS
1438
1486
  ]);
1439
1487
  var DISPOSABLE_KINDS = /* @__PURE__ */ new Set([
1440
1488
  EVENT_KIND.SHIP_STAGE,
1441
1489
  EVENT_KIND.HEARTBEAT,
1442
- EVENT_KIND.SETUP
1490
+ EVENT_KIND.SETUP,
1491
+ EVENT_KIND.PR_CHECKS
1443
1492
  ]);
1444
1493
  var event_schema = z3.object({
1445
1494
  pos: z3.number(),
@@ -1473,10 +1522,10 @@ function last_position(events) {
1473
1522
  function issue_of(event) {
1474
1523
  return event.text.split(WORD_SEPARATOR2)[FIRST_POSITION] ?? "";
1475
1524
  }
1476
- function newest_stages(events) {
1525
+ function newest_by_issue(events, kind) {
1477
1526
  const newest = /* @__PURE__ */ new Map();
1478
1527
  for (const event of events) {
1479
- if (event.kind === EVENT_KIND.SHIP_STAGE) newest.set(issue_of(event), event);
1528
+ if (event.kind === kind) newest.set(issue_of(event), event);
1480
1529
  }
1481
1530
  return new Set(newest.values());
1482
1531
  }
@@ -1486,7 +1535,11 @@ function is_stage_start(event) {
1486
1535
  }
1487
1536
  function drawn_lines(events) {
1488
1537
  const setup = events.findLast((event) => event.kind === EVENT_KIND.SETUP);
1489
- return /* @__PURE__ */ new Set([...newest_stages(events), ...setup === void 0 ? [] : [setup]]);
1538
+ return /* @__PURE__ */ new Set([
1539
+ ...newest_by_issue(events, EVENT_KIND.SHIP_STAGE),
1540
+ ...newest_by_issue(events, EVENT_KIND.PR_CHECKS),
1541
+ ...setup === void 0 ? [] : [setup]
1542
+ ]);
1490
1543
  }
1491
1544
  function droppable(events) {
1492
1545
  const kept = drawn_lines(events);
@@ -1594,6 +1647,7 @@ var SHIP_POSITION_KINDS = /* @__PURE__ */ new Set([
1594
1647
  var KIND = run_event_stream.EVENT_KIND;
1595
1648
  var BATCH_RECORD_KINDS = /* @__PURE__ */ new Set([
1596
1649
  KIND.CHILD_LAUNCH,
1650
+ KIND.RESTART,
1597
1651
  KIND.PARK,
1598
1652
  KIND.SPLIT,
1599
1653
  KIND.RETROSPECTIVE,
@@ -1748,7 +1802,7 @@ import { closeSync, constants, openSync, writeSync } from "node:fs";
1748
1802
 
1749
1803
  // scripts/agent/agent-launch-environment.ts
1750
1804
  import { existsSync as existsSync3, lstatSync, mkdirSync, readlinkSync, symlinkSync, unlinkSync } from "node:fs";
1751
- import path4 from "node:path";
1805
+ import path5 from "node:path";
1752
1806
 
1753
1807
  // scripts/gh/gh-cli-token.ts
1754
1808
  import { execaSync } from "execa";
@@ -1776,9 +1830,9 @@ var agent_session_role = { KEY: KEY2, env_for: environment_for, is_reviewer };
1776
1830
 
1777
1831
  // scripts/agent/codex-home-source.ts
1778
1832
  import os from "node:os";
1779
- import path3 from "node:path";
1833
+ import path4 from "node:path";
1780
1834
  function default_home() {
1781
- return path3.join(os.homedir(), ".codex");
1835
+ return path4.join(os.homedir(), ".codex");
1782
1836
  }
1783
1837
  var codex_home_source = { default_home };
1784
1838
 
@@ -1800,13 +1854,13 @@ function remove_old_home_link(source, target) {
1800
1854
  return false;
1801
1855
  }
1802
1856
  function link_home_file(source_home, target_home, name) {
1803
- const source = path4.join(source_home, name);
1804
- const target = path4.join(target_home, name);
1857
+ const source = path5.join(source_home, name);
1858
+ const target = path5.join(target_home, name);
1805
1859
  if (!remove_old_home_link(source, target) && existsSync3(source)) symlinkSync(source, target);
1806
1860
  }
1807
1861
  function reviewer_home(cwd, environment3) {
1808
1862
  const source = environment3["CODEX_HOME"] ?? process.env["CODEX_HOME"] ?? codex_home_source.default_home();
1809
- const target = path4.resolve(cwd, ...REVIEWER_HOME);
1863
+ const target = path5.resolve(cwd, ...REVIEWER_HOME);
1810
1864
  mkdirSync(target, { recursive: true, mode: PRIVATE_DIRECTORY_MODE });
1811
1865
  for (const name of HOME_FILES) link_home_file(source, target, name);
1812
1866
  return target;
@@ -1960,6 +2014,8 @@ var detached_launch = {
1960
2014
  };
1961
2015
 
1962
2016
  export {
2017
+ repo_origin,
2018
+ repo_discovery,
1963
2019
  issue_cite,
1964
2020
  git_common_directory,
1965
2021
  run_event_stream,
@@ -1968,10 +2024,9 @@ export {
1968
2024
  agent_role_profile,
1969
2025
  agent_session_role,
1970
2026
  lane_child_invocation,
1971
- repo_origin,
1972
- repo_discovery,
1973
2027
  agent_headless,
1974
2028
  detached_launch,
2029
+ session_language,
1975
2030
  lane_registry,
1976
2031
  run_headless
1977
2032
  };
@@ -1,34 +1,34 @@
1
1
  #!/usr/bin/env tsx
2
2
  import {
3
3
  pretool_guard
4
- } from "./chunk-GJ7JPIHN.js";
5
- import "./chunk-DCY2GWHC.js";
4
+ } from "./chunk-5C7L6FRC.js";
5
+ import "./chunk-SHYUQOIS.js";
6
6
  import {
7
7
  bounded_pool
8
- } from "./chunk-GNDJ7NJ7.js";
8
+ } from "./chunk-Y3GKIKGW.js";
9
9
  import {
10
10
  build_envelope,
11
11
  compose_context,
12
12
  format_edited_payload
13
- } from "./chunk-STDSEPWU.js";
14
- import "./chunk-JBBMAPC4.js";
15
- import "./chunk-U32VSRNG.js";
13
+ } from "./chunk-D3NJXN5M.js";
14
+ import "./chunk-IX6TTTI6.js";
15
+ import "./chunk-Z4XI7CZS.js";
16
16
  import "./chunk-CDY4NFQG.js";
17
- import "./chunk-LMWBRJIP.js";
18
- import "./chunk-IYVOLN6A.js";
19
- import "./chunk-WNFJLBXI.js";
20
- import "./chunk-EAQEGME7.js";
17
+ import "./chunk-EF5GQ6WS.js";
18
+ import "./chunk-LBFYEOXJ.js";
19
+ import "./chunk-NO4AALP5.js";
20
+ import "./chunk-UT7YC3N2.js";
21
21
  import {
22
22
  hook_decision
23
- } from "./chunk-EBSHN25W.js";
23
+ } from "./chunk-W5ZKGTSY.js";
24
24
  import {
25
25
  time_density_hook
26
- } from "./chunk-SL4GQ2XP.js";
27
- import "./chunk-J3KSS7II.js";
26
+ } from "./chunk-MBJYQPEK.js";
27
+ import "./chunk-OLMO72ON.js";
28
28
  import {
29
29
  json_value
30
- } from "./chunk-2YSW3CXH.js";
31
- import "./chunk-NEC4AT4Z.js";
30
+ } from "./chunk-3C4XRYG6.js";
31
+ import "./chunk-DGT54IH5.js";
32
32
 
33
33
  // scripts/hooks/codex-hook-adapter.ts
34
34
  import { text } from "node:stream/consumers";
@@ -9,14 +9,14 @@ import {
9
9
  is_enabled,
10
10
  notice_refusal_path,
11
11
  refusal_path
12
- } from "./chunk-DCY2GWHC.js";
13
- import "./chunk-WNFJLBXI.js";
14
- import "./chunk-EAQEGME7.js";
15
- import "./chunk-EBSHN25W.js";
16
- import "./chunk-SL4GQ2XP.js";
17
- import "./chunk-J3KSS7II.js";
18
- import "./chunk-2YSW3CXH.js";
19
- import "./chunk-NEC4AT4Z.js";
12
+ } from "./chunk-SHYUQOIS.js";
13
+ import "./chunk-NO4AALP5.js";
14
+ import "./chunk-UT7YC3N2.js";
15
+ import "./chunk-W5ZKGTSY.js";
16
+ import "./chunk-MBJYQPEK.js";
17
+ import "./chunk-OLMO72ON.js";
18
+ import "./chunk-3C4XRYG6.js";
19
+ import "./chunk-DGT54IH5.js";
20
20
  export {
21
21
  DISABLED_VALUES,
22
22
  SWITCH_ENV_KEY,
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  report_no_payload,
4
4
  run_hook
5
- } from "./chunk-STDSEPWU.js";
6
- import "./chunk-JBBMAPC4.js";
7
- import "./chunk-SL4GQ2XP.js";
8
- import "./chunk-2YSW3CXH.js";
9
- import "./chunk-NEC4AT4Z.js";
5
+ } from "./chunk-D3NJXN5M.js";
6
+ import "./chunk-IX6TTTI6.js";
7
+ import "./chunk-MBJYQPEK.js";
8
+ import "./chunk-3C4XRYG6.js";
9
+ import "./chunk-DGT54IH5.js";
10
10
 
11
11
  // scripts/hooks/format-edited-cli.ts
12
12
  import { text } from "node:stream/consumers";