opencode-swarm 7.137.2 → 7.137.4
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.
- package/.opencode/skills/test-file-split/SKILL.md +2 -2
- package/.opencode/skills/writing-tests/SKILL.md +15 -1
- package/dist/cli/{config-doctor-xrbzq4r0.js → config-doctor-5qymy0bp.js} +2 -2
- package/dist/cli/{core-6w5sd5bc.js → core-v6bte964.js} +1 -1
- package/dist/cli/{curation-policy-xyradeax.js → curation-policy-788qbgwk.js} +6 -6
- package/dist/cli/{curator-h1ea9skz.js → curator-0zebvv5q.js} +25 -25
- package/dist/cli/{curator-llm-factory-rk7pccwc.js → curator-llm-factory-6w7hpfb0.js} +25 -25
- package/dist/cli/{evidence-summary-service-85gw9p2m.js → evidence-summary-service-1azhyeft.js} +7 -7
- package/dist/cli/{gate-evidence-s2kytsrj.js → gate-evidence-ecx4djaw.js} +4 -4
- package/dist/cli/{guardrail-explain-sq1kcah3.js → guardrail-explain-k1a7mwq9.js} +26 -26
- package/dist/cli/{guardrail-log-7anp1z1n.js → guardrail-log-wqsg11xd.js} +3 -3
- package/dist/cli/{hive-promoter-qsymj94z.js → hive-promoter-kxcm4n0n.js} +25 -25
- package/dist/cli/{index-s9at02fn.js → index-01dpavd4.js} +2 -2
- package/dist/cli/{index-h5sbn1zr.js → index-10mz5js6.js} +75 -34
- package/dist/cli/{index-pwx989sa.js → index-2qr7twf5.js} +3 -3
- package/dist/cli/{index-gv00q5gc.js → index-2y4jy0de.js} +1 -1
- package/dist/cli/{index-5r6kkhd7.js → index-39k6y018.js} +2 -2
- package/dist/cli/{index-s3j9fsab.js → index-4fmztnrq.js} +2 -2
- package/dist/cli/{index-9casmxdt.js → index-b2khb7xx.js} +6 -6
- package/dist/cli/{index-02jqxmh8.js → index-b9pgq0fk.js} +5 -5
- package/dist/cli/{index-4t39wzzg.js → index-bma4nwts.js} +3 -3
- package/dist/cli/{index-877ah4kx.js → index-c2v79596.js} +1 -1
- package/dist/cli/{index-ysh3a2nb.js → index-csneb2ph.js} +2 -2
- package/dist/cli/{index-vft1pg34.js → index-en4fb04r.js} +1 -1
- package/dist/cli/{index-kakb2jm0.js → index-eq564d4t.js} +2 -2
- package/dist/cli/{index-jdqayy7h.js → index-fetnv58w.js} +4 -4
- package/dist/cli/{index-1zrb3vt2.js → index-fmh15wxb.js} +5 -5
- package/dist/cli/{index-1da1tvtn.js → index-h353c1xz.js} +1 -1
- package/dist/cli/{index-dxatvs3f.js → index-j0xx9wpj.js} +1 -1
- package/dist/cli/{index-aygnzd04.js → index-m09k3dpz.js} +1 -1
- package/dist/cli/{index-5k0csd2m.js → index-mrwr3kac.js} +2 -2
- package/dist/cli/{index-5wjw05dy.js → index-ngqxzkqm.js} +2 -2
- package/dist/cli/{index-d735dzm7.js → index-nnf41ca1.js} +1409 -1112
- package/dist/cli/{index-gey6qegb.js → index-p9shqpbc.js} +1 -1
- package/dist/cli/{index-vyh2prxv.js → index-pzkn7d2k.js} +4 -2
- package/dist/cli/{index-rfrkt29c.js → index-q9eqty52.js} +1 -1
- package/dist/cli/{index-p0kez6cn.js → index-rdg1tkz4.js} +27 -27
- package/dist/cli/{index-b2s3t517.js → index-rrxcfxrd.js} +1 -1
- package/dist/cli/{index-n3h6rmbe.js → index-tqshdzaw.js} +1 -1
- package/dist/cli/{index-8ehyt3rx.js → index-xybtaph7.js} +1 -1
- package/dist/cli/{index-qy3rgmkc.js → index-z7jgvm9b.js} +1 -1
- package/dist/cli/index.js +25 -25
- package/dist/cli/{knowledge-escalator-e9zk371p.js → knowledge-escalator-dna6s7qy.js} +7 -7
- package/dist/cli/{knowledge-events-dnyc1k78.js → knowledge-events-shy8wgb3.js} +5 -5
- package/dist/cli/{knowledge-link-t94b79qe.js → knowledge-link-xc6yhxmz.js} +4 -4
- package/dist/cli/{knowledge-store-x4vqyhbz.js → knowledge-store-j7xtx4dd.js} +5 -5
- package/dist/cli/{knowledge-validator-72jdx5ze.js → knowledge-validator-zfweje73.js} +8 -8
- package/dist/cli/{pending-delegations-kshh66s2.js → pending-delegations-gee019ec.js} +3 -3
- package/dist/cli/{pr-subscriptions-5fpzz4f3.js → pr-subscriptions-m943zn6g.js} +3 -3
- package/dist/cli/{runner-9rqc8y3m.js → runner-x1hy047y.js} +5 -5
- package/dist/cli/{scan-cursor-z4xpes5f.js → scan-cursor-fessrenj.js} +6 -6
- package/dist/cli/{schema-2dkw18zz.js → schema-36b6sv6b.js} +1 -1
- package/dist/cli/{scope-persistence-sjz200dt.js → scope-persistence-n1bryhzf.js} +4 -4
- package/dist/cli/{skill-generator-0q1jk6xd.js → skill-generator-0ghcwxeb.js} +9 -9
- package/dist/cli/{telemetry-h7h7f0ez.js → telemetry-0yqed3jv.js} +3 -1
- package/dist/cli/{worktree-collision-ownership-xzwab4xt.js → worktree-collision-ownership-y1c7yx14.js} +3 -3
- package/dist/commands/archive-sqlite.d.ts +106 -0
- package/dist/commands/close.d.ts +33 -11
- package/dist/context/role-filter.d.ts +21 -2
- package/dist/db/project-db.d.ts +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +322 -322
- package/dist/observability/catalog.d.ts +8 -9
- package/dist/telemetry.d.ts +58 -3
- package/package.json +4 -2
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The event catalog (issue #2029).
|
|
3
3
|
*
|
|
4
|
-
* Exactly
|
|
5
|
-
* `src/telemetry.ts:15-
|
|
6
|
-
* `agent_conflict_detected
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* exists to close: an event kind can enter the stream with no registration.
|
|
4
|
+
* Exactly 40 entries, matching the `TelemetryEvent` union at
|
|
5
|
+
* `src/telemetry.ts:15-91`. Thirty-eight predate the #2029 contract; the 39th is
|
|
6
|
+
* `agent_conflict_detected` (previously emitted through a force-cast past the
|
|
7
|
+
* type system), and the 40th is `close_archive_result` (issue #2030 — the
|
|
8
|
+
* structured close/archive result event). Both late additions are instances of
|
|
9
|
+
* the defect class this contract exists to close: an event kind entering the
|
|
10
|
+
* stream with no registration.
|
|
12
11
|
*
|
|
13
12
|
* Every entry names a real producer `file:line`, a retention owner issue at or
|
|
14
13
|
* above #2030 — every entry today cites the #2030-#2051 programme, but only the
|
|
@@ -61,7 +60,7 @@ export interface CatalogEntry {
|
|
|
61
60
|
/**
|
|
62
61
|
* Whether an event of this kind must carry `trace.parentSpanId`.
|
|
63
62
|
*
|
|
64
|
-
* `false` for all
|
|
63
|
+
* `false` for all 40 entries today, and that is a truthful statement about
|
|
65
64
|
* the current system rather than a placeholder: no producer supplies a
|
|
66
65
|
* parent span, so `createObservation` never sets one. Setting this to `true`
|
|
67
66
|
* for a kind whose producer cannot supply a parent would make every
|
package/dist/telemetry.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ export type TelemetryEvent = 'session_started' | 'session_ended' | 'agent_activa
|
|
|
17
17
|
| 'execution_stall_denied'
|
|
18
18
|
/**
|
|
19
19
|
* Issue #2063 B4 — a read/glob/grep/bash call resolved to a path inside the
|
|
20
|
-
* INSTALLED opencode-swarm package and was denied. `target` is relative to
|
|
21
|
-
*
|
|
20
|
+
* INSTALLED opencode-swarm package and was denied. `target` is relative to the
|
|
21
|
+
* package root so no user home path is written to the ledger.
|
|
22
22
|
*/
|
|
23
23
|
| 'swarm_internals_read_denied' | 'prm_pattern_detected' | 'prm_course_correction_injected' | 'prm_escalation_triggered' | 'prm_hard_stop'
|
|
24
24
|
/**
|
|
@@ -26,7 +26,7 @@ export type TelemetryEvent = 'session_started' | 'session_ended' | 'agent_activa
|
|
|
26
26
|
* `prm_hard_stop` TRIGGER emitted by `src/prm/escalation.ts`. A trigger with
|
|
27
27
|
* no matching delivery means the containment never reached the agent.
|
|
28
28
|
*/
|
|
29
|
-
| 'prm_hard_stop_delivered' | 'agent_conflict_detected';
|
|
29
|
+
| 'prm_hard_stop_delivered' | 'agent_conflict_detected' | 'close_archive_result';
|
|
30
30
|
/** Stable classification for how a reviewer-gate decision was established. */
|
|
31
31
|
export type ReviewerGateEvidenceKind = 'genuine' | 'fallback' | 'data_quality' | 'block';
|
|
32
32
|
/**
|
|
@@ -78,6 +78,31 @@ export declare function addTelemetryListener(callback: TelemetryListener): void;
|
|
|
78
78
|
* @param maxBytes - Size threshold in bytes (default: 10MB)
|
|
79
79
|
*/
|
|
80
80
|
export declare function rotateTelemetryIfNeeded(maxBytes?: number): void;
|
|
81
|
+
/**
|
|
82
|
+
* Flush any buffered telemetry records to disk and reopen the append stream.
|
|
83
|
+
*
|
|
84
|
+
* Why this exists (issue #2030 item 8): `/swarm close` archives
|
|
85
|
+
* `telemetry.jsonl` via `fs.copyFile`, but the writer holds an open buffered
|
|
86
|
+
* `WriteStream` whose in-memory buffer is not reflected in the on-disk file
|
|
87
|
+
* until the OS accepts the bytes. Archiving without flushing silently loses the
|
|
88
|
+
* tail records of the session.
|
|
89
|
+
*
|
|
90
|
+
* Ordering (race fix, swarm-pr-review F-003): the replacement stream is created
|
|
91
|
+
* and assigned to `_writeStream` BEFORE `end()` is called on the old handle, so
|
|
92
|
+
* a concurrent `emit()` that races across the await lands on the live stream.
|
|
93
|
+
* The old handle's write callback would otherwise fire
|
|
94
|
+
* `ERR_STREAM_WRITE_AFTER_END`, latch `_disabled = true`, and kill telemetry for
|
|
95
|
+
* every subsequent session until restart (server-scoped plugin process). This
|
|
96
|
+
* mirrors the already-safe `rotateTelemetryIfNeeded` ordering.
|
|
97
|
+
*
|
|
98
|
+
* `WriteStream.end(cb)` invokes `cb` on the `'finish'` event — AFTER the buffer
|
|
99
|
+
* has been drained to the OS — so awaiting that callback is the documented way
|
|
100
|
+
* to guarantee the on-disk file contains every emitted record up to this point.
|
|
101
|
+
*
|
|
102
|
+
* Fail-open: any error during reopen disables telemetry rather than throwing —
|
|
103
|
+
* a flush failure must never block the close pipeline.
|
|
104
|
+
*/
|
|
105
|
+
export declare function flushAndDrainTelemetry(): Promise<void>;
|
|
81
106
|
export declare const telemetry: {
|
|
82
107
|
sessionStarted(sessionId: string, agentName: string): void;
|
|
83
108
|
sessionEnded(sessionId: string, reason: string): void;
|
|
@@ -136,6 +161,35 @@ export declare const telemetry: {
|
|
|
136
161
|
prmCourseCorrectionInjected(sessionId: string, pattern: string, level: number): void;
|
|
137
162
|
prmEscalationTriggered(sessionId: string, pattern: string, level: number, occurrenceCount: number): void;
|
|
138
163
|
prmHardStop(sessionId: string, pattern: string, level: number, occurrenceCount: number): void;
|
|
164
|
+
/**
|
|
165
|
+
* Close/archive structured result (issue #2030). This single event is the
|
|
166
|
+
* shared source of truth for both the user-facing close summary prose and
|
|
167
|
+
* the telemetry stream, so the two cannot disagree. Carries per-artifact
|
|
168
|
+
* structured fields plus aggregate `archive_valid`/`archive_empty` health
|
|
169
|
+
* facts. Row counts are counts ONLY — no row content is ever emitted (issue
|
|
170
|
+
* item 4/9), enabling PR 16 to alarm and PR 20 to report without leaking
|
|
171
|
+
* data.
|
|
172
|
+
*/
|
|
173
|
+
closeArchiveResult(data: {
|
|
174
|
+
archive_valid: boolean;
|
|
175
|
+
archive_empty: boolean;
|
|
176
|
+
file_count: number;
|
|
177
|
+
bundle: string;
|
|
178
|
+
artifacts: Array<{
|
|
179
|
+
artifact: string;
|
|
180
|
+
requiredness: string;
|
|
181
|
+
attempt: string;
|
|
182
|
+
validation: string;
|
|
183
|
+
source_disposition: string;
|
|
184
|
+
method: string;
|
|
185
|
+
reason_code: string;
|
|
186
|
+
row_counts?: {
|
|
187
|
+
schema_migrations_max_version: number | null;
|
|
188
|
+
project_constraints: number;
|
|
189
|
+
qa_gate_profile: number;
|
|
190
|
+
};
|
|
191
|
+
}>;
|
|
192
|
+
}): void;
|
|
139
193
|
/**
|
|
140
194
|
* Issue #2063 C2 — the PRM hard-stop DENIAL was actually delivered to the
|
|
141
195
|
* agent (thrown by the guardrails `toolBefore` consumer). `prm_hard_stop`
|
|
@@ -157,6 +211,7 @@ export declare const _internals: {
|
|
|
157
211
|
telemetry: typeof telemetry;
|
|
158
212
|
emit: typeof emit;
|
|
159
213
|
rotateTelemetryIfNeeded: typeof rotateTelemetryIfNeeded;
|
|
214
|
+
flushAndDrainTelemetry: typeof flushAndDrainTelemetry;
|
|
160
215
|
heartbeatListenerCount: () => number;
|
|
161
216
|
createObservation: typeof createObservation;
|
|
162
217
|
toLegacyTelemetryLine: typeof toLegacyTelemetryLine;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.137.
|
|
3
|
+
"version": "7.137.4",
|
|
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",
|
|
@@ -105,7 +105,9 @@
|
|
|
105
105
|
"repro:704": "node scripts/repro-704.mjs",
|
|
106
106
|
"repro:1144": "bun scripts/repro-1144.mjs",
|
|
107
107
|
"repro:1873": "bun build scripts/repro-1873-entry.ts --outdir dist-build-test/repro-1873 --target node --format esm && node scripts/repro-1873.mjs",
|
|
108
|
-
"check:events": "bun run scripts/check-event-contract.ts"
|
|
108
|
+
"check:events": "bun run scripts/check-event-contract.ts",
|
|
109
|
+
"check:test-file-cap": "bun run scripts/check-test-file-cap.ts",
|
|
110
|
+
"check:gate-portability": "bun run scripts/check-gate-portability.ts"
|
|
109
111
|
},
|
|
110
112
|
"dependencies": {
|
|
111
113
|
"@opencode-ai/plugin": "^1.18.3",
|