opencode-swarm 7.110.2 → 7.112.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 (71) hide show
  1. package/.opencode/skills/ci-failure-batching/SKILL.md +6 -9
  2. package/.opencode/skills/gate-attribution/SKILL.md +24 -7
  3. package/.opencode/skills/merge-queue-readiness/SKILL.md +21 -7
  4. package/.opencode/skills/skill-edit-validation/SKILL.md +10 -3
  5. package/.opencode/skills/swarm-pr-feedback/SKILL.md +24 -0
  6. package/.opencode/skills/worktree-retry-cleanup/SKILL.md +7 -11
  7. package/dist/background/pr-event-subscribers.d.ts +28 -0
  8. package/dist/background/pr-monitor-worker.d.ts +8 -1
  9. package/dist/background/pr-subscriptions.d.ts +6 -0
  10. package/dist/cli/{config-doctor-q5e9yzn6.js → config-doctor-mmw4c50z.js} +2 -2
  11. package/dist/cli/{core-gjac7vd9.js → core-f4cbabe7.js} +2 -2
  12. package/dist/cli/{curator-drift-169wgaxn.js → curator-drift-jvs1v6em.js} +2 -2
  13. package/dist/cli/{curator-qpgdv0fp.js → curator-j7ty8k6t.js} +19 -19
  14. package/dist/cli/curator-llm-factory-8rnk2083.js +40 -0
  15. package/dist/cli/{dispatch-zr1xja4t.js → dispatch-wst7bypk.js} +2 -2
  16. package/dist/cli/{evidence-summary-service-8tasw2tt.js → evidence-summary-service-j6fnsfeq.js} +5 -5
  17. package/dist/cli/{gate-evidence-v6ds8rcp.js → gate-evidence-mk0ss1re.js} +3 -3
  18. package/dist/cli/guardrail-explain-2j0gw8f0.js +41 -0
  19. package/dist/cli/{guardrail-log-973nan7m.js → guardrail-log-xjgr00eq.js} +4 -4
  20. package/dist/cli/{hive-promoter-rs5dr4pf.js → hive-promoter-y179n7wx.js} +19 -19
  21. package/dist/cli/{index-1cn967sa.js → index-0dab9w37.js} +1 -1
  22. package/dist/cli/{index-r3j3458j.js → index-1rga1vvb.js} +1 -1
  23. package/dist/cli/{index-mvg66d9n.js → index-2aqs6daa.js} +3 -3
  24. package/dist/cli/{index-yw8qpf51.js → index-9fxs0rm1.js} +1 -1
  25. package/dist/cli/{index-cmjq1kg7.js → index-b83y9a7r.js} +3 -3
  26. package/dist/cli/{index-rm8b4959.js → index-c3h3d8kh.js} +23 -21
  27. package/dist/cli/{index-0g5xsrp4.js → index-cq2hgvd2.js} +13 -5
  28. package/dist/cli/{index-yhmt3dw3.js → index-cye4g7zj.js} +3 -3
  29. package/dist/cli/{index-j2v3w1ds.js → index-d0w40jm3.js} +4 -4
  30. package/dist/cli/{index-40h0yp9e.js → index-db1fh1fv.js} +1 -1
  31. package/dist/cli/{index-dm35e55e.js → index-fhmw7evd.js} +36 -15
  32. package/dist/cli/{index-vzzt3ygr.js → index-g55nzpwn.js} +1 -1
  33. package/dist/cli/{index-c483hnn4.js → index-hg0pamsa.js} +3 -3
  34. package/dist/cli/{index-smk3st51.js → index-j5c98bd9.js} +1799 -1249
  35. package/dist/cli/{index-53z1afgh.js → index-npxmfj48.js} +1 -1
  36. package/dist/cli/{index-6jng9c8t.js → index-pm992z24.js} +1 -1
  37. package/dist/cli/{index-85bacexr.js → index-q1jaeynn.js} +4 -1
  38. package/dist/cli/{index-v8pk35h7.js → index-t7efm8vz.js} +4 -4
  39. package/dist/cli/{index-5rfxzgmt.js → index-w84stmkx.js} +1 -1
  40. package/dist/cli/{index-4k3gh2nz.js → index-x4bghdyv.js} +2 -2
  41. package/dist/cli/{index-xddysq89.js → index-xehrmy76.js} +1 -1
  42. package/dist/cli/index.js +19 -19
  43. package/dist/cli/{knowledge-escalator-0dkkenp2.js → knowledge-escalator-t1e2211j.js} +6 -6
  44. package/dist/cli/{knowledge-events-bckbj6ah.js → knowledge-events-2h3gvtfa.js} +4 -4
  45. package/dist/cli/{knowledge-store-dvjbdn00.js → knowledge-store-gpta9gzh.js} +4 -4
  46. package/dist/cli/{knowledge-validator-bqr936sg.js → knowledge-validator-03f0hm0p.js} +5 -5
  47. package/dist/cli/{pending-delegations-yyz3fcfn.js → pending-delegations-gc3a2hfx.js} +2 -2
  48. package/dist/cli/{pr-subscriptions-vv8byxe6.js → pr-subscriptions-p8g2rzxd.js} +3 -3
  49. package/dist/cli/{schema-s48je8zt.js → schema-2p15yrvn.js} +1 -1
  50. package/dist/cli/{scope-persistence-tgp00wtd.js → scope-persistence-5ccgtebg.js} +2 -2
  51. package/dist/cli/{skill-generator-5rsjmmfq.js → skill-generator-2tsqqaa2.js} +7 -7
  52. package/dist/commands/ci-simulate.d.ts +40 -0
  53. package/dist/commands/index.d.ts +1 -0
  54. package/dist/commands/pr-monitor-status.d.ts +24 -0
  55. package/dist/commands/registry.d.ts +8 -0
  56. package/dist/config/bundled-skills.d.ts +1 -1
  57. package/dist/config/schema.d.ts +5 -0
  58. package/dist/full-auto/oversight.d.ts +4 -0
  59. package/dist/full-auto/state.d.ts +12 -0
  60. package/dist/git/pr.d.ts +23 -0
  61. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +110 -0
  62. package/dist/hooks/delegation-gate.d.ts +17 -0
  63. package/dist/hooks/full-auto-intercept.d.ts +1 -1
  64. package/dist/index.js +399 -364
  65. package/dist/tools/placeholder-scan.d.ts +15 -0
  66. package/dist/utils/bun-compat.d.ts +6 -0
  67. package/dist/worktree/merge.d.ts +12 -0
  68. package/package.json +9 -5
  69. package/dist/cli/curator-llm-factory-3x89ddtd.js +0 -40
  70. package/dist/cli/guardrail-explain-jdwp6h9c.js +0 -41
  71. /package/dist/cli/{index-7xgqky26.js → index-h91bv3hy.js} +0 -0
