@joshuafolkken/kit 1.1035.0 → 1.1050.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/verify-ui/SKILL.md +1 -1
- package/.claude/skills/workflow-commands/SKILL.md +2 -2
- package/.claude/skills/workflow-commands/background-commands.md +1 -1
- package/.claude/skills/workflow-commands/backlogrun-child.md +2 -2
- package/.claude/skills/workflow-commands/backlogrun-lanes.md +1 -1
- package/.claude/skills/workflow-commands/backlogrun-park.md +6 -0
- package/.claude/skills/workflow-commands/backlogrun-progress.md +30 -36
- package/.claude/skills/workflow-commands/backlogrun-steps.md +16 -16
- package/.claude/skills/workflow-commands/chain-rule.md +2 -2
- package/.claude/skills/workflow-commands/followup-reference.md +2 -2
- package/.claude/skills/workflow-commands/issue-comments.md +1 -1
- package/.claude/skills/workflow-commands/observation-filing.md +41 -86
- package/.claude/skills/workflow-commands/pre-gate-cut.md +33 -36
- package/.claude/skills/workflow-commands/working-tree-hold.md +2 -2
- package/.github/workflows/auto-tag.yml +21 -0
- package/.github/workflows/publish.yml +9 -10
- package/dist/hooks/batch-guard.js +4 -4
- package/dist/hooks/{chunk-HU66PWWL.js → chunk-5BK3K7V4.js} +89 -41
- package/dist/hooks/{chunk-GLBDBJOK.js → chunk-7VPDUBRN.js} +49 -151
- package/dist/hooks/{chunk-GJT4BNVE.js → chunk-DMQN45FN.js} +3 -3
- package/dist/hooks/{chunk-D67KVGGY.js → chunk-EJDX2TOB.js} +13 -3
- package/dist/hooks/{chunk-KG6PZD72.js → chunk-GQ7KP45M.js} +2 -2
- package/dist/hooks/{chunk-Y27M6A7X.js → chunk-HJIISEAC.js} +4 -4
- package/dist/hooks/{chunk-XPLP27WA.js → chunk-NAS4C7GP.js} +4 -26
- package/dist/hooks/{chunk-ZXNE6NY3.js → chunk-NJQOBE6L.js} +2 -2
- package/dist/hooks/{chunk-EIFCAJRB.js → chunk-RLDX5SOC.js} +1184 -946
- package/dist/hooks/{chunk-HOYJU5RM.js → chunk-WQ4OSBSS.js} +10 -3
- package/dist/hooks/codex-hook-adapter.js +10 -10
- package/dist/hooks/duplicate-read-guard.js +5 -5
- package/dist/hooks/format-edited.js +15 -34
- package/dist/hooks/investigation-guard.js +5 -5
- package/dist/hooks/pretool-guard.js +23 -16
- package/dist/hooks/stop-guard.js +13 -188
- package/dist/josh.js +4 -106
- package/dist/version/index.js +381 -9
- package/package.json +6 -6
- package/prompts/collaboration-workflow/file-edits.md +6 -53
- package/prompts/collaboration-workflow/residency.md +1 -1
- package/prompts/collaboration-workflow/rule-delivery.md +4 -35
- package/prompts/collaboration-workflow/shell-body.md +7 -9
- package/prompts/collaboration-workflow/turn-batching.md +21 -37
- package/prompts/collaboration-workflow/wip-cap.md +15 -18
- package/prompts/sonar-hotspot-handling.md +1 -1
- package/scripts/adopt/adopt-toolkits.ts +2 -0
- package/scripts/auto-ok/auto-ok-cli.ts +9 -9
- package/scripts/backlog/backlog-next.ts +24 -8
- package/scripts/backlog/backlog-plan-cli.ts +5 -1
- package/scripts/backlog/backlog-pool.ts +31 -11
- package/scripts/backlog/backlog-rank.ts +106 -0
- package/scripts/backlog/backlog-waves.ts +42 -29
- package/scripts/build/build-hooks.ts +7 -2
- package/scripts/delegation/delegation-policy.ts +11 -0
- package/scripts/document/document-byte-budget.ts +5 -5
- package/scripts/document/entry-read-budget.ts +5 -4
- package/scripts/epic/epic-lane-offer.ts +11 -22
- package/scripts/epic/epic-rank.ts +37 -0
- package/scripts/epic/epic-solo.ts +29 -28
- package/scripts/git/git-command.ts +1 -1
- package/scripts/git/git-execa-error.ts +6 -1
- package/scripts/git/git-next-issues.ts +34 -5
- package/scripts/git/git-preflight.ts +22 -4
- package/scripts/git/git-push-transport.ts +12 -69
- package/scripts/git/git-spawn.ts +79 -3
- package/scripts/git/git-ssh-keepalive.ts +74 -0
- package/scripts/git/gone-branch.ts +3 -2
- package/scripts/git/issue-labels.ts +12 -0
- package/scripts/git/issue-rank.ts +89 -0
- package/scripts/hooks/format-edited-cli.ts +15 -0
- package/scripts/hooks/format-edited-file.ts +2 -9
- package/scripts/hooks/pretool-guard-cli.ts +21 -0
- package/scripts/hooks/pretool-guard.ts +14 -15
- package/scripts/init/start-exec.ts +7 -1
- package/scripts/init/start-plan.ts +18 -5
- package/scripts/init/start-setup-pr.ts +46 -19
- package/scripts/init/start-steps.ts +41 -9
- package/scripts/init/start.ts +40 -10
- package/scripts/issue/issue-cite.ts +19 -1
- package/scripts/josh/josh-command-map.ts +0 -102
- package/scripts/josh/josh-commands-development.ts +2 -2
- package/scripts/josh/josh-commands-project.ts +1 -1
- package/scripts/lane/lane-child-marker.ts +16 -2
- package/scripts/lane/lane-cli.ts +32 -14
- package/scripts/lane/lane-report.ts +10 -4
- package/scripts/propagate/propagate-plan.ts +185 -0
- package/scripts/propagate/propagate-run.ts +5 -1
- package/scripts/propagate/propagate-steps.ts +16 -1
- package/scripts/propagate/propagate-targets.ts +13 -2
- package/scripts/propagate/propagate.ts +60 -42
- package/scripts/registry-migration/migrate-logic.ts +1 -0
- package/scripts/release/github-release.ts +1 -1
- package/scripts/review/review-attest.ts +44 -0
- package/scripts/review/review-brief-cli.ts +49 -2
- package/scripts/review/review-brief.ts +46 -1
- package/scripts/review/review-stamps.ts +7 -0
- package/scripts/rules/implementation-cut.ts +1 -1
- package/scripts/rules/issue-fold.ts +1 -2
- package/scripts/rules/lane-carry-conflict.ts +1 -2
- package/scripts/rules/lane-park.ts +1 -2
- package/scripts/rules/pre-gate-cut.ts +2 -2
- package/scripts/run/run-headless.ts +22 -6
- package/scripts/run/run-parent-cut-hook.ts +144 -0
- package/scripts/run/run-progress-read.ts +2 -1
- package/scripts/run/run-progress.ts +21 -8
- package/scripts/run/run-ship-cli.ts +6 -74
- package/scripts/run/run-ship-preflight.ts +87 -0
- package/scripts/run/run-ship-review-steps.ts +5 -26
- package/scripts/run/run-ship-review.ts +9 -0
- package/scripts/run/run-ship-scoped.ts +44 -0
- package/scripts/run/run-ship-stage.ts +5 -1
- package/scripts/run/run-ship-steps.ts +105 -0
- package/scripts/run/run-ship.ts +2 -0
- package/scripts/run/run-wake-cli.ts +2 -2
- package/scripts/run/run-wake-describe.ts +19 -1
- package/scripts/run/run-watcher-hook.ts +1 -1
- package/scripts/time-runtime/time-bundle-call.ts +2 -2
- package/scripts/version/npm-registry.ts +97 -0
- package/scripts/version/version-commands.ts +5 -4
- package/scripts/version/version-remote.ts +26 -12
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
stamp_file,
|
|
4
4
|
time_density_hook,
|
|
5
5
|
time_hook_transcript
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7VPDUBRN.js";
|
|
7
7
|
import {
|
|
8
8
|
josh_environment_file
|
|
9
9
|
} from "./chunk-WPALEIRX.js";
|
|
@@ -218,9 +218,11 @@ var run_issue_number = { BAD_ISSUE_MESSAGE, ISSUE_NUMBER_PATTERN, require_issue_
|
|
|
218
218
|
|
|
219
219
|
// scripts/lane/lane-child-marker.ts
|
|
220
220
|
var KEY = "JOSH_LANE_CHILD";
|
|
221
|
+
var CACHE_TTL_KEY = "CLAUDE_CODE_PROMPT_CACHE_TTL";
|
|
222
|
+
var CACHE_TTL = "5m";
|
|
221
223
|
function environment_for(issue) {
|
|
222
224
|
run_issue_number.require_issue_number(issue);
|
|
223
|
-
return { [KEY]: issue };
|
|
225
|
+
return { [KEY]: issue, [CACHE_TTL_KEY]: CACHE_TTL };
|
|
224
226
|
}
|
|
225
227
|
function marked_issue(source = process.env) {
|
|
226
228
|
const value = source[KEY];
|
|
@@ -231,7 +233,12 @@ function is_child_of(directory, source = process.env) {
|
|
|
231
233
|
const marked = marked_issue(source);
|
|
232
234
|
return marked !== void 0 && marked === lane_paths.lane_issue_of(directory, { ...source });
|
|
233
235
|
}
|
|
234
|
-
var lane_child_marker = {
|
|
236
|
+
var lane_child_marker = {
|
|
237
|
+
KEY,
|
|
238
|
+
env_for: environment_for,
|
|
239
|
+
is_child_of,
|
|
240
|
+
marked_issue
|
|
241
|
+
};
|
|
235
242
|
|
|
236
243
|
export {
|
|
237
244
|
hook_decision,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env tsx
|
|
2
2
|
import {
|
|
3
3
|
pretool_guard
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5BK3K7V4.js";
|
|
5
|
+
import "./chunk-RLDX5SOC.js";
|
|
6
6
|
import {
|
|
7
7
|
build_envelope,
|
|
8
8
|
compose_context,
|
|
9
9
|
format_edited_payload
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NAS4C7GP.js";
|
|
11
11
|
import "./chunk-3V37IID6.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-GQ7KP45M.js";
|
|
13
|
+
import "./chunk-DMQN45FN.js";
|
|
14
|
+
import "./chunk-HJIISEAC.js";
|
|
15
|
+
import "./chunk-EJDX2TOB.js";
|
|
16
|
+
import "./chunk-NJQOBE6L.js";
|
|
17
17
|
import {
|
|
18
18
|
hook_decision
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-WQ4OSBSS.js";
|
|
20
20
|
import {
|
|
21
21
|
time_density_hook
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-7VPDUBRN.js";
|
|
23
23
|
import "./chunk-WPALEIRX.js";
|
|
24
24
|
import "./chunk-RKUAD3I6.js";
|
|
25
25
|
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
is_enabled,
|
|
10
10
|
notice_refusal_path,
|
|
11
11
|
refusal_path
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-HJIISEAC.js";
|
|
13
|
+
import "./chunk-EJDX2TOB.js";
|
|
14
|
+
import "./chunk-NJQOBE6L.js";
|
|
15
|
+
import "./chunk-WQ4OSBSS.js";
|
|
16
|
+
import "./chunk-7VPDUBRN.js";
|
|
17
17
|
import "./chunk-WPALEIRX.js";
|
|
18
18
|
import "./chunk-RKUAD3I6.js";
|
|
19
19
|
export {
|
|
@@ -1,38 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env tsx
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
build_envelope,
|
|
7
|
-
compose_context,
|
|
8
|
-
density_envelope,
|
|
9
|
-
format_edited_file,
|
|
10
|
-
format_edited_payload,
|
|
11
|
-
is_start_failure,
|
|
12
|
-
parse_edited_path,
|
|
13
|
-
plan_commands,
|
|
14
|
-
plan_daemon_restart,
|
|
15
|
-
relative_to_root,
|
|
16
|
-
resolve_invocations,
|
|
17
|
-
select_invocation
|
|
18
|
-
} from "./chunk-XPLP27WA.js";
|
|
3
|
+
report_no_payload,
|
|
4
|
+
run_hook
|
|
5
|
+
} from "./chunk-NAS4C7GP.js";
|
|
19
6
|
import "./chunk-3V37IID6.js";
|
|
20
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-7VPDUBRN.js";
|
|
21
8
|
import "./chunk-RKUAD3I6.js";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
plan_commands,
|
|
34
|
-
plan_daemon_restart,
|
|
35
|
-
relative_to_root,
|
|
36
|
-
resolve_invocations,
|
|
37
|
-
select_invocation
|
|
38
|
-
};
|
|
9
|
+
|
|
10
|
+
// scripts/hooks/format-edited-cli.ts
|
|
11
|
+
import { text } from "node:stream/consumers";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
14
|
+
if (process.stdin.isTTY) {
|
|
15
|
+
report_no_payload();
|
|
16
|
+
} else {
|
|
17
|
+
await run_hook(await text(process.stdin));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
is_enabled,
|
|
11
11
|
load_environment_file,
|
|
12
12
|
refusal_path
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-DMQN45FN.js";
|
|
14
|
+
import "./chunk-EJDX2TOB.js";
|
|
15
|
+
import "./chunk-NJQOBE6L.js";
|
|
16
|
+
import "./chunk-WQ4OSBSS.js";
|
|
17
|
+
import "./chunk-7VPDUBRN.js";
|
|
18
18
|
import "./chunk-WPALEIRX.js";
|
|
19
19
|
import "./chunk-RKUAD3I6.js";
|
|
20
20
|
export {
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env tsx
|
|
2
2
|
import {
|
|
3
|
-
pretool_guard,
|
|
4
|
-
pretool_outcome,
|
|
5
3
|
pretool_outcome_async
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-5BK3K7V4.js";
|
|
5
|
+
import "./chunk-RLDX5SOC.js";
|
|
8
6
|
import "./chunk-3V37IID6.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import
|
|
15
|
-
|
|
7
|
+
import "./chunk-GQ7KP45M.js";
|
|
8
|
+
import "./chunk-DMQN45FN.js";
|
|
9
|
+
import "./chunk-HJIISEAC.js";
|
|
10
|
+
import "./chunk-EJDX2TOB.js";
|
|
11
|
+
import "./chunk-NJQOBE6L.js";
|
|
12
|
+
import {
|
|
13
|
+
hook_decision
|
|
14
|
+
} from "./chunk-WQ4OSBSS.js";
|
|
15
|
+
import "./chunk-7VPDUBRN.js";
|
|
16
16
|
import "./chunk-WPALEIRX.js";
|
|
17
17
|
import "./chunk-RKUAD3I6.js";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
|
|
19
|
+
// scripts/hooks/pretool-guard-cli.ts
|
|
20
|
+
import { text } from "node:stream/consumers";
|
|
21
|
+
import { fileURLToPath } from "node:url";
|
|
22
|
+
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
23
|
+
if (process.stdin.isTTY) hook_decision.report_no_payload("pretool:guard");
|
|
24
|
+
else {
|
|
25
|
+
const raw_payload = await text(process.stdin);
|
|
26
|
+
hook_decision.load_environment_file();
|
|
27
|
+
hook_decision.emit_outcome(await pretool_outcome_async(raw_payload));
|
|
28
|
+
}
|
|
29
|
+
}
|
package/dist/hooks/stop-guard.js
CHANGED
|
@@ -8,25 +8,25 @@ import {
|
|
|
8
8
|
git_gh_api_path,
|
|
9
9
|
git_gh_exec,
|
|
10
10
|
has_label_name,
|
|
11
|
+
issue_cite,
|
|
11
12
|
lane_background,
|
|
12
|
-
lane_child_invocation,
|
|
13
13
|
lane_park,
|
|
14
14
|
lane_registry,
|
|
15
15
|
process_identity,
|
|
16
16
|
repo_party,
|
|
17
17
|
run_carry,
|
|
18
18
|
run_cut,
|
|
19
|
+
run_headless,
|
|
19
20
|
run_hold,
|
|
20
|
-
run_invocation
|
|
21
|
-
|
|
22
|
-
} from "./chunk-EIFCAJRB.js";
|
|
21
|
+
run_invocation
|
|
22
|
+
} from "./chunk-RLDX5SOC.js";
|
|
23
23
|
import {
|
|
24
24
|
session_language
|
|
25
25
|
} from "./chunk-6V5OPIUU.js";
|
|
26
26
|
import {
|
|
27
27
|
hook_decision,
|
|
28
28
|
lane_child_marker
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-WQ4OSBSS.js";
|
|
30
30
|
import {
|
|
31
31
|
PROJECT_ROOT,
|
|
32
32
|
json_value,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
time_density_hook,
|
|
35
35
|
time_hook_transcript,
|
|
36
36
|
time_reported_failure
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-7VPDUBRN.js";
|
|
38
38
|
import "./chunk-WPALEIRX.js";
|
|
39
39
|
import "./chunk-RKUAD3I6.js";
|
|
40
40
|
|
|
@@ -78,8 +78,8 @@ function read_limit(raw) {
|
|
|
78
78
|
}
|
|
79
79
|
return { kind: "limit", limit: Number(trimmed) };
|
|
80
80
|
}
|
|
81
|
-
function lane_limit(
|
|
82
|
-
return read_limit(
|
|
81
|
+
function lane_limit(environment = process.env) {
|
|
82
|
+
return read_limit(environment[LANE_LIMIT_KEY]);
|
|
83
83
|
}
|
|
84
84
|
function free_lanes(limit, occupied) {
|
|
85
85
|
return Math.max(NO_LANES, limit - occupied);
|
|
@@ -92,181 +92,6 @@ var lane_capacity = {
|
|
|
92
92
|
free_lanes
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
// scripts/lane/lane-reap.ts
|
|
96
|
-
import { execFileSync } from "node:child_process";
|
|
97
|
-
var PGREP_COMMAND = "pgrep";
|
|
98
|
-
var MATCH_FULL_COMMAND_LINE = "-f";
|
|
99
|
-
var CHILDREN_OF_FLAG = "-P";
|
|
100
|
-
var PS_COMMAND = "/bin/ps";
|
|
101
|
-
var PARENT_FORMAT = ["-o", "ppid=", "-p"];
|
|
102
|
-
var TERMINATE_SIGNAL = "SIGTERM";
|
|
103
|
-
var PROBE_TIMEOUT_MS = 2e3;
|
|
104
|
-
var LOWEST_CHILD_PID = 2;
|
|
105
|
-
function parse_pids(printed) {
|
|
106
|
-
return printed.split("\n").map((line) => Number(line.trim())).filter((pid) => Number.isSafeInteger(pid) && pid >= LOWEST_CHILD_PID);
|
|
107
|
-
}
|
|
108
|
-
function run_probe(command, args) {
|
|
109
|
-
try {
|
|
110
|
-
return execFileSync(command, [...args], {
|
|
111
|
-
encoding: "utf8",
|
|
112
|
-
timeout: PROBE_TIMEOUT_MS,
|
|
113
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
114
|
-
});
|
|
115
|
-
} catch {
|
|
116
|
-
return "";
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
function parent_of(pid) {
|
|
120
|
-
return parse_pids(run_probe(PS_COMMAND, [...PARENT_FORMAT, String(pid)]))[0];
|
|
121
|
-
}
|
|
122
|
-
function terminate(pid) {
|
|
123
|
-
try {
|
|
124
|
-
process.kill(pid, TERMINATE_SIGNAL);
|
|
125
|
-
return true;
|
|
126
|
-
} catch {
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
var SYSTEM_PROBES = {
|
|
131
|
-
matching: (pattern) => parse_pids(run_probe(PGREP_COMMAND, [MATCH_FULL_COMMAND_LINE, pattern])),
|
|
132
|
-
children_of: (pid) => parse_pids(run_probe(PGREP_COMMAND, [CHILDREN_OF_FLAG, String(pid)])),
|
|
133
|
-
parent_of,
|
|
134
|
-
terminate
|
|
135
|
-
};
|
|
136
|
-
function ancestry_of(pid, probes) {
|
|
137
|
-
const ancestry = /* @__PURE__ */ new Set([pid]);
|
|
138
|
-
let current = probes.parent_of(pid);
|
|
139
|
-
while (current !== void 0 && !ancestry.has(current)) {
|
|
140
|
-
ancestry.add(current);
|
|
141
|
-
current = probes.parent_of(current);
|
|
142
|
-
}
|
|
143
|
-
return ancestry;
|
|
144
|
-
}
|
|
145
|
-
function own_ancestry(probes = SYSTEM_PROBES) {
|
|
146
|
-
return ancestry_of(process.pid, probes);
|
|
147
|
-
}
|
|
148
|
-
function tree_of(roots, probes) {
|
|
149
|
-
const tree = [];
|
|
150
|
-
const pending = [...roots];
|
|
151
|
-
let next = pending.shift();
|
|
152
|
-
while (next !== void 0) {
|
|
153
|
-
if (!tree.includes(next)) {
|
|
154
|
-
tree.push(next);
|
|
155
|
-
pending.push(...probes.children_of(next));
|
|
156
|
-
}
|
|
157
|
-
next = pending.shift();
|
|
158
|
-
}
|
|
159
|
-
return tree;
|
|
160
|
-
}
|
|
161
|
-
function reap_child(issue, probes = SYSTEM_PROBES) {
|
|
162
|
-
const own = own_ancestry(probes);
|
|
163
|
-
const pattern = lane_child_invocation.process_pattern(issue);
|
|
164
|
-
const roots = probes.matching(pattern).filter((pid) => !own.has(pid));
|
|
165
|
-
const doomed = tree_of(roots, probes).filter((pid) => !own.has(pid));
|
|
166
|
-
return doomed.filter((pid) => probes.terminate(pid));
|
|
167
|
-
}
|
|
168
|
-
var lane_reap = {
|
|
169
|
-
own_ancestry,
|
|
170
|
-
parse_pids,
|
|
171
|
-
reap_child
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
// scripts/run/run-headless.ts
|
|
175
|
-
var HEADLESS_ENV_KEY = "JOSH_RUN_HEADLESS";
|
|
176
|
-
var HEADLESS_VALUE = "1";
|
|
177
|
-
function environment() {
|
|
178
|
-
return { [HEADLESS_ENV_KEY]: HEADLESS_VALUE };
|
|
179
|
-
}
|
|
180
|
-
function is_headless(source = process.env) {
|
|
181
|
-
return source[HEADLESS_ENV_KEY] === HEADLESS_VALUE;
|
|
182
|
-
}
|
|
183
|
-
function is_driving(read) {
|
|
184
|
-
return read?.kind === "carried" && read.carry.is_handed_off !== true;
|
|
185
|
-
}
|
|
186
|
-
async function read_carry_here() {
|
|
187
|
-
const repository = await run_carry.repository_directory();
|
|
188
|
-
return repository === void 0 ? void 0 : run_carry.read_carry(run_carry.carry_path(repository));
|
|
189
|
-
}
|
|
190
|
-
async function must_keep_waiting(source = process.env) {
|
|
191
|
-
const is_candidate = is_headless(source) && lane_child_marker.marked_issue(source) === void 0;
|
|
192
|
-
if (!is_candidate || !await run_watcher_guard.has_lanes_in_flight()) return false;
|
|
193
|
-
return is_driving(await read_carry_here());
|
|
194
|
-
}
|
|
195
|
-
async function current_carry() {
|
|
196
|
-
const read = await read_carry_here();
|
|
197
|
-
return read?.kind === "carried" ? read.carry : void 0;
|
|
198
|
-
}
|
|
199
|
-
function is_owned_here(carry, ancestry) {
|
|
200
|
-
return carry.owner_pid !== void 0 && ancestry().has(carry.owner_pid);
|
|
201
|
-
}
|
|
202
|
-
function is_driven_here(read, ancestry) {
|
|
203
|
-
if (read?.kind !== "carried" || !is_driving(read)) return false;
|
|
204
|
-
return is_owned_here(read.carry, ancestry);
|
|
205
|
-
}
|
|
206
|
-
async function is_backlog_parent(source = process.env, ancestry = lane_reap.own_ancestry) {
|
|
207
|
-
if (lane_child_marker.marked_issue(source) !== void 0) return false;
|
|
208
|
-
return is_driven_here(await read_carry_here(), ancestry);
|
|
209
|
-
}
|
|
210
|
-
var run_headless = {
|
|
211
|
-
HEADLESS_ENV_KEY,
|
|
212
|
-
current_carry,
|
|
213
|
-
environment,
|
|
214
|
-
is_backlog_parent,
|
|
215
|
-
is_headless,
|
|
216
|
-
is_owned_here,
|
|
217
|
-
must_keep_waiting
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
// scripts/issue/issue-cite.ts
|
|
221
|
-
var GITHUB_URL_PREFIX = "https://github.com/";
|
|
222
|
-
var ISSUE_PATH = "/issues/";
|
|
223
|
-
var SUMMARY_SEPARATOR = " \u2014 ";
|
|
224
|
-
var REPO_QUALIFIED = /^([^\s/#]+\/[^\s/#]+)#(\d+)$/u;
|
|
225
|
-
var BARE_NUMBER = /^#?(\d+)$/u;
|
|
226
|
-
function issue_url(slug, number) {
|
|
227
|
-
return `${GITHUB_URL_PREFIX}${slug}${ISSUE_PATH}${number}`;
|
|
228
|
-
}
|
|
229
|
-
function citation_line(slug, number, summary) {
|
|
230
|
-
return `[#${number}](${issue_url(slug, number)})${SUMMARY_SEPARATOR}${summary}`;
|
|
231
|
-
}
|
|
232
|
-
function qualified_target(token) {
|
|
233
|
-
const match = REPO_QUALIFIED.exec(token);
|
|
234
|
-
if (match === null) return void 0;
|
|
235
|
-
const [, repo = "", number = ""] = match;
|
|
236
|
-
return { number, repo };
|
|
237
|
-
}
|
|
238
|
-
function bare_target(token, default_repo) {
|
|
239
|
-
const match = BARE_NUMBER.exec(token);
|
|
240
|
-
if (match === null) return void 0;
|
|
241
|
-
const [, number = ""] = match;
|
|
242
|
-
return { number, repo: default_repo };
|
|
243
|
-
}
|
|
244
|
-
function parse_target(token, default_repo) {
|
|
245
|
-
return qualified_target(token) ?? bare_target(token, default_repo);
|
|
246
|
-
}
|
|
247
|
-
function label(target) {
|
|
248
|
-
return target.repo === void 0 ? `#${target.number}` : `${target.repo}#${target.number}`;
|
|
249
|
-
}
|
|
250
|
-
function missing_line(target) {
|
|
251
|
-
return `\u2716 ${label(target)}: issue does not resolve \u2014 check the number and the repository`;
|
|
252
|
-
}
|
|
253
|
-
function unreadable_line(target) {
|
|
254
|
-
return `\u2716 ${label(target)}: could not be read \u2014 a rate limit, expired auth, or a dropped connection`;
|
|
255
|
-
}
|
|
256
|
-
function no_repo_line(target) {
|
|
257
|
-
return `\u2716 ${label(target)}: could not read this repository \u2014 check gh auth and the origin remote`;
|
|
258
|
-
}
|
|
259
|
-
var issue_cite = {
|
|
260
|
-
SUMMARY_SEPARATOR,
|
|
261
|
-
citation_line,
|
|
262
|
-
issue_url,
|
|
263
|
-
label,
|
|
264
|
-
missing_line,
|
|
265
|
-
no_repo_line,
|
|
266
|
-
parse_target,
|
|
267
|
-
unreadable_line
|
|
268
|
-
};
|
|
269
|
-
|
|
270
95
|
// scripts/rules/issue-citation.ts
|
|
271
96
|
var ISSUE_NUMBER = /#\d+/gu;
|
|
272
97
|
var REFERENCE_BOUNDARY = /[\s#()[\]<>|]/u;
|
|
@@ -742,9 +567,9 @@ function is_notify_disabled() {
|
|
|
742
567
|
return parse_environment_string(process.env[NOTIFY_SWITCH_KEY]).toLowerCase() === NOTIFY_OFF_VALUE;
|
|
743
568
|
}
|
|
744
569
|
function build_header(task_type, repo_name) {
|
|
745
|
-
const { icon, label
|
|
746
|
-
if (repo_name === void 0 || repo_name.length === 0) return `${icon} ${
|
|
747
|
-
return `${icon} ${repo_name}: ${
|
|
570
|
+
const { icon, label } = TASK_DEFINITIONS[task_type];
|
|
571
|
+
if (repo_name === void 0 || repo_name.length === 0) return `${icon} ${label}`;
|
|
572
|
+
return `${icon} ${repo_name}: ${label}`;
|
|
748
573
|
}
|
|
749
574
|
function push_if_present(target, value) {
|
|
750
575
|
if (value !== void 0 && value.length > 0) target.push(value);
|
|
@@ -754,8 +579,8 @@ function build_title_block(input) {
|
|
|
754
579
|
push_if_present(lines, input.issue_title);
|
|
755
580
|
return lines.join("\n");
|
|
756
581
|
}
|
|
757
|
-
function append_url(parts,
|
|
758
|
-
if (value !== void 0 && value.length > 0) parts.push(`${
|
|
582
|
+
function append_url(parts, label, value) {
|
|
583
|
+
if (value !== void 0 && value.length > 0) parts.push(`${label}: ${value}`);
|
|
759
584
|
}
|
|
760
585
|
function build_url_parts(input) {
|
|
761
586
|
const parts = [];
|
package/dist/josh.js
CHANGED
|
@@ -929,7 +929,7 @@ var DEV_COMMANDS = {
|
|
|
929
929
|
reference: ["", "developer", ["files", "processes"]]
|
|
930
930
|
},
|
|
931
931
|
"format:edited": {
|
|
932
|
-
script: "scripts/hooks/format-edited-
|
|
932
|
+
script: "scripts/hooks/format-edited-cli.ts",
|
|
933
933
|
description: "Claude Code hook: format the file just edited (reads the tool call on stdin)",
|
|
934
934
|
category: "Development",
|
|
935
935
|
reference: ["", "automation", ["files", "processes"]]
|
|
@@ -947,7 +947,7 @@ var DEV_COMMANDS = {
|
|
|
947
947
|
// node's own `--env-file` parser with node's own precedence.
|
|
948
948
|
},
|
|
949
949
|
"pretool:guard": {
|
|
950
|
-
script: "scripts/hooks/pretool-guard.ts",
|
|
950
|
+
script: "scripts/hooks/pretool-guard-cli.ts",
|
|
951
951
|
description: "Claude Code hook: the batch, investigation and rule guards in one process (reads the tool call on stdin)",
|
|
952
952
|
category: "Development",
|
|
953
953
|
reference: ["", "automation", ["none"]]
|
|
@@ -1205,7 +1205,7 @@ var PROJECT_COMMANDS = {
|
|
|
1205
1205
|
description: "Set a project up for the GitHub Issue workflow, from git init to the setup PR",
|
|
1206
1206
|
category: "Project",
|
|
1207
1207
|
reference: [
|
|
1208
|
-
`${PROFILE_ARGUMENTS} [--yes] [--github] [--public]`,
|
|
1208
|
+
`${PROFILE_ARGUMENTS} [--yes] [--github] [--public] [--init-command <command>]`,
|
|
1209
1209
|
"developer",
|
|
1210
1210
|
["files", "git", "network", "processes"]
|
|
1211
1211
|
]
|
|
@@ -1450,8 +1450,6 @@ var ALIASES = {
|
|
|
1450
1450
|
ln: "lines",
|
|
1451
1451
|
by: "bytes",
|
|
1452
1452
|
f: "format",
|
|
1453
|
-
fd: "format:edited",
|
|
1454
|
-
bg: "batch:guard",
|
|
1455
1453
|
sd: "cspell:dot",
|
|
1456
1454
|
bh: "behavior",
|
|
1457
1455
|
t: "test",
|
|
@@ -1460,8 +1458,6 @@ var ALIASES = {
|
|
|
1460
1458
|
td: "test:declared",
|
|
1461
1459
|
trd: "test:red",
|
|
1462
1460
|
te: "test:e2e",
|
|
1463
|
-
er: "e2e:retry-check",
|
|
1464
|
-
sl: "session:lang",
|
|
1465
1461
|
c: "check",
|
|
1466
1462
|
pt: "port",
|
|
1467
1463
|
i: "init",
|
|
@@ -1469,19 +1465,12 @@ var ALIASES = {
|
|
|
1469
1465
|
st: "start",
|
|
1470
1466
|
sy: "sync",
|
|
1471
1467
|
rmi: "registry:migrate",
|
|
1472
|
-
sys: "sync:scope",
|
|
1473
1468
|
g: "git",
|
|
1474
1469
|
gp: "pr",
|
|
1475
|
-
prc: "pr:classification",
|
|
1476
|
-
fu: "followup",
|
|
1477
|
-
nf: "notify",
|
|
1478
|
-
obf: "observations:flush",
|
|
1479
|
-
mrr: "measure:rerun",
|
|
1480
1470
|
ms: "main:sync",
|
|
1481
1471
|
mm: "main:merge",
|
|
1482
1472
|
bp: "bump",
|
|
1483
1473
|
re: "release",
|
|
1484
|
-
res: "release:scope",
|
|
1485
1474
|
v: "version",
|
|
1486
1475
|
r: "ranges",
|
|
1487
1476
|
dr: "doctor",
|
|
@@ -1489,107 +1478,16 @@ var ALIASES = {
|
|
|
1489
1478
|
ad: "adopt",
|
|
1490
1479
|
ov: "overrides",
|
|
1491
1480
|
a: "audit",
|
|
1492
|
-
ap: "audit:provision",
|
|
1493
1481
|
rt: "reconcile-templates",
|
|
1494
1482
|
u: "latest",
|
|
1495
|
-
lg: "latest:guard",
|
|
1496
1483
|
lc: "latest:corepack",
|
|
1497
1484
|
lu: "latest:update",
|
|
1498
|
-
ls: "latest:scope",
|
|
1499
|
-
pm: "prevent-main-commit",
|
|
1500
|
-
cm: "check-commit-message",
|
|
1501
|
-
ss: "secretlint-scan",
|
|
1502
|
-
ppu: "pre-push-unit",
|
|
1503
|
-
rer: "reserved-run",
|
|
1504
|
-
ptc: "pre-commit-type-check",
|
|
1505
|
-
ird: "issue:read",
|
|
1506
|
-
ist: "issue:state",
|
|
1507
|
-
isc: "issue:scout",
|
|
1508
|
-
ifl: "issue:file",
|
|
1509
|
-
isf: "issue:fold",
|
|
1510
|
-
isfe: "issue:fold-existing",
|
|
1511
|
-
dfr: "defect:rate",
|
|
1512
|
-
ici: "issue:cite",
|
|
1513
|
-
icm: "issue:comment",
|
|
1514
|
-
pks: "pkg:scout",
|
|
1515
|
-
iln: "issue:lint",
|
|
1516
|
-
ibl: "issue:backlinks",
|
|
1517
|
-
rl: "report:lint",
|
|
1518
|
-
ep: "epic",
|
|
1519
|
-
ec: "epic:check",
|
|
1520
|
-
en: "epic:next",
|
|
1521
|
-
ea: "epic:audit",
|
|
1522
|
-
eb: "epic:bundle",
|
|
1523
|
-
ao: "auto-ok:next",
|
|
1524
|
-
bl: "backlog:next",
|
|
1525
|
-
blo: "backlog:offer",
|
|
1526
|
-
bld: "backlog:drive",
|
|
1527
|
-
blp: "backlog:plan",
|
|
1528
|
-
bls: "backlog:stalled",
|
|
1529
|
-
bb: "backlog:budget",
|
|
1530
|
-
co: "cost",
|
|
1531
|
-
ds: "doc:section",
|
|
1532
|
-
rs: "read:set",
|
|
1533
|
-
dcr: "doc:read",
|
|
1534
|
-
rf: "read:files",
|
|
1535
|
-
ef: "edit:files",
|
|
1536
|
-
rfs: "refactor:scan",
|
|
1537
1485
|
tm: "time",
|
|
1538
1486
|
tmd: "time:density",
|
|
1539
1487
|
rtr: "retrospective",
|
|
1540
|
-
rb: "review:brief",
|
|
1541
|
-
r2: "review:round2",
|
|
1542
|
-
ra: "review:attest",
|
|
1543
|
-
rvr: "review:record",
|
|
1544
1488
|
rvf: "review:findings",
|
|
1545
|
-
dp: "disposition",
|
|
1546
|
-
dg: "delegate",
|
|
1547
|
-
fo: "fanout",
|
|
1548
|
-
rh: "run:hold",
|
|
1549
|
-
rr: "run:release",
|
|
1550
|
-
rc: "run:carry",
|
|
1551
|
-
rtd: "run:tidy",
|
|
1552
|
-
rw: "run:wake",
|
|
1553
|
-
rct: "run:cut",
|
|
1554
|
-
rv: "run:liveness",
|
|
1555
|
-
red: "run:ending",
|
|
1556
|
-
rg: "run:progress",
|
|
1557
|
-
rp: "run:prep",
|
|
1558
|
-
ren: "run:entry",
|
|
1559
|
-
rtl: "run:tail",
|
|
1560
|
-
shp: "ship",
|
|
1561
|
-
rst: "run:status",
|
|
1562
|
-
rn: "run:next",
|
|
1563
|
-
rsp: "run:step",
|
|
1564
|
-
rpy: "repo:party",
|
|
1565
|
-
rmg: "run:merge",
|
|
1566
|
-
rrp: "run:report",
|
|
1567
|
-
rrv: "run:review",
|
|
1568
|
-
rev: "run:event",
|
|
1569
|
-
sp: "stash:pop",
|
|
1570
|
-
lno: "lane:open",
|
|
1571
|
-
lnc: "lane:close",
|
|
1572
|
-
lnl: "lane:list",
|
|
1573
|
-
lnp: "lane:prune",
|
|
1574
|
-
lnv: "lane:output",
|
|
1575
|
-
lnd: "lane:dispatch",
|
|
1576
|
-
lna: "lane:await",
|
|
1577
|
-
lnla: "lane:launch",
|
|
1578
|
-
rwg: "run:watcher:guard",
|
|
1579
|
-
rsd: "run:stranded",
|
|
1580
|
-
ig: "investigation:guard",
|
|
1581
|
-
drg: "duplicate-read:guard",
|
|
1582
|
-
rug: "rule:guard",
|
|
1583
1489
|
ruv: "rule:value",
|
|
1584
|
-
|
|
1585
|
-
sg: "stop:guard",
|
|
1586
|
-
ev: "eval",
|
|
1587
|
-
ol: "oracle:list",
|
|
1588
|
-
sa: "split:assess",
|
|
1589
|
-
shs: "sonar:hotspots",
|
|
1590
|
-
uir: "ui:routes",
|
|
1591
|
-
cs: "clone:scan",
|
|
1592
|
-
ca: "cases"
|
|
1490
|
+
ev: "eval"
|
|
1593
1491
|
};
|
|
1594
1492
|
|
|
1595
1493
|
// scripts/josh/josh-composite-arguments.ts
|