opencode-swarm 7.136.2 → 7.136.3

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 (84) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +1 -1
  2. package/.opencode/skills/clarify/SKILL.md +3 -3
  3. package/.opencode/skills/clarify-spec/SKILL.md +2 -2
  4. package/.opencode/skills/consult/SKILL.md +1 -1
  5. package/.opencode/skills/council/SKILL.md +1 -1
  6. package/.opencode/skills/critic-gate/SKILL.md +8 -3
  7. package/.opencode/skills/discover/SKILL.md +1 -1
  8. package/.opencode/skills/execute/SKILL.md +1 -1
  9. package/.opencode/skills/gate-attribution/SKILL.md +1 -1
  10. package/.opencode/skills/issue-ingest/SKILL.md +3 -3
  11. package/.opencode/skills/phase-wrap/SKILL.md +1 -1
  12. package/.opencode/skills/plan/SKILL.md +3 -3
  13. package/.opencode/skills/pre-phase-briefing/SKILL.md +1 -1
  14. package/.opencode/skills/resume/SKILL.md +1 -1
  15. package/.opencode/skills/specify/SKILL.md +1 -1
  16. package/dist/cli/{config-doctor-b67nb84b.js → config-doctor-g71mz50j.js} +2 -2
  17. package/dist/cli/{core-4z1s2ak1.js → core-jpjk2qvt.js} +1 -1
  18. package/dist/cli/{curation-policy-kvzhfaj1.js → curation-policy-zhyttjpa.js} +6 -6
  19. package/dist/cli/{curator-nrmj8bds.js → curator-36dxw38r.js} +25 -25
  20. package/dist/cli/{curator-llm-factory-x7kvry9x.js → curator-llm-factory-k2a7cv41.js} +25 -25
  21. package/dist/cli/{evidence-summary-service-cf8sz2bq.js → evidence-summary-service-nse06dqr.js} +7 -7
  22. package/dist/cli/{gate-evidence-aenyz6vt.js → gate-evidence-kdygjr56.js} +4 -4
  23. package/dist/cli/{guardrail-explain-5kd44rcj.js → guardrail-explain-1k337z5d.js} +26 -26
  24. package/dist/cli/{guardrail-log-aksrzqdx.js → guardrail-log-xbc9bvdt.js} +3 -3
  25. package/dist/cli/{hive-promoter-cy21rhnd.js → hive-promoter-daxrn62p.js} +25 -25
  26. package/dist/cli/{index-y0xaq4f3.js → index-0vq9gnqd.js} +8 -2
  27. package/dist/cli/{index-rw3f73aq.js → index-176zwqcq.js} +2 -2
  28. package/dist/cli/{index-kwwxevne.js → index-45y0y3xh.js} +5 -5
  29. package/dist/cli/{index-7ayaq27q.js → index-68tjkaqk.js} +1 -1
  30. package/dist/cli/{index-s0rbdp61.js → index-79pgzj9a.js} +4 -4
  31. package/dist/cli/{index-45t7w06b.js → index-7t3vjw5e.js} +1 -1
  32. package/dist/cli/{index-ey29aap6.js → index-b3jfcptk.js} +1 -1
  33. package/dist/cli/{index-sr2cynyw.js → index-brtg922w.js} +108 -51
  34. package/dist/cli/{index-7a2hm51h.js → index-cze4bq1x.js} +41 -0
  35. package/dist/cli/{index-mrtms113.js → index-d2sf9an1.js} +2 -2
  36. package/dist/cli/{index-wxyxf0bd.js → index-d61h3f3h.js} +2 -2
  37. package/dist/cli/{index-ckybsn6p.js → index-g2kpqpvh.js} +27 -27
  38. package/dist/cli/{index-37v2wxqe.js → index-g5rtcb1n.js} +1 -1
  39. package/dist/cli/{index-ad6j0m7k.js → index-gj5jerzz.js} +3 -3
  40. package/dist/cli/{index-c9ddxv4k.js → index-hh34tyv7.js} +1 -1
  41. package/dist/cli/{index-21115szq.js → index-kp5h245k.js} +5 -5
  42. package/dist/cli/{index-tcn457d5.js → index-kym0cctr.js} +1 -1
  43. package/dist/cli/{index-84nz7bhe.js → index-mgbpbs1f.js} +3 -3
  44. package/dist/cli/{index-m5fw4mer.js → index-n89fdxwg.js} +1 -1
  45. package/dist/cli/{index-z1tm47nj.js → index-ne28wyyc.js} +2 -2
  46. package/dist/cli/{index-wjm896ey.js → index-nfm9f10v.js} +1 -1
  47. package/dist/cli/{index-azghvnja.js → index-pff46kfv.js} +2 -2
  48. package/dist/cli/{index-wnz282j3.js → index-rtgqy0yg.js} +2 -2
  49. package/dist/cli/{index-09b9zncg.js → index-tncy55bp.js} +1 -1
  50. package/dist/cli/{index-vg3yx648.js → index-w6j1n5az.js} +1 -1
  51. package/dist/cli/{index-0755132s.js → index-wbdxmf1a.js} +6 -6
  52. package/dist/cli/{index-1kn24ja0.js → index-zcrvn579.js} +2 -2
  53. package/dist/cli/{index-s0vahtdm.js → index-zwh5dewz.js} +1 -1
  54. package/dist/cli/{index-dzyjb33e.js → index-zzhyws9g.js} +1 -1
  55. package/dist/cli/index.js +25 -25
  56. package/dist/cli/{knowledge-escalator-ta3xjrdj.js → knowledge-escalator-h7fspgph.js} +7 -7
  57. package/dist/cli/{knowledge-events-dk6banmz.js → knowledge-events-vkf7an5n.js} +5 -5
  58. package/dist/cli/{knowledge-link-mm1w967j.js → knowledge-link-zr40rnwr.js} +4 -4
  59. package/dist/cli/{knowledge-store-h3jz10bv.js → knowledge-store-s4976v9c.js} +5 -5
  60. package/dist/cli/{knowledge-validator-jsz1dxkr.js → knowledge-validator-64ppqy4y.js} +8 -8
  61. package/dist/cli/{pending-delegations-qajsxct0.js → pending-delegations-0h5b18p7.js} +3 -3
  62. package/dist/cli/{pr-subscriptions-qhr41epq.js → pr-subscriptions-jn0h047q.js} +3 -3
  63. package/dist/cli/{runner-2v413r74.js → runner-deeswadt.js} +5 -5
  64. package/dist/cli/{scan-cursor-48gwzh9c.js → scan-cursor-xbkae12h.js} +6 -6
  65. package/dist/cli/{schema-f937b9cs.js → schema-7jm70cab.js} +1 -1
  66. package/dist/cli/{scope-persistence-h2fpgxww.js → scope-persistence-5xc9ntdh.js} +4 -4
  67. package/dist/cli/{skill-generator-4p10ktw1.js → skill-generator-8gtq1ajr.js} +9 -9
  68. package/dist/cli/{telemetry-859khp82.js → telemetry-6678gya0.js} +1 -1
  69. package/dist/cli/{worktree-collision-ownership-13btcj9g.js → worktree-collision-ownership-wt7cc850.js} +3 -3
  70. package/dist/config/schema.d.ts +10 -0
  71. package/dist/hooks/delegation-gate.d.ts +12 -1
  72. package/dist/hooks/gate-denial-tracker.d.ts +175 -0
  73. package/dist/hooks/guardrails/execution-episode.d.ts +41 -0
  74. package/dist/hooks/guardrails/execution-stall.d.ts +285 -0
  75. package/dist/hooks/guardrails/internals-guard.d.ts +117 -0
  76. package/dist/hooks/guardrails/messages-transform.d.ts +85 -0
  77. package/dist/hooks/trajectory-logger.d.ts +76 -0
  78. package/dist/index.js +476 -462
  79. package/dist/memory/schema.d.ts +3 -3
  80. package/dist/prm/index.d.ts +2 -0
  81. package/dist/state.d.ts +32 -0
  82. package/dist/telemetry.d.ts +66 -1
  83. package/dist/types/events.d.ts +14 -1
  84. package/package.json +2 -1