@@ -6,7 +6,8 @@ description: Batch collection and fix protocol for CI failures. Triggered when a
6
6
  # CI Failure Batching
7
7
 
8
8
  ## Trigger
9
- When ANY CI check fails on the PR (pr-monitor surfaces `pr.ci.failed`).
9
+ When the PR monitor surfaces `pr.ci.failed`. The event is batched after the
10
+ check set is complete and includes all known failed checks in `failedChecks`.
10
11
 
11
12
  ## Protocol
12
13
  1. **DO NOT immediately fix the first failure.** Check if other jobs are still running:
@@ -29,11 +30,7 @@ Example from session #1685:
29
30
  - Without batching: 6 pushes (format → stale-assertion-1 → stale-assertion-2 → integration → merge-group → clean)
30
31
  - With batching: 2 pushes (collect all → fix all → push once → clean)
31
32
 
32
- ## Pr-monitor workaround
33
- The pr-monitor fires `pr.ci.failed` per-check. When the first event arrives:
34
- 1. Check `gh pr checks` — are other jobs still running?
35
- 2. If yes: WAIT for completion
36
- 3. If no: the single failure IS the only failure — proceed normally
37
-
38
- ## Root cause
39
- The pr-monitor should batch-fire after the CI run completes (issue #1746 item 7). This playbook is the manual protocol.
33
+ ## Pr-monitor expectation
34
+ The pr-monitor should fire one `pr.ci.failed` event for the completed failing
35
+ check set, not one event per check. Still verify with `gh pr checks` before
36
+ fixing, because GitHub can append late merge-group or matrix jobs.
@@ -1,24 +1,38 @@
1
1
  ---
2
2
  name: gate-attribution
3
- description: Per-task gate dispatch protocol. Documents the single-taskId attribution rule and parallel-lane optimization for reviewer/test_engineer gates.
3
+ description: Per-task gate dispatch protocol. Documents single-task attribution plus parseable set-dispatch reviewer/test_engineer rows.
4
4
  ---
5
5
 
6
6
  # Gate Attribution
7
7
 
8
8
  ## The rule
9
- The gate tracker attributes reviewer/test_engineer dispatches PER TASK (single taskId in the prompt). Set-dispatches covering multiple tasks do NOT count per-task, even with per-task verdicts.
9
+ The gate tracker attributes reviewer/test_engineer dispatches PER TASK. A
10
+ single-task prompt still attributes by `task_id` / `taskId` / unambiguous prompt
11
+ task ID. A set-dispatch can also count per-task when the reviewer/test_engineer
12
+ output includes parseable per-task rows:
13
+
14
+ ```
15
+ [REVIEWED] | task-2.1 | APPROVED | ...
16
+ [REVIEWED] | 2.2 | PASS | ...
17
+ ```
18
+
19
+ Rows with `task-X.Y` are normalized to `X.Y`; unsafe or non-plan IDs are ignored.
20
+ Only passing verdicts (`APPROVED`, `PASS`, or `PASSED`) create gate evidence.
21
+ Rows such as `NEEDS_REVISION` are reviewed rows but do not satisfy the gate. If
22
+ no reviewed rows are parseable, attribution falls back to the single-task rule.
10
23
 
11
24
  ## Protocol
12
- 1. **For each task requiring a gate:** Dispatch a separate reviewer and/or test_engineer with exactly ONE taskId
13
- 2. **Minimize overhead via parallel dispatch:**
25
+ 1. **For unrelated or high-risk tasks:** Dispatch separate reviewer and/or test_engineer lanes with exactly ONE taskId.
26
+ 2. **For a true set-dispatch:** Require one `[REVIEWED] | task-id | verdict | ...` row per task in the returned output. Only passing verdict rows count.
27
+ 3. **Minimize overhead via parallel dispatch when set-dispatch is not appropriate:**
14
28
  ```
15
29
  dispatch_lanes_async with:
16
30
  - common_prompt: shared verification context
17
31
  - lanes: one lane per task, each with a single taskId
18
32
  - max_concurrent: up to 3
19
33
  ```
20
- 3. **Collect + attribute:** Each lane result auto-attributes to its taskId
21
- 4. **Do NOT batch:** Even for identical reviews, dispatch separately
34
+ 4. **Collect + attribute:** Single-task lanes auto-attribute to their taskId; set-dispatch rows auto-attribute per parsed row.
35
+ 5. **Do NOT rely on prose summaries:** A batched dispatch without parseable rows is ambiguous and does not count per-task.
22
36
 
23
37
  ## Optimization for trivial tasks
24
38
  For pure ceremony gates (1-line doc fix):
@@ -28,4 +42,7 @@ taskId: X.Y
28
42
  ```
29
43
 
30
44
  ## Why this exists
31
- The gate tracker (`src/hooks/delegation-gate.ts`) keys delegation chains by `sessionID`, and task attribution resolves exactly ONE taskId per dispatch (`args.task_id ?? args.taskId`). Ambiguous multi-task prompts fail closed (resolve to null) rather than attributing to any task — so a set-dispatch covering multiple tasks does not count per-task even with per-task verdicts. Tracked in issue #1746 item 6.
45
+ The gate tracker (`src/hooks/delegation-gate.ts`) keys delegation chains by
46
+ `sessionID`. Ambiguous multi-task prompts still fail closed, but parseable
47
+ `[REVIEWED] | task-id | ...` rows provide explicit per-task attribution for
48
+ set-dispatches. Tracked in issue #1746 item 6.
@@ -10,21 +10,33 @@ Before adding the PR to the merge queue (or before the final push if the repo us
10
10
 
11
11
  ## Protocol
12
12
  1. **Fetch latest main:** `git fetch origin main`
13
- 2. **Create a temporary simulation worktree (do NOT mutate the PR branch).** Use a project-relative path UNDER the swarm worktree base so the path is portable across OSes and its later removal is permitted by the worktree guardrail (paths outside `.swarm-worktrees/` are blocked). Do NOT hardcode `/tmp` — it does not exist on Windows.
13
+ 2. **Run the simulation command (preferred):**
14
+ ```
15
+ /swarm ci-simulate --base origin/main --head <pr-branch>
16
+ ```
17
+ By default this runs fixed local CI gates: `bun run typecheck`,
18
+ `bun run lint:ci`, `bun run build`, `bun run test:unit:ci`,
19
+ integration/security/smoke tests, and `bun run drift:check`.
20
+ `test:unit:ci` runs unit tests per file with the repo's quarantine filters
21
+ and retry budget, matching CI's mock-isolation semantics. The command creates
22
+ a temporary detached worktree under `.swarm/ci-simulate`, merges the PR branch
23
+ or current worktree commit, runs the gate sequence, removes the worktree, and
24
+ prunes metadata. It does not accept arbitrary shell commands.
25
+ 3. **Manual fallback:** If the command is unavailable, create a temporary simulation worktree (do NOT mutate the PR branch). Use a project-relative path UNDER the swarm worktree base so the path is portable across OSes and its later removal is permitted by the worktree guardrail (paths outside `.swarm-worktrees/` are blocked). Do NOT hardcode `/tmp` — it does not exist on Windows.
14
26
  ```
15
27
  git worktree add .swarm-worktrees/merge-sim origin/main
16
28
  cd .swarm-worktrees/merge-sim
17
29
  git merge <pr-branch> --no-edit
18
30
  ```
19
- 3. **Run integration + unit tests against the merged result:**
31
+ 4. **Run integration + unit tests against the merged result:**
20
32
  ```
21
33
  bun test tests/integration --timeout 120000
22
34
  bun test tests/unit --timeout 120000
23
35
  ```
24
36
  (Use per-file loops for hot modules per AGENTS.md invariant 6)
25
- 4. **If failures:** Fix on the PR branch, re-push, re-simulate. Always run the cleanup step (5) before re-simulating or on any exit path — do not leave the simulation worktree behind.
26
- 5. **Cleanup (run on EVERY exit path, including failure):** `git worktree remove --force .swarm-worktrees/merge-sim`. If the remove is guardrail-blocked or fails, delete the directory directly and run `git worktree prune`.
27
- 6. **Only after simulation passes,** add PR to the merge queue.
37
+ 5. **If failures:** Fix on the PR branch, re-push, re-simulate. Always run the cleanup step (6) before re-simulating or on any exit path — do not leave the simulation worktree behind.
38
+ 6. **Cleanup for manual fallback (run on EVERY exit path, including failure):** `git worktree remove --force .swarm-worktrees/merge-sim`. If the remove is guardrail-blocked or fails, delete the directory directly and run `git worktree prune`.
39
+ 7. **Only after simulation passes,** add PR to the merge queue.
28
40
 
29
41
  ## Why this matters
30
42
  PR-branch CI and merge-group CI test DIFFERENT things:
@@ -33,5 +45,7 @@ PR-branch CI and merge-group CI test DIFFERENT things:
33
45
 
34
46
  Integration tests that pass on the PR branch may fail in merge-group context due to test interactions exposed by the merged result.
35
47
 
36
- ## Root cause
37
- A `swarm ci-simulate` command would automate this (issue #1746 item 5). This playbook is the manual protocol.
48
+ ## Automation
49
+ `/swarm ci-simulate` automates the merge-result worktree, merge, command run,
50
+ worktree removal, and metadata prune. Use the manual protocol only when the
51
+ command is unavailable or the repo needs bespoke setup.
@@ -19,11 +19,18 @@ After editing ANY `.md` file under `.opencode/skills/`, `.claude/skills/`, or `.
19
19
  - Does the assertion still hold against the new content?
20
20
  - Is it checking a substring containing the old phrase?
21
21
  - Is it checking for the ABSENCE of a word the new wording introduces? (e.g., `not.toContain('skip')` catches "this check is skipped")
22
- 4. **Update stale assertions in the same changeset.** Do NOT defer to CI.
23
- 5. **Preserve behavioral intent:** When updating, preserve what the assertion TESTS (e.g., "the plan skill has a spec-absent branch"), not just the string match.
22
+ 4. **Prefer the semantic registry:** If the assertion is checking skill behavior
23
+ rather than an exact contract string, move it behind
24
+ `tests/helpers/skill-content-registry.ts` (or add a concept there) and assert
25
+ the named concept from the test.
26
+ 5. **Update stale assertions in the same changeset.** Do NOT defer to CI.
27
+ 6. **Preserve behavioral intent:** When updating, preserve what the assertion TESTS (e.g., "the plan skill has a spec-absent branch"), not just the string match.
24
28
 
25
29
  ## Constraint
26
30
  Do NOT rubber-stamp brittle assertions. If an assertion tests implementation detail rather than behavioral intent, flag it for refactoring to a semantic check.
27
31
 
28
32
  ## Root cause
29
- A skill-content test registry would auto-adjust (issue #1746 item 3). This playbook is the manual safety net.
33
+ Skill-content tests should assert named semantic concepts where possible. The
34
+ registry in `tests/helpers/skill-content-registry.ts` is the preferred safety
35
+ net for recurring skill wording checks; use the manual grep sweep for exact
36
+ contract strings and any tests not yet migrated.
@@ -233,6 +233,30 @@ branches or prior work sessions.
233
233
 
234
234
  *Reference: Caught during PR #1472 Round 1 closure.*
235
235
 
236
+ ## Batch Collection (mandatory before any fix)
237
+
238
+ Issue #1746: 8+ push cycles where 3–4 would have sufficed with batching.
239
+ The anti-pattern: iterating check-by-check, proposing a fix for one failure,
240
+ pushing, waiting for CI, then discovering the next failure. Each cycle costs
241
+ one push + one CI run.
242
+
243
+ **The fix:** Collect all failures and their logs in one batch operation before
244
+ proposing any fix.
245
+
246
+ 1. `gh pr checks --json checkName,conclusion,detailsUrl` — get every check,
247
+ its conclusion, and the URL to its run details.
248
+ 2. Filter to failing checks (`conclusion: "failure"` | `"cancelled"` | `"timed_out"`).
249
+ 3. For each failing check, extract the run ID from `detailsUrl` and run
250
+ `gh run view <run-id> --log-failed` to fetch the full log output.
251
+ 4. Build a complete failure ledger: all checks + all failure logs collected.
252
+ 5. Triage the full ledger to identify root causes.
253
+ 6. Propose fixes for all failures in **one batch** — do not iterate
254
+ check-by-check through push cycles.
255
+
256
+ **Rule:** The complete failure ledger must be collected before any
257
+ modification is proposed. Verifying the ledger is complete is a prerequisite
258
+ for the Fix Planning step.
259
+
236
260
  ## Pre-flight: Scope Discipline
237
261
 
238
262
  `declare_scope({ taskId, files })` enforces that the delegated coder agent may only modify the declared files. The enforcement requires an active `.swarm/plan.json` — calling `declare_scope` in a feedback-closure run (which does not go through `save_plan`) rejects with "No plan found."
@@ -9,16 +9,12 @@ description: Protocol for cleaning parallel-coder worktree lanes before retry. T
9
9
  Before re-dispatching a coder for a task that already has a lane (any prior dispatch status).
10
10
 
11
11
  ## Protocol
12
- 1. **Ownership check do this FIRST, before any deletion.** Confirm the lane is not owned by another ACTIVE session: read `.swarm/session/state.json` and verify no other session's `delegationChains` reference `<session>/<task>`. If another active session owns it, STOP — surface the conflict and do not delete.
13
- 2. **Check for existing lane branch:** `git branch --list "swarm/lane/<session>/<task>"`
14
- 3. **If branch exists:**
15
- - Verify 0-commits-ahead: `git log --oneline HEAD..swarm/lane/<session>/<task>` empty = safe
16
- - Delete: `git branch -d swarm/lane/<session>/<task>` (use `-D` only if `-d` fails AND the commits are confirmed unneeded)
17
- - Under full-auto, `-D` is deny-pattern-blocked use `-d`
18
- 4. **Remove the per-lane worktree directory.** Target the SPECIFIC lane `.swarm-worktrees/<session>/<task>`, NOT the session parent (the parent holds sibling lanes). Prefer `git worktree remove .swarm-worktrees/<session>/<task>` — this is permitted because the path is under the `.swarm-worktrees/` base. A bare `rm -rf` / `Remove-Item -Recurse -Force` on `.swarm-worktrees/` is deny-pattern-blocked by the guardrail, so do not use it here.
19
- 5. **Prune:** `git worktree prune`
20
- 6. **Verify:** `git branch --list "swarm/lane/<session>/<task>"` returns empty
21
- 7. Only after cleanup, proceed to `declare_scope` + coder dispatch
12
+ 1. **Prefer built-in provisioning cleanup.** Re-dispatch normally through the standard coder/worktree path. Provisioning pre-cleans stale same-lane worktrees/branches when ownership is safe and the existing lane is clean.
13
+ 2. **If provisioning blocks:** Treat the error as signal. Dirty lanes, lanes active in another worktree, and lanes owned by another active session must be surfaced to the user instead of deleted.
14
+ 3. **If manual cleanup is explicitly required:** Do the ownership check FIRST. Confirm the lane is not owned by another ACTIVE session: read `.swarm/session/state.json` and verify no other session's `delegationChains` reference `<session>/<task>`. If another active session owns it, STOP.
15
+ 4. **Remove only the specific lane.** Target `.swarm-worktrees/<session>/<task>`, never the session parent. Prefer `git worktree remove .swarm-worktrees/<session>/<task>` and then `git worktree prune`.
16
+ 5. **Delete only confirmed stale branches.** `git branch -d swarm/lane/<session>/<task>` is allowed after confirming the branch is not checked out and contains no needed commits. Use force deletion only with explicit human approval.
17
+ 6. **Verify:** `git branch --list "swarm/lane/<session>/<task>"` returns empty before retrying.
22
18
 
23
19
  ## Root cause
24
- The provisioning code should auto-clean after coder completion/denial/cancellation (tracked in issue #1746 item 1). This playbook is the temporary protocol.
20
+ Stale same-lane worktrees and branches used to require manual cleanup before retry. Provisioning now handles the safe clean/stale cases automatically and fails closed for dirty, active, or cross-session-owned lanes.
@@ -48,7 +48,29 @@ export declare const _internals: {
48
48
  scheduleClearUnaddressed: typeof scheduleClearUnaddressed;
49
49
  clearUnaddressedDelayMs: number;
50
50
  log: typeof log;
51
+ formatAdvisory: typeof formatAdvisory;
51
52
  };
53
+ /**
54
+ * Expected payload shape for subscribed PR event types.
55
+ * Each event type uses a subset of these fields (see the payloads published
56
+ * by src/background/pr-monitor-worker.ts computeChanges/computeCIEvents).
57
+ */
58
+ interface PrEventPayload {
59
+ prNumber: number;
60
+ repoFullName: string;
61
+ prUrl?: string;
62
+ checkName?: string;
63
+ checkState?: string;
64
+ errorMessage?: string;
65
+ author?: string;
66
+ body?: string;
67
+ /** pr.ci.passed */
68
+ checkCount?: number;
69
+ /** pr.review.* */
70
+ reviewDecision?: string;
71
+ /** pr.merge.conflict_resolved */
72
+ mergeableState?: string;
73
+ }
52
74
  /**
53
75
  * Register subscribers on the global event bus for all gated PR event
54
76
  * types. Returns a cleanup function that unsubscribes all listeners.
@@ -72,4 +94,10 @@ declare function handlePrEvent(event: {
72
94
  * they never hold the process open. Fail-open: store errors are swallowed.
73
95
  */
74
96
  declare function scheduleClearUnaddressed(directory: string, correlationId: string): void;
97
+ /**
98
+ * Format a structured advisory message for the given PR event type.
99
+ * Returns null for unknown event types. The first token is always the
100
+ * dedup token `[pr-monitor:<type>:<repo>#<n>]`.
101
+ */
102
+ declare function formatAdvisory(type: string, payload: PrEventPayload): string | null;
75
103
  export {};
@@ -7,7 +7,7 @@
7
7
  * start/stop/dispose lifecycle and bounded, fail-open operation.
8
8
  */
9
9
  import type { PrMonitorConfig } from '../config/schema';
10
- import { getMergeState, getPRComments, getPRReviewState, getPRStatus } from '../git/pr';
10
+ import { getMergeGroupRun, getMergeState, getPRComments, getPRReviewState, getPRStatus } from '../git/pr';
11
11
  import { type AutomationEventType, getGlobalEventBus } from './event-bus';
12
12
  import { listActive, sweepStale, unsubscribe, updateSnapshot } from './pr-subscriptions';
13
13
  /** Configuration options for PrMonitorWorker construction. */
@@ -105,10 +105,16 @@ export declare class PrMonitorWorker {
105
105
  /**
106
106
  * Pure computation: compare current fetch results against the subscription
107
107
  * snapshot and return all events/mutations to apply. No side effects.
108
+ *
109
+ * @param mergeGroupRunFetchSucceeded - if false, mergeGroupRun fields are
110
+ * intentionally omitted from snapshotUpdates to preserve prior snapshot state
111
+ * on transient fetch failures.
108
112
  */
109
113
  private computeChanges;
110
114
  /**
111
115
  * Pure computation: detect CI transitions and push events into the array.
116
+ * When multiple checks fail in a single poll cycle, emits ONE batched
117
+ * pr.ci.failed event listing all failed checks (FR-005a batching).
112
118
  */
113
119
  private computeCIEvents;
114
120
  /**
@@ -145,6 +151,7 @@ export declare const _internals: {
145
151
  getPRStatus: typeof getPRStatus;
146
152
  getPRComments: typeof getPRComments;
147
153
  getMergeState: typeof getMergeState;
154
+ getMergeGroupRun: typeof getMergeGroupRun;
148
155
  getPRReviewState: typeof getPRReviewState;
149
156
  listActive: typeof listActive;
150
157
  updateSnapshot: typeof updateSnapshot;
@@ -41,6 +41,12 @@ export interface PrSubscriptionRecord {
41
41
  /** JSON stringified array of check names + conclusions. */
42
42
  lastCheckRunSet?: string;
43
43
  mergeableState?: string;
44
+ /** Merge-group run status (e.g. "queued", "in_progress", "completed"). */
45
+ mergeGroupRunStatus?: string;
46
+ /** Merge-group run conclusion (e.g. "success", "failure"). */
47
+ mergeGroupRunConclusion?: string;
48
+ /** Merge-group run HTML URL for linking to the run. */
49
+ mergeGroupRunHtmlUrl?: string;
44
50
  isWatching: boolean;
45
51
  /** Guard for cleanup sweep — subscriptions with unaddressed events are retained. */
46
52
  hasUnaddressedEvents: boolean;
@@ -12,8 +12,8 @@ import {
12
12
  shouldRunOnStartup,
13
13
  writeBackupArtifact,
14
14
  writeDoctorArtifact
15
- } from "./index-xddysq89.js";
16
- import"./index-0g5xsrp4.js";
15
+ } from "./index-xehrmy76.js";
16
+ import"./index-cq2hgvd2.js";
17
17
  import"./index-bfwt3abw.js";
18
18
  import"./index-5e4e2hvv.js";
19
19
  import"./index-p0arc26j.js";
@@ -14,11 +14,11 @@ import {
14
14
  resolveWorktreeBaseDir,
15
15
  shortenWorktreePath,
16
16
  writeLaneProfileToDiskReal
17
- } from "./index-dm35e55e.js";
17
+ } from "./index-fhmw7evd.js";
18
18
  import"./index-5e4e2hvv.js";
19
19
  import"./index-p0arc26j.js";
20
20
  import"./index-zgwm4ryv.js";
21
- import"./index-7xgqky26.js";
21
+ import"./index-h91bv3hy.js";
22
22
  import"./index-a76rekgs.js";
23
23
  export {
24
24
  writeLaneProfileToDiskReal,
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  readSwarmFileAsync,
10
10
  validateSwarmPath
11
- } from "./index-r3j3458j.js";
11
+ } from "./index-1rga1vvb.js";
12
12
  import"./index-jtqkh8jf.js";
13
13
  import"./index-5e4e2hvv.js";
14
14
  import"./index-p0arc26j.js";
@@ -17,7 +17,7 @@ import {
17
17
  warn
18
18
  } from "./index-zgwm4ryv.js";
19
19
  import"./index-293f68mj.js";
20
- import"./index-7xgqky26.js";
20
+ import"./index-h91bv3hy.js";
21
21
  import"./index-a76rekgs.js";
22
22
 
23
23
  // src/hooks/curator-drift.ts
@@ -12,39 +12,39 @@ import {
12
12
  runCuratorInit,
13
13
  runCuratorPhase,
14
14
  writeCuratorSummary
15
- } from "./index-smk3st51.js";
16
- import"./index-53z1afgh.js";
15
+ } from "./index-j5c98bd9.js";
16
+ import"./index-npxmfj48.js";
17
17
  import"./index-c8s9a3zh.js";
