opencode-swarm 7.112.0 → 7.112.2

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 (24) hide show
  1. package/dist/cli/{curator-llm-factory-8rnk2083.js → curator-llm-factory-5bns4xy6.js} +6 -6
  2. package/dist/cli/{curator-j7ty8k6t.js → curator-snvp9542.js} +6 -6
  3. package/dist/cli/{guardrail-explain-2j0gw8f0.js → guardrail-explain-4s7djf9p.js} +7 -7
  4. package/dist/cli/{hive-promoter-y179n7wx.js → hive-promoter-zs295trk.js} +6 -6
  5. package/dist/cli/{index-hg0pamsa.js → index-30ejh1tx.js} +1 -1
  6. package/dist/cli/{index-t7efm8vz.js → index-32bx4kch.js} +68 -3
  7. package/dist/cli/{index-b83y9a7r.js → index-82v0d72f.js} +3 -3
  8. package/dist/cli/{index-x4bghdyv.js → index-9fjpecax.js} +1 -1
  9. package/dist/cli/{index-cye4g7zj.js → index-hpp2r0sd.js} +1 -1
  10. package/dist/cli/{index-c3h3d8kh.js → index-k6wd3chp.js} +7 -7
  11. package/dist/cli/{index-j5c98bd9.js → index-snmfqhez.js} +18 -50
  12. package/dist/cli/{index-2aqs6daa.js → index-t6wfwdm1.js} +3 -3
  13. package/dist/cli/index.js +6 -6
  14. package/dist/cli/{knowledge-escalator-t1e2211j.js → knowledge-escalator-4gbz527n.js} +3 -3
  15. package/dist/cli/{knowledge-events-2h3gvtfa.js → knowledge-events-b6x28fgc.js} +1 -1
  16. package/dist/cli/{knowledge-store-gpta9gzh.js → knowledge-store-h3cjx4dg.js} +6 -2
  17. package/dist/cli/{knowledge-validator-03f0hm0p.js → knowledge-validator-q6jw2p0t.js} +2 -2
  18. package/dist/cli/{skill-generator-2tsqqaa2.js → skill-generator-fe6q8xgm.js} +4 -4
  19. package/dist/hooks/knowledge-events.d.ts +21 -1
  20. package/dist/hooks/knowledge-injector.d.ts +4 -0
  21. package/dist/hooks/knowledge-reader.d.ts +16 -0
  22. package/dist/hooks/knowledge-store.d.ts +23 -0
  23. package/dist/index.js +17 -17
  24. package/package.json +1 -1
@@ -9,6 +9,8 @@ import { recordKnowledgeShown } from './knowledge-application.js';
9
9
  import { buildEscalationBriefing, readRecentEscalations } from './knowledge-escalator.js';
10
10
  import { recordKnowledgeEvent } from './knowledge-events.js';
11
11
  import type { RankedEntry } from './knowledge-reader.js';
12
+ import { recordLessonsShown } from './knowledge-reader.js';
13
+ import { confirmEntriesPhase } from './knowledge-store.js';
12
14
  import type { DirectivePriority, KnowledgeConfig, MessageWithParts } from './knowledge-types.js';
13
15
  import { searchKnowledge } from './search-knowledge.js';
14
16
  /** Marker that uniquely identifies the delegate directive block in a transcript. */
@@ -97,4 +99,6 @@ export declare const _internals: {
97
99
  recordKnowledgeShown: typeof recordKnowledgeShown;
98
100
  readRecentEscalations: typeof readRecentEscalations;
99
101
  buildEscalationBriefing: typeof buildEscalationBriefing;
102
+ recordLessonsShown: typeof recordLessonsShown;
103
+ confirmEntriesPhase: typeof confirmEntriesPhase;
100
104
  };
@@ -35,6 +35,21 @@ export interface RankedEntry extends KnowledgeEntryBase {
35
35
  };
36
36
  }
