opencode-swarm 7.116.1 → 7.118.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 (50) hide show
  1. package/dist/cli/{config-doctor-htzxe394.js → config-doctor-p73yfdz0.js} +2 -2
  2. package/dist/cli/{curator-yxmtp8py.js → curator-920swpnk.js} +10 -10
  3. package/dist/cli/{curator-llm-factory-9qn52fnv.js → curator-llm-factory-kqt1f4sw.js} +10 -10
  4. package/dist/cli/{guardrail-explain-xvyz2eag.js → guardrail-explain-bycz51b0.js} +11 -11
  5. package/dist/cli/{guardrail-log-dzbqcgz9.js → guardrail-log-qjqgg7pz.js} +3 -3
  6. package/dist/cli/{hive-promoter-ykqc60w1.js → hive-promoter-w9pgfs6w.js} +15 -10
  7. package/dist/cli/{index-m7hc7nn7.js → index-11q1t6g0.js} +1 -1
  8. package/dist/cli/{index-7kcpkm4y.js → index-34tsqvqb.js} +2527 -1354
  9. package/dist/cli/{index-efdyjgeh.js → index-470tykwx.js} +2 -2
  10. package/dist/cli/{index-g4p13g8t.js → index-5hze8ztj.js} +12 -22
  11. package/dist/cli/{index-m43zgtjn.js → index-bcg89pt8.js} +1 -1
  12. package/dist/cli/{index-8j5d3ytd.js → index-g2wrs7jy.js} +1 -1
  13. package/dist/cli/{index-wegc6xwr.js → index-jbdgpqpj.js} +3 -3
  14. package/dist/cli/{index-p9jf8gt8.js → index-k83hebh1.js} +12 -12
  15. package/dist/cli/{index-nvc0nsvg.js → index-pdk1n8yh.js} +2 -0
  16. package/dist/cli/{index-t5f01hnz.js → index-pjhfe7c3.js} +2 -2
  17. package/dist/cli/{index-5h7d37nf.js → index-qx5z58a7.js} +19 -31
  18. package/dist/cli/{index-wxkf3089.js → index-sb9x6xjj.js} +3 -3
  19. package/dist/cli/{index-34g1mv3c.js → index-wpgv6hht.js} +52 -6
  20. package/dist/cli/index.js +10 -10
  21. package/dist/cli/{knowledge-escalator-tthw6c9q.js → knowledge-escalator-gt1q632m.js} +4 -4
  22. package/dist/cli/{knowledge-events-hrbmwxxj.js → knowledge-events-0bjdtdsb.js} +2 -2
  23. package/dist/cli/{knowledge-store-5cns5sns.js → knowledge-store-fm2300xf.js} +7 -2
  24. package/dist/cli/{knowledge-validator-xre0s774.js → knowledge-validator-91kx3eqv.js} +3 -3
  25. package/dist/cli/{schema-bqn7g3ez.js → schema-7c484wjz.js} +1 -1
  26. package/dist/cli/{skill-generator-22nk6c6a.js → skill-generator-t47xyfps.js} +5 -5
  27. package/dist/commands/link.d.ts +7 -4
  28. package/dist/commands/promote.d.ts +3 -0
  29. package/dist/commands/registry.d.ts +2 -2
  30. package/dist/commands/unlink.d.ts +12 -5
  31. package/dist/config/schema.d.ts +8 -4
  32. package/dist/hooks/curator-postmortem.d.ts +1 -1
  33. package/dist/hooks/hive-policy.d.ts +81 -0
  34. package/dist/hooks/hive-promoter.d.ts +147 -28
  35. package/dist/hooks/hive-transaction.d.ts +113 -0
  36. package/dist/hooks/knowledge-events.d.ts +4 -1
  37. package/dist/hooks/knowledge-link.d.ts +31 -4
  38. package/dist/hooks/knowledge-store.d.ts +6 -5
  39. package/dist/hooks/knowledge-types.d.ts +87 -0
  40. package/dist/index.js +343 -325
  41. package/dist/knowledge/cohort-identity.d.ts +103 -0
  42. package/dist/knowledge/config-fingerprint.d.ts +57 -0
  43. package/dist/knowledge/family-manifest.d.ts +50 -0
  44. package/dist/knowledge/family-migration.d.ts +109 -0
  45. package/dist/knowledge/hive-paths.d.ts +51 -0
  46. package/dist/knowledge/identity.d.ts +12 -2
  47. package/dist/knowledge/index.d.ts +1 -0
  48. package/dist/services/knowledge-diagnostics.d.ts +45 -0
  49. package/dist/services/status-service.d.ts +13 -0
  50. package/package.json +1 -1
@@ -7,6 +7,15 @@ export interface PhaseConfirmationRecord {
7
7
  }
8
8
  export interface ProjectConfirmationRecord {
9
9
  project_name: string;
10
+ /**
11
+ * Canonical cohort id (issue #1847) — the identity used for cross-project
12
+ * distinctness, from `resolveCohortId` (#1846). Sibling worktrees and remote
13
+ * aliases of one repository share one `cohort_id`, so they count as a single
14
+ * project. Absent on legacy records written before #1847; such records are
15
+ * counted by `project_name` as a degraded fallback and are NEVER synthetically
16
+ * credited with a cohort id.
17
+ */
18
+ cohort_id?: string;
10
19
  confirmed_at: string;
11
20
  phase_number?: number;
12
21
  }
@@ -205,6 +214,69 @@ export interface SwarmKnowledgeEntry extends KnowledgeEntryBase {
205
214
  confirmed_by: PhaseConfirmationRecord[];
206
215
  project_name: string;
207
216
  }