18
- import"./index-xddysq89.js";
19
- import"./index-0g5xsrp4.js";
20
- import"./index-j2v3w1ds.js";
18
+ import"./index-xehrmy76.js";
19
+ import"./index-cq2hgvd2.js";
20
+ import"./index-d0w40jm3.js";
21
21
  import"./index-scww5b77.js";
22
- import"./index-yw8qpf51.js";
23
- import"./index-85bacexr.js";
24
- import"./index-cmjq1kg7.js";
25
- import"./index-c483hnn4.js";
26
- import"./index-mvg66d9n.js";
27
- import"./index-yhmt3dw3.js";
28
- import"./index-v8pk35h7.js";
22
+ import"./index-9fxs0rm1.js";
23
+ import"./index-q1jaeynn.js";
24
+ import"./index-b83y9a7r.js";
25
+ import"./index-hg0pamsa.js";
26
+ import"./index-2aqs6daa.js";
27
+ import"./index-cye4g7zj.js";
28
+ import"./index-t7efm8vz.js";
29
29
  import"./index-bfwt3abw.js";
30
- import"./index-40h0yp9e.js";
30
+ import"./index-db1fh1fv.js";
31
31
  import"./index-jt58s751.js";
32
32
  import"./index-wvrj16f0.js";
33
33
  import"./index-q1exe2b3.js";
