@joshuafolkken/kit 1.1010.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/settings.json +1 -5
- package/.claude/skills/dependency-update/SKILL.md +6 -3
- package/.claude/skills/epic-commands/SKILL.md +46 -17
- package/.claude/skills/verify-ui/SKILL.md +1 -1
- package/.claude/skills/workflow-commands/SKILL.md +10 -25
- package/.claude/skills/workflow-commands/background-commands.md +1 -1
- package/.claude/skills/workflow-commands/backlogrun-child.md +6 -4
- 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/backlogrun.md +3 -12
- 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/fullrun-steps.md +4 -3
- package/.claude/skills/workflow-commands/fullrun.md +1 -1
- package/.claude/skills/workflow-commands/halfrun.md +2 -1
- package/.claude/skills/workflow-commands/into-target.md +1 -1
- package/.claude/skills/workflow-commands/issue-comments.md +1 -1
- package/.claude/skills/workflow-commands/observation-filing.md +80 -126
- package/.claude/skills/workflow-commands/pre-gate-cut.md +33 -36
- package/.claude/skills/workflow-commands/prerequisite.md +1 -1
- package/.claude/skills/workflow-commands/working-tree-hold.md +2 -2
- package/.codex/hooks.json +1 -5
- package/.github/workflows/auto-tag.yml +21 -0
- package/.github/workflows/publish.yml +9 -10
- package/.github/workflows/sonar-qube.yml +1 -1
- package/AGENTS.md +4 -25
- package/CLAUDE.md +24 -38
- package/GEMINI.md +4 -24
- package/README.md +22 -56
- package/dist/CLAUDE.md +24 -38
- package/dist/hooks/batch-guard.js +4 -4
- package/dist/hooks/{chunk-6PSTVOLH.js → chunk-5BK3K7V4.js} +114 -90
- package/dist/hooks/{chunk-PAXMLGSS.js → chunk-7VPDUBRN.js} +93 -175
- package/dist/hooks/{chunk-KPZN42RT.js → chunk-DMQN45FN.js} +3 -3
- package/dist/hooks/{chunk-WMIR5SNX.js → chunk-EJDX2TOB.js} +13 -3
- package/dist/hooks/{chunk-A2H5I2VD.js → chunk-GQ7KP45M.js} +2 -2
- package/dist/hooks/{chunk-4GDR2YTV.js → chunk-HJIISEAC.js} +4 -4
- package/dist/hooks/{chunk-AWTFKKFW.js → chunk-NAS4C7GP.js} +6 -33
- package/dist/hooks/{chunk-56LGMJJV.js → chunk-NJQOBE6L.js} +2 -2
- package/dist/hooks/{chunk-EZLHXKJ6.js → chunk-RLDX5SOC.js} +1222 -941
- package/dist/hooks/{chunk-GBJUERYK.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 +21 -200
- package/dist/josh.js +42 -125
- package/dist/version/index.js +466 -42
- package/eslint/base.js +2 -11
- package/package.json +36 -10
- package/prompts/coding-standards.md +15 -290
- package/prompts/collaboration-workflow/cross-repo-epic.md +2 -51
- package/prompts/collaboration-workflow/epic-audit.md +2 -53
- package/prompts/collaboration-workflow/epic-bundle.md +2 -106
- package/prompts/collaboration-workflow/file-edits.md +6 -53
- package/prompts/collaboration-workflow/issue-template.md +4 -4
- package/prompts/collaboration-workflow/operating-rules.md +18 -75
- package/prompts/collaboration-workflow/principles.md +74 -0
- package/prompts/collaboration-workflow/residency.md +55 -15
- package/prompts/collaboration-workflow/rule-delivery.md +5 -46
- package/prompts/collaboration-workflow/shell-body.md +7 -9
- package/prompts/collaboration-workflow/turn-batching.md +21 -37
- package/prompts/collaboration-workflow/upstream-interrupt.md +1 -1
- package/prompts/collaboration-workflow/wip-cap.md +15 -18
- package/prompts/collaboration-workflow.md +22 -28
- package/prompts/sonar-hotspot-handling.md +1 -1
- package/scripts/adopt/adopt-logic.ts +2 -2
- package/scripts/adopt/adopt-toolkits.ts +3 -1
- package/scripts/adopt/adopt.ts +2 -2
- package/scripts/agent/agent-event.ts +2 -9
- package/scripts/agent/agent-exit-record.ts +2 -9
- package/scripts/auto-ok/auto-ok-cli.ts +9 -9
- package/scripts/backlog/backlog-budget-cli.ts +2 -6
- package/scripts/backlog/backlog-drive-cli.ts +20 -10
- package/scripts/backlog/backlog-drive.ts +50 -16
- package/scripts/backlog/backlog-next.ts +24 -8
- package/scripts/backlog/backlog-offer-cli.ts +6 -5
- package/scripts/backlog/backlog-plan-cli.ts +5 -1
- package/scripts/backlog/backlog-plan.ts +1 -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-bin.ts +2 -1
- package/scripts/build/build-config-merge.ts +2 -1
- package/scripts/build/build-hooks.ts +31 -6
- package/scripts/build/build-managed-marker.ts +2 -1
- package/scripts/build/build-self-sync-guard.ts +2 -1
- package/scripts/build/build-version.ts +2 -1
- package/scripts/cases/cases-logic.ts +2 -6
- package/scripts/ci/pr-classification.ts +13 -11
- package/scripts/cost-runtime/cost-transcript.ts +4 -11
- package/scripts/delegation/delegation-policy.ts +11 -0
- package/scripts/doctor/doctor-consumer.ts +5 -12
- package/scripts/doctor/doctor-ports.ts +2 -2
- package/scripts/document/document-byte-budget.ts +13 -21
- package/scripts/document/document-section.ts +2 -6
- package/scripts/document/entry-read-budget.ts +6 -5
- package/scripts/{git/git-epic-add-body.ts → epic/epic-add-body.ts} +23 -23
- package/scripts/{git/git-epic-add-plan.ts → epic/epic-add-plan.ts} +23 -26
- package/scripts/{git/git-epic-add.ts → epic/epic-add.ts} +17 -17
- package/scripts/epic/epic-audit-cli.ts +4 -4
- package/scripts/epic/epic-audit-orphans.ts +2 -2
- package/scripts/epic/epic-audit-rationale.ts +1 -1
- package/scripts/epic/epic-audit.ts +1 -1
- package/scripts/{git/git-epic-body.ts → epic/epic-body.ts} +6 -6
- package/scripts/epic/epic-bundle-cli.ts +1 -1
- package/scripts/epic/epic-bundle.ts +2 -2
- package/scripts/epic/epic-candidate-confirm.ts +2 -1
- package/scripts/{git/git-epic-chains.ts → epic/epic-chains.ts} +4 -4
- package/{scripts-ai → scripts/epic}/epic-check.ts +5 -4
- package/{scripts-ai → scripts/epic}/epic-cli.ts +4 -4
- package/scripts/{git/git-epic-close-comment.ts → epic/epic-close-comment.ts} +9 -9
- package/scripts/{git/git-epic-close.ts → epic/epic-close.ts} +23 -19
- package/scripts/epic/epic-cross-repo.ts +21 -38
- package/scripts/{git/git-epic-decision.ts → epic/epic-decision.ts} +12 -14
- package/scripts/epic/epic-fetch.ts +3 -3
- package/scripts/epic/epic-graph.ts +3 -3
- package/scripts/epic/epic-index.ts +2 -2
- package/scripts/epic/epic-issue.ts +1 -1
- package/scripts/epic/epic-lane-offer.ts +11 -22
- package/scripts/epic/epic-next.ts +3 -3
- package/scripts/{git/git-epic-parse.ts → epic/epic-parse.ts} +3 -3
- package/scripts/{git/git-epic-promote.ts → epic/epic-promote.ts} +10 -10
- package/scripts/epic/epic-rank.ts +37 -0
- package/scripts/{git/git-epic-read.ts → epic/epic-read.ts} +9 -9
- package/scripts/{git/git-epic-reconcile.ts → epic/epic-reconcile.ts} +18 -20
- package/scripts/{git/git-epic-reference.ts → epic/epic-reference.ts} +4 -23
- package/scripts/epic/epic-relation-recheck.ts +4 -3
- package/scripts/{git/git-epic-relations.ts → epic/epic-relations.ts} +5 -5
- package/scripts/{git/git-epic-remove-plan.ts → epic/epic-remove-plan.ts} +17 -19
- package/scripts/{git/git-epic-remove.ts → epic/epic-remove.ts} +13 -13
- package/scripts/{git/git-epic-run.ts → epic/epic-run.ts} +27 -27
- package/scripts/{git/git-epic-sections.ts → epic/epic-sections.ts} +6 -6
- package/scripts/{git/git-epic-shape.ts → epic/epic-shape.ts} +7 -7
- package/scripts/epic/epic-solo.ts +29 -28
- package/scripts/{git/git-epic-validate.ts → epic/epic-validate.ts} +13 -13
- package/{scripts-ai → scripts/epic}/epic.ts +17 -16
- package/scripts/gh/fix-gh-packages.ts +2 -1
- package/scripts/gh/gh-spawn.ts +12 -10
- package/scripts/git/constants.ts +1 -1
- package/scripts/git/git-branch.ts +10 -1
- package/scripts/git/git-command.ts +2 -2
- package/scripts/git/git-error.ts +2 -5
- package/scripts/git/git-execa-error.ts +6 -1
- package/{scripts-ai → scripts/git}/git-followup-finish.ts +7 -7
- package/scripts/git/git-followup-flush.ts +74 -48
- package/scripts/git/git-followup-issue-close.ts +2 -2
- package/scripts/git/git-followup-label.ts +1 -1
- package/scripts/git/git-followup-pending.ts +1 -1
- package/{scripts-ai → scripts/git}/git-followup-workflow.ts +23 -11
- package/scripts/git/git-gh-exec.ts +85 -26
- package/scripts/git/git-gh-issue-read.ts +2 -2
- package/scripts/git/git-gh-issue-rest.ts +2 -2
- package/scripts/git/git-gh-issue-write.ts +6 -6
- package/scripts/git/git-gh-pr-read.ts +0 -21
- package/scripts/git/git-gh-pr.ts +2 -23
- package/scripts/git/git-next-issues.ts +34 -5
- package/scripts/git/git-pr-followup-wrapup.ts +2 -6
- package/scripts/git/git-preflight.ts +25 -10
- 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/git-staging.ts +21 -9
- package/{scripts-ai → scripts/git}/git-workflow.ts +11 -11
- package/scripts/git/github-issue-url.ts +1 -1
- package/scripts/git/gone-branch.ts +3 -2
- package/scripts/git/issue-labels.ts +13 -1
- package/scripts/git/issue-rank.ts +89 -0
- package/scripts/git/issue-reference.ts +19 -0
- package/scripts/git/main-merge.ts +2 -1
- package/scripts/git/main-sync.ts +3 -2
- package/scripts/git/schemas.ts +1 -1
- package/scripts/git/stash-pop-args.ts +7 -13
- package/scripts/git/stash-pop-cli.ts +2 -1
- package/{scripts-ai → scripts/git}/telegram-test-logic.ts +2 -2
- package/{scripts-ai → scripts/git}/telegram-test.ts +7 -7
- package/scripts/hooks/format-edited-cli.ts +15 -0
- package/scripts/hooks/format-edited-file.ts +2 -9
- package/scripts/hooks/format-rewrite-notice.ts +2 -8
- package/scripts/hooks/pretool-guard-cli.ts +21 -0
- package/scripts/hooks/pretool-guard.ts +14 -15
- package/scripts/init/init-ai-copy.ts +2 -5
- package/scripts/init/init.ts +8 -4
- 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 +43 -10
- package/scripts/init/start.ts +42 -11
- package/scripts/issue/issue-cite.ts +19 -1
- package/scripts/issue/issue-comment-cli.ts +2 -1
- package/scripts/issue/issue-file-cli.ts +2 -1
- package/scripts/issue/issue-fold-cli.ts +9 -16
- package/scripts/issue/issue-scout-cli.ts +8 -13
- package/scripts/issue/measure-rerun-cli.ts +7 -6
- package/scripts/josh/josh-command-map.ts +0 -102
- package/scripts/josh/josh-commands-ai.ts +2 -2
- package/scripts/josh/josh-commands-backlog.ts +1 -1
- package/scripts/josh/josh-commands-development.ts +3 -3
- package/scripts/josh/josh-commands-project.ts +1 -1
- package/scripts/josh/josh-commands-workflow.ts +4 -4
- package/scripts/lane/lane-child-marker.ts +16 -2
- package/scripts/lane/lane-cli.ts +34 -15
- package/scripts/lane/lane-open.ts +3 -2
- package/scripts/lane/lane-registry.ts +3 -6
- package/scripts/lane/lane-report.ts +10 -4
- package/scripts/lib/cli-flags.ts +20 -2
- package/scripts/lib/error-message.ts +9 -0
- package/scripts/lib/read-file.ts +26 -2
- package/scripts/observations/observation-ledger-home.ts +98 -26
- package/scripts/observations/observation-ledger-migrate.ts +26 -21
- package/scripts/observations/observation-ledger-prepare.ts +10 -20
- package/scripts/observations/observation-ledger.ts +58 -25
- package/scripts/observations/observations-flush-cli.ts +6 -23
- package/scripts/observations/observations-flush-landing.ts +2 -1
- package/scripts/observations/observations-flush.ts +29 -20
- package/scripts/package/package-scout-cli.ts +8 -16
- package/scripts/ports/port-command.ts +2 -1
- package/scripts/propagate/propagate-plan.ts +185 -0
- package/scripts/propagate/propagate-publish.ts +6 -7
- package/scripts/propagate/propagate-run.ts +5 -1
- package/scripts/propagate/propagate-steps.ts +18 -2
- package/scripts/propagate/propagate-targets.ts +13 -2
- package/scripts/propagate/propagate.ts +63 -44
- package/scripts/refactor/import-graph.ts +2 -6
- package/scripts/registry-migration/migrate-logic.ts +1 -0
- package/scripts/registry-migration/migrate.ts +3 -2
- package/scripts/registry-migration/user-npmrc.ts +2 -2
- package/scripts/release/github-release.ts +1 -1
- package/scripts/release/release-cli.ts +2 -1
- package/scripts/repo/repo-setting.ts +10 -8
- 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-finding-ledger.ts +3 -3
- package/scripts/review/review-findings-cli.ts +4 -11
- package/scripts/review/review-record-cli.ts +14 -11
- package/scripts/review/review-record.ts +6 -16
- package/scripts/review/review-stamps.ts +7 -0
- package/scripts/rules/decision-oracle.ts +2 -2
- 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/rules/rule-body-guard.ts +2 -2
- package/scripts/rules/rule-value-cache.ts +99 -0
- package/scripts/rules/rule-value-cli.ts +10 -9
- package/scripts/rules/rule-value.ts +1 -1
- package/scripts/run/run-carry-args.ts +2 -6
- package/scripts/run/run-carry-cli.ts +5 -7
- package/scripts/run/run-cut-args.ts +7 -13
- package/scripts/run/run-ending-cli.ts +4 -7
- package/scripts/run/run-event-stream.ts +2 -5
- package/scripts/run/run-headless.ts +22 -6
- package/scripts/run/run-liveness-cli.ts +4 -7
- package/scripts/run/run-parent-cut-hook.ts +144 -0
- package/scripts/run/run-progress-args.ts +2 -6
- package/scripts/run/run-progress-cli.ts +2 -1
- 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-tail-cli.ts +3 -3
- package/scripts/run/run-tidy-stashes.ts +7 -14
- package/scripts/run/run-wake-cli.ts +4 -8
- package/scripts/run/run-wake-describe.ts +19 -1
- package/scripts/run/run-wake-driver.ts +15 -2
- package/scripts/run/run-wake-session.ts +14 -4
- package/scripts/run/run-watcher-hook.ts +1 -1
- package/scripts/safe-chain/project-config.ts +3 -6
- package/scripts/security/security-audit-provision.ts +6 -7
- package/scripts/sonar/sonar-hotspots-cli.ts +2 -1
- package/scripts/sync/directory-copy-guard.ts +2 -1
- package/scripts/sync/sync-ai-files.ts +3 -3
- package/scripts/sync/template-source-logic.ts +3 -4
- package/scripts/test/e2e-retry-check.ts +3 -6
- package/scripts/time-runtime/time-bundle-call.ts +2 -2
- package/scripts/ui/ui-routes-cli.ts +3 -6
- package/scripts/version/bump-version.ts +2 -1
- package/scripts/version/npm-registry.ts +97 -0
- package/scripts/version/version-commands.ts +5 -4
- package/scripts/version/version-remote.ts +38 -33
- package/scripts/version/version-targets.ts +3 -3
- package/.claude/skills/workflow-commands/rule-residency.md +0 -267
- package/evals/scenarios/consult-not-execute.json +0 -20
- package/evals/scenarios/no-implicit-workflow.json +0 -26
- package/evals/scenarios/overrides-both-locations.json +0 -29
- package/evals/scenarios/upstream-interrupt.json +0 -23
- package/evals/scenarios/workflow-skill-loaded.json +0 -16
- package/prompts/agent-lint-protocol.json +0 -79
- package/prompts/agent-rules.md +0 -63
- package/prompts/collaboration-workflow/consultation-vs-execution.md +0 -8
- package/prompts/collaboration-workflow/distributed-docs.md +0 -7
- package/prompts/collaboration-workflow/durable-rules.md +0 -24
- package/prompts/collaboration-workflow/latest-first.md +0 -14
- package/prompts/collaboration-workflow/no-clones.md +0 -11
- package/prompts/collaboration-workflow/simplicity-first.md +0 -9
- package/prompts/collaboration-workflow/single-source-rules.md +0 -13
- package/scripts/build/shim-shell.ts +0 -25
- package/scripts/claude/skill-meta.ts +0 -37
- package/scripts/document/document-scan.ts +0 -108
- package/scripts/document/generate-catalog.ts +0 -69
- package/scripts/document/retired-phrases.ts +0 -143
- package/scripts/document/review-agent-type.ts +0 -46
- package/scripts/document/single-source.ts +0 -73
- package/scripts/git/git-fixture-workspace.ts +0 -88
- package/scripts/hooks/format-edited-file-fixtures.ts +0 -109
- package/scripts/hooks/prompt-hooks.ts +0 -38
- package/scripts/init/hook-command-bootstrap.ts +0 -83
- package/scripts/issue/issue-logic.ts +0 -50
- package/scripts/josh/__snapshots__/josh-command-map.test.ts.snap +0 -1227
- package/scripts/josh/josh-script-reader.ts +0 -11
- package/scripts/package/production-dependency-graph.ts +0 -68
- package/scripts/retrospective/retrospective-cli.ts +0 -97
- package/scripts/retrospective/retrospective.ts +0 -127
- package/scripts/rules/delivered-rules-harness.ts +0 -72
- package/scripts/rules/top-level-scripts-guard.ts +0 -47
- package/scripts/run/run-carry-flush.ts +0 -58
- package/scripts/run/run-transcript.golden.txt +0 -57
- package/scripts/run/run-wake-work.ts +0 -108
- package/scripts/sync/dependabot-pin-logic.ts +0 -135
- package/scripts/test/classify-isolation.ts +0 -149
- package/scripts/test/http-fault-injection.ts +0 -79
- package/scripts/test/josh-harness-environment.ts +0 -260
- package/scripts/test/josh-harness.ts +0 -96
- package/scripts/test/pilot-files.ts +0 -452
- package/scripts/test/pilot-measure.ts +0 -78
- package/scripts/test/test-network-guard.ts +0 -453
- package/scripts/test/test-repository-guard.ts +0 -317
- package/scripts/test/test-state-guard.ts +0 -85
- package/scripts/test/test-stdout-guard.ts +0 -54
- package/scripts/test/test-telegram-guard.ts +0 -90
- package/scripts/test/unit-guard-environment.ts +0 -12
- package/scripts/test/unit-projects.ts +0 -139
- package/scripts/test/vitest-include-globs.ts +0 -12
- package/scripts/time-runtime/time-batch-guard-fixtures.ts +0 -66
- package/scripts-ai/completion-gate.ts +0 -13
- package/scripts-ai/environment-loader.ts +0 -9
- /package/{scripts-ai → scripts/epic}/epic-cli-argv.ts +0 -0
- /package/{scripts-ai → scripts/epic}/epic-cli-remove.ts +0 -0
- /package/{scripts-ai → scripts/git}/followup-issue-number.ts +0 -0
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
agent_role_profile,
|
|
14
14
|
agent_session_environment,
|
|
15
15
|
bash_triggers,
|
|
16
|
+
error_text,
|
|
16
17
|
filing_cap,
|
|
17
18
|
gh_failure,
|
|
18
19
|
git_command,
|
|
@@ -20,6 +21,7 @@ import {
|
|
|
20
21
|
git_gh_exec,
|
|
21
22
|
has_any_label,
|
|
22
23
|
has_stderr_field,
|
|
24
|
+
issue_cite,
|
|
23
25
|
lane_background,
|
|
24
26
|
lane_park,
|
|
25
27
|
lane_registry,
|
|
@@ -30,52 +32,50 @@ import {
|
|
|
30
32
|
repo_party,
|
|
31
33
|
run_carry,
|
|
32
34
|
run_cut,
|
|
35
|
+
run_headless,
|
|
33
36
|
run_hold,
|
|
34
37
|
run_progress_clock,
|
|
35
38
|
run_tail,
|
|
36
39
|
run_watcher_guard,
|
|
37
40
|
shell_segments,
|
|
38
41
|
tail_commands
|
|
39
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-RLDX5SOC.js";
|
|
40
43
|
import {
|
|
41
44
|
find_local_bin_upwards
|
|
42
45
|
} from "./chunk-3V37IID6.js";
|
|
43
46
|
import {
|
|
44
47
|
batch_outcome
|
|
45
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-GQ7KP45M.js";
|
|
46
49
|
import {
|
|
47
50
|
investigation_refusal
|
|
48
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-DMQN45FN.js";
|
|
49
52
|
import {
|
|
50
53
|
duplicate_read_outcome
|
|
51
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-HJIISEAC.js";
|
|
52
55
|
import {
|
|
53
56
|
investigation_reads
|
|
54
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-EJDX2TOB.js";
|
|
55
58
|
import {
|
|
56
59
|
lane_guard_policy,
|
|
57
60
|
time_batch_guard
|
|
58
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-NJQOBE6L.js";
|
|
59
62
|
import {
|
|
60
63
|
hook_decision,
|
|
61
64
|
lane_child_marker,
|
|
62
65
|
run_issue_number
|
|
63
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-WQ4OSBSS.js";
|
|
64
67
|
import {
|
|
65
68
|
PLATFORM_TEMP_ROOT,
|
|
66
69
|
cost_attribute,
|
|
67
70
|
cost_blocks,
|
|
68
71
|
cost_transcript,
|
|
69
72
|
cost_usage,
|
|
73
|
+
file_reader,
|
|
70
74
|
json_value,
|
|
71
75
|
lane_paths,
|
|
72
76
|
stamp_file,
|
|
73
77
|
time_shell
|
|
74
|
-
} from "./chunk-
|
|
75
|
-
|
|
76
|
-
// scripts/hooks/pretool-guard.ts
|
|
77
|
-
import { text } from "node:stream/consumers";
|
|
78
|
-
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
78
|
+
} from "./chunk-7VPDUBRN.js";
|
|
79
79
|
|
|
80
80
|
// scripts/rules/direct-filing.ts
|
|
81
81
|
var DIRECT_FILING_REASON = '\u26D4 direct filing: an Issue is filed with `pnpm josh issue:file "<title>" --body-file <path> --depth <0|1|2> [--route <route>] [--label <name>] [--repo <owner/repo>]`, never with `gh api \u2026/issues` or `gh issue create`. The command runs every filing step in order \u2014 the duplicate scout, the body lint and its classification labels, the depth and `route:` labels, the `## Origin` check when filing into another repository, and `epic:bundle` after the create \u2014 so none of them is a step to remember. When the scout prints candidates it holds the filing: read each, then reissue with `--distinct <N,\u2026>` for the ones that are separate deliverables. Reference: `docs/josh-commands.md` \u2192 "`josh issue:file`". **This rule fires on every occurrence, not once per run.**';
|
|
@@ -136,17 +136,19 @@ function next_state(previous, key, now_ms) {
|
|
|
136
136
|
if (previous?.key === key) return previous;
|
|
137
137
|
return { key, unchanged_since_ms: now_ms };
|
|
138
138
|
}
|
|
139
|
-
function format_child(child) {
|
|
139
|
+
function format_child(child, cite) {
|
|
140
140
|
const labels = child.labels.length > 0 ? child.labels.join(",") : "(no labels)";
|
|
141
|
-
return
|
|
141
|
+
return `${cite(child.issue)} ${labels} PR:${child.pr_state}`;
|
|
142
142
|
}
|
|
143
|
-
function format_children(children) {
|
|
143
|
+
function format_children(children, repo) {
|
|
144
144
|
if (children.length === 0) return NO_CHILD_YET;
|
|
145
|
-
|
|
145
|
+
const cite = issue_cite.citer(repo, new Map(children.map((child) => [child.issue, child.title])));
|
|
146
|
+
return children.map((child) => format_child(child, cite)).join(" \xB7 ");
|
|
146
147
|
}
|
|
147
|
-
function format_lanes(lanes) {
|
|
148
|
+
function format_lanes(lanes, repo) {
|
|
148
149
|
if (lanes.length === 0) return NO_LANES;
|
|
149
|
-
|
|
150
|
+
const cite = issue_cite.citer(repo, /* @__PURE__ */ new Map());
|
|
151
|
+
return lanes.map((lane) => `${cite(lane.issue)}:${lane.state}`).join(" ");
|
|
150
152
|
}
|
|
151
153
|
function format_record(record_age_ms) {
|
|
152
154
|
return record_age_ms === void 0 ? "unread" : `+${format_minutes(record_age_ms)}`;
|
|
@@ -171,8 +173,8 @@ function format_line(observations, timing) {
|
|
|
171
173
|
observed_at: format_observed_at(timing.now_ms),
|
|
172
174
|
quiet: format_minutes(timing.now_ms - timing.quiet_since_ms),
|
|
173
175
|
unchanged: format_minutes(timing.now_ms - timing.unchanged_since_ms),
|
|
174
|
-
children: format_children(observations.children),
|
|
175
|
-
lanes: format_lanes(observations.lanes),
|
|
176
|
+
children: format_children(observations.children, observations.repo),
|
|
177
|
+
lanes: format_lanes(observations.lanes, observations.repo),
|
|
176
178
|
load: observations.load_average.toFixed(1),
|
|
177
179
|
record: format_record(observations.record_age_ms),
|
|
178
180
|
next: format_next_report(timing.now_ms, timing.interval_ms)
|
|
@@ -1180,8 +1182,8 @@ function labels_of(question) {
|
|
|
1180
1182
|
}
|
|
1181
1183
|
function render_question(question) {
|
|
1182
1184
|
const labels = labels_of(question);
|
|
1183
|
-
const
|
|
1184
|
-
return labels.length === 0 ?
|
|
1185
|
+
const text = question.question ?? UNKNOWN_QUESTION;
|
|
1186
|
+
return labels.length === 0 ? text : `${text} [${labels.join(OPTION_SEPARATOR)}]`;
|
|
1185
1187
|
}
|
|
1186
1188
|
function interactive_input(raw) {
|
|
1187
1189
|
const denial = DENIAL_SCHEMA.safeParse(raw);
|
|
@@ -1510,7 +1512,7 @@ var DECISION_ORACLES = [
|
|
|
1510
1512
|
decision: "Whether cross-file or cross-repository code duplication exists",
|
|
1511
1513
|
args: "",
|
|
1512
1514
|
vocabulary: ["clean", "clones:"],
|
|
1513
|
-
single_source: "prompts/collaboration-workflow/
|
|
1515
|
+
single_source: "prompts/collaboration-workflow/principles.md \u2192 \u30AF\u30ED\u30FC\u30F3\u7981\u6B62"
|
|
1514
1516
|
},
|
|
1515
1517
|
{
|
|
1516
1518
|
name: "epic:reconcile",
|
|
@@ -1848,7 +1850,6 @@ var ROW11 = {
|
|
|
1848
1850
|
var raw_field_body = { RAW_FIELD_BODY_REASON, ROW: ROW11, posts_at_path_literally };
|
|
1849
1851
|
|
|
1850
1852
|
// scripts/rules/rule-body-guard.ts
|
|
1851
|
-
import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
|
|
1852
1853
|
var EDIT_TOOL = "Edit";
|
|
1853
1854
|
var WRITE_TOOL = "Write";
|
|
1854
1855
|
var CLAUDE_DOCUMENT = /(?:^|\/)CLAUDE\.md$/u;
|
|
@@ -1859,8 +1860,8 @@ function is_rule_document(file_path) {
|
|
|
1859
1860
|
}
|
|
1860
1861
|
var LINK_TARGET = /\]\([^)]*\)/gu;
|
|
1861
1862
|
var BARE_URL = /https?:\/\/\S+/gu;
|
|
1862
|
-
function prose_of(
|
|
1863
|
-
return
|
|
1863
|
+
function prose_of(text) {
|
|
1864
|
+
return text.replaceAll(LINK_TARGET, "]()").replaceAll(BARE_URL, "");
|
|
1864
1865
|
}
|
|
1865
1866
|
var MIN_APPENDED_PROSE = 120;
|
|
1866
1867
|
function adds_rule_prose(old_text, new_text) {
|
|
@@ -1871,7 +1872,7 @@ function string_field(input, key) {
|
|
|
1871
1872
|
return typeof value === "string" ? value : "";
|
|
1872
1873
|
}
|
|
1873
1874
|
function read_existing(file_path) {
|
|
1874
|
-
return
|
|
1875
|
+
return file_reader.read_file_or_empty(file_path);
|
|
1875
1876
|
}
|
|
1876
1877
|
function texts_of(name, input, read2) {
|
|
1877
1878
|
if (name === WRITE_TOOL) {
|
|
@@ -2010,11 +2011,11 @@ var shell_body_trigger = {
|
|
|
2010
2011
|
import { execFileSync } from "node:child_process";
|
|
2011
2012
|
|
|
2012
2013
|
// scripts/gate/project-checks.ts
|
|
2013
|
-
import { existsSync as
|
|
2014
|
+
import { existsSync as existsSync3, globSync as globSync2, readFileSync as readFileSync4 } from "node:fs";
|
|
2014
2015
|
import path5 from "node:path";
|
|
2015
2016
|
|
|
2016
2017
|
// scripts/init/project-profile.ts
|
|
2017
|
-
import { existsSync as
|
|
2018
|
+
import { existsSync as existsSync2, readdirSync, readFileSync as readFileSync3 } from "node:fs";
|
|
2018
2019
|
import path4 from "node:path";
|
|
2019
2020
|
|
|
2020
2021
|
// scripts/version/kit-descriptor.ts
|
|
@@ -2054,8 +2055,8 @@ function requested_profile(args, usage = "josh init [--profile basic|full]") {
|
|
|
2054
2055
|
}
|
|
2055
2056
|
function read_manifest(root) {
|
|
2056
2057
|
const filename = path4.join(root, "package.json");
|
|
2057
|
-
if (!
|
|
2058
|
-
const parsed = JSON.parse(
|
|
2058
|
+
if (!existsSync2(filename)) return void 0;
|
|
2059
|
+
const parsed = JSON.parse(readFileSync3(filename, "utf8"));
|
|
2059
2060
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
2060
2061
|
throw new Error("package.json must contain an object");
|
|
2061
2062
|
}
|
|
@@ -2126,7 +2127,7 @@ function has_github_remote(root) {
|
|
|
2126
2127
|
function inspect_project(root, requested) {
|
|
2127
2128
|
const profile = resolve_profile(root, requested);
|
|
2128
2129
|
const files = scan_files(root);
|
|
2129
|
-
const has_git =
|
|
2130
|
+
const has_git = existsSync2(path4.join(root, ".git"));
|
|
2130
2131
|
return { ...profile, ...files, has_git, has_github: has_git && has_github_remote(root) };
|
|
2131
2132
|
}
|
|
2132
2133
|
var project_profile = {
|
|
@@ -2179,7 +2180,7 @@ var DEPENDENCY_FIELDS = ["dependencies", "devDependencies"];
|
|
|
2179
2180
|
var object_schema = z5.record(z5.string(), z5.unknown());
|
|
2180
2181
|
function project_root(directory) {
|
|
2181
2182
|
let current = directory;
|
|
2182
|
-
while (!
|
|
2183
|
+
while (!existsSync3(path5.join(current, PACKAGE_JSON))) {
|
|
2183
2184
|
const parent = path5.dirname(current);
|
|
2184
2185
|
if (parent === current) return directory;
|
|
2185
2186
|
current = parent;
|
|
@@ -2193,7 +2194,7 @@ function has_files(directory, pattern) {
|
|
|
2193
2194
|
return globSync2(pattern, { cwd: project_root(directory), exclude: is_ignored }).length > 0;
|
|
2194
2195
|
}
|
|
2195
2196
|
function has_config(directory, names) {
|
|
2196
|
-
return names.some((name) =>
|
|
2197
|
+
return names.some((name) => existsSync3(path5.join(project_root(directory), name)));
|
|
2197
2198
|
}
|
|
2198
2199
|
function has_bin(directory, bin_name) {
|
|
2199
2200
|
return find_local_bin_upwards(directory, bin_name) !== void 0;
|
|
@@ -2210,7 +2211,7 @@ function is_basic_manifest(manifest) {
|
|
|
2210
2211
|
function read_manifest2(directory) {
|
|
2211
2212
|
try {
|
|
2212
2213
|
const manifest_path = path5.join(project_root(directory), PACKAGE_JSON);
|
|
2213
|
-
return JSON.parse(
|
|
2214
|
+
return JSON.parse(readFileSync4(manifest_path, "utf8"));
|
|
2214
2215
|
} catch {
|
|
2215
2216
|
return void 0;
|
|
2216
2217
|
}
|
|
@@ -3527,9 +3528,8 @@ var git_gh_issue = {
|
|
|
3527
3528
|
};
|
|
3528
3529
|
|
|
3529
3530
|
// scripts/ci/pr-classification.ts
|
|
3530
|
-
import { readFileSync as
|
|
3531
|
+
import { readFileSync as readFileSync5 } from "node:fs";
|
|
3531
3532
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
3532
|
-
import { execaSync as execaSync2 } from "execa";
|
|
3533
3533
|
import { z as z8 } from "zod";
|
|
3534
3534
|
var CLASSIFICATION_SET = new Set(RELEASE_CLASSIFICATION_NAMES);
|
|
3535
3535
|
var ISSUE_BUG_LABEL = "bug";
|
|
@@ -3587,18 +3587,17 @@ function select_issue_classification(issue_json) {
|
|
|
3587
3587
|
return label;
|
|
3588
3588
|
}
|
|
3589
3589
|
function fetch_current_labels(repository, pull_number) {
|
|
3590
|
-
const
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
)
|
|
3595
|
-
|
|
3596
|
-
throw new Error(`Could not read the pull request labels: ${
|
|
3590
|
+
const path7 = `repos/${repository}/issues/${String(pull_number)}/labels`;
|
|
3591
|
+
try {
|
|
3592
|
+
const names = git_gh_exec.exec_gh_api_sync({ path: path7, jq_filter: ".[].name" });
|
|
3593
|
+
return names.split("\n").filter((name) => name !== "");
|
|
3594
|
+
} catch (error) {
|
|
3595
|
+
const detail = error_text.message_of(error);
|
|
3596
|
+
throw new Error(`Could not read the pull request labels: ${detail}`, { cause: error });
|
|
3597
3597
|
}
|
|
3598
|
-
return result.stdout.split("\n").filter((name) => name !== "");
|
|
3599
3598
|
}
|
|
3600
3599
|
function check_event(event_path, read_labels = fetch_current_labels) {
|
|
3601
|
-
const event = EVENT.parse(JSON.parse(
|
|
3600
|
+
const event = EVENT.parse(JSON.parse(readFileSync5(event_path, "utf8")));
|
|
3602
3601
|
const labels = read_labels(event.repository.full_name, event.pull_request.number);
|
|
3603
3602
|
return classification_error(labels, event.pull_request.user.login);
|
|
3604
3603
|
}
|
|
@@ -3614,6 +3613,7 @@ if (process.argv[1] === fileURLToPath2(import.meta.url)) {
|
|
|
3614
3613
|
var pr_classification = {
|
|
3615
3614
|
classification_error,
|
|
3616
3615
|
check_event,
|
|
3616
|
+
fetch_current_labels,
|
|
3617
3617
|
declaration,
|
|
3618
3618
|
is_classification,
|
|
3619
3619
|
select_issue_classification
|
|
@@ -3728,8 +3728,6 @@ var pr_number_by_branch = /* @__PURE__ */ new Map();
|
|
|
3728
3728
|
var LOOKUP_QUERY = "state=all&sort=created&direction=desc&per_page=100";
|
|
3729
3729
|
var COMMENTS_QUERY = FULL_PAGE_QUERY;
|
|
3730
3730
|
var OWNER_PLACEHOLDER = "{owner}";
|
|
3731
|
-
var NO_HEAD_REF_MESSAGE = "gh api answered a pull request with no head branch";
|
|
3732
|
-
var FORK_HEAD_MESSAGE = "gh api answered a pull request whose head branch is in another repository";
|
|
3733
3731
|
var NO_PULL_REQUEST_MESSAGE = "gh api found no pull request for branch";
|
|
3734
3732
|
var UNREADABLE_PULL_REQUEST_MESSAGE = "gh api could not read the pull requests for branch";
|
|
3735
3733
|
function lookup_path(branch_name) {
|
|
@@ -3822,13 +3820,6 @@ async function pr_view(branch_name) {
|
|
|
3822
3820
|
if (pull === void 0) return "";
|
|
3823
3821
|
return JSON.stringify(git_gh_pr_rest.to_pr_info(pull));
|
|
3824
3822
|
}
|
|
3825
|
-
async function pr_head_reference(pr_number) {
|
|
3826
|
-
const pull = await read_pull(pr_number);
|
|
3827
|
-
const reference = pull.head?.ref;
|
|
3828
|
-
if (reference === void 0) throw new Error(NO_HEAD_REF_MESSAGE);
|
|
3829
|
-
if (!git_gh_pr_rest.is_same_repository_head(pull)) throw new Error(FORK_HEAD_MESSAGE);
|
|
3830
|
-
return reference;
|
|
3831
|
-
}
|
|
3832
3823
|
async function read_comments(branch_name, to_path, to_json) {
|
|
3833
3824
|
const pr_number = await resolve_pr_number(branch_name);
|
|
3834
3825
|
if (pr_number === void 0) return void 0;
|
|
@@ -3857,7 +3848,6 @@ var git_gh_pr_read = {
|
|
|
3857
3848
|
pr_get_url,
|
|
3858
3849
|
pr_get_body,
|
|
3859
3850
|
pr_view,
|
|
3860
|
-
pr_head_reference,
|
|
3861
3851
|
pr_get_comments,
|
|
3862
3852
|
pr_get_review_comments
|
|
3863
3853
|
};
|
|
@@ -4097,12 +4087,6 @@ async function pr_create(title, body, label) {
|
|
|
4097
4087
|
await add_pr_classification(number, label);
|
|
4098
4088
|
return url;
|
|
4099
4089
|
}
|
|
4100
|
-
async function pr_checkout(pr_number) {
|
|
4101
|
-
const branch_name = await git_gh_pr_read.pr_head_reference(pr_number);
|
|
4102
|
-
await git_command.fetch_branch(branch_name);
|
|
4103
|
-
await git_command.checkout(branch_name);
|
|
4104
|
-
await git_command.merge_fast_forward(branch_name);
|
|
4105
|
-
}
|
|
4106
4090
|
async function pr_comment(branch_name, body) {
|
|
4107
4091
|
const pr_number = await require_pr_number(branch_name);
|
|
4108
4092
|
return await git_gh_issue_write.issue_comment(String(pr_number), body);
|
|
@@ -4156,7 +4140,6 @@ var git_gh_pr = {
|
|
|
4156
4140
|
pr_create,
|
|
4157
4141
|
pr_get_classification,
|
|
4158
4142
|
pr_ensure_classification,
|
|
4159
|
-
pr_checkout,
|
|
4160
4143
|
pr_comment,
|
|
4161
4144
|
pr_merge,
|
|
4162
4145
|
pr_update_body
|
|
@@ -4634,7 +4617,7 @@ var epic_busy = {
|
|
|
4634
4617
|
};
|
|
4635
4618
|
|
|
4636
4619
|
// scripts/run/run-liveness.ts
|
|
4637
|
-
import { readFileSync as
|
|
4620
|
+
import { readFileSync as readFileSync6, realpathSync, statSync } from "node:fs";
|
|
4638
4621
|
import { homedir, tmpdir } from "node:os";
|
|
4639
4622
|
import path6 from "node:path";
|
|
4640
4623
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
@@ -4732,18 +4715,11 @@ var EMPTY_STATE = {
|
|
|
4732
4715
|
};
|
|
4733
4716
|
var LAUNCH_HEADER_PREFIX = "=== ";
|
|
4734
4717
|
var LAUNCH_HEADER_MARKER = " \xB7 started by process ";
|
|
4735
|
-
function parse_line(line) {
|
|
4736
|
-
try {
|
|
4737
|
-
return JSON.parse(line);
|
|
4738
|
-
} catch {
|
|
4739
|
-
return void 0;
|
|
4740
|
-
}
|
|
4741
|
-
}
|
|
4742
4718
|
function usable_text(value) {
|
|
4743
4719
|
return typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
4744
4720
|
}
|
|
4745
4721
|
function claude_progress(content) {
|
|
4746
|
-
return content.map((block) => TEXT_BLOCK_SCHEMA.safeParse(block)).filter((parsed) => parsed.success).map((parsed) => parsed.data.text).findLast((
|
|
4722
|
+
return content.map((block) => TEXT_BLOCK_SCHEMA.safeParse(block)).filter((parsed) => parsed.success).map((parsed) => parsed.data.text).findLast((text) => text.trim() !== "");
|
|
4747
4723
|
}
|
|
4748
4724
|
function claude_result(value, state) {
|
|
4749
4725
|
const result = claude_result_event.decode(value);
|
|
@@ -4803,7 +4779,7 @@ function normalized(value, state) {
|
|
|
4803
4779
|
function next_state2(line, state) {
|
|
4804
4780
|
const is_header = line.startsWith(LAUNCH_HEADER_PREFIX) && line.includes(LAUNCH_HEADER_MARKER);
|
|
4805
4781
|
if (is_header) return EMPTY_STATE;
|
|
4806
|
-
return normalized(
|
|
4782
|
+
return normalized(json_value.parse_or_undefined(line), state);
|
|
4807
4783
|
}
|
|
4808
4784
|
function read(transcript) {
|
|
4809
4785
|
let state = EMPTY_STATE;
|
|
@@ -4970,7 +4946,7 @@ function read_agent_state(output_path) {
|
|
|
4970
4946
|
const safe_path = to_safe_path(output_path);
|
|
4971
4947
|
if (safe_path === void 0) return void 0;
|
|
4972
4948
|
try {
|
|
4973
|
-
const state = agent_event.read(
|
|
4949
|
+
const state = agent_event.read(readFileSync6(safe_path, "utf8"));
|
|
4974
4950
|
return state.provider === void 0 ? void 0 : state;
|
|
4975
4951
|
} catch {
|
|
4976
4952
|
return void 0;
|
|
@@ -5065,9 +5041,10 @@ function event_column(lane) {
|
|
|
5065
5041
|
const state = run_liveness.describe_agent_state(lane.output);
|
|
5066
5042
|
return state ?? "agent -";
|
|
5067
5043
|
}
|
|
5068
|
-
|
|
5044
|
+
var PLAIN_CITE = issue_cite.citer(void 0, /* @__PURE__ */ new Map());
|
|
5045
|
+
function describe_lane(lane, cite = PLAIN_CITE) {
|
|
5069
5046
|
return [
|
|
5070
|
-
|
|
5047
|
+
cite(lane.issue),
|
|
5071
5048
|
`seat ${value_or_unknown(lane.seat)}`,
|
|
5072
5049
|
`dev ${value_or_unknown(lane.development_port)}`,
|
|
5073
5050
|
`preview ${value_or_unknown(lane.preview_port)}`,
|
|
@@ -5079,9 +5056,9 @@ function describe_lane(lane) {
|
|
|
5079
5056
|
event_column(lane)
|
|
5080
5057
|
].join(COLUMN_SEPARATOR);
|
|
5081
5058
|
}
|
|
5082
|
-
function describe_lanes(lanes) {
|
|
5059
|
+
function describe_lanes(lanes, cite = PLAIN_CITE) {
|
|
5083
5060
|
if (lanes.length === 0) return NO_LANES2;
|
|
5084
|
-
return lanes.map((lane) => describe_lane(lane)).join("\n");
|
|
5061
|
+
return lanes.map((lane) => describe_lane(lane, cite)).join("\n");
|
|
5085
5062
|
}
|
|
5086
5063
|
function describe_ports(lane) {
|
|
5087
5064
|
if (lane.seat === void 0) return "no lane seat could be read";
|
|
@@ -5328,7 +5305,7 @@ function to_labels(issue) {
|
|
|
5328
5305
|
async function to_child(issue) {
|
|
5329
5306
|
const number = String(issue.number);
|
|
5330
5307
|
const child = await run_preflight.read_child_state(number);
|
|
5331
|
-
return { issue: number, labels: to_labels(issue), pr_state: child.pr_state };
|
|
5308
|
+
return { issue: number, title: issue.title, labels: to_labels(issue), pr_state: child.pr_state };
|
|
5332
5309
|
}
|
|
5333
5310
|
async function read_children(repo) {
|
|
5334
5311
|
const read2 = await epic_busy.read_repository(repo);
|
|
@@ -5373,6 +5350,7 @@ async function read_observations(request) {
|
|
|
5373
5350
|
if (children === void 0) return UNREADABLE_READ;
|
|
5374
5351
|
if (children.length === 0 && !await has_run_started(lanes)) return IDLE_READ;
|
|
5375
5352
|
const observations = {
|
|
5353
|
+
repo: request.repo,
|
|
5376
5354
|
children,
|
|
5377
5355
|
lanes,
|
|
5378
5356
|
load_average: loadavg()[FIRST_LOAD_AVERAGE] ?? 0,
|
|
@@ -5427,7 +5405,58 @@ async function watcher_hook_reason(raw_payload, now_ms = Date.now()) {
|
|
|
5427
5405
|
if (transcript === void 0) return void 0;
|
|
5428
5406
|
return await stale_reason(transcript, now_ms);
|
|
5429
5407
|
}
|
|
5430
|
-
var run_watcher_hook = { SWITCH_ENV_KEY: SWITCH_ENV_KEY2, STAMP_PREFIX: STAMP_PREFIX2, watcher_hook_reason };
|
|
5408
|
+
var run_watcher_hook = { SWITCH_ENV_KEY: SWITCH_ENV_KEY2, STAMP_PREFIX: STAMP_PREFIX2, transcript_of, watcher_hook_reason };
|
|
5409
|
+
|
|
5410
|
+
// scripts/run/run-parent-cut-hook.ts
|
|
5411
|
+
var SWITCH_ENV_KEY3 = "JOSH_PARENT_CUT_GUARD";
|
|
5412
|
+
var STAMP_PREFIX3 = "josh-parent-cut-guard-";
|
|
5413
|
+
var QUIET_WINDOW_MS = 6e5;
|
|
5414
|
+
function current_state3() {
|
|
5415
|
+
return {
|
|
5416
|
+
carry: async () => await run_headless.driving_carry(),
|
|
5417
|
+
verdict: () => implementation_cut_verdict.reused_verdict(() => cost_cli.session_verdict())
|
|
5418
|
+
};
|
|
5419
|
+
}
|
|
5420
|
+
var THRESHOLD_TEXT2 = `${cost_format.format_tokens(CONTEXT_CUT_THRESHOLD)}-token`;
|
|
5421
|
+
var PARENT_CUT_REASON = `\u26D4 backlogrun parent hand-off: this session drives a \`backlogrun\` (it owns the live carry record) and its recent-context cost has crossed the shared ${THRESHOLD_TEXT2} threshold between merges, so every later request re-reads the accumulated context (joshuafolkken/kit#2947). Take the hand-off now rather than at the next merge: follow \`.claude/skills/workflow-commands/backlogrun-progress.md\` \u2192 "The hand-off" from its \`over\` branch \u2014 open no new lane and take no new child, read \`pnpm josh lane:list\`, make sure every lane in flight records an output path, then run \`pnpm josh run:carry --cut --owner "$PPID"\` and, unless it answers \`capped\`, \`pnpm josh run:wake\`, post the progress comment and end the turn. A lane nobody can poll means the cut does not happen; carry on and this asks again later. Reissue this call when the hand-off is done or cannot be taken \u2014 the guard stays quiet for a while after it refuses, so the hand-off calls themselves are not refused.`;
|
|
5422
|
+
async function is_due2(state) {
|
|
5423
|
+
const carry = await state.carry();
|
|
5424
|
+
if (carry === void 0 || run_carry.is_at_cut_cap(carry)) return false;
|
|
5425
|
+
return state.verdict() === cost_verdict.OVER_VERDICT;
|
|
5426
|
+
}
|
|
5427
|
+
function is_quiet(target, now_ms) {
|
|
5428
|
+
const last_ms = hook_decision.create_refusal_stamp(STAMP_PREFIX3).last_ms(target);
|
|
5429
|
+
return last_ms !== hook_decision.NEVER_MS && now_ms - last_ms < QUIET_WINDOW_MS;
|
|
5430
|
+
}
|
|
5431
|
+
async function refusal_for(transcript, now_ms, state) {
|
|
5432
|
+
const stamp = hook_decision.create_refusal_stamp(STAMP_PREFIX3);
|
|
5433
|
+
const target = stamp.path(transcript);
|
|
5434
|
+
if (is_quiet(target, now_ms) || !await is_due2(state)) return void 0;
|
|
5435
|
+
return stamp.record(target, now_ms) ? PARENT_CUT_REASON : void 0;
|
|
5436
|
+
}
|
|
5437
|
+
function is_unit_call(raw_payload) {
|
|
5438
|
+
try {
|
|
5439
|
+
return (hook_decision.parse_hook_payload(raw_payload)?.agent_id ?? "") !== "";
|
|
5440
|
+
} catch {
|
|
5441
|
+
return false;
|
|
5442
|
+
}
|
|
5443
|
+
}
|
|
5444
|
+
function is_exempt2(raw_payload) {
|
|
5445
|
+
return !hook_decision.is_switch_enabled(SWITCH_ENV_KEY3) || is_unit_call(raw_payload);
|
|
5446
|
+
}
|
|
5447
|
+
async function parent_cut_reason(raw_payload, now_ms = Date.now(), state = current_state3()) {
|
|
5448
|
+
if (is_exempt2(raw_payload)) return void 0;
|
|
5449
|
+
const transcript = run_watcher_hook.transcript_of(raw_payload);
|
|
5450
|
+
if (transcript === void 0) return void 0;
|
|
5451
|
+
return await refusal_for(transcript, now_ms, state);
|
|
5452
|
+
}
|
|
5453
|
+
var run_parent_cut_hook = {
|
|
5454
|
+
PARENT_CUT_REASON,
|
|
5455
|
+
QUIET_WINDOW_MS,
|
|
5456
|
+
STAMP_PREFIX: STAMP_PREFIX3,
|
|
5457
|
+
SWITCH_ENV_KEY: SWITCH_ENV_KEY3,
|
|
5458
|
+
parent_cut_reason
|
|
5459
|
+
};
|
|
5431
5460
|
|
|
5432
5461
|
// scripts/hooks/pretool-guard.ts
|
|
5433
5462
|
function combine_outcomes(batch, extra_reason) {
|
|
@@ -5453,24 +5482,19 @@ function pretool_outcome(raw_payload) {
|
|
|
5453
5482
|
const combined = combine_outcomes(batch, investigation ?? duplicate_refusal ?? rule);
|
|
5454
5483
|
return with_duplicate_notice(combined, duplicate.notice);
|
|
5455
5484
|
}
|
|
5485
|
+
async function async_reason(raw_payload) {
|
|
5486
|
+
const watcher = await run_watcher_hook.watcher_hook_reason(raw_payload);
|
|
5487
|
+
return watcher ?? await run_parent_cut_hook.parent_cut_reason(raw_payload);
|
|
5488
|
+
}
|
|
5456
5489
|
async function pretool_outcome_async(raw_payload) {
|
|
5457
5490
|
const base = pretool_outcome(raw_payload);
|
|
5458
5491
|
if (!is_clear(base)) return base;
|
|
5459
|
-
const reason = await
|
|
5492
|
+
const reason = await async_reason(raw_payload);
|
|
5460
5493
|
return reason === void 0 ? base : { reason, notice: void 0, fault: void 0 };
|
|
5461
5494
|
}
|
|
5462
5495
|
var pretool_guard = { combine_outcomes, pretool_outcome, pretool_outcome_async };
|
|
5463
|
-
if (process.argv[1] === fileURLToPath3(import.meta.url)) {
|
|
5464
|
-
if (process.stdin.isTTY) hook_decision.report_no_payload("pretool:guard");
|
|
5465
|
-
else {
|
|
5466
|
-
const raw_payload = await text(process.stdin);
|
|
5467
|
-
hook_decision.load_environment_file();
|
|
5468
|
-
hook_decision.emit_outcome(await pretool_outcome_async(raw_payload));
|
|
5469
|
-
}
|
|
5470
|
-
}
|
|
5471
5496
|
|
|
5472
5497
|
export {
|
|
5473
|
-
pretool_outcome,
|
|
5474
5498
|
pretool_outcome_async,
|
|
5475
5499
|
pretool_guard
|
|
5476
5500
|
};
|