@@ -46,9 +46,9 @@ export declare const MemorySourceSchema: z.ZodObject<{
46
46
  type: z.ZodEnum<{
47
47
  file: "file";
48
48
  agent: "agent";
49
+ tool: "tool";
49
50
  manual: "manual";
50
51
  test: "test";
51
- tool: "tool";
52
52
  commit: "commit";
53
53
  user: "user";
54
54
  repo: "repo";
@@ -107,9 +107,9 @@ export declare const MemoryRecordSchema: z.ZodObject<{
107
107
  type: z.ZodEnum<{
108
108
  file: "file";
109
109
  agent: "agent";
110
+ tool: "tool";
110
111
  manual: "manual";
111
112
  test: "test";
112
- tool: "tool";
113
113
  commit: "commit";
114
114
  user: "user";
115
115
  repo: "repo";
@@ -195,9 +195,9 @@ export declare const MemoryProposalSchema: z.ZodObject<{
195
195
  type: z.ZodEnum<{
196
196
  file: "file";
197
197
  agent: "agent";
198
+ tool: "tool";
198
199
  manual: "manual";
199
200
  test: "test";
200
- tool: "tool";
201
201
  commit: "commit";
202
202
  user: "user";
203
203
  repo: "repo";
@@ -74,6 +74,8 @@ interface ResettablePrmSessionState {
74
74
  prmEscalationLevel?: number;
75
75
  prmLastPatternDetected?: unknown;
76
76
  prmHardStopPending?: boolean;
77
+ /** Issue #2063 C2 — twin one-shot token; reset with its deny counterpart. */
78
+ prmHardStopInjectPending?: boolean;
77
79
  prmTrajectoryStep?: number;
78
80
  prmInjectedAdvisoryKeys?: Set<string>;
79
81
  replayArtifactPath?: string | null;
package/dist/state.d.ts CHANGED
@@ -397,6 +397,22 @@ export interface AgentSessionState {
397
397
  prmTrajectoryStep: number;
398
398
  /** Whether a hard stop has been triggered */
399
399
  prmHardStopPending: boolean;
400
+ /**
401
+ * Issue #2063 C2 — second, independent one-shot token for the PRM hard stop.
402
+ *
403
+ * `prmHardStopPending` is the DENY token: guardrails `toolBefore` consumes it
404
+ * by throwing the HARD STOP denial once. `prmHardStopInjectPending` is the
405
+ * INJECT token: `messagesTransform` consumes it by prepending the
406
+ * `[HARD STOP]` block into the next completion. They are deliberately
407
+ * separate because either consumer can run first, and a single shared flag
408
+ * meant whichever ran first disarmed the other — so the escalation was either
409
+ * denied without ever being explained, or explained without ever being
410
+ * denied.
411
+ *
412
+ * Optional: ~25 existing test/session literals enumerate the required PRM
413
+ * fields, and this one is additive.
414
+ */
415
+ prmHardStopInjectPending?: boolean;
400
416
  /** Per-session escalation tracker instance (set lazily by PRM hook) */
401
417
  prmEscalationTracker?: EscalationTracker;
402
418
  /** Cross-turn set of already-injected PRM advisory dedupe keys
@@ -406,6 +422,22 @@ export interface AgentSessionState {
406
422
  * pattern's count advances escalation. Bounded by distinct (pattern, level)
407
423
  * pairs — at most (numPatterns × 3 levels). */
408
424
  prmInjectedAdvisoryKeys: Set<string>;
425
+ /**
426
+ * Issue #2063 B3/B5 — whether an "execution episode" is currently armed for
427
+ * this session.
428
+ *
429
+ * An episode arms when the session actually attempts execution work (a `Task`
430
+ * dispatch to a mutating/verifying role, or an `update_task_status(...,
431
+ * in_progress)` that succeeds) and disarms on episode lapse. Consumers read
432
+ * it through {@link isExecutionEpisodeArmed} in
433
+ * `src/hooks/guardrails/execution-episode.ts` rather than touching the field,
434
+ * so the arming policy has exactly one owner.
435
+ *
436
+ * Deliberately reset on rehydrate (see `src/session/snapshot-reader.ts`): a
437
+ * stale `in_progress` task left over from a previous session must NOT arm a
438
+ * fresh one.
439
+ */
440
+ executionEpisodeArmed?: boolean;
409
441
  /** Active PR subscriptions for the background poller, keyed by `${repoFullName}::${prNumber}` */
410
442
  prSubscriptions: Map<string, PrSubscriptionState>;
411
443
  /**
@@ -1,5 +1,31 @@
1
1
  import type { DelegationCostFields } from './services/cost-accounting.js';
2
- export type TelemetryEvent = 'session_started' | 'session_ended' | 'agent_activated' | 'delegation_begin' | 'delegation_end' | 'task_state_changed' | 'gate_passed' | 'gate_failed' | 'gate_parse_error' | 'reviewer_gate_decision' | 'phase_changed' | 'budget_updated' | 'model_fallback' | 'hard_limit_hit' | 'revision_limit_hit' | 'loop_detected' | 'scope_violation' | 'qa_skip_violation' | 'heartbeat' | 'turbo_mode_changed' | 'auto_oversight_escalation' | 'environment_detected' | 'evidence_lock_acquired' | 'evidence_lock_contended' | 'evidence_lock_stale_recovered' | 'plan_ledger_cas_retry' | 'plan_md_write_failed' | 'snapshot_failed' | 'prm_pattern_detected' | 'prm_course_correction_injected' | 'prm_escalation_triggered' | 'prm_hard_stop';
2
+ export type TelemetryEvent = 'session_started' | 'session_ended' | 'agent_activated' | 'delegation_begin' | 'delegation_end' | 'task_state_changed' | 'gate_passed' | 'gate_failed' | 'gate_parse_error' | 'reviewer_gate_decision' | 'phase_changed' | 'budget_updated' | 'model_fallback' | 'hard_limit_hit' | 'revision_limit_hit' | 'loop_detected' | 'no_op_strong_warning' | 'scope_violation' | 'qa_skip_violation' | 'heartbeat' | 'turbo_mode_changed' | 'auto_oversight_escalation' | 'environment_detected' | 'evidence_lock_acquired' | 'evidence_lock_contended' | 'evidence_lock_stale_recovered' | 'plan_ledger_cas_retry' | 'plan_md_write_failed' | 'snapshot_failed' | 'gate_denial_loop'
3
+ /**
4
+ * Issue #2063 B5 — an ARMED execution episode reached the advisory rung:
5
+ * `execution_stall_warn_calls` tool calls with no delegation completion, no
6
+ * file write, no `update_task_status`, and no workspace change. Emitted once
7
+ * per non-progress streak.
8
+ */
9
+ | 'execution_stall_warning'
10
+ /**
11
+ * Issue #2063 B5 — the same episode reached `execution_stall_stop_calls` and
12
+ * a non-productive tool (read/glob/grep/bash/shell) was hard-denied. Emitted
13
+ * once per non-progress streak; the denial itself repeats until a progress
14
+ * event clears the rung.
15
+ */
16
+ | 'execution_stall_denied'
17
+ /**
18
+ * Issue #2063 B4 — a read/glob/grep/bash call resolved to a path inside the
19
+ * INSTALLED opencode-swarm package and was denied. `target` is relative to
20
+ * the package root so no user home path is written to the ledger.
21
+ */
22
+ | 'swarm_internals_read_denied' | 'prm_pattern_detected' | 'prm_course_correction_injected' | 'prm_escalation_triggered' | 'prm_hard_stop'
23
+ /**
24
+ * Issue #2063 C2 — DELIVERY of a PRM hard stop, as distinct from the
25
+ * `prm_hard_stop` TRIGGER emitted by `src/prm/escalation.ts`. A trigger with
26
+ * no matching delivery means the containment never reached the agent.
27
+ */
28
+ | 'prm_hard_stop_delivered';
3
29
  /** Stable classification for how a reviewer-gate decision was established. */
4
30
  export type ReviewerGateEvidenceKind = 'genuine' | 'fallback' | 'data_quality' | 'block';
5
31
  /**
@@ -68,6 +94,37 @@ export declare const telemetry: {
68
94
  hardLimitHit(sessionId: string, agentName: string, limitType: string, value: number): void;
69
95
  revisionLimitHit(sessionId: string, agentName: string): void;
70
96
  loopDetected(sessionId: string, agentName: string, loopType: string): void;
97
+ /**
98
+ * Issue #2063 B2 — stage 2 of the no-op ladder fired: the session has made
99
+ * `count` consecutive tool calls with no file write and no subagent dispatch,
100
+ * at or beyond 2× `no_op_warning_threshold`.
101
+ */
102
+ noOpStrongWarning(sessionId: string, agentName: string, count: number, threshold: number): void;
103
+ /**
104
+ * Issue #2063 B1 — a fail-closed `tool.execute.before` denial streak reached
105
+ * the hard rung: `count` consecutive denials with the same classification
106
+ * (`code`) for the same tool in the same session. Emitted from
107
+ * `src/hooks/gate-denial-tracker.ts` at every denial at or past the rung, so
108
+ * the ledger shows how long the model kept retrying after being told to stop.
109
+ */
110
+ gateDenialLoop(sessionId: string, tool: string, code: string, count: number): void;
111
+ /**
112
+ * Issue #2063 B5 — advisory rung of the execution-stall ladder. Emitted from
113
+ * `src/hooks/guardrails/execution-stall.ts` once per non-progress streak, so
114
+ * a warning with no matching `execution_stall_denied` means the agent
115
+ * recovered on its own.
116
+ */
117
+ executionStallWarning(sessionId: string, count: number, threshold: number): void;
118
+ /**
119
+ * Issue #2063 B5 — hard rung of the execution-stall ladder. `tool` is the
120
+ * normalized name of the denied non-productive tool.
121
+ */
122
+ executionStallDenied(sessionId: string, tool: string, count: number, threshold: number): void;
123
+ /**
124
+ * Issue #2063 B4 — a call targeting the installed plugin package was denied.
125
+ * `target` is package-root-relative (never an absolute user path).
126
+ */
127
+ swarmInternalsReadDenied(sessionId: string, tool: string, target: string): void;
71
128
  scopeViolation(sessionId: string, agentName: string, file: string, reason: string): void;
72
129
  qaSkipViolation(sessionId: string, agentName: string, skipCount: number): void;
73
130
  heartbeat(sessionId: string): void;
@@ -78,6 +135,14 @@ export declare const telemetry: {
78
135
  prmCourseCorrectionInjected(sessionId: string, pattern: string, level: number): void;
79
136
  prmEscalationTriggered(sessionId: string, pattern: string, level: number, occurrenceCount: number): void;
80
137
  prmHardStop(sessionId: string, pattern: string, level: number, occurrenceCount: number): void;
138
+ /**
139
+ * Issue #2063 C2 — the PRM hard-stop DENIAL was actually delivered to the
140
+ * agent (thrown by the guardrails `toolBefore` consumer). `prm_hard_stop`
141
+ * above records the TRIGGER and is emitted solely by
142
+ * `src/prm/escalation.ts`; a trigger without a matching delivery means the
143
+ * containment armed but never reached the model.
144
+ */
145
+ prmHardStopDelivered(sessionId: string, pattern: string, level: number, occurrenceCount: number): void;
81
146
  };
82
147
  /**
83
148
  * Test-only dependency-injection seam. Production code calls
@@ -142,4 +142,17 @@ export interface PrmHardStopEvent {
142
142
  level: number;
143
143
  occurrenceCount: number;
144
144
  }
145
- export type V619Event = SoundingBoardConsultedEvent | ArchitectLoopDetectedEvent | PrecedentManipulationDetectedEvent | CoderSelfAuditEvent | CoderRetryCircuitBreakerEvent | AgentConflictDetectedEvent | AuthorityHandoffResolvedEvent | SpecStaleDetectedEvent | SpecDriftAcknowledgedEvent | TaskRemovedEvent | PrmPatternDetectedEvent | PrmCourseCorrectionInjectedEvent | PrmEscalationTriggeredEvent | PrmHardStopEvent;
145
+ /**
146
+ * Issue #2063 C2 — the hard stop was DELIVERED (denial thrown at the agent),
147
+ * as opposed to {@link PrmHardStopEvent} which records that it was TRIGGERED.
148
+ * The pair makes "armed but never reached the model" observable.
149
+ */
150
+ export interface PrmHardStopDeliveredEvent {
151
+ type: 'prm_hard_stop_delivered';
152
+ timestamp: string;
153
+ sessionId: string;
154
+ pattern: string;
155
+ level: number;
156
+ occurrenceCount: number;
157
+ }
158
+ export type V619Event = SoundingBoardConsultedEvent | ArchitectLoopDetectedEvent | PrecedentManipulationDetectedEvent | CoderSelfAuditEvent | CoderRetryCircuitBreakerEvent | AgentConflictDetectedEvent | AuthorityHandoffResolvedEvent | SpecStaleDetectedEvent | SpecDriftAcknowledgedEvent | TaskRemovedEvent | PrmPatternDetectedEvent | PrmCourseCorrectionInjectedEvent | PrmEscalationTriggeredEvent | PrmHardStopEvent | PrmHardStopDeliveredEvent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.136.2",
3
+ "version": "7.136.3",
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",
@@ -94,6 +94,7 @@
94
94
  "lint:ci": "biome ci .",
95
95
  "test:unit:ci": "bun scripts/ci/run-unit-tests-local.ts",
96
96
  "drift:check": "bun run scripts/drift-check.ts",
97
+ "check:runtime-src-refs": "bun run scripts/check-runtime-src-refs.ts",
97
98
  "drift:fix": "bun run scripts/drift-check.ts --fix --confirm",
98
99
  "skills:sync": "bun run scripts/sync-qa-gate-skills.ts",
99
100
  "format": "biome format . --write",