34
- import"./index-vzzt3ygr.js";
35
- import"./index-dm35e55e.js";
36
- import"./index-r3j3458j.js";
34
+ import"./index-g55nzpwn.js";
35
+ import"./index-fhmw7evd.js";
36
+ import"./index-1rga1vvb.js";
37
37
  import"./index-jtqkh8jf.js";
38
38
  import"./index-5e4e2hvv.js";
39
39
  import"./index-p0arc26j.js";
40
40
  import"./index-zgwm4ryv.js";
41
- import"./index-6jng9c8t.js";
42
- import"./index-1cn967sa.js";
41
+ import"./index-pm992z24.js";
42
+ import"./index-0dab9w37.js";
43
43
  import"./index-293f68mj.js";
44
44
  import"./index-5mkc2f9z.js";
45
45
  import"./index-vn263hqt.js";
46
46
  import"./index-vvk2g744.js";
47
- import"./index-7xgqky26.js";
47
+ import"./index-h91bv3hy.js";
48
48
  import"./index-a76rekgs.js";
49
49
  export {
50
50
  writeCuratorSummary,
@@ -0,0 +1,40 @@
1
+ // @bun
2
+ import {
3
+ createCuratorLLMDelegate
4
+ } from "./index-j5c98bd9.js";
5
+ import"./index-npxmfj48.js";
6
+ import"./index-c8s9a3zh.js";
7
+ import"./index-xehrmy76.js";
8
+ import"./index-cq2hgvd2.js";
9
+ import"./index-d0w40jm3.js";
10
+ import"./index-scww5b77.js";
11
+ import"./index-9fxs0rm1.js";
12
+ import"./index-q1jaeynn.js";
13
+ import"./index-b83y9a7r.js";
14
+ import"./index-hg0pamsa.js";
15
+ import"./index-2aqs6daa.js";
16
+ import"./index-cye4g7zj.js";
17
+ import"./index-t7efm8vz.js";
18
+ import"./index-bfwt3abw.js";
19
+ import"./index-db1fh1fv.js";
20
+ import"./index-jt58s751.js";
21
+ import"./index-wvrj16f0.js";
22
+ import"./index-q1exe2b3.js";
23
+ import"./index-g55nzpwn.js";
24
+ import"./index-fhmw7evd.js";
25
+ import"./index-1rga1vvb.js";
26
+ import"./index-jtqkh8jf.js";
27
+ import"./index-5e4e2hvv.js";
28
+ import"./index-p0arc26j.js";
29
+ import"./index-zgwm4ryv.js";
30
+ import"./index-pm992z24.js";
31
+ import"./index-0dab9w37.js";
32
+ import"./index-293f68mj.js";
33
+ import"./index-5mkc2f9z.js";
34
+ import"./index-vn263hqt.js";
35
+ import"./index-vvk2g744.js";
36
+ import"./index-h91bv3hy.js";
37
+ import"./index-a76rekgs.js";
38
+ export {
39
+ createCuratorLLMDelegate
40
+ };
@@ -11,11 +11,11 @@ import {
11
11
  defaultTestFilesFor,
12
12
  detectProjectLanguages,
13
13
  tokenizeCommand
14
- } from "./index-yw8qpf51.js";
14
+ } from "./index-9fxs0rm1.js";
15
15
  import"./index-5e4e2hvv.js";
