@joshuafolkken/kit 1.1387.0 → 1.1435.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.
- package/.claude/skills/epic-commands/SKILL.md +1 -1
- package/.claude/skills/epic-commands/epic-bundle.md +5 -0
- package/.claude/skills/workflow-commands/backlogrun-lanes.md +5 -3
- package/.claude/skills/workflow-commands/backlogrun-steps.md +4 -3
- package/.claude/skills/workflow-commands/backlogrun.md +1 -0
- package/.claude/skills/workflow-commands/chain-rule.md +4 -2
- package/.claude/skills/workflow-commands/issue-comments.md +6 -0
- package/.claude/skills/workflow-commands/observation-ledger.md +3 -2
- package/.claude/skills/workflow-commands/pre-gate-cut.md +5 -3
- package/README.md +25 -0
- package/dist/hooks/audit-provision.js +2 -2
- package/dist/hooks/batch-guard.js +7 -7
- package/dist/hooks/{chunk-IYVOLN6A.js → chunk-2G5F2YCD.js} +3 -3
- package/dist/hooks/{chunk-2YSW3CXH.js → chunk-3LE6VLSR.js} +17 -6
- package/dist/hooks/{chunk-J3KSS7II.js → chunk-4BHUPFKF.js} +1 -1
- package/dist/hooks/{chunk-EAQEGME7.js → chunk-5SJSSCJG.js} +1 -1
- package/dist/hooks/{chunk-FZ6FUSBM.js → chunk-723HKZO5.js} +1 -1
- package/dist/hooks/{chunk-LMWBRJIP.js → chunk-7KMN5QB5.js} +3 -3
- package/dist/hooks/{chunk-NEC4AT4Z.js → chunk-DGT54IH5.js} +4 -0
- package/dist/hooks/{chunk-STDSEPWU.js → chunk-EMB55BDF.js} +4 -4
- package/dist/hooks/{chunk-JBBMAPC4.js → chunk-IX6TTTI6.js} +4 -0
- package/dist/hooks/{chunk-GJ7JPIHN.js → chunk-JXQBK323.js} +2674 -187
- package/dist/hooks/{chunk-DCY2GWHC.js → chunk-MSYSUSY6.js} +5 -5
- package/dist/hooks/{chunk-EBSHN25W.js → chunk-MU4LJFIV.js} +4 -4
- package/dist/hooks/{chunk-WNFJLBXI.js → chunk-QL6QTPWN.js} +3 -3
- package/dist/hooks/{chunk-SL4GQ2XP.js → chunk-XER6SSIB.js} +91 -18
- package/dist/hooks/{chunk-U32VSRNG.js → chunk-YW452ZAX.js} +89 -34
- package/dist/hooks/{chunk-GNDJ7NJ7.js → chunk-YZXYOAZ3.js} +202 -55
- package/dist/hooks/codex-hook-adapter.js +15 -15
- package/dist/hooks/duplicate-read-guard.js +8 -8
- package/dist/hooks/format-edited.js +5 -5
- package/dist/hooks/inputs.json +288 -229
- package/dist/hooks/investigation-guard.js +8 -8
- package/dist/hooks/pretool-guard.js +14 -14
- package/dist/hooks/session-lang.js +69 -16
- package/dist/hooks/stop-guard.js +13 -38
- package/dist/josh.js +62 -9
- package/package.json +4 -3
- package/prompts/review.md +22 -0
- package/scripts/agent/claude-agent-argv.ts +13 -1
- package/scripts/auth/auth-setup-cli.ts +101 -0
- package/scripts/auth/claude-token-output.ts +78 -0
- package/scripts/auth/claude-token.ts +68 -0
- package/scripts/backlog/backlog-drive-epic.ts +24 -8
- package/scripts/backlog/backlog-drive-launch.ts +3 -0
- package/scripts/backlog/backlog-drive-named-offer.ts +7 -2
- package/scripts/backlog/backlog-drive-named.ts +4 -2
- package/scripts/backlog/backlog-drive-unread.ts +56 -0
- package/scripts/backlog/backlog-drive.ts +16 -8
- package/scripts/backlog/backlog-overlap.ts +22 -5
- package/scripts/backlog/backlog-ready.ts +1 -3
- package/scripts/backlog/backlogrun-args.ts +13 -2
- package/scripts/backlog/backlogrun-cli.ts +91 -19
- package/scripts/backlog/backlogrun-launch.ts +24 -0
- package/scripts/backlog/backlogrun-replace.ts +166 -0
- package/scripts/backlog/backlogrun-stop.ts +178 -0
- package/scripts/behavior/behavior-cli.ts +6 -1
- package/scripts/doctor/doctor-io.ts +60 -9
- package/scripts/doctor/doctor.ts +20 -1
- package/scripts/document/document-byte-budget.ts +3 -3
- package/scripts/epic/epic-bundle-cli.ts +8 -8
- package/scripts/epic/epic-bundle-referenced.ts +2 -5
- package/scripts/epic/epic-bundle.ts +39 -4
- package/scripts/exports/unused-members-cli.ts +2 -1
- package/scripts/followup/followup-checks-event.ts +82 -0
- package/scripts/followup/git-followup-finish.ts +16 -2
- package/scripts/followup/git-followup-workflow.ts +5 -2
- package/scripts/followup/git-pr-followup-checks.ts +18 -4
- package/scripts/followup/git-pr-followup-wrapup.ts +5 -0
- package/scripts/followup/git-pr-followup.ts +4 -1
- package/scripts/fresh-machine/fresh-machine-cli.ts +204 -0
- package/scripts/fresh-machine/fresh-machine-docker.ts +65 -0
- package/scripts/fresh-machine/fresh-machine-image.ts +62 -0
- package/scripts/fresh-machine/fresh-machine-log.ts +61 -0
- package/scripts/fresh-machine/fresh-machine-patterns.ts +130 -0
- package/scripts/fresh-machine/fresh-machine-run.ts +215 -0
- package/scripts/fresh-machine/fresh-machine-script.ts +45 -0
- package/scripts/fresh-machine/fresh-machine-spec.ts +57 -0
- package/scripts/fresh-machine/specs/kit-test-backlogrun-python.json +34 -0
- package/scripts/fresh-machine/specs/kit-test-backlogrun.json +31 -0
- package/scripts/gate/gate-report.ts +70 -15
- package/scripts/gate/project-checks.ts +13 -2
- package/scripts/gate/scoped-green.ts +2 -1
- package/scripts/gate/verification-gate.ts +4 -3
- package/scripts/gh/gh-author-association.ts +14 -0
- package/scripts/gh/git-gh-conditional.ts +66 -0
- package/scripts/gh/git-gh-exec.ts +1 -1
- package/scripts/gh/git-gh-issue-read.ts +6 -3
- package/scripts/gh/git-gh-issue-write.ts +5 -1
- package/scripts/gh/git-gh-issue.ts +4 -1
- package/scripts/gh/git-pr-checks-eval.ts +13 -0
- package/scripts/gh/git-pr-checks-parse.ts +8 -1
- package/scripts/gh/git-pr-checks-watch.ts +11 -4
- package/scripts/gh/git-pr-checks.ts +36 -2
- package/scripts/git/git-command.ts +16 -4
- package/scripts/git/git-schemas.ts +1 -0
- package/scripts/git/git-spawn-sync.ts +1 -1
- package/scripts/hooks/pretool-guard.ts +3 -1
- package/scripts/init/hook-command-rewrite.ts +31 -0
- package/scripts/init/init-actions.ts +4 -1
- package/scripts/init/init-ai-copy.ts +33 -10
- package/scripts/init/init-basic.ts +8 -3
- package/scripts/init/init-logic-toolchain.ts +76 -0
- package/scripts/init/init-logic.ts +2 -0
- package/scripts/init/init.ts +5 -23
- package/scripts/init/project-profile.ts +36 -7
- package/scripts/init/start-exec.ts +27 -1
- package/scripts/init/start-plan.ts +15 -0
- package/scripts/init/start-steps.ts +46 -0
- package/scripts/init/start.ts +1 -0
- package/scripts/init/workflow-mark.ts +35 -0
- package/scripts/issue/issue-ack-cli.ts +84 -0
- package/scripts/issue/issue-labels.ts +40 -8
- package/scripts/issue/issue-state-cli.ts +14 -4
- package/scripts/issue/issue-watch-diff.ts +152 -0
- package/scripts/issue/issue-watch-gate.ts +81 -0
- package/scripts/issue/issue-watch-hook.ts +54 -0
- package/scripts/issue/issue-watch.ts +240 -0
- package/scripts/issue/measure-rerun-cli.ts +3 -4
- package/scripts/josh/josh-command-map.ts +4 -0
- package/scripts/josh/josh-commands-backlog.ts +2 -2
- package/scripts/josh/josh-commands-development.ts +1 -1
- package/scripts/josh/josh-commands-issue.ts +7 -0
- package/scripts/josh/josh-commands-lane.ts +11 -2
- package/scripts/josh/josh-commands-project.ts +24 -0
- package/scripts/josh/josh-verdict.ts +33 -4
- package/scripts/lane/claude-lane-broker.ts +142 -0
- package/scripts/lane/lane-await.ts +6 -2
- package/scripts/lane/lane-cache.ts +37 -7
- package/scripts/lane/lane-capacity.ts +8 -6
- package/scripts/lane/lane-child-invocation.ts +1 -0
- package/scripts/lane/lane-cli.ts +15 -1
- package/scripts/lane/lane-close.ts +15 -6
- package/scripts/lane/lane-dispatch.ts +36 -10
- package/scripts/lane/lane-environment.ts +1 -1
- package/scripts/lane/lane-launch-cli.ts +13 -4
- package/scripts/lane/lane-ledger.ts +21 -3
- package/scripts/lane/lane-measure-cli.ts +10 -2
- package/scripts/lane/lane-open.ts +9 -1
- package/scripts/lane/lane-preserve.ts +49 -0
- package/scripts/lane/lane-reap.ts +20 -5
- package/scripts/lane/lane-registry.ts +6 -0
- package/scripts/lane/lane-restart-cli.ts +51 -0
- package/scripts/lane/lane-restart.ts +175 -0
- package/scripts/lane/{openai-review-broker.ts → lane-session-broker.ts} +106 -28
- package/scripts/lane/lane-spent.ts +195 -0
- package/scripts/lane/lane-stage-stats.ts +27 -3
- package/scripts/lane/lane-stop-stats.ts +96 -0
- package/scripts/lane/openai-lane-supervisor.ts +2 -2
- package/scripts/lane/process-tools.ts +31 -0
- package/scripts/lib/buffered-process.ts +36 -2
- package/scripts/lib/pnpm-reach.ts +27 -0
- package/scripts/lib/status-icons.ts +5 -1
- package/scripts/lint/lint-parallel.ts +19 -2
- package/scripts/observations/observation-ledger-home.ts +1 -0
- package/scripts/review/review-attest-cli.ts +21 -6
- package/scripts/review/review-brief-cli.ts +2 -2
- package/scripts/review/review-comment-round.ts +114 -0
- package/scripts/review/review-record-cli.ts +39 -17
- package/scripts/rules/implementation-cut.ts +3 -3
- package/scripts/rules/pre-gate-cut.ts +1 -1
- package/scripts/run/board/run-board-checks.ts +42 -0
- package/scripts/run/board/run-board-cli.ts +2 -0
- package/scripts/run/board/run-board-every.ts +3 -1
- package/scripts/run/board/run-board-fit.ts +16 -5
- package/scripts/run/board/run-board-fresh.ts +64 -0
- package/scripts/run/board/run-board-header.ts +129 -53
- package/scripts/run/board/run-board-labels.ts +47 -4
- package/scripts/run/board/run-board-lane-event.ts +66 -0
- package/scripts/run/board/run-board-layout.ts +57 -9
- package/scripts/run/board/run-board-now.ts +234 -0
- package/scripts/run/board/run-board-operation-read.ts +75 -0
- package/scripts/run/board/run-board-operation.ts +150 -0
- package/scripts/run/board/run-board-phase.ts +26 -1
- package/scripts/run/board/run-board-plan.ts +4 -6
- package/scripts/run/board/run-board-read.ts +49 -3
- package/scripts/run/board/run-board-reason.ts +124 -0
- package/scripts/run/board/run-board-render-checks.ts +55 -0
- package/scripts/run/board/run-board-render-legend.ts +12 -3
- package/scripts/run/board/run-board-render-slot.ts +2 -2
- package/scripts/run/board/run-board-render-tail.ts +128 -0
- package/scripts/run/board/run-board-render-thanks.ts +50 -0
- package/scripts/run/board/run-board-render-title.ts +58 -0
- package/scripts/run/board/run-board-render.ts +96 -80
- package/scripts/run/board/run-board-row-yield.ts +32 -0
- package/scripts/run/board/run-board-setup.ts +61 -13
- package/scripts/run/board/run-board-state.ts +10 -0
- package/scripts/run/board/run-board-status.ts +66 -7
- package/scripts/run/board/run-board-thanks-csv.ts +71 -0
- package/scripts/run/board/run-board-thanks-read.ts +112 -0
- package/scripts/run/board/run-board-thanks.ts +53 -0
- package/scripts/run/board/run-board-tick.ts +50 -21
- package/scripts/run/board/run-board-usual.ts +44 -0
- package/scripts/run/carry/run-carry-args.ts +9 -1
- package/scripts/run/carry/run-carry-cli.ts +2 -45
- package/scripts/run/carry/run-carry-end.ts +73 -0
- package/scripts/run/carry/run-carry.ts +8 -1
- package/scripts/run/entry/run-entry-cli.ts +5 -0
- package/scripts/run/event/run-event-checks.ts +54 -0
- package/scripts/run/event/run-event-render.ts +2 -0
- package/scripts/run/event/run-event-scope.ts +1 -0
- package/scripts/run/event/run-event-setup.ts +55 -11
- package/scripts/run/event/run-event-stream.ts +27 -11
- package/scripts/run/merge/run-merge-cli.ts +7 -4
- package/scripts/run/merge/run-merge-ship.ts +61 -0
- package/scripts/run/merge/run-merge-steps.ts +7 -14
- package/scripts/run/merge/run-merge-token.ts +16 -2
- package/scripts/run/run-headless.ts +1 -0
- package/scripts/run/run-step.ts +2 -0
- package/scripts/run/ship/run-ship-cli.ts +22 -2
- package/scripts/run/ship/run-ship-return.ts +31 -13
- package/scripts/run/ship/run-ship-review-steps.ts +17 -4
- package/scripts/run/ship/run-ship-stage.ts +1 -0
- package/scripts/run/wake/run-wake-await.ts +130 -0
- package/scripts/run/wake/run-wake-cli.ts +60 -71
- package/scripts/run/wake/run-wake-describe.ts +34 -2
- package/scripts/run/wake/run-wake-driver.ts +11 -4
- package/scripts/run/wake/run-wake-session.ts +20 -3
- package/scripts/run/wake/run-wake-stop.ts +37 -0
- package/scripts/run/wake/run-wake-supervise.ts +44 -0
- package/scripts/sync/claude-settings-merge.ts +144 -0
- package/scripts/sync/sync-ai-files.ts +28 -3
- package/scripts/sync/sync.ts +15 -0
- package/scripts/test/project-test-script.ts +73 -0
- package/scripts/test/skip-marker.ts +14 -1
- package/scripts/test/test-related.ts +3 -2
- package/scripts/test/test-unit-guard.ts +78 -14
- package/scripts/time-runtime/time-reported-failure.ts +11 -3
- package/scripts/uninstall/distributed-files.ts +92 -0
- package/scripts/uninstall/uninstall-plan.ts +119 -0
- package/scripts/uninstall/uninstall-report.ts +61 -0
- package/scripts/uninstall/uninstall.ts +206 -0
- package/templates/AGENTS.basic.md +4 -0
- package/templates/GEMINI.basic.md +6 -0
- package/dist/hooks/chunk-6V5OPIUU.js +0 -13
- 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-
|
|
6
|
+
} from "./chunk-4BHUPFKF.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-
|
|
26
|
+
} from "./chunk-3LE6VLSR.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-
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
585
|
+
const pointer = path2.join(git_directory, COMMON_DIRECTORY_FILE);
|
|
553
586
|
if (!existsSync(pointer)) return git_directory;
|
|
554
587
|
try {
|
|
555
|
-
return
|
|
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
|
|
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 =
|
|
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(
|
|
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) =>
|
|
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 (
|
|
615
|
-
return
|
|
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(
|
|
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(
|
|
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
|
|
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
|
|
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 ===
|
|
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([
|
|
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
|
|
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
|
|
1833
|
+
import path4 from "node:path";
|
|
1780
1834
|
function default_home() {
|
|
1781
|
-
return
|
|
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 =
|
|
1804
|
-
const target =
|
|
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 =
|
|
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
|
};
|