opencode-swarm 7.133.0 → 7.134.1

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 (87) hide show
  1. package/.opencode/skills/codebase-review-swarm/SKILL.md +18 -2
  2. package/.opencode/skills/codebase-review-swarm/references/review-protocol-v8.2.md +18 -2
  3. package/.opencode/skills/swarm-implement/SKILL.md +17 -2
  4. package/dist/background/completion-observer.d.ts +17 -7
  5. package/dist/background/pending-delegations.d.ts +305 -30
  6. package/dist/background/pr-event-subscribers.d.ts +1 -1
  7. package/dist/cli/{config-doctor-8nbdwnn6.js → config-doctor-4avzz3rh.js} +3 -3
  8. package/dist/cli/{core-egwpry19.js → core-d6yd2jzv.js} +3 -3
  9. package/dist/cli/{curation-policy-gae3xm5d.js → curation-policy-8vkzjtwb.js} +7 -7
  10. package/dist/cli/{curator-e88bm4mg.js → curator-3vsvhwav.js} +31 -28
  11. package/dist/cli/{curator-drift-ea0p8nh1.js → curator-drift-9q6f85bm.js} +7 -7
  12. package/dist/cli/{curator-llm-factory-1a7esr69.js → curator-llm-factory-2qk8q4y9.js} +31 -28
  13. package/dist/cli/{dispatch-3mhgqj2x.js → dispatch-gxbeb2ps.js} +2 -2
  14. package/dist/cli/{evidence-summary-service-nhsmsap8.js → evidence-summary-service-mrzsjpg4.js} +13 -12
  15. package/dist/cli/{gate-evidence-cy2te3x8.js → gate-evidence-b5v1xvxp.js} +4 -4
  16. package/dist/cli/guardrail-explain-tw521x47.js +57 -0
  17. package/dist/cli/{guardrail-log-fjgyx76r.js → guardrail-log-e3jrwdw8.js} +5 -5
  18. package/dist/cli/{hive-promoter-2b04e0wh.js → hive-promoter-sdy5qjzn.js} +31 -28
  19. package/dist/cli/{index-66zght9d.js → index-0541h76w.js} +2 -2
  20. package/dist/cli/{index-g4mnf3p5.js → index-1j3682j8.js} +5 -5
  21. package/dist/cli/{index-mmvaf4t6.js → index-1v5mby7t.js} +25 -3
  22. package/dist/cli/{index-j5pnah1w.js → index-2j8f71c3.js} +12 -12
  23. package/dist/cli/{index-17zjp67y.js → index-2t1n9k7b.js} +4 -4
  24. package/dist/cli/{index-mwqfyjja.js → index-358f9h8p.js} +48406 -48697
  25. package/dist/cli/{index-hfpw5m0e.js → index-463k8mfr.js} +3 -3
  26. package/dist/cli/{index-2tn5h2zp.js → index-4p02dp92.js} +6 -6
  27. package/dist/cli/{index-7ftthvqt.js → index-6b69mp0r.js} +8 -8
  28. package/dist/cli/{index-bz08438z.js → index-8t9xpn1a.js} +7 -7
  29. package/dist/cli/{index-sp7tm8t7.js → index-9z1q181f.js} +1 -1
  30. package/dist/cli/index-b4z7s917.js +80 -0
  31. package/dist/cli/index-b8zgtz81.js +123 -0
  32. package/dist/cli/{index-tj2mkfb3.js → index-bq2848a3.js} +1 -1
  33. package/dist/cli/{index-kc1m6vpr.js → index-c0e3vhv9.js} +2 -2
  34. package/dist/cli/{index-q27bajqb.js → index-cfkvc5q9.js} +3 -3
  35. package/dist/cli/{index-7mkpsw6g.js → index-dd7ttx8x.js} +1 -1
  36. package/dist/cli/{index-r260ybay.js → index-k742ecbm.js} +178 -222
  37. package/dist/cli/{index-cpest8sa.js → index-kwm7hz18.js} +5 -5
  38. package/dist/cli/{index-0vd91yb8.js → index-m8ajf6wb.js} +3 -3
  39. package/dist/cli/{index-mhcge2ry.js → index-mz6sqtm9.js} +33 -30
  40. package/dist/cli/{index-74tptrss.js → index-p8hezdtz.js} +1 -1
  41. package/dist/cli/{index-sw82jvf2.js → index-pz49rx4y.js} +2 -2
  42. package/dist/cli/{index-3x761jqv.js → index-wk1h5ec2.js} +1 -1
  43. package/dist/cli/{index-wzb4dv5s.js → index-y2esw64s.js} +4 -4
  44. package/dist/cli/index-y3v1404y.js +1625 -0
  45. package/dist/cli/{index-wz36r0fk.js → index-zjw32rv9.js} +2 -2
  46. package/dist/cli/index.js +31 -28
  47. package/dist/cli/{knowledge-escalator-hzkw1ban.js → knowledge-escalator-v09w0jmg.js} +8 -8
  48. package/dist/cli/{knowledge-events-pbycdhqd.js → knowledge-events-qp19r2he.js} +6 -6
  49. package/dist/cli/{knowledge-link-4yd2z8ev.js → knowledge-link-nc4y2zkq.js} +5 -5
  50. package/dist/cli/{knowledge-store-45jawb2p.js → knowledge-store-n5pvv0s3.js} +6 -6
  51. package/dist/cli/{knowledge-validator-ge576f8n.js → knowledge-validator-qg31ycbb.js} +9 -9
  52. package/dist/cli/pending-delegations-v9e40hfk.js +96 -0
  53. package/dist/cli/{pr-subscriptions-zqbmctwz.js → pr-subscriptions-ztq40hrt.js} +7 -7
  54. package/dist/cli/{scan-cursor-kvw872be.js → scan-cursor-wtzfvkh2.js} +7 -7
  55. package/dist/cli/{schema-a2zm2m3r.js → schema-erk5bz43.js} +2 -2
  56. package/dist/cli/{scope-persistence-5qypzxxm.js → scope-persistence-hz3zmmsv.js} +5 -5
  57. package/dist/cli/{skill-generator-ch79hvxh.js → skill-generator-nxs65tq3.js} +10 -10
  58. package/dist/cli/worktree-collision-ownership-c4bdnjtx.js +221 -0
  59. package/dist/evaluation/contracts.d.ts +1 -1
  60. package/dist/evaluation/public-api.d.ts +1 -1
  61. package/dist/hooks/delegation-gate/worktree-collision-ownership.d.ts +28 -0
  62. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +63 -1
  63. package/dist/hooks/delegation-gate/worktree-merge-status.d.ts +14 -0
  64. package/dist/hooks/delegation-gate/worktree-ownership-tag.d.ts +19 -0
  65. package/dist/hooks/delegation-gate/worktree-provisioning-owner.d.ts +30 -0
  66. package/dist/hooks/delegation-gate.d.ts +14 -5
  67. package/dist/hooks/guardrails/messages-transform.d.ts +10 -0
  68. package/dist/hooks/guardrails/stored-input-args.d.ts +6 -0
  69. package/dist/hooks/index.d.ts +1 -1
  70. package/dist/hooks/init-orphan-recovery.d.ts +17 -0
  71. package/dist/index.js +486 -479
  72. package/dist/memory/schema.d.ts +4 -4
  73. package/dist/prm/escalation.d.ts +1 -11
  74. package/dist/prm/index.d.ts +1 -0
  75. package/dist/prm/types.d.ts +0 -2
  76. package/dist/session/snapshot-writer.d.ts +3 -0
  77. package/dist/state.d.ts +54 -1
  78. package/dist/tools/dispatch-lanes.d.ts +1 -1
  79. package/dist/tools/epic-record-divergence.d.ts +5 -5
  80. package/dist/utils/advisory-queue.d.ts +60 -0
  81. package/dist/worktree/merge.d.ts +47 -1
  82. package/package.json +1 -1
  83. package/dist/cli/guardrail-explain-zgja2b9m.js +0 -54
  84. package/dist/cli/pending-delegations-kxy8mdqg.js +0 -75
  85. package/dist/cli/{index-9f71ye47.js → index-13xxjfhn.js} +3 -3
  86. package/dist/cli/{index-s80bsjkj.js → index-2ghkk9ve.js} +6 -6
  87. package/dist/cli/{index-76kvm9z5.js → index-5nybajn9.js} +3 -3