16
16
  import"./index-p0arc26j.js";
17
17
  import"./index-zgwm4ryv.js";
18
- import"./index-7xgqky26.js";
18
+ import"./index-h91bv3hy.js";
19
19
  import"./index-a76rekgs.js";
20
20
 
21
21
  // src/lang/dispatch.ts
@@ -6,23 +6,23 @@ import {
6
6
  loadPlanJsonOnly,
7
7
  mergeDurableGateEntriesFromEvidence,
8
8
  readDurableGateEvidence
9
- } from "./index-j2v3w1ds.js";
9
+ } from "./index-d0w40jm3.js";
10
10
  import"./index-scww5b77.js";
11
11
  import"./index-q1exe2b3.js";
12
- import"./index-r3j3458j.js";
12
+ import"./index-1rga1vvb.js";
13
13
  import"./index-jtqkh8jf.js";
14
14
  import"./index-5e4e2hvv.js";
15
15
  import"./index-p0arc26j.js";
16
16
  import {
17
17
  log
18
18
  } from "./index-zgwm4ryv.js";
19
- import"./index-6jng9c8t.js";
20
- import"./index-1cn967sa.js";
19
+ import"./index-pm992z24.js";
20
+ import"./index-0dab9w37.js";
21
21
  import"./index-293f68mj.js";
