@joshuafolkken/kit 1.957.0 → 1.978.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/.claude/skills/workflow-commands/background-commands.md +3 -0
  2. package/.claude/skills/workflow-commands/backlogrun-child.md +75 -120
  3. package/.claude/skills/workflow-commands/backlogrun-lanes.md +78 -115
  4. package/.claude/skills/workflow-commands/backlogrun-progress.md +82 -146
  5. package/.claude/skills/workflow-commands/backlogrun-steps.md +173 -229
  6. package/.claude/skills/workflow-commands/backlogrun.md +3 -1
  7. package/.claude/skills/workflow-commands/followup.md +3 -0
  8. package/.claude/skills/workflow-commands/fullrun.md +4 -4
  9. package/.claude/skills/workflow-commands/halfrun.md +12 -7
  10. package/.claude/skills/workflow-commands/observation-filing.md +31 -25
  11. package/.claude/skills/workflow-commands/pre-gate-cut.md +96 -161
  12. package/.claude/skills/workflow-commands/working-tree-hold.md +16 -1
  13. package/.github/workflows/pr-classification.yml +12 -1
  14. package/CLAUDE.md +3 -3
  15. package/README.md +25 -21
  16. package/dist/CLAUDE.md +3 -3
  17. package/dist/hooks/batch-guard.js +4 -4
  18. package/dist/hooks/{chunk-XSL4SRMA.js → chunk-2K52BRWV.js} +2 -2
  19. package/dist/hooks/{chunk-M6K7EQDO.js → chunk-BNGGEY3Z.js} +38 -32
  20. package/dist/hooks/{chunk-KOCK5FXQ.js → chunk-BVMSPG3M.js} +3 -3
  21. package/dist/hooks/{chunk-3ON7HOYB.js → chunk-CRGJTD6E.js} +1 -1
  22. package/dist/hooks/{chunk-HJXQZ7V4.js → chunk-F6OM6SIG.js} +3 -3
  23. package/dist/hooks/{chunk-LDQDZYHX.js → chunk-KQG4776P.js} +1 -1
  24. package/dist/hooks/{chunk-244WYOEO.js → chunk-NXL3SBXY.js} +2 -2
  25. package/dist/hooks/{chunk-IJPBTDTB.js → chunk-Q7LE77CO.js} +88 -18
  26. package/dist/hooks/{chunk-BELI5XSS.js → chunk-ZPLXLJ7O.js} +15 -5
  27. package/dist/hooks/{chunk-GNOITLRR.js → chunk-ZYYSBNR6.js} +4 -4
  28. package/dist/hooks/codex-hook-adapter.js +10 -10
  29. package/dist/hooks/duplicate-read-guard.js +5 -5
  30. package/dist/hooks/format-edited.js +2 -2
  31. package/dist/hooks/investigation-guard.js +5 -5
  32. package/dist/hooks/pretool-guard.js +9 -9
  33. package/dist/hooks/stop-guard.js +206 -176
  34. package/dist/josh.js +8 -4
  35. package/package.json +4 -4
  36. package/prompts/collaboration-workflow/wip-cap.md +1 -1
  37. package/scripts/backlog/backlog-arrival.ts +11 -1
  38. package/scripts/backlog/backlog-budget.ts +25 -8
  39. package/scripts/backlog/backlog-next.ts +45 -2
  40. package/scripts/backlog/backlog-offer.ts +1 -0
  41. package/scripts/backlog/backlog-plan-cli.ts +66 -27
  42. package/scripts/backlog/backlog-plan.ts +30 -2
  43. package/scripts/backlog/backlog-stalled.ts +9 -0
  44. package/scripts/backlog/backlog-waves.ts +169 -0
  45. package/scripts/ci/pr-classification.ts +13 -12
  46. package/scripts/document/document-byte-budget.ts +1 -1
  47. package/scripts/document/entry-read-budget.ts +7 -5
  48. package/scripts/epic/epic-lane-offer.ts +69 -4
  49. package/scripts/epic/epic-next.ts +2 -2
  50. package/scripts/epic/epic-solo.ts +147 -0
  51. package/scripts/epic/epic-triage.ts +47 -0
  52. package/scripts/gate/hook-gate-reuse.ts +7 -8
  53. package/scripts/git/git-closes-keyword.ts +15 -0
  54. package/scripts/git/git-followup-flush.ts +5 -6
  55. package/scripts/git/git-followup-issue-close.ts +75 -0
  56. package/scripts/git/git-pr-followup-wrapup.ts +36 -6
  57. package/scripts/git/git-pr-followup.ts +9 -16
  58. package/scripts/git/git-staging.ts +33 -20
  59. package/scripts/git/issue-labels.ts +75 -5
  60. package/scripts/hooks/stop-guard.ts +1 -0
  61. package/scripts/init/init-bootstrap.ts +92 -0
  62. package/scripts/init/init-install.ts +67 -0
  63. package/scripts/init/init-logic-workspace.ts +1 -1
  64. package/scripts/init/init.ts +58 -13
  65. package/scripts/init/start-plan.ts +1 -1
  66. package/scripts/init/start-steps.ts +5 -28
  67. package/scripts/issue/issue-closing-pr.ts +93 -0
  68. package/scripts/josh/__snapshots__/josh-command-map.test.ts.snap +2 -1
  69. package/scripts/josh/josh-commands-project.ts +5 -1
  70. package/scripts/josh/josh-commands-workflow.ts +3 -3
  71. package/scripts/observations/observation-ledger-prepare.ts +31 -0
  72. package/scripts/observations/observation-ledger.ts +5 -5
  73. package/scripts/observations/observations-flush.ts +11 -30
  74. package/scripts/repo/repository-labels.ts +91 -0
  75. package/scripts/rules/implementation-cut.ts +49 -16
  76. package/scripts/rules/lane-background.ts +25 -5
  77. package/scripts/rules/stop-rules.ts +16 -4
  78. package/scripts/run/run-carry-cli.ts +21 -0
  79. package/scripts/run/run-cut-cli.ts +92 -110
  80. package/scripts/run/run-cut-report.ts +167 -0
  81. package/scripts/run/run-cut.ts +23 -7
  82. package/scripts/run/run-entry-cli.ts +70 -3
  83. package/scripts/run/run-halfrun-resume.ts +104 -0
  84. package/scripts/run/run-headless.ts +1 -0
  85. package/scripts/run/run-hold-cli.ts +57 -13
  86. package/scripts/run/run-hold.ts +26 -4
  87. package/scripts/run/run-merge-cli.ts +28 -14
  88. package/scripts/run/run-merge-steps.ts +38 -2
  89. package/scripts/run/run-merge.ts +41 -3
  90. package/scripts/run/run-prep-cli.ts +8 -2
  91. package/scripts/run/run-prep-locate.ts +165 -0
  92. package/scripts/run/run-prep.ts +12 -1
  93. package/scripts/run/run-step-cli.ts +16 -0
  94. package/scripts/run/run-step.ts +28 -4
  95. package/scripts/run/run-tail-cli.ts +4 -2
  96. package/scripts/run/run-wake-work.ts +4 -0
  97. package/scripts/safe-chain/ci-installer-pin.ts +8 -4
  98. package/scripts/security/security-audit.ts +12 -1
  99. package/scripts/sync/sync.ts +6 -0
  100. package/scripts/time-runtime/time-background.ts +11 -0
  101. package/scripts/time-runtime/time-transcript-line.ts +4 -0
  102. package/templates/pnpm-workspace.static.yaml +2 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  lane_child_marker,