@@ -3,8 +3,8 @@ import type { CuratorMemoryDecision, MemoryKind, MemoryPatch, MemoryProposal, Me
3
3
  export declare const MemoryScopeTypeSchema: z.ZodEnum<{
4
4
  agent: "agent";
5
5
  project: "project";
6
- global_user: "global_user";
7
6
  workspace: "workspace";
7
+ global_user: "global_user";
8
8
  repository: "repository";
9
9
  run: "run";
10
10
  cohort: "cohort";
@@ -13,8 +13,8 @@ export declare const MemoryScopeRefSchema: z.ZodObject<{
13
13
  type: z.ZodEnum<{
14
14
  agent: "agent";
15
15
  project: "project";
16
- global_user: "global_user";
17
16
  workspace: "workspace";
17
+ global_user: "global_user";
18
18
  repository: "repository";
19
19
  run: "run";
20
20
  cohort: "cohort";
@@ -66,8 +66,8 @@ export declare const MemoryRecordSchema: z.ZodObject<{
66
66
  type: z.ZodEnum<{
67
67
  agent: "agent";
68
68
  project: "project";
69
- global_user: "global_user";
70
69
  workspace: "workspace";
70
+ global_user: "global_user";
71
71
  repository: "repository";
72
72
  run: "run";
73
73
  cohort: "cohort";
@@ -154,8 +154,8 @@ export declare const MemoryProposalSchema: z.ZodObject<{
154
154
  type: z.ZodEnum<{
155
155
  agent: "agent";
156
156
  project: "project";
157
- global_user: "global_user";
158
157
  workspace: "workspace";
158
+ global_user: "global_user";
159
159
  repository: "repository";
160
160
  run: "run";
161
161
  cohort: "cohort";
@@ -50,19 +50,9 @@ export declare class EscalationTracker {
50
50
  getState(): EscalationState;
51
51
  /**
52
52
  * Resets all escalation counts and flags to their default values.
53
- * Clears pattern counts, corrections pending, and all flags.
53
+ * Clears pattern counts and all flags.
54
54
  */
55
55
  reset(): void;
56
- /**
57
- * Returns defensive copies of all pending course corrections.
58
- *
59
- * @returns Array of pending CourseCorrection objects
60
- */
61
- getPendingCorrections(): CourseCorrection[];
62
- /**
63
- * Clears all pending course corrections.
64
- */
65
- clearPendingCorrections(): void;
66
56
  /**
67
57
  * Returns whether a hard stop is pending.
68
58
  * This flag is read by messagesTransform to halt agent execution.
@@ -75,6 +75,7 @@ interface ResettablePrmSessionState {
75
75
  prmLastPatternDetected?: unknown;
76
76
  prmHardStopPending?: boolean;
77
77
  prmTrajectoryStep?: number;
78
+ prmInjectedAdvisoryKeys?: Set<string>;
78
79
  replayArtifactPath?: string | null;
79
80
  }
80
81
  export declare function resetPrmSessionState(session: ResettablePrmSessionState, sessionId?: string): void;
@@ -115,6 +115,4 @@ export interface EscalationState {
115
115
  lastPatternDetected: PatternMatch | null;
116
116
  /** Whether a hard stop has been triggered */
117
117
  hardStopPending: boolean;
118
- /** Queue of correction messages to inject */
119
- correctionsPending: CourseCorrection[];
120
118
  }
@@ -32,6 +32,7 @@ export interface SerializedAgentSession {
32
32
  timestamp: number;
33
33
  } | null;
34
34
  partialGateWarningsIssuedForTask: string[];
35
+ completionGateWarnedForTask: string[];
35
36
  selfFixAttempted: boolean;
36
37
  selfCodingWarnedAtCount: number;
37
38
  catastrophicPhaseWarnings: number[];
@@ -43,6 +44,8 @@ export interface SerializedAgentSession {
43
44
  qaSkipTaskIds: string[];
44
45
  pendingAdvisoryMessages: string[];
45
46
  taskWorkflowStates?: Record<string, string>;
47
+ /** Task-keyed coder file attribution. Optional for backward compatibility. */
48
+ modifiedFilesByTask?: Record<string, string[]>;
46
49
  /** Flag for one-shot scope violation warning injection (omitted when undefined for additive-only schema) */
47
50
  scopeViolationDetected?: boolean;
48
51
  /** Current index into the fallback_models array (v6.33) */
package/dist/state.d.ts CHANGED
@@ -64,6 +64,14 @@ export interface PrSubscriptionState {
64
64
  * Transitions must be forward-only: idle → coder_delegated → pre_check_passed → reviewer_run → tests_run → complete
65
65
  */
66
66
  export type TaskWorkflowState = 'idle' | 'coder_delegated' | 'pre_check_passed' | 'reviewer_run' | 'tests_run' | 'complete';
67
+ /**
68
+ * Upper bound for per-session task file-attribution entries.
69
+ *
70
+ * Runtime concurrency is capped well below this value. When the map is full,
71
+ * only workflow-complete entries may be reclaimed; live task attribution is
72
+ * never evicted to make room.
73
+ */
74
+ export declare const MAX_TRACKED_TASK_FILE_ATTRIBUTIONS = 128;
67
75
  /** Exact lifecycle state for one coder generation and its paired reviewer. */
68
76
  export interface ReviewerScopeGeneration {
69
77
  taskId: string;
@@ -161,6 +169,10 @@ export interface AgentSessionState {
161
169
  } | null;
162
170
  /** Task IDs for which partial gate warning has already been issued (prevents per-task spam) */
163
171
  partialGateWarningsIssuedForTask: Set<string>;
172
+ /** Task IDs for which the completion-gate violation advisory has already been issued
173
+ * (issue #1976 B3: prevents re-injecting the identical, unactionable directive on
174
+ * every subsequent Task tool call while the same task stays stuck in tests_run). */
175
+ completionGateWarnedForTask: Set<string>;
164
176
  /** Whether architect attempted self-fix write after gate failure */
165
177
  selfFixAttempted: boolean;
166
178
  /** Value of architectWriteCount at the time the self-coding warning was last injected.
@@ -218,7 +230,12 @@ export interface AgentSessionState {
218
230
  lastScopeViolation: string | null;
219
231
  /** Flag for one-shot scope violation warning injection in messagesTransform */
220
232
  scopeViolationDetected?: boolean;
221
- /** Files modified by the current coder task (populated by guardrails toolBefore/toolAfter, reset on new coder delegation) */
233
+ /** Task-keyed files modified by coder work. Bounded by MAX_TRACKED_TASK_FILE_ATTRIBUTIONS. */
234
+ modifiedFilesByTask: Map<string, string[]>;
235
+ /**
236
+ * Compatibility projection for callers that still inspect the active task.
237
+ * Helpers in this module keep it synchronized only with `currentTaskId`.
238
+ */
222
239
  modifiedFilesThisCoderTask: string[];
223
240
  /** Bounded coder generations awaiting exact reviewer claims. */
224
241
  reviewerScopeGenerations?: Map<string, ReviewerScopeGeneration>;
@@ -316,6 +333,13 @@ export interface AgentSessionState {
316
333
  prmHardStopPending: boolean;
317
334
  /** Per-session escalation tracker instance (set lazily by PRM hook) */
318
335
  prmEscalationTracker?: EscalationTracker;
336
+ /** Cross-turn set of already-injected PRM advisory dedupe keys
337
+ * (issue #1976 B1). The pushAdvisory helper only dedupes WITHIN a turn
338
+ * (the drain clears pendingAdvisoryMessages each turn); this set suppresses
339
+ * re-injecting the same pattern@level on subsequent tool calls until the
340
+ * pattern's count advances escalation. Bounded by distinct (pattern, level)
341
+ * pairs — at most (numPatterns × 3 levels). */
342
+ prmInjectedAdvisoryKeys: Set<string>;
319
343
  /** Active PR subscriptions for the background poller, keyed by `${repoFullName}::${prNumber}` */
320
344
  prSubscriptions: Map<string, PrSubscriptionState>;
321
345
  /**
@@ -737,6 +761,35 @@ export declare function pruneOldWindows(sessionId: string, maxAgeMs?: number, ma
737
761
  * @param agentName - Agent name to record (will be normalized)
738
762
  */
739
763
  export declare function recordPhaseAgentDispatch(sessionId: string, agentName: string): void;
764
+ /**
765
+ * Atomically replace one task's attributed file list.
766
+ *
767
+ * Returns false without mutation when the task id is invalid or the bounded
768
+ * map has no reclaimable workflow-complete slot.
769
+ */
770
+ export declare function recordModifiedFilesForTask(session: AgentSessionState, taskId: string, files: readonly string[]): boolean;
771
+ /**
772
+ * Add one file to a task's attribution without disturbing its existing files.
773
+ */
774
+ export declare function recordModifiedFileForTask(session: AgentSessionState, taskId: string, file: string): boolean;
775
+ /**
776
+ * Return a defensive copy of the files attributed to one task.
777
+ */
778
+ export declare function getModifiedFilesForTask(session: AgentSessionState, taskId: string): string[];
779
+ /**
780
+ * Reset one task's attribution. `remove` is used at terminal cleanup; the
781
+ * default keeps an empty live-task slot ready for subsequent writes.
782
+ */
783
+ export declare function resetModifiedFilesForTask(session: AgentSessionState, taskId: string, options?: {
784
+ remove?: boolean;
785
+ }): boolean;
786
+ /**
787
+ * Apply task-completion retention rules.
788
+ *
789
+ * Non-Epic sessions release attribution at the workflow-complete boundary.
790
+ * Epic sessions retain it until `epic_record_divergence` consumes the entry.
791
+ */
792
+ export declare function completeModifiedFilesForTask(session: AgentSessionState, taskId: string): void;
740
793
  /**
741
794
  * Advance a task's workflow state. Validates forward-only transitions.
742
795
  * Throws 'INVALID_TASK_STATE_TRANSITION: [taskId] [current] → [requested]' on illegal transition.
@@ -67,7 +67,7 @@ declare function validatePrReviewMicroDispatch(args: DispatchLanesAsyncArgs, dep
67
67
  export type DispatchLanesArgs = z.infer<typeof DispatchLanesArgsSchema>;
68
68
  export type DispatchLanesAsyncArgs = z.infer<typeof DispatchLanesAsyncArgsSchema>;
69
69
  export type CollectLaneResultsArgs = z.infer<typeof CollectLaneResultsArgsSchema>;
70
- export type DispatchLaneStatus = 'pending' | 'completed' | 'failed' | 'rejected' | 'cancelled' | 'stale' | 'consumed';
70
+ export type DispatchLaneStatus = 'pending' | 'completed' | 'failed' | 'rejected' | 'cancelled' | 'stale' | 'ingesting' | 'consumed';
71
71
  export interface DispatchLaneResult {
72
72
  id: string;
73
73
  agent: string;
@@ -6,10 +6,8 @@
6
6
  *
7
7
  * 1. Reads the task's DECLARED scope from `.swarm/scopes/scope-{taskId}.json`
8
8
  * (the same on-disk record `readScopeFromDisk` consults).
9
- * 2. Reads the ACTUAL files the coder modified from the session's
10
- * `modifiedFilesThisCoderTask` populated by the guardrails write hook
11
- * and reset by Lean Turbo at task-boundaries, so it captures THIS
12
- * task's writes only.
9
+ * 2. Reads the ACTUAL files attributed to this exact task by the guardrails
10
+ * write hook and background-completion ingestion.
13
11
  * 3. Appends one record to `.swarm/epic/divergence.jsonl` via
14
12
  * `recordTaskDivergence`. The calibration engine reads that file on the
15
13
  * next `epic_decide_phase` invocation (the architect-facing decide
@@ -28,7 +26,7 @@
28
26
  import type { ToolDefinition } from '@opencode-ai/plugin/tool';
29
27
  import { loadPlanJsonOnly as loadPlanJsonOnly_import } from '../plan/manager.js';
30
28
  import { readScopeFromDisk as readScopeFromDisk_import } from '../scope/scope-persistence.js';
31
- import { getAgentSession as getAgentSession_import, hasActiveEpicMode as hasActiveEpicMode_import } from '../state.js';
29
+ import { getAgentSession as getAgentSession_import, getModifiedFilesForTask as getModifiedFilesForTask_import, hasActiveEpicMode as hasActiveEpicMode_import, resetModifiedFilesForTask as resetModifiedFilesForTask_import } from '../state.js';
32
30
  import { recordTaskDivergence as recordTaskDivergence_import } from '../turbo/epic/divergence-recorder.js';
33
31
  export interface EpicRecordDivergenceArgs {
34
32
  directory: string;
@@ -65,6 +63,8 @@ export interface EpicRecordDivergenceResult {
65
63
  export declare const _internals: {
66
64
  hasActiveEpicMode: typeof hasActiveEpicMode_import;
67
65
  getAgentSession: typeof getAgentSession_import;
66
+ getModifiedFilesForTask: typeof getModifiedFilesForTask_import;
67
+ resetModifiedFilesForTask: typeof resetModifiedFilesForTask_import;
68
68
  readScopeFromDisk: typeof readScopeFromDisk_import;
69
69
  loadPlanJsonOnly: typeof loadPlanJsonOnly_import;
70
70
  recordTaskDivergence: typeof recordTaskDivergence_import;
@@ -0,0 +1,60 @@
1
+ import type { AgentSessionState } from '../state';
2
+ /**
3
+ * Shared advisory-queue push helper (issue #1976).
4
+ *
5
+ * Problem it fixes: `session.pendingAdvisoryMessages` is a bare `string[]`
6
+ * that ~70 producer sites pushed onto directly via `.push()`, with no shared
7
+ * gate. Re-firing triggers (per-tool-call, per-Task-call, per-poll, on retry)
8
+ * stacked near-identical or byte-identical advisories that the drain rendered
9
+ * verbatim with no dedupe or size bound — which produced the PR_REVIEW banner
10
+ * flood (55.3% of non-blank lines in a real transcript).
11
+ *
12
+ * This helper gives every producer a gate by construction:
13
+ * 1. empty/whitespace messages are skipped (drain hygiene),
14
+ * 2. near-identical messages already queued are suppressed (dedupe),
15
+ * 3. the queue is length-bounded (keep-latest) so volume is capped.
16
+ *
17
+ * IMPORTANT — dedupe scope. The advisory drain (`messagesTransform`) clears
18
+ * `pendingAdvisoryMessages = []` on every turn, so this helper's dedupe only
19
+ * suppresses duplicates that accumulate WITHIN a single turn (between pushes
20
+ * and the next drain). CROSS-turn re-injection (the dominant failure mode for
21
+ * per-tool/per-Task repeaters) is NOT handled here — those producers carry
22
+ * their own session-scoped "already said" state keyed on a stable identity.
23
+ * The drain-level byte budget (`messagesTransform`) bounds rendered output
24
+ * across all producers, including any not yet migrated to this helper.
25
+ */
26
+ /**
27
+ * Maximum number of pending advisories retained in the queue at once
28
+ * (defense-in-depth, in addition to the drain byte budget). Keep-latest: when
29
+ * the cap is exceeded the OLDEST entry is dropped. The issue explicitly flags
30
+ * "keep earliest" as a priority inversion because high-value advisories tend
31
+ * to arrive LATE in a turn while low-value ones arrive early.
32
+ */
33
+ export declare const MAX_PENDING_ADVISORIES = 25;
34
+ /**
35
+ * Options for {@link pushAdvisory}.
36
+ */
37
+ export interface PushAdvisoryOptions {
38
+ /**
39
+ * Stable semantic identity for dedupe. Use this when the rendered message
40
+ * embeds volatile fields (counts, step ranges, ids) that vary across
41
+ * logically-equivalent re-fires. When omitted, the full normalized message
42
+ * text is used as the fingerprint.
43
+ */
44
+ dedupeKey?: string;
45
+ /**
46
+ * Override the default queue length cap ({@link MAX_PENDING_ADVISORIES}).
47
+ */
48
+ maxPending?: number;
49
+ }
50
+ /**
51
+ * Push an advisory onto the session's pending queue with dedupe + length cap.
52
+ *
53
+ * @returns `true` if the message was enqueued, `false` if it was suppressed
54
+ * (empty, or a near-identical/duplicate message was already queued). Callers
55
+ * that maintain cross-turn "already said" state should record that state ONLY
56
+ * when this returns `true` — and must NEVER early-return out of other
57
+ * mandatory work (escalation counting, telemetry, replay) based on this
58
+ * result. Suppression applies to the ADVISORY INJECTION only.
59
+ */
60
+ export declare function pushAdvisory(session: Pick<AgentSessionState, 'pendingAdvisoryMessages'>, message: string, opts?: PushAdvisoryOptions): boolean;
@@ -65,6 +65,10 @@ export interface DirtyMergeSuccess {
65
65
  strategy: string;
66
66
  autoCommitted: boolean;
67
67
  cleaned: boolean;
68
+ /** True when a resumed operation was already present on the target. */
69
+ reconciled?: boolean;
70
+ /** Durable identity for the Git operation, when settlement tracking is enabled. */
71
+ provenance?: MergeOperationProvenance;
68
72
  }
69
73
  export interface DirtyMergePartial {
70
74
  partial: true;
@@ -73,11 +77,45 @@ export interface DirtyMergePartial {
73
77
  cleaned: boolean;
74
78
  message: string;
75
79
  conflictFiles?: string[];
80
+ provenance?: MergeOperationProvenance;
76
81
  }
77
82
  export interface DirtyMergeFailure {
78
83
  failed: true;
79
84
  stage: string;
80
85
  message: string;
86
+ provenance?: MergeOperationProvenance;
87
+ }
88
+ /**
89
+ * Durable identity for a standard-worktree merge-back operation.
90
+ *
91
+ * `sourceHead` is captured after the lane's dirty state is auto-committed and
92
+ * `targetHeadBefore` immediately before the merge starts. The stable
93
+ * `operationId` is supplied by the durable background-delegation record.
94
+ */
95
+ export interface MergeOperationProvenance {
96
+ operationId: string;
97
+ sourceHead: string;
98
+ targetHeadBefore: string;
99
+ branchName: string;
100
+ strategy: MergeStrategy;
101
+ }
102
+ export type MergeReconciliationResult = {
103
+ landed: true;
104
+ method: 'ancestry' | 'cherry-pick-trailer';
105
+ } | {
106
+ landed: false;
107
+ error?: string;
108
+ };
109
+ export interface DirtyMergeOptions {
110
+ /** Stable identifier allocated before the merge-back begins. */
111
+ operationId?: string;
112
+ /** Previously persisted provenance when resuming a `settling` operation. */
113
+ resume?: MergeOperationProvenance;
114
+ /**
115
+ * Awaited after auto-commit and HEAD capture, but before the Git merge.
116
+ * A rejection fails closed without invoking the merge.
117
+ */
118
+ onBeforeMerge?: (provenance: MergeOperationProvenance) => Promise<void>;
81
119
  }
82
120
  export interface OrphanCleanupResult {
83
121
  removed: string[];
@@ -123,6 +161,14 @@ export declare function getMergeStrategy(config: {
123
161
  * @returns Discriminated union: success, conflict, or failure.
124
162
  */
125
163
  export declare function mergeLaneBranch(primaryDir: string, branchName: string, strategy: MergeStrategy): Promise<MergeSuccess | MergeConflict | MergeFailure>;
164
+ /**
165
+ * Detect whether a previously-started merge-back already landed on the target.
166
+ *
167
+ * Merge and rebase settlement uses ancestry. Cherry-pick settlement uses the
168
+ * exact provenance trailer emitted by Git's `cherry-pick -x`; patch identity or
169
+ * subject matching is intentionally insufficient.
170
+ */
171
+ export declare function reconcileLandedMerge(primaryDir: string, provenance: MergeOperationProvenance): Promise<MergeReconciliationResult>;
126
172
  /**
127
173
  * Cleans up a lane branch after a successful merge.
128
174
  *
@@ -168,7 +214,7 @@ export declare function handleMergeConflict(primaryDir: string, _branchName: str
168
214
  * @param strategy - Merge strategy to use.
169
215
  * @returns Discriminated union: success, partial, or failure.
170
216
  */
171
- export declare function attemptMergeBackFromDirty(worktreePath: string, branchName: string, primaryDir: string, strategy: MergeStrategy): Promise<DirtyMergeSuccess | DirtyMergePartial | DirtyMergeFailure>;
217
+ export declare function attemptMergeBackFromDirty(worktreePath: string, branchName: string, primaryDir: string, strategy: MergeStrategy, options?: DirtyMergeOptions): Promise<DirtyMergeSuccess | DirtyMergePartial | DirtyMergeFailure>;
172
218
  /**
173
219
  * Extracts the session ID from a swarm-lane branch name.
174
220
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.133.0",
3
+ "version": "7.134.1",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,54 +0,0 @@
1
- // @bun
2
- import {
3
- handleGuardrailExplain
4
- } from "./index-sw82jvf2.js";
5
- import"./index-mwqfyjja.js";
6
- import"./index-mmvaf4t6.js";
7
- import"./index-tj2mkfb3.js";
8
- import"./index-r260ybay.js";
9
- import"./index-4905hd2m.js";
10
- import"./index-134d35c1.js";
11
- import"./index-9f71ye47.js";
12
- import"./index-0vd91yb8.js";
13
- import"./index-cpest8sa.js";
14
- import"./index-66zght9d.js";
15
- import"./index-vxv732ex.js";
16
- import"./index-c8s9a3zh.js";
17
- import"./index-9ss2m4rs.js";
18
- import"./index-g4mnf3p5.js";
19
- import"./index-s80bsjkj.js";
20
- import"./index-7ftthvqt.js";
21
- import"./index-wz36r0fk.js";
22
- import"./index-rtry5xyf.js";
23
- import"./index-j5pnah1w.js";
24
- import"./index-bz08438z.js";
25
- import"./index-ae75rja9.js";
26
- import"./index-q27bajqb.js";
27
- import"./index-kc1m6vpr.js";
28
- import"./index-k5jrywpr.js";
29
- import"./index-n832052r.js";
30
- import"./index-wzb4dv5s.js";
31
- import"./index-bk5tah7q.js";
32
- import"./index-8fwhhayc.js";
33
- import"./index-q1exe2b3.js";
34
- import"./index-74tptrss.js";
35
- import"./index-2tn5h2zp.js";
36
- import"./index-1kz6da87.js";
37
- import"./index-17zjp67y.js";
38
- import"./index-z6xqpmqg.js";
39
- import"./index-4rhhvd1a.js";
40
- import"./index-zjygnfay.js";
41
- import"./index-zgwm4ryv.js";
42
- import"./index-h3k62043.js";
43
- import"./index-3x761jqv.js";
44
- import"./index-7mkpsw6g.js";
45
- import"./index-fsrp8wp3.js";
46
- import"./index-76kvm9z5.js";
47
- import"./index-q2rrv0cy.js";
48
- import"./index-bpmtbmy9.js";
49
- import"./index-7g4c7s5r.js";
50
- import"./index-qe3v54nb.js";
51
- import"./index-a76rekgs.js";
52
- export {
53
- handleGuardrailExplain
54
- };
@@ -1,75 +0,0 @@
1
- // @bun
2
- import {
3
- BACKGROUND_DELEGATIONS_FILE,
4
- BACKGROUND_INGESTION_LEASE_MS,
5
- appendDelegationTransition,
6
- buildPromptSnapshot,
7
- claimDelegationIngestion,
8
- findByBatchId,
9
- findByCorrelationId,
10
- findOpenAsyncLaneBatches,
11
- readDelegations,
12
- recordPendingDelegation,
13
- settleDelegationIngestion,
14
- sweepStaleDelegations
15
- } from "./index-mwqfyjja.js";
16
- import"./index-mmvaf4t6.js";
17
- import"./index-tj2mkfb3.js";
18
- import"./index-r260ybay.js";
19
- import"./index-4905hd2m.js";
20
- import"./index-134d35c1.js";
21
- import"./index-9f71ye47.js";
22
- import"./index-0vd91yb8.js";
23
- import"./index-cpest8sa.js";
24
- import"./index-66zght9d.js";
25
- import"./index-vxv732ex.js";
26
- import"./index-c8s9a3zh.js";
27
- import"./index-9ss2m4rs.js";
28
- import"./index-g4mnf3p5.js";
29
- import"./index-s80bsjkj.js";
30
- import"./index-7ftthvqt.js";
31
- import"./index-wz36r0fk.js";
32
- import"./index-rtry5xyf.js";
33
- import"./index-j5pnah1w.js";
34
- import"./index-bz08438z.js";
35
- import"./index-ae75rja9.js";
36
- import"./index-q27bajqb.js";
37
- import"./index-kc1m6vpr.js";
38
- import"./index-k5jrywpr.js";
39
- import"./index-n832052r.js";
40
- import"./index-wzb4dv5s.js";
41
- import"./index-bk5tah7q.js";
42
- import"./index-8fwhhayc.js";
43
- import"./index-q1exe2b3.js";
44
- import"./index-74tptrss.js";
45
- import"./index-2tn5h2zp.js";
46
- import"./index-1kz6da87.js";
47
- import"./index-17zjp67y.js";
48
- import"./index-z6xqpmqg.js";
49
- import"./index-4rhhvd1a.js";
50
- import"./index-zjygnfay.js";
51
- import"./index-zgwm4ryv.js";
52
- import"./index-h3k62043.js";
53
- import"./index-3x761jqv.js";
54
- import"./index-7mkpsw6g.js";
55
- import"./index-fsrp8wp3.js";
56
- import"./index-76kvm9z5.js";
57
- import"./index-q2rrv0cy.js";
58
- import"./index-bpmtbmy9.js";
59
- import"./index-7g4c7s5r.js";
60
- import"./index-qe3v54nb.js";
61
- import"./index-a76rekgs.js";
62
- export {
63
- sweepStaleDelegations,
64
- settleDelegationIngestion,
65
- recordPendingDelegation,
66
- readDelegations,
67
- findOpenAsyncLaneBatches,
68
- findByCorrelationId,
69
- findByBatchId,
70
- claimDelegationIngestion,
71
- buildPromptSnapshot,
72
- appendDelegationTransition,
73
- BACKGROUND_INGESTION_LEASE_MS,
74
- BACKGROUND_DELEGATIONS_FILE
75
- };
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  simpleGlobToRegex
4
4
  } from "./index-z6xqpmqg.js";
5
- import {
6
- warn
7
- } from "./index-zgwm4ryv.js";
8
5
  import {
9
6
  bunSpawnSync
10
7
  } from "./index-qe3v54nb.js";
8
+ import {
9
+ warn
10
+ } from "./index-zgwm4ryv.js";
11
11
  import {
12
12
  __export
13
13
  } from "./index-a76rekgs.js";
@@ -1,16 +1,16 @@
1
1
  // @bun
2
- import {
3
- SwarmError
4
- } from "./index-z6xqpmqg.js";
5
- import {
6
- warn
7
- } from "./index-zgwm4ryv.js";
8
2
  import {
9
3
  readCachedTextFile
10
4
  } from "./index-fsrp8wp3.js";
5
+ import {
6
+ SwarmError
7
+ } from "./index-z6xqpmqg.js";
11
8
  import {
12
9
  bunFile
13
10
  } from "./index-qe3v54nb.js";
11
+ import {
12
+ warn
13
+ } from "./index-zgwm4ryv.js";
14
14
 
15
15
  // src/hooks/utils.ts
16
16
  import * as fs from "fs";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
- import {
3
- emit
4
- } from "./index-q2rrv0cy.js";
5
2
  import {
6
3
  require_proper_lockfile
7
4
  } from "./index-7g4c7s5r.js";
5
+ import {
6
+ emit
7
+ } from "./index-q2rrv0cy.js";
8
8
  import {
9
9
  __toESM
10
10
  } from "./index-a76rekgs.js";