22
22
  import"./index-5mkc2f9z.js";
23
23
  import"./index-vn263hqt.js";
24
24
  import"./index-vvk2g744.js";
25
- import"./index-7xgqky26.js";
25
+ import"./index-h91bv3hy.js";
26
26
  import"./index-a76rekgs.js";
27
27
 
28
28
  // src/services/evidence-summary-service.ts
@@ -9,13 +9,13 @@ import {
9
9
  readTaskEvidenceRaw,
10
10
  recordAgentDispatch,
11
11
  recordGateEvidence
12
- } from "./index-6jng9c8t.js";
13
- import"./index-1cn967sa.js";
12
+ } from "./index-pm992z24.js";
13
+ import"./index-0dab9w37.js";
14
14
  import"./index-293f68mj.js";
15
15
  import"./index-5mkc2f9z.js";
16
16
  import"./index-vn263hqt.js";
17
17
  import"./index-vvk2g744.js";
18
- import"./index-7xgqky26.js";
18
+ import"./index-h91bv3hy.js";
19
19
  import"./index-a76rekgs.js";
20
20
  export {
21
21
  recordGateEvidence,
@@ -0,0 +1,41 @@
1
+ // @bun
2
+ import {
3
+ handleGuardrailExplain
4
+ } from "./index-x4bghdyv.js";
5
+ import"./index-j5c98bd9.js";
6
+ import"./index-npxmfj48.js";
7
+ import"./index-c8s9a3zh.js";
8
+ import"./index-xehrmy76.js";
9
+ import"./index-cq2hgvd2.js";
10
+ import"./index-d0w40jm3.js";
11
+ import"./index-scww5b77.js";
12
+ import"./index-9fxs0rm1.js";
13
+ import"./index-q1jaeynn.js";
14
+ import"./index-b83y9a7r.js";
15
+ import"./index-hg0pamsa.js";
16
+ import"./index-2aqs6daa.js";
17
+ import"./index-cye4g7zj.js";
18
+ import"./index-t7efm8vz.js";
19
+ import"./index-bfwt3abw.js";
20
+ import"./index-db1fh1fv.js";
21
+ import"./index-jt58s751.js";
22
+ import"./index-wvrj16f0.js";
23
+ import"./index-q1exe2b3.js";
24
+ import"./index-g55nzpwn.js";
25
+ import"./index-fhmw7evd.js";
26
+ import"./index-1rga1vvb.js";
27
+ import"./index-jtqkh8jf.js";
28
+ import"./index-5e4e2hvv.js";
29
+ import"./index-p0arc26j.js";
30
+ import"./index-zgwm4ryv.js";
31
+ import"./index-pm992z24.js";
32
+ import"./index-0dab9w37.js";
33
+ import"./index-293f68mj.js";
34
+ import"./index-5mkc2f9z.js";
35
+ import"./index-vn263hqt.js";
36
+ import"./index-vvk2g744.js";
37
+ import"./index-h91bv3hy.js";
38
+ import"./index-a76rekgs.js";
39
+ export {
40
+ handleGuardrailExplain
41
+ };
@@ -1,15 +1,15 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailLog
4
- } from "./index-5rfxzgmt.js";
5
- import"./index-53z1afgh.js";
6
- import"./index-0g5xsrp4.js";
4
+ } from "./index-w84stmkx.js";
5
+ import"./index-npxmfj48.js";
6
+ import"./index-cq2hgvd2.js";
7
7
  import"./index-bfwt3abw.js";