3
3
  run_issue_number
4
- } from "./chunk-LDQDZYHX.js";
4
+ } from "./chunk-KQG4776P.js";
5
5
  import {
6
6
  PLATFORM_TEMP_ROOT,
7
7
  cost_blocks,
@@ -12,7 +12,7 @@ import {
12
12
  time_density_hook,
13
13
  time_shell,
14
14
  time_transcript_line
15
- } from "./chunk-BELI5XSS.js";
15
+ } from "./chunk-ZPLXLJ7O.js";
16
16
  import {
17
17
  ENV_FILE_NAME,
18
18
  LANE_SEAT_KEY,
@@ -546,7 +546,9 @@ async function is_linked_worktree() {
546
546
  var run_hold_schema = z.object({
547
547
  issue: z.string(),
548
548
  taken_at: z.string(),
549
- pid: z.number()
549
+ pid: z.number(),
550
+ is_fullrun: z.boolean().optional(),
551
+ is_halfrun_stop: z.boolean().optional()
550
552
  });
551
553
  function parse_hold(raw) {
552
554
  try {
@@ -570,16 +572,19 @@ function classify(raw, now) {
570
572
  function read_hold(target, now = /* @__PURE__ */ new Date()) {
571
573
  return classify(stamp_file.read_stamp_text(target), now);
572
574
  }
573
- function build_hold(issue, now) {
574
- return { issue, taken_at: now.toISOString(), pid: process.pid };
575
+ function build_hold(issue, now, is_fullrun) {
576
+ return { issue, taken_at: now.toISOString(), pid: process.pid, is_fullrun };
575
577
  }
576
578
  function write_hold(target, issue, now = /* @__PURE__ */ new Date()) {
577
579
  const hold = build_hold(issue, now);
578
580
  stamp_file.write_stamp(target, hold);
579
581
  return hold;
580
582
  }
581
- function create_hold(target, issue, now = /* @__PURE__ */ new Date()) {
582
- return stamp_file.create_stamp(target, build_hold(issue, now));
583
+ function create_hold(target, issue, now = /* @__PURE__ */ new Date(), is_fullrun) {
584
+ return stamp_file.create_stamp(target, build_hold(issue, now, is_fullrun));
585
+ }
586
+ function create_halfrun_stop_hold(target, issue, now = /* @__PURE__ */ new Date()) {
587
+ return stamp_file.create_stamp(target, { ...build_hold(issue, now), is_halfrun_stop: true });
583
588
  }
584
589
  async function is_tree_dirty() {
585
590
  try {
@@ -634,6 +639,7 @@ var run_hold = {
634
639
  RELEASE_COMMAND,
635
640
  UNNUMBERED_ISSUE,
636
641
  classify,
642
+ create_halfrun_stop_hold,
637
643
  create_hold,
638
644
  describe_holder,
639
645
  foreign_release_message,
@@ -943,11 +949,13 @@ var IDLE_POLL_MINUTES = 5;
943
949
  var RUN_VERDICT = "run";
944
950
  var WATCH_VERDICT = "watch";
945
951
  var STOP_VERDICT = "stop";
946
- var ANSWERS = ["blocked", "candidates", "exhausted", "parked", "unreadable"];
952
+ var TRIAGE_VERDICT = "triage";
953
+ var ANSWERS = ["blocked", "candidates", "exhausted", "parked", "unreadable", "untriaged"];
947
954
  var WHOLE_RUN_REASON = `The whole-run bound of ${String(WHOLE_RUN_BUDGET_HOURS)} hours has passed. An unattended run that has not finished overnight needs a person, not more waiting.`;
948
955
  var PARKED_REASON = "Nothing opted in can proceed without a person. Report the parked issues and finish.";
949
956
  var UNREADABLE_REASON = "The backlog listing could not be read, so nothing was offered. Report what the command printed and finish \u2014 it is not an empty backlog.";
950
957
  var BLOCKED_REASON = "Everything opted in is blocked or already running, so waiting can still change the answer. Poll again at the polling interval.";
958
+ var TRIAGE_REASON = "An opted-in candidate carries neither `run:solo` nor `run:lane`, so nothing starts until it is judged. Read each issue named above, record its order and one of the two labels with a comment, then ask again.";
951
959
  var NO_IDLE_WATCH_REASON = "The backlog is empty and the idle watch was turned off with `--idle 0`, so the run finishes here.";
952
960
  function to_minutes(duration_ms) {
953
961
  return String(Math.ceil(duration_ms / MS_PER_MINUTE));
@@ -1013,14 +1021,20 @@ function idle_decision(input) {
1013
1021
  function is_finish(input) {
1014
1022
  return stop_reason(input) === void 0 && max_decision(input) === void 0;
1015
1023
  }
1024
+ var FIXED_DECISIONS = {
1025
+ blocked: { verdict: WATCH_VERDICT, reason: BLOCKED_REASON },
1026
+ untriaged: { verdict: TRIAGE_VERDICT, reason: TRIAGE_REASON }
1027
+ };
1028
+ function answer_decision(input) {
1029
+ if (input.answer === "candidates") return { verdict: RUN_VERDICT, reason: run_reason(input) };
1030
+ return FIXED_DECISIONS[input.answer] ?? idle_decision(input);
1031
+ }
1016
1032
  function decide2(input) {
1017
1033
  const reason = stop_reason(input);
1018
1034
  if (reason !== void 0) return stopping(input, reason);
1019
1035
  const capped = max_decision(input);
1020
1036
  if (capped !== void 0) return capped;
1021
- if (input.answer === "candidates") return { verdict: RUN_VERDICT, reason: run_reason(input) };
1022
- if (input.answer === "blocked") return { verdict: WATCH_VERDICT, reason: BLOCKED_REASON };
1023
- return idle_decision(input);
1037
+ return answer_decision(input);
1024
1038
  }
1025
1039
  var backlog_budget = {
1026
1040
  ANSWERS,
@@ -1034,6 +1048,8 @@ var backlog_budget = {
1034
1048
  PARKED_REASON,
1035
1049
  RUN_VERDICT,
1036
1050
  STOP_VERDICT,
1051
+ TRIAGE_REASON,
1052
+ TRIAGE_VERDICT,
1037
1053
  UNREADABLE_REASON,
1038
1054
  WATCH_VERDICT,
1039
1055
  WHOLE_RUN_BUDGET_HOURS,
@@ -1448,16 +1464,22 @@ function adopt_cut(target, cut) {
1448
1464
  function end_cut(target) {
1449
1465
  stamp_file.remove_stamp(target);
1450
1466
  }
1451
- function tree_is_held(directory) {
1452
- if (directory === void 0) return false;
1467
+ function hold_of(directory) {
1468
+ if (directory === void 0) return void 0;
1453
1469
  const read2 = run_hold.read_hold(run_hold.hold_path(directory));
1454
- return read2.kind === "held" || read2.kind === "stale";
1470
+ return read2.kind === "held" || read2.kind === "stale" ? read2.hold : void 0;
1471
+ }
1472
+ function fullrun_issue(hold) {
1473
+ return hold?.is_fullrun === true ? hold.issue : void 0;
1474
+ }
1475
+ function held_issue_sync() {
1476
+ return fullrun_issue(hold_of(worktree_git_directory_sync()));
1455
1477
  }
1456
1478
  async function current_state() {
1457
1479
  const branch2 = await git_command.branch();
1458
1480
  const is_dirty = await run_hold.is_tree_dirty();
1459
- const directory = await worktree_directory2();
1460
- return { branch: branch2, is_dirty, is_held: tree_is_held(directory) };
1481
+ const hold = hold_of(await worktree_directory2());
1482
+ return { branch: branch2, is_dirty, is_held: hold !== void 0, held_issue: fullrun_issue(hold) };
1461
1483
  }
1462
1484
  function describe_cut(cut) {
1463
1485
  return `${cut.invocation} cut at ${cut.cut_at} on ${cut.branch} (${cut.phase})`;
@@ -1499,8 +1521,10 @@ var run_cut = {
1499
1521
  describe_cut,
1500
1522
  end_cut,
1501
1523
  fresh_cut,
1524
+ fullrun_issue,
1502
1525
  handed_off_message,
1503
1526
  has_required_handoff,
1527
+ held_issue_sync,
1504
1528
  incomplete_message,
1505
1529
  invocation_for,
1506
1530
  is_expired,
@@ -1602,12 +1626,19 @@ function is_candidate(call) {
1602
1626
  function is_background_long_run(call, is_lane_child = () => lane_child_marker.is_child_of(process.cwd())) {
1603
1627
  return is_candidate(call) && is_lane_child();
1604
1628
  }
1605
- function pending_background_ids(tail) {
1629
+ function unfinished_ids(tail, launched_ids) {
1606
1630
  const lines = tail.split("\n").map((line) => time_transcript_line.parse_line(line));
1607
1631
  const finished = new Set(lines.map((line) => line?.finished_background ?? ""));
1608
- const launched = lines.flatMap((line) => line?.blocks.map((block) => block.background_id) ?? []);
1632
+ const blocks = lines.flatMap((line) => line?.blocks ?? []);
1633
+ const launched = blocks.flatMap((block) => launched_ids(block));
1609
1634
  return launched.filter((id) => id !== "" && !finished.has(id));
1610
1635
  }
1636
+ function pending_background_ids(tail) {
1637
+ return unfinished_ids(tail, (block) => [block.background_id, block.agent_id]);
1638
+ }
1639
+ function pending_agent_ids(tail) {
1640
+ return unfinished_ids(tail, (block) => [block.agent_id]);
1641
+ }
1611
1642
  var LANE_BACKGROUND_REASON = '\u26D4 lane background: this session is a dispatched lane child (`JOSH_LANE_CHILD`), a headless `claude -p` process whose background Bash tasks are killed when the turn ends \u2014 so a backgrounded `josh gate` / `josh git` / `josh followup` never re-invokes you; it dies at `exit code 143` (joshuafolkken/kit#2704, measured on the #2606 child: implementation, review and live verification done, the run parked instead of merged). Hand the gate-to-merge region to the detached supervisor instead: `pnpm josh ship --detach --review "<title> #<N>"` (add `--cite <N>`), then end the turn on `launched` / `busy` \u2014 `.claude/skills/workflow-commands/chain-rule.md` step 0 is the single source. A single check you must read before continuing runs in the foreground within the tool timeout; the commit-push step does not \u2014 in a child it too belongs to the detached ship, in either spelling. This rule fires on every occurrence, not once per run.';
1612
1643
  var LANE_BACKGROUND_STOP_REASON = "\u26D4 lane background stop: this is a dispatched lane child (`JOSH_LANE_CHILD`) and a background task it launched has not finished \u2014 ending this headless turn kills it, and nothing re-invokes you afterwards (joshuafolkken/kit#2704). Do not send a notification and do not stop: wait for the task in the foreground and act on its result, or re-issue the work through `pnpm josh ship --detach`, whose supervisor outlives the turn (`.claude/skills/workflow-commands/chain-rule.md` step 0). Do not repeat your previous reply.";
1613
1644
  var ROW2 = {
@@ -1621,6 +1652,7 @@ var lane_background = {
1621
1652
  LANE_BACKGROUND_STOP_REASON,
1622
1653
  ROW: ROW2,
1623
1654
  is_background_long_run,
1655
+ pending_agent_ids,
1624
1656
  pending_background_ids
1625
1657
  };
1626
1658
 
@@ -1631,6 +1663,8 @@ var ENHANCEMENT_LABEL = "enhancement";
1631
1663
  var BREAKING_CHANGE_LABEL = "breaking-change";
1632
1664
  var IN_PROGRESS_LABEL = "in-progress";
1633
1665
  var NEEDS_DECISION_LABEL = "needs-decision";
1666
+ var RUN_SOLO_LABEL = "run:solo";
1667
+ var RUN_LANE_LABEL = "run:lane";
1634
1668
  var NEEDS_HUMAN_REVIEW_LABEL = "needs-human-review";
1635
1669
  var ALREADY_DONE_LABEL = "already-done";
1636
1670
  var INTERRUPT_ROUTE_LABEL = "route:interrupt";
@@ -1690,9 +1724,41 @@ var WORKFLOW_LABELS = [
1690
1724
  description: "Tracks a batch of child issues from one split"
1691
1725
  },
1692
1726
  { name: IN_PROGRESS_LABEL, color: "0075ca", description: "Work is actively in progress" },
1727
+ {
1728
+ name: RUN_SOLO_LABEL,
1729
+ color: "b60205",
1730
+ description: "Runs alone in a backlogrun: nothing starts beside it"
1731
+ },
1732
+ {
1733
+ name: RUN_LANE_LABEL,
1734
+ color: "0e8a16",
1735
+ description: "Judged safe to run beside others in a backlogrun"
1736
+ },
1693
1737
  ...FILING_ROUTE_LABELS,
1694
1738
  ...DEPTH_LABELS
1695
1739
  ];
1740
+ var BUGFIX_LABEL = "bugfix";
1741
+ var OTHER_CHANGE_LABEL = "other-change";
1742
+ var IGNORE_FOR_RELEASE_LABEL = "ignore-for-release";
1743
+ var RELEASE_CLASSIFICATION_NAMES = [
1744
+ BREAKING_CHANGE_LABEL,
1745
+ ENHANCEMENT_LABEL,
1746
+ BUGFIX_LABEL,
1747
+ OTHER_CHANGE_LABEL,
1748
+ IGNORE_FOR_RELEASE_LABEL
1749
+ ];
1750
+ var RELEASE_CLASSIFICATION_METADATA = {
1751
+ [BREAKING_CHANGE_LABEL]: { color: "d93f0b", description: "Release: a breaking change (major)" },
1752
+ [ENHANCEMENT_LABEL]: { color: "84b6eb", description: "Release: a new feature (minor)" },
1753
+ [BUGFIX_LABEL]: { color: "d73a4a", description: "Release: a bug fix (patch)" },
1754
+ [OTHER_CHANGE_LABEL]: { color: "c2e0c6", description: "Release: any other change (patch)" },
1755
+ [IGNORE_FOR_RELEASE_LABEL]: { color: "cfd3d7", description: "Release: left out of the notes" }
1756
+ };
1757
+ var RELEASE_CLASSIFICATION_LABELS = RELEASE_CLASSIFICATION_NAMES.map((name) => ({ name, ...RELEASE_CLASSIFICATION_METADATA[name] }));
1758
+ var REPOSITORY_LABELS = [
1759
+ ...WORKFLOW_LABELS,
1760
+ ...RELEASE_CLASSIFICATION_LABELS
1761
+ ];
1696
1762
  function has_any_label(labels, wanted) {
1697
1763
  return (labels ?? []).some((label) => wanted.has(label.name.toLowerCase()));
1698
1764
  }
@@ -3581,8 +3647,12 @@ export {
3581
3647
  BREAKING_CHANGE_LABEL,
3582
3648
  IN_PROGRESS_LABEL,
3583
3649
  NEEDS_DECISION_LABEL,
3650
+ RUN_SOLO_LABEL,
3651
+ RUN_LANE_LABEL,
3584
3652
  NEEDS_HUMAN_REVIEW_LABEL,
3585
3653
  ALREADY_DONE_LABEL,
3654
+ BUGFIX_LABEL,
3655
+ RELEASE_CLASSIFICATION_NAMES,
3586
3656
  has_any_label,
3587
3657
  has_label_name,
3588
3658
  run_tail,
@@ -1028,7 +1028,11 @@ var PROJECT_COMMANDS = {
1028
1028
  script: "scripts/init/init.ts",
1029
1029
  description: "Initialize config in a new project",
1030
1030
  category: "Project",
1031
- reference: [PROFILE_ARGUMENTS, "developer", ["files", "processes"]]
1031
+ reference: [
1032
+ `${PROFILE_ARGUMENTS} [--no-install]`,
1033
+ "developer",
1034
+ ["files", "network", "processes"]
1035
+ ]
1032
1036
  },
1033
1037
  sync: {
1034
1038
  script: "scripts/sync/sync.ts",
@@ -1169,9 +1173,9 @@ var WORKFLOW_COMMANDS = {
1169
1173
  reference: ["--task-type <type> --body <text>", "automation", ["notifications"]],
1170
1174
  tsx_arguments: OPTIONAL_ENV_FILE_FLAGS
1171
1175
  },
1172
- // The observation ledger's only commit path (joshuafolkken/kit#1756). `pnpm josh git` excludes the
1173
- // ledger from what it stages, so without this command a parent's appended line has no route to the
1174
- // default branch at all — and the recurrence count the promotion rule reads is a count of main.
1176
+ // The observation ledger's commit path for the lines no run's own commit carried
1177
+ // (joshuafolkken/kit#1756, joshuafolkken/kit#2763): a lane's lines sit in the primary checkout, which
1178
+ // its commit cannot see, and the recurrence count the promotion rule reads is a count of main.
1175
1179
  "observations:flush": {
1176
1180
  script: "scripts/observations/observations-flush-cli.ts",
1177
1181
  description: "Commit the observation ledger as a pull request of its own, and merge it",
@@ -1497,6 +1501,7 @@ var time_shell = {
1497
1501
  var NO_BACKGROUND = "";
1498
1502
  var NO_FINISH = 0;
1499
1503
  var LAUNCH_PATTERN = /running in background with ID:\s*([\w-]+)/iu;
1504
+ var AGENT_LAUNCH_PATTERN = /^Async agent launched[\s\S]*?\bagentId:\s*([\w-]+)/u;
1500
1505
  var FINISH_PATTERN = /^<task-notification>[\s\S]*?<task-id>([\w-]+)<\/task-id>/u;
1501
1506
  var OUTPUT_PATTERN = /tasks\/([\w-]+)\.output/u;
1502
1507
  var BASH_ID_KEY = "bash_id";
@@ -1511,6 +1516,9 @@ function read_id_of(input) {
1511
1516
  function launch_id(text) {
1512
1517
  return LAUNCH_PATTERN.exec(text)?.[1] ?? NO_BACKGROUND;
1513
1518
  }
1519
+ function agent_launch_id(text) {
1520
+ return AGENT_LAUNCH_PATTERN.exec(text)?.[1] ?? NO_BACKGROUND;
1521
+ }
1514
1522
  function finished_id(text) {
1515
1523
  return FINISH_PATTERN.exec(text)?.[1] ?? NO_BACKGROUND;
1516
1524
  }
@@ -1575,6 +1583,7 @@ var time_background = {
1575
1583
  NO_BACKGROUND,
1576
1584
  NO_FINISH,
1577
1585
  launch_id,
1586
+ agent_launch_id,
1578
1587
  finished_id,
1579
1588
  finished_at,
1580
1589
  read_id,
@@ -2410,7 +2419,8 @@ function to_block2(raw) {
2410
2419
  followup_stages: time_followup_stage.read_stages(text),
2411
2420
  error_text: is_error === true ? text.slice(0, ERROR_TEXT_LIMIT) : "",
2412
2421
  refusal_guard: is_error === true ? guard_from_refusal(text) : "",
2413
- background_id: time_background.launch_id(text)
2422
+ background_id: time_background.launch_id(text),
2423
+ agent_id: time_background.agent_launch_id(text)
2414
2424
  };
2415
2425
  }
2416
2426
  function to_blocks2(content) {
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  investigation_reads
3
- } from "./chunk-HJXQZ7V4.js";
3
+ } from "./chunk-F6OM6SIG.js";
4
4
  import {
5
5
  lane_guard_policy
6
- } from "./chunk-XSL4SRMA.js";
6
+ } from "./chunk-2K52BRWV.js";
7
7
  import {
8
8
  hook_decision
9
- } from "./chunk-LDQDZYHX.js";
9
+ } from "./chunk-KQG4776P.js";
10
10
  import {
11
11
  json_value,
12
12
  time_spans
13
- } from "./chunk-BELI5XSS.js";
13
+ } from "./chunk-ZPLXLJ7O.js";
14
14
 
15
15
  // scripts/delegation/duplicate-read-guard.ts
16
16
  import { statSync } from "node:fs";
@@ -1,25 +1,25 @@
1
1
  #!/usr/bin/env tsx
2
2
  import {
3
3
  pretool_guard
4
- } from "./chunk-M6K7EQDO.js";
5
- import "./chunk-IJPBTDTB.js";
4
+ } from "./chunk-BNGGEY3Z.js";
5
+ import "./chunk-Q7LE77CO.js";
6
6
  import {
7
7
  build_envelope,
8
8
  compose_context,
9
9
  format_edited_payload
10
- } from "./chunk-3ON7HOYB.js";
10
+ } from "./chunk-CRGJTD6E.js";
11
11
  import "./chunk-3V37IID6.js";
12
- import "./chunk-244WYOEO.js";
13
- import "./chunk-KOCK5FXQ.js";
14
- import "./chunk-GNOITLRR.js";
15
- import "./chunk-HJXQZ7V4.js";
16
- import "./chunk-XSL4SRMA.js";
12
+ import "./chunk-NXL3SBXY.js";
13
+ import "./chunk-BVMSPG3M.js";
14
+ import "./chunk-ZYYSBNR6.js";
15
+ import "./chunk-F6OM6SIG.js";
16
+ import "./chunk-2K52BRWV.js";
17
17
  import {
18
18
  hook_decision
19
- } from "./chunk-LDQDZYHX.js";
19
+ } from "./chunk-KQG4776P.js";
20
20
  import {
21
21
  time_density_hook
22
- } from "./chunk-BELI5XSS.js";
22
+ } from "./chunk-ZPLXLJ7O.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-GNOITLRR.js";
13
- import "./chunk-HJXQZ7V4.js";
14
- import "./chunk-XSL4SRMA.js";
15
- import "./chunk-LDQDZYHX.js";
16
- import "./chunk-BELI5XSS.js";
12
+ } from "./chunk-ZYYSBNR6.js";
13
+ import "./chunk-F6OM6SIG.js";
14
+ import "./chunk-2K52BRWV.js";
15
+ import "./chunk-KQG4776P.js";
16
+ import "./chunk-ZPLXLJ7O.js";
17
17
  import "./chunk-WPALEIRX.js";
18
18
  import "./chunk-RKUAD3I6.js";
19
19
  export {
@@ -15,9 +15,9 @@ import {
15
15
  relative_to_root,
16
16
  resolve_invocations,
17
17
  select_invocation
18
- } from "./chunk-3ON7HOYB.js";
18
+ } from "./chunk-CRGJTD6E.js";
19
19
  import "./chunk-3V37IID6.js";
20
- import "./chunk-BELI5XSS.js";
20
+ import "./chunk-ZPLXLJ7O.js";
21
21
  import "./chunk-RKUAD3I6.js";
22
22
  export {
23
23
  ESLINT_DAEMON,
@@ -10,11 +10,11 @@ import {
10
10
  is_enabled,
11
11
  load_environment_file,
12
12
  refusal_path
13
- } from "./chunk-KOCK5FXQ.js";
14
- import "./chunk-HJXQZ7V4.js";
15
- import "./chunk-XSL4SRMA.js";
16
- import "./chunk-LDQDZYHX.js";
17
- import "./chunk-BELI5XSS.js";
13
+ } from "./chunk-BVMSPG3M.js";
14
+ import "./chunk-F6OM6SIG.js";
15
+ import "./chunk-2K52BRWV.js";
16
+ import "./chunk-KQG4776P.js";
17
+ import "./chunk-ZPLXLJ7O.js";
18
18
  import "./chunk-WPALEIRX.js";
19
19
  import "./chunk-RKUAD3I6.js";
20
20
  export {
@@ -3,16 +3,16 @@ import {
3
3
  pretool_guard,
4
4
  pretool_outcome,
5
5
  pretool_outcome_async
6
- } from "./chunk-M6K7EQDO.js";
7
- import "./chunk-IJPBTDTB.js";
6
+ } from "./chunk-BNGGEY3Z.js";
7
+ import "./chunk-Q7LE77CO.js";
8
8
  import "./chunk-3V37IID6.js";
9
- import "./chunk-244WYOEO.js";
10
- import "./chunk-KOCK5FXQ.js";
11
- import "./chunk-GNOITLRR.js";
12
- import "./chunk-HJXQZ7V4.js";
13
- import "./chunk-XSL4SRMA.js";
14
- import "./chunk-LDQDZYHX.js";
15
- import "./chunk-BELI5XSS.js";
9
+ import "./chunk-NXL3SBXY.js";
10
+ import "./chunk-BVMSPG3M.js";
11
+ import "./chunk-ZYYSBNR6.js";
12
+ import "./chunk-F6OM6SIG.js";
13
+ import "./chunk-2K52BRWV.js";
14
+ import "./chunk-KQG4776P.js";
15
+ import "./chunk-ZPLXLJ7O.js";
16
16
  import "./chunk-WPALEIRX.js";
17
17
  import "./chunk-RKUAD3I6.js";
18
18
  export {