opencode-swarm 7.134.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 (46) 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/pr-event-subscribers.d.ts +1 -1
  5. package/dist/cli/{config-doctor-t5r92674.js → config-doctor-4avzz3rh.js} +2 -2
  6. package/dist/cli/{curation-policy-3smfn2a3.js → curation-policy-8vkzjtwb.js} +2 -2
  7. package/dist/cli/{curator-hva8f3nf.js → curator-3vsvhwav.js} +12 -12
  8. package/dist/cli/{curator-drift-tsyyf4b4.js → curator-drift-9q6f85bm.js} +1 -1
  9. package/dist/cli/{curator-llm-factory-p3aqev12.js → curator-llm-factory-2qk8q4y9.js} +12 -12
  10. package/dist/cli/{guardrail-explain-k8mcvk61.js → guardrail-explain-tw521x47.js} +13 -13
  11. package/dist/cli/{guardrail-log-absma1rv.js → guardrail-log-e3jrwdw8.js} +3 -3
  12. package/dist/cli/{hive-promoter-jwd51gzk.js → hive-promoter-sdy5qjzn.js} +12 -12
  13. package/dist/cli/{index-m2s0gbzt.js → index-0541h76w.js} +1 -1
  14. package/dist/cli/{index-hgh01f6h.js → index-1v5mby7t.js} +1 -1
  15. package/dist/cli/{index-baawkm48.js → index-2j8f71c3.js} +4 -4
  16. package/dist/cli/{index-3dtjhr26.js → index-358f9h8p.js} +47 -36
  17. package/dist/cli/{index-kapharv7.js → index-463k8mfr.js} +2 -2
  18. package/dist/cli/{index-2njes601.js → index-6b69mp0r.js} +2 -2
  19. package/dist/cli/{index-dgxgvzab.js → index-8t9xpn1a.js} +1 -1
  20. package/dist/cli/{index-c3e0ymrg.js → index-9z1q181f.js} +1 -1
  21. package/dist/cli/{index-g87ty4wp.js → index-bq2848a3.js} +1 -1
  22. package/dist/cli/{index-xfejq1p9.js → index-c0e3vhv9.js} +1 -1
  23. package/dist/cli/{index-jpkxjmfw.js → index-kwm7hz18.js} +5 -5
  24. package/dist/cli/{index-j6ywarjp.js → index-m8ajf6wb.js} +3 -3
  25. package/dist/cli/{index-eedq2y40.js → index-mz6sqtm9.js} +14 -14
  26. package/dist/cli/{index-rkyhv4p5.js → index-pz49rx4y.js} +2 -2
  27. package/dist/cli/{index-b5ek2cge.js → index-y2esw64s.js} +1 -1
  28. package/dist/cli/{index-y0kk3rtv.js → index-zjw32rv9.js} +1 -1
  29. package/dist/cli/index.js +12 -12
  30. package/dist/cli/{knowledge-escalator-mkdac2m7.js → knowledge-escalator-v09w0jmg.js} +3 -3
  31. package/dist/cli/{knowledge-events-jjc9qbe0.js → knowledge-events-qp19r2he.js} +1 -1
  32. package/dist/cli/{knowledge-store-9e0w1kxm.js → knowledge-store-n5pvv0s3.js} +1 -1
  33. package/dist/cli/{knowledge-validator-h1nrn2pk.js → knowledge-validator-qg31ycbb.js} +4 -4
  34. package/dist/cli/{scan-cursor-mk3tq3sf.js → scan-cursor-wtzfvkh2.js} +2 -2
  35. package/dist/cli/{schema-bjb0yzsq.js → schema-erk5bz43.js} +1 -1
  36. package/dist/cli/{skill-generator-p1de0wkr.js → skill-generator-nxs65tq3.js} +5 -5
  37. package/dist/hooks/guardrails/messages-transform.d.ts +10 -0
  38. package/dist/hooks/guardrails/stored-input-args.d.ts +6 -0
  39. package/dist/index.js +38 -37
  40. package/dist/prm/escalation.d.ts +1 -11
  41. package/dist/prm/index.d.ts +1 -0
  42. package/dist/prm/types.d.ts +0 -2
  43. package/dist/session/snapshot-writer.d.ts +1 -0
  44. package/dist/state.d.ts +11 -0
  45. package/dist/utils/advisory-queue.d.ts +60 -0
  46. package/package.json +1 -1
@@ -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[];
package/dist/state.d.ts CHANGED
@@ -169,6 +169,10 @@ export interface AgentSessionState {
169
169
  } | null;
170
170
  /** Task IDs for which partial gate warning has already been issued (prevents per-task spam) */
171
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>;
172
176
  /** Whether architect attempted self-fix write after gate failure */
173
177
  selfFixAttempted: boolean;
174
178
  /** Value of architectWriteCount at the time the self-coding warning was last injected.
@@ -329,6 +333,13 @@ export interface AgentSessionState {
329
333
  prmHardStopPending: boolean;
330
334
  /** Per-session escalation tracker instance (set lazily by PRM hook) */
331
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>;
332
343
  /** Active PR subscriptions for the background poller, keyed by `${repoFullName}::${prNumber}` */
333
344
  prSubscriptions: Map<string, PrSubscriptionState>;
334
345
  /**
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.134.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",