8
8
  import"./index-5e4e2hvv.js";
9
9
  import"./index-p0arc26j.js";
10
10
  import"./index-zgwm4ryv.js";
11
11
  import"./index-293f68mj.js";
12
- import"./index-7xgqky26.js";
12
+ import"./index-h91bv3hy.js";
13
13
  import"./index-a76rekgs.js";
14
14
  export {
15
15
  handleGuardrailLog
@@ -5,39 +5,39 @@ import {
5
5
  isHiveEligible,
6
6
  promoteFromSwarm,
7
7
  promoteToHive
8
- } from "./index-smk3st51.js";
9
- import"./index-53z1afgh.js";
8
+ } from "./index-j5c98bd9.js";
9
+ import"./index-npxmfj48.js";
10
10
  import"./index-c8s9a3zh.js";
11
- import"./index-xddysq89.js";
12
- import"./index-0g5xsrp4.js";
13
- import"./index-j2v3w1ds.js";
11
+ import"./index-xehrmy76.js";
12
+ import"./index-cq2hgvd2.js";
13
+ import"./index-d0w40jm3.js";
14
14
  import"./index-scww5b77.js";
15
- import"./index-yw8qpf51.js";
16
- import"./index-85bacexr.js";
17
- import"./index-cmjq1kg7.js";
18
- import"./index-c483hnn4.js";
19
- import"./index-mvg66d9n.js";
20
- import"./index-yhmt3dw3.js";
21
- import"./index-v8pk35h7.js";
15
+ import"./index-9fxs0rm1.js";
16
+ import"./index-q1jaeynn.js";
17
+ import"./index-b83y9a7r.js";
18
+ import"./index-hg0pamsa.js";
19
+ import"./index-2aqs6daa.js";
20
+ import"./index-cye4g7zj.js";
21
+ import"./index-t7efm8vz.js";
22
22
  import"./index-bfwt3abw.js";