37
37
  declare function transactShownFile(shownFile: string, mutate: (data: Record<string, string[]>) => Record<string, string[]> | null): Promise<boolean>;
38
+ /**
39
+ * Records the set of knowledge IDs actually injected during a phase under the
40
+ * canonical `Phase N` key in `.swarm/.knowledge-shown.json`, so
41
+ * {@link updateRetrievalOutcome} can later attribute the phase's outcome to
42
+ * exactly those entries.
43
+ *
44
+ * Ownership (issue #1768): the shown-set write lives HERE at the injector layer
45
+ * (which knows the final rendered set), NOT inside `readMergedKnowledge` (which
46
+ * only sees the widened pre-rerank pool). Multiple injectors (architect +
47
+ * delegate) may write the same `Phase N` key within one phase, so the key is
48
+ * **union-merged** (dedup-safe) rather than overwritten — otherwise the last
49
+ * writer would clobber earlier id sets and those entries would receive no
50
+ * outcome attribution.
51
+ */
52
+ export declare function recordLessonsShown(directory: string, lessonIds: string[], currentPhase: string): Promise<void>;
38
53
  export declare function readMergedKnowledge(directory: string, config: KnowledgeConfig, context?: ProjectContext, opts?: {
39
54
  skipScopeFilter?: boolean;
40
55
  }): Promise<RankedEntry[]>;
@@ -52,5 +67,6 @@ export declare const _internals: {
52
67
  scoreDirectiveAgainstContext: typeof scoreDirectiveAgainstContext;
53
68
  transactShownFile: typeof transactShownFile;
54
69
  recordKnowledgeEvent: typeof recordKnowledgeEvent;
70
+ recordLessonsShown: typeof recordLessonsShown;
55
71
  };
56
72
  export {};
@@ -47,6 +47,29 @@ export declare function findNearDuplicate<T extends {
47
47
  lesson: string;
48
48
  }>(candidate: string, entries: T[], threshold?: number): T | undefined;
49
49
  export declare function computeConfidence(confirmedByCount: number, autoGenerated: boolean): number;
50
+ /**
51
+ * Soft cap on the number of {@link PhaseConfirmationRecord}s retained per entry.
52
+ * Distinct-phase COUNT is the signal that matters (skill-maturity gate,
53
+ * `✓`/`✓✓` markers); the array itself only needs enough history to represent
54
+ * realistic multi-phase confirmation. Capped for hygiene on long-lived entries;
55
+ * oldest records are evicted. Issue #1768.
56
+ */
57
+ export declare const MAX_CONFIRMED_BY = 50;
58
+ /**
59
+ * Confirm that a set of knowledge entries was surfaced during a phase, by
60
+ * appending a {@link PhaseConfirmationRecord} to each entry's `confirmed_by`
61
+ * (issue #1768 defect 3). Retrieval/injection is the confirmation signal —
62
+ * previously `confirmed_by` only grew on near-duplicate re-add, so the
63
+ * skill-maturity `distinctPhases >= 2` gate was unsatisfiable in practice.
64
+ *
65
+ * Reuses {@link reinforceSwarmKnowledgeEntry} as the canonical writer so
66
+ * `confidence` stays consistent with `confirmed_by` (it recomputes confidence
67
+ * and applies the same-phase dedup + inactive-entry guard). All entries are
68
+ * mutated in ONE locked `transactKnowledge` transaction (mirroring the curator
69
+ * batch pattern) — never one lock per id. Fail-open: confirmation is
70
+ * best-effort and must never break injection.
71
+ */
72
+ export declare function confirmEntriesPhase(directory: string, ids: string[], phaseNumber: number, projectName: string): Promise<void>;
50
73
  export declare const OUTCOME_SIGNAL_SMOOTHING = 4;
51
74
  export declare function computeOutcomeSignal(outcomes?: RetrievalOutcome): number;
52
75
  export declare function inferTags(lesson: string): string[];