217
+ /**
218
+ * A single validated terminal application of a knowledge entry, usable as
219
+ * promotion evidence (issue #1847). Only receipts tied to a real retrieval
220
+ * trace AND a terminal outcome (`applied` / `violated` / `contradicted`) that
221
+ * is a member of that trace's result set qualify. Shown / retrieved / injected
222
+ * / acknowledged-only states do NOT qualify — they are display/attention
223
+ * signals, not application evidence.
224
+ *
225
+ * Production of real host traces is owned by #1849; this PR (#1847) owns the
226
+ * schema and the conservative promotion-side consumer. Legacy records carry no
227
+ * `PromotionEvidenceRecord`s and receive NO synthetic credit.
228
+ */
229
+ export interface PromotionEvidenceRecord {
230
+ /** Canonical repository/cohort identity (from `resolveCohortId`, #1846). */
231
+ cohort_id: string;
232
+ /** Source cohort / link id when known (from the v2 LinkPointer). */
233
+ source_link_id?: string;
234
+ /** The hive/swarm entry id this evidence contributes to. */
235
+ entry_id: string;
236
+ /** Retrieval trace id that surfaced the entry (ties to a RetrievedEvent). */
237
+ retrieval_trace_id: string;
238
+ /** Terminal receipt outcome. */
239
+ receipt_outcome: 'applied' | 'violated' | 'contradicted';
240
+ /** Id of the ReceiptEvent this evidence was derived from. */
241
+ receipt_event_id: string;
242
+ phase?: string;
243
+ timestamp: string;
244
+ }
245
+ /** How a hive entry was promoted (issue #1847 §3 lineage). */
246
+ export type PromotionActor = 'auto' | 'manual' | 'manual-override';
247
+ /**
248
+ * Lineage + validated-evidence block attached to a promoted hive entry (issue
249
+ * #1847 §3). A promoted hive record must retain enough provenance to audit
250
+ * redaction/ownership and to trace back to its source without storing
251
+ * unnecessary sensitive content.
252
+ *
253
+ * All fields optional except `actor` so legacy on-disk records (which predate
254
+ * this block) load unchanged. Legacy records are NOT retroactively given a
255
+ * synthetic lineage block (no broad rewrite); consumers treat an absent
256
+ * `lineage` as "origin unknown, pre-#1847".
257
+ */
258
+ export interface PromotionLineage {
259
+ /** UUID of the source swarm entry this hive record was promoted from. */
260
+ source_entry_id?: string;
261
+ /** Canonical cohort id of the source repository (#1846). */
262
+ source_cohort_id?: string;
263
+ /** Source entry content hash/revision (for drift detection). */
264
+ source_revision?: string;
265
+ /** Prior phase/confidence snapshot captured at promotion time. */
266
+ prior_confidence?: number;
267
+ prior_phases_alive?: number;
268
+ /** Ids of {@link PromotionEvidenceRecord}s that contributed to this promotion. */
269
+ contributing_evidence_ids?: string[];
270
+ /** For merged near-duplicates: losing entry ids preserved for audit. */
271
+ merged_from?: string[];
272
+ /** The promotion transaction/event id (ties to the hive audit-event log). */
273
+ promotion_event_id?: string;
274
+ /** Who/what initiated the promotion. */
275
+ actor: PromotionActor;
276
+ reason?: string;
277
+ /** When an override was used: the policy gates that failed. */
278
+ override_failed_gates?: string[];
279
+ }
208
280
  export interface HiveKnowledgeEntry extends KnowledgeEntryBase {
209
281
  tier: 'hive';
210
282
  confirmed_by: ProjectConfirmationRecord[];
@@ -213,6 +285,9 @@ export interface HiveKnowledgeEntry extends KnowledgeEntryBase {
213
285
  encounter_score: number;
214
286
  /** @deprecated Legacy field for backward compatibility. Use encounter_score for weighting. */
215
287
  encounter_count?: number;
288
+ /** #1847: promotion lineage + validated-evidence references. Optional so
289
+ * legacy on-disk records load unchanged; normalized in-memory on read. */
290
+ lineage?: PromotionLineage;
216
291
  }
217
292
  export interface RejectedLesson {
218
293
  id: string;
@@ -298,6 +373,18 @@ export interface KnowledgeConfig {
298
373
  * demotion counter increments for the current phase. Default: -0.3 (matches
299
374
  * `OUTCOME_BLOCK_THRESHOLD`). */
300
375
  promoted_demotion_signal_threshold: number;
376
+ /** #1847: minimum number of validated terminal-application receipts
377
+ * (PromotionEvidenceRecord) required for the `validated_terminal_applications`
378
+ * promotion gate. Default 0 — conservative: until #1849 produces real
379
+ * receipts, absence of evidence neither credits nor blocks. Raising this
380
+ * activates application-evidence gating. Legacy records get NO synthetic
381
+ * credit; they simply do not add to the count. */
382
+ promotion_min_terminal_applications: number;
383
+ /** #1847: minimum number of DISTINCT canonical cohort ids that must appear
384
+ * among the validated terminal-application receipts for the
385
+ * `validated_terminal_applications` gate. Default 0 (conservative; see
386
+ * `promotion_min_terminal_applications`). */
387
+ promotion_min_distinct_cohorts: number;
301
388
  /** Change 5: retrieval-upgrade tuning (MMR / cold-start / synonyms). */
302
389
  retrieval?: {
303
390
  mmr_lambda?: number;