23
- import"./index-40h0yp9e.js";
23
+ import"./index-db1fh1fv.js";
24
24
  import"./index-jt58s751.js";
25
25
  import"./index-wvrj16f0.js";
26
26
  import"./index-q1exe2b3.js";
27
- import"./index-vzzt3ygr.js";
28
- import"./index-dm35e55e.js";
29
- import"./index-r3j3458j.js";
27
+ import"./index-g55nzpwn.js";
28
+ import"./index-fhmw7evd.js";
29
+ import"./index-1rga1vvb.js";
30
30
  import"./index-jtqkh8jf.js";
31
31
  import"./index-5e4e2hvv.js";
32
32
  import"./index-p0arc26j.js";
33
33
  import"./index-zgwm4ryv.js";
34
- import"./index-6jng9c8t.js";
35
- import"./index-1cn967sa.js";
34
+ import"./index-pm992z24.js";
35
+ import"./index-0dab9w37.js";
36
36
  import"./index-293f68mj.js";
37
37
  import"./index-5mkc2f9z.js";
38
38
  import"./index-vn263hqt.js";
39
39
  import"./index-vvk2g744.js";
40
- import"./index-7xgqky26.js";
40
+ import"./index-h91bv3hy.js";
41
41
  import"./index-a76rekgs.js";
42
42
  export {
43
43
  promoteToHive,