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.
- package/dist/cli/{curator-llm-factory-8rnk2083.js → curator-llm-factory-5bns4xy6.js} +6 -6
- package/dist/cli/{curator-j7ty8k6t.js → curator-snvp9542.js} +6 -6
- package/dist/cli/{guardrail-explain-2j0gw8f0.js → guardrail-explain-4s7djf9p.js} +7 -7
- package/dist/cli/{hive-promoter-y179n7wx.js → hive-promoter-zs295trk.js} +6 -6
- package/dist/cli/{index-hg0pamsa.js → index-30ejh1tx.js} +1 -1
- package/dist/cli/{index-t7efm8vz.js → index-32bx4kch.js} +68 -3
- package/dist/cli/{index-b83y9a7r.js → index-82v0d72f.js} +3 -3
- package/dist/cli/{index-x4bghdyv.js → index-9fjpecax.js} +1 -1
- package/dist/cli/{index-cye4g7zj.js → index-hpp2r0sd.js} +1 -1
- package/dist/cli/{index-c3h3d8kh.js → index-k6wd3chp.js} +7 -7
- package/dist/cli/{index-j5c98bd9.js → index-snmfqhez.js} +18 -50
- package/dist/cli/{index-2aqs6daa.js → index-t6wfwdm1.js} +3 -3
- package/dist/cli/index.js +6 -6
- package/dist/cli/{knowledge-escalator-t1e2211j.js → knowledge-escalator-4gbz527n.js} +3 -3
- package/dist/cli/{knowledge-events-2h3gvtfa.js → knowledge-events-b6x28fgc.js} +1 -1
- package/dist/cli/{knowledge-store-gpta9gzh.js → knowledge-store-h3cjx4dg.js} +6 -2
- package/dist/cli/{knowledge-validator-03f0hm0p.js → knowledge-validator-q6jw2p0t.js} +2 -2
- package/dist/cli/{skill-generator-2tsqqaa2.js → skill-generator-fe6q8xgm.js} +4 -4
- package/dist/hooks/knowledge-events.d.ts +21 -1
- package/dist/hooks/knowledge-injector.d.ts +4 -0
- package/dist/hooks/knowledge-reader.d.ts +16 -0
- package/dist/hooks/knowledge-store.d.ts +23 -0
- package/dist/index.js +17 -17
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
createCuratorLLMDelegate
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-snmfqhez.js";
|
|
5
5
|
import"./index-npxmfj48.js";
|
|
6
6
|
import"./index-c8s9a3zh.js";
|
|
7
7
|
import"./index-xehrmy76.js";
|
|
@@ -10,11 +10,11 @@ import"./index-d0w40jm3.js";
|
|
|
10
10
|
import"./index-scww5b77.js";
|
|
11
11
|
import"./index-9fxs0rm1.js";
|
|
12
12
|
import"./index-q1jaeynn.js";
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
13
|
+
import"./index-82v0d72f.js";
|
|
14
|
+
import"./index-30ejh1tx.js";
|
|
15
|
+
import"./index-t6wfwdm1.js";
|
|
16
|
+
import"./index-hpp2r0sd.js";
|
|
17
|
+
import"./index-32bx4kch.js";
|
|
18
18
|
import"./index-bfwt3abw.js";
|
|
19
19
|
import"./index-db1fh1fv.js";
|
|
20
20
|
import"./index-jt58s751.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
runCuratorInit,
|
|
13
13
|
runCuratorPhase,
|
|
14
14
|
writeCuratorSummary
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-snmfqhez.js";
|
|
16
16
|
import"./index-npxmfj48.js";
|
|
17
17
|
import"./index-c8s9a3zh.js";
|
|
18
18
|
import"./index-xehrmy76.js";
|
|
@@ -21,11 +21,11 @@ import"./index-d0w40jm3.js";
|
|
|
21
21
|
import"./index-scww5b77.js";
|
|
22
22
|
import"./index-9fxs0rm1.js";
|
|
23
23
|
import"./index-q1jaeynn.js";
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
24
|
+
import"./index-82v0d72f.js";
|
|
25
|
+
import"./index-30ejh1tx.js";
|
|
26
|
+
import"./index-t6wfwdm1.js";
|
|
27
|
+
import"./index-hpp2r0sd.js";
|
|
28
|
+
import"./index-32bx4kch.js";
|
|
29
29
|
import"./index-bfwt3abw.js";
|
|
30
30
|
import"./index-db1fh1fv.js";
|
|
31
31
|
import"./index-jt58s751.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-9fjpecax.js";
|
|
5
|
+
import"./index-snmfqhez.js";
|
|
6
6
|
import"./index-npxmfj48.js";
|
|
7
7
|
import"./index-c8s9a3zh.js";
|
|
8
8
|
import"./index-xehrmy76.js";
|
|
@@ -11,11 +11,11 @@ import"./index-d0w40jm3.js";
|
|
|
11
11
|
import"./index-scww5b77.js";
|
|
12
12
|
import"./index-9fxs0rm1.js";
|
|
13
13
|
import"./index-q1jaeynn.js";
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
14
|
+
import"./index-82v0d72f.js";
|
|
15
|
+
import"./index-30ejh1tx.js";
|
|
16
|
+
import"./index-t6wfwdm1.js";
|
|
17
|
+
import"./index-hpp2r0sd.js";
|
|
18
|
+
import"./index-32bx4kch.js";
|
|
19
19
|
import"./index-bfwt3abw.js";
|
|
20
20
|
import"./index-db1fh1fv.js";
|
|
21
21
|
import"./index-jt58s751.js";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
isHiveEligible,
|
|
6
6
|
promoteFromSwarm,
|
|
7
7
|
promoteToHive
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-snmfqhez.js";
|
|
9
9
|
import"./index-npxmfj48.js";
|
|
10
10
|
import"./index-c8s9a3zh.js";
|
|
11
11
|
import"./index-xehrmy76.js";
|
|
@@ -14,11 +14,11 @@ import"./index-d0w40jm3.js";
|
|
|
14
14
|
import"./index-scww5b77.js";
|
|
15
15
|
import"./index-9fxs0rm1.js";
|
|
16
16
|
import"./index-q1jaeynn.js";
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
17
|
+
import"./index-82v0d72f.js";
|
|
18
|
+
import"./index-30ejh1tx.js";
|
|
19
|
+
import"./index-t6wfwdm1.js";
|
|
20
|
+
import"./index-hpp2r0sd.js";
|
|
21
|
+
import"./index-32bx4kch.js";
|
|
22
22
|
import"./index-bfwt3abw.js";
|
|
23
23
|
import"./index-db1fh1fv.js";
|
|
24
24
|
import"./index-jt58s751.js";
|
|
@@ -25,6 +25,42 @@ import { existsSync } from "fs";
|
|
|
25
25
|
import { appendFile, mkdir, readFile } from "fs/promises";
|
|
26
26
|
import * as os from "os";
|
|
27
27
|
import * as path from "path";
|
|
28
|
+
|
|
29
|
+
// src/hooks/knowledge-reinforcement.ts
|
|
30
|
+
function isActiveSwarmKnowledgeEntry(entry) {
|
|
31
|
+
return isActiveStatus(entry.status);
|
|
32
|
+
}
|
|
33
|
+
function findActiveSwarmNearDuplicate(lesson, entries, threshold) {
|
|
34
|
+
return findNearDuplicate(lesson, entries.filter(isActiveSwarmKnowledgeEntry), threshold);
|
|
35
|
+
}
|
|
36
|
+
function distinctPhaseCount(records) {
|
|
37
|
+
const phases = new Set;
|
|
38
|
+
for (const record of records ?? []) {
|
|
39
|
+
if (Number.isInteger(record.phase_number)) {
|
|
40
|
+
phases.add(record.phase_number);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return phases.size;
|
|
44
|
+
}
|
|
45
|
+
function reinforceSwarmKnowledgeEntry(entry, confirmation) {
|
|
46
|
+
if (!isActiveSwarmKnowledgeEntry(entry)) {
|
|
47
|
+
return { entryId: entry.id, reinforced: false, reason: "inactive" };
|
|
48
|
+
}
|
|
49
|
+
if ((entry.confirmed_by ?? []).some((record) => record.phase_number === confirmation.phase_number)) {
|
|
50
|
+
return {
|
|
51
|
+
entryId: entry.id,
|
|
52
|
+
reinforced: false,
|
|
53
|
+
reason: "already_confirmed_phase"
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
entry.confirmed_by = [...entry.confirmed_by ?? [], confirmation];
|
|
57
|
+
entry.updated_at = confirmation.confirmed_at;
|
|
58
|
+
entry.phases_alive = 0;
|
|
59
|
+
entry.confidence = computeConfidence(distinctPhaseCount(entry.confirmed_by), entry.auto_generated ?? false);
|
|
60
|
+
return { entryId: entry.id, reinforced: true, reason: "reinforced" };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// src/hooks/knowledge-store.ts
|
|
28
64
|
var KNOWLEDGE_JSONL_CACHE_NAMESPACE = "knowledge-jsonl:normalized:v1";
|
|
29
65
|
function getPlatformConfigDir() {
|
|
30
66
|
const platform = process.platform;
|
|
@@ -445,6 +481,35 @@ function computeConfidence(confirmedByCount, autoGenerated) {
|
|
|
445
481
|
score += 0.1;
|
|
446
482
|
return Math.min(score, 1);
|
|
447
483
|
}
|
|
484
|
+
var MAX_CONFIRMED_BY = 50;
|
|
485
|
+
async function confirmEntriesPhase(directory, ids, phaseNumber, projectName) {
|
|
486
|
+
if (ids.length === 0)
|
|
487
|
+
return;
|
|
488
|
+
const knowledgePath = resolveSwarmKnowledgePath(directory);
|
|
489
|
+
await transactKnowledge(knowledgePath, (current) => {
|
|
490
|
+
const idSet = new Set(ids);
|
|
491
|
+
let changed = false;
|
|
492
|
+
const now = new Date().toISOString();
|
|
493
|
+
for (const entry of current) {
|
|
494
|
+
if (!idSet.has(entry.id))
|
|
495
|
+
continue;
|
|
496
|
+
const result = reinforceSwarmKnowledgeEntry(entry, {
|
|
497
|
+
phase_number: phaseNumber,
|
|
498
|
+
confirmed_at: now,
|
|
499
|
+
project_name: projectName
|
|
500
|
+
});
|
|
501
|
+
if (result.reinforced) {
|
|
502
|
+
const records = entry.confirmed_by ?? [];
|
|
503
|
+
if (records.length > MAX_CONFIRMED_BY) {
|
|
504
|
+
entry.confirmed_by = [...records].sort((a, b) => a.confirmed_at.localeCompare(b.confirmed_at)).slice(-MAX_CONFIRMED_BY);
|
|
505
|
+
entry.confidence = computeConfidence(new Set(entry.confirmed_by.map((r) => r.phase_number).filter((n) => Number.isInteger(n))).size, entry.auto_generated ?? false);
|
|
506
|
+
}
|
|
507
|
+
changed = true;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return changed ? current : null;
|
|
511
|
+
}).catch(() => {});
|
|
512
|
+
}
|
|
448
513
|
var OUTCOME_SIGNAL_SMOOTHING = 4;
|
|
449
514
|
function computeOutcomeSignal(outcomes) {
|
|
450
515
|
if (!outcomes)
|
|
@@ -525,7 +590,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
525
590
|
const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
|
|
526
591
|
if (atFloor.length === 0 && recovered.length === 0)
|
|
527
592
|
return;
|
|
528
|
-
const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-
|
|
593
|
+
const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-b6x28fgc.js");
|
|
529
594
|
const rollups = await readKnowledgeCounterRollups(directory);
|
|
530
595
|
const flagIds = new Set;
|
|
531
596
|
for (const e of atFloor) {
|
|
@@ -592,7 +657,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
592
657
|
});
|
|
593
658
|
}
|
|
594
659
|
if (action === "quarantine" && toQuarantine.length > 0) {
|
|
595
|
-
const { quarantineEntry } = await import("./knowledge-validator-
|
|
660
|
+
const { quarantineEntry } = await import("./knowledge-validator-q6jw2p0t.js");
|
|
596
661
|
for (const { id } of toQuarantine) {
|
|
597
662
|
await quarantineEntry(directory, id, "confidence_floor_negative_outcome", "auto").catch((err) => {
|
|
598
663
|
console.warn("[knowledge-store] confidence-floor quarantine failed (best-effort):", err instanceof Error ? err.message : String(err));
|
|
@@ -675,4 +740,4 @@ var _internals = {
|
|
|
675
740
|
getArchivedKnowledgeIds
|
|
676
741
|
};
|
|
677
742
|
|
|
678
|
-
export { getPlatformConfigDir, resolveSwarmKnowledgePath, resolveSwarmRejectedPath, resolveSwarmRetractionsPath, resolveHiveKnowledgePath, resolveHiveRejectedPath, resolveHiveEventsPath, readKnowledge, normalizeEntry, readRejectedLessons, readRetractionRecords, appendRetractionRecord, appendKnowledge, rewriteKnowledge, transactFile, transactKnowledge, getArchivedKnowledgeIds, appendKnowledgeWithCapEnforcement, enforceKnowledgeCap, sweepAgedEntries, sweepStaleTodos, appendRejectedLesson, normalize, wordBigrams, jaccardBigram, findNearDuplicate, computeConfidence, OUTCOME_SIGNAL_SMOOTHING, computeOutcomeSignal, inferTags, bumpKnowledgeConfidenceBatch, _internals };
|
|
743
|
+
export { findActiveSwarmNearDuplicate, reinforceSwarmKnowledgeEntry, getPlatformConfigDir, resolveSwarmKnowledgePath, resolveSwarmRejectedPath, resolveSwarmRetractionsPath, resolveHiveKnowledgePath, resolveHiveRejectedPath, resolveHiveEventsPath, readKnowledge, normalizeEntry, readRejectedLessons, readRetractionRecords, appendRetractionRecord, appendKnowledge, rewriteKnowledge, transactFile, transactKnowledge, getArchivedKnowledgeIds, appendKnowledgeWithCapEnforcement, enforceKnowledgeCap, sweepAgedEntries, sweepStaleTodos, appendRejectedLesson, normalize, wordBigrams, jaccardBigram, findNearDuplicate, computeConfidence, MAX_CONFIRMED_BY, confirmEntriesPhase, OUTCOME_SIGNAL_SMOOTHING, computeOutcomeSignal, inferTags, bumpKnowledgeConfidenceBatch, _internals };
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ALLOWED_SKILL_PATH_PREFIXES,
|
|
4
4
|
validateSkillPath
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-30ejh1tx.js";
|
|
6
6
|
import {
|
|
7
7
|
effectiveRetrievalOutcomes,
|
|
8
8
|
readKnowledgeCounterRollups
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-hpp2r0sd.js";
|
|
10
10
|
import {
|
|
11
11
|
computeOutcomeSignal,
|
|
12
12
|
readKnowledge,
|
|
13
13
|
resolveHiveKnowledgePath,
|
|
14
14
|
resolveSwarmKnowledgePath,
|
|
15
15
|
transactKnowledge
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-32bx4kch.js";
|
|
17
17
|
import {
|
|
18
18
|
isActiveStatus
|
|
19
19
|
} from "./index-bfwt3abw.js";
|
|
@@ -594,7 +594,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
|
|
|
594
594
|
deltas.push({ id, delta });
|
|
595
595
|
}
|
|
596
596
|
if (deltas.length > 0) {
|
|
597
|
-
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-
|
|
597
|
+
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-h3cjx4dg.js");
|
|
598
598
|
await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
|
|
599
599
|
}
|
|
600
600
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-9fjpecax.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailLog
|
|
7
7
|
} from "./index-w84stmkx.js";
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
handleWriteRetroCommand,
|
|
82
82
|
normalizeSwarmCommandInput,
|
|
83
83
|
resolveCommand
|
|
84
|
-
} from "./index-
|
|
84
|
+
} from "./index-snmfqhez.js";
|
|
85
85
|
import"./index-npxmfj48.js";
|
|
86
86
|
import"./index-c8s9a3zh.js";
|
|
87
87
|
import"./index-xehrmy76.js";
|
|
@@ -94,11 +94,11 @@ import"./index-d0w40jm3.js";
|
|
|
94
94
|
import"./index-scww5b77.js";
|
|
95
95
|
import"./index-9fxs0rm1.js";
|
|
96
96
|
import"./index-q1jaeynn.js";
|
|
97
|
-
import"./index-
|
|
98
|
-
import"./index-
|
|
99
|
-
import"./index-
|
|
100
|
-
import"./index-
|
|
101
|
-
import"./index-
|
|
97
|
+
import"./index-82v0d72f.js";
|
|
98
|
+
import"./index-30ejh1tx.js";
|
|
99
|
+
import"./index-t6wfwdm1.js";
|
|
100
|
+
import"./index-hpp2r0sd.js";
|
|
101
|
+
import"./index-32bx4kch.js";
|
|
102
102
|
import"./index-bfwt3abw.js";
|
|
103
103
|
import"./index-db1fh1fv.js";
|
|
104
104
|
import"./index-jt58s751.js";
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
retireOrMarkStale,
|
|
107
107
|
retireSkill,
|
|
108
108
|
selectCandidateEntries
|
|
109
|
-
} from "./index-
|
|
109
|
+
} from "./index-82v0d72f.js";
|
|
110
110
|
import {
|
|
111
111
|
appendUnactionable,
|
|
112
112
|
quarantineEntry,
|
|
@@ -116,10 +116,10 @@ import {
|
|
|
116
116
|
validateActionability,
|
|
117
117
|
validateActionableFields,
|
|
118
118
|
validateLesson
|
|
119
|
-
} from "./index-
|
|
119
|
+
} from "./index-30ejh1tx.js";
|
|
120
120
|
import {
|
|
121
121
|
readRecentEscalations
|
|
122
|
-
} from "./index-
|
|
122
|
+
} from "./index-t6wfwdm1.js";
|
|
123
123
|
import {
|
|
124
124
|
effectiveRetrievalOutcomes,
|
|
125
125
|
readKnowledgeCounterRollups,
|
|
@@ -127,7 +127,7 @@ import {
|
|
|
127
127
|
recordHiveKnowledgeEvent,
|
|
128
128
|
recordKnowledgeEvent,
|
|
129
129
|
resolveKnowledgeEventsPath
|
|
130
|
-
} from "./index-
|
|
130
|
+
} from "./index-hpp2r0sd.js";
|
|
131
131
|
import {
|
|
132
132
|
appendKnowledge,
|
|
133
133
|
appendRejectedLesson,
|
|
@@ -136,6 +136,7 @@ import {
|
|
|
136
136
|
computeConfidence,
|
|
137
137
|
computeOutcomeSignal,
|
|
138
138
|
enforceKnowledgeCap,
|
|
139
|
+
findActiveSwarmNearDuplicate,
|
|
139
140
|
findNearDuplicate,
|
|
140
141
|
getArchivedKnowledgeIds,
|
|
141
142
|
inferTags,
|
|
@@ -143,13 +144,14 @@ import {
|
|
|
143
144
|
readKnowledge,
|
|
144
145
|
readRejectedLessons,
|
|
145
146
|
readRetractionRecords,
|
|
147
|
+
reinforceSwarmKnowledgeEntry,
|
|
146
148
|
resolveHiveKnowledgePath,
|
|
147
149
|
resolveHiveRejectedPath,
|
|
148
150
|
resolveSwarmKnowledgePath,
|
|
149
151
|
rewriteKnowledge,
|
|
150
152
|
transactFile,
|
|
151
153
|
transactKnowledge
|
|
152
|
-
} from "./index-
|
|
154
|
+
} from "./index-32bx4kch.js";
|
|
153
155
|
import {
|
|
154
156
|
KNOWLEDGE_SCHEMA_VERSION,
|
|
155
157
|
OUTCOME_BLOCK_THRESHOLD,
|
|
@@ -9197,7 +9199,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
|
|
|
9197
9199
|
}
|
|
9198
9200
|
if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
|
|
9199
9201
|
try {
|
|
9200
|
-
const skillModule = await import("./skill-generator-
|
|
9202
|
+
const skillModule = await import("./skill-generator-fe6q8xgm.js");
|
|
9201
9203
|
for (const cand of skillCandidates) {
|
|
9202
9204
|
if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
|
|
9203
9205
|
continue;
|
|
@@ -9478,7 +9480,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
|
|
|
9478
9480
|
} catch {}
|
|
9479
9481
|
}
|
|
9480
9482
|
if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
|
|
9481
|
-
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-
|
|
9483
|
+
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-4gbz527n.js");
|
|
9482
9484
|
for (const { id } of contradictedEntries) {
|
|
9483
9485
|
try {
|
|
9484
9486
|
await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
|
|
@@ -10439,11 +10441,11 @@ var _internals12 = {
|
|
|
10439
10441
|
return KnowledgeConfigSchema2.parse({});
|
|
10440
10442
|
},
|
|
10441
10443
|
applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig) => {
|
|
10442
|
-
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-
|
|
10444
|
+
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-snvp9542.js");
|
|
10443
10445
|
return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig);
|
|
10444
10446
|
},
|
|
10445
10447
|
checkHivePromotions: async (entries, knowledgeConfig) => {
|
|
10446
|
-
const { checkHivePromotions } = await import("./hive-promoter-
|
|
10448
|
+
const { checkHivePromotions } = await import("./hive-promoter-zs295trk.js");
|
|
10447
10449
|
return checkHivePromotions(entries, knowledgeConfig);
|
|
10448
10450
|
},
|
|
10449
10451
|
applyProposalTriage: async (directory, triage) => {
|
|
@@ -10452,7 +10454,7 @@ var _internals12 = {
|
|
|
10452
10454
|
activateProposal,
|
|
10453
10455
|
listSkills: listSkills2,
|
|
10454
10456
|
sanitizeSlug
|
|
10455
|
-
} = await import("./skill-generator-
|
|
10457
|
+
} = await import("./skill-generator-fe6q8xgm.js");
|
|
10456
10458
|
const result = {
|
|
10457
10459
|
approved: [],
|
|
10458
10460
|
rejected: [],
|
|
@@ -10988,40 +10990,6 @@ async function rebuildSynonymMap(directory, entries, maxPairs = DEFAULT_MAX_PAIR
|
|
|
10988
10990
|
// src/hooks/knowledge-curator.ts
|
|
10989
10991
|
init_logger();
|
|
10990
10992
|
|
|
10991
|
-
// src/hooks/knowledge-reinforcement.ts
|
|
10992
|
-
function isActiveSwarmKnowledgeEntry(entry) {
|
|
10993
|
-
return isActiveStatus(entry.status);
|
|
10994
|
-
}
|
|
10995
|
-
function findActiveSwarmNearDuplicate(lesson, entries, threshold) {
|
|
10996
|
-
return findNearDuplicate(lesson, entries.filter(isActiveSwarmKnowledgeEntry), threshold);
|
|
10997
|
-
}
|
|
10998
|
-
function distinctPhaseCount(records) {
|
|
10999
|
-
const phases = new Set;
|
|
11000
|
-
for (const record of records ?? []) {
|
|
11001
|
-
if (Number.isInteger(record.phase_number)) {
|
|
11002
|
-
phases.add(record.phase_number);
|
|
11003
|
-
}
|
|
11004
|
-
}
|
|
11005
|
-
return phases.size;
|
|
11006
|
-
}
|
|
11007
|
-
function reinforceSwarmKnowledgeEntry(entry, confirmation) {
|
|
11008
|
-
if (!isActiveSwarmKnowledgeEntry(entry)) {
|
|
11009
|
-
return { entryId: entry.id, reinforced: false, reason: "inactive" };
|
|
11010
|
-
}
|
|
11011
|
-
if ((entry.confirmed_by ?? []).some((record) => record.phase_number === confirmation.phase_number)) {
|
|
11012
|
-
return {
|
|
11013
|
-
entryId: entry.id,
|
|
11014
|
-
reinforced: false,
|
|
11015
|
-
reason: "already_confirmed_phase"
|
|
11016
|
-
};
|
|
11017
|
-
}
|
|
11018
|
-
entry.confirmed_by = [...entry.confirmed_by ?? [], confirmation];
|
|
11019
|
-
entry.updated_at = confirmation.confirmed_at;
|
|
11020
|
-
entry.phases_alive = 0;
|
|
11021
|
-
entry.confidence = computeConfidence(distinctPhaseCount(entry.confirmed_by), entry.auto_generated ?? false);
|
|
11022
|
-
return { entryId: entry.id, reinforced: true, reason: "reinforced" };
|
|
11023
|
-
}
|
|
11024
|
-
|
|
11025
10993
|
// src/hooks/micro-reflector.ts
|
|
11026
10994
|
import { existsSync as existsSync13 } from "fs";
|
|
11027
10995
|
import { readFile as readFile7, writeFile as writeFile7 } from "fs/promises";
|
|
@@ -17266,8 +17234,8 @@ var _internals23 = {
|
|
|
17266
17234
|
loadCuratorDeps: async () => {
|
|
17267
17235
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
|
|
17268
17236
|
import("./schema-2p15yrvn.js"),
|
|
17269
|
-
import("./curator-
|
|
17270
|
-
import("./curator-llm-factory-
|
|
17237
|
+
import("./curator-snvp9542.js"),
|
|
17238
|
+
import("./curator-llm-factory-5bns4xy6.js")
|
|
17271
17239
|
]);
|
|
17272
17240
|
return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
|
|
17273
17241
|
}
|
|
@@ -17763,7 +17731,7 @@ import { fileURLToPath } from "url";
|
|
|
17763
17731
|
// package.json
|
|
17764
17732
|
var package_default = {
|
|
17765
17733
|
name: "opencode-swarm",
|
|
17766
|
-
version: "7.112.
|
|
17734
|
+
version: "7.112.2",
|
|
17767
17735
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
17768
17736
|
main: "dist/index.js",
|
|
17769
17737
|
types: "dist/index.d.ts",
|
|
@@ -32600,7 +32568,7 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
32600
32568
|
async function handleHelpCommand(ctx) {
|
|
32601
32569
|
const targetCommand = ctx.args.join(" ");
|
|
32602
32570
|
if (!targetCommand) {
|
|
32603
|
-
const { buildHelpText } = await import("./index-
|
|
32571
|
+
const { buildHelpText } = await import("./index-k6wd3chp.js");
|
|
32604
32572
|
return buildHelpText();
|
|
32605
32573
|
}
|
|
32606
32574
|
const tokens = targetCommand.split(/\s+/);
|
|
@@ -32609,7 +32577,7 @@ async function handleHelpCommand(ctx) {
|
|
|
32609
32577
|
return _internals48.buildDetailedHelp(resolved.key, resolved.entry);
|
|
32610
32578
|
}
|
|
32611
32579
|
const similar = _internals48.findSimilarCommands(targetCommand);
|
|
32612
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
32580
|
+
const { buildHelpText: fullHelp } = await import("./index-k6wd3chp.js");
|
|
32613
32581
|
if (similar.length > 0) {
|
|
32614
32582
|
return `Command '/swarm ${targetCommand}' not found.
|
|
32615
32583
|
|
|
@@ -32742,7 +32710,7 @@ var COMMAND_REGISTRY = {
|
|
|
32742
32710
|
},
|
|
32743
32711
|
"guardrail explain": {
|
|
32744
32712
|
handler: async (ctx) => {
|
|
32745
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
32713
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-4s7djf9p.js");
|
|
32746
32714
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
32747
32715
|
},
|
|
32748
32716
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
countEntryViolationsInWindow,
|
|
5
5
|
readKnowledgeEvents,
|
|
6
6
|
recordKnowledgeEvent
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-hpp2r0sd.js";
|
|
8
8
|
import {
|
|
9
9
|
jaccardBigram,
|
|
10
10
|
readKnowledge,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
resolveSwarmKnowledgePath,
|
|
13
13
|
transactKnowledge,
|
|
14
14
|
wordBigrams
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-32bx4kch.js";
|
|
16
16
|
import {
|
|
17
17
|
isActiveStatus
|
|
18
18
|
} from "./index-bfwt3abw.js";
|
|
@@ -188,7 +188,7 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
|
|
|
188
188
|
alreadyInactive: true
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
const { quarantineEntry } = await import("./knowledge-validator-
|
|
191
|
+
const { quarantineEntry } = await import("./knowledge-validator-q6jw2p0t.js");
|
|
192
192
|
await quarantineEntry(directory, entryId, `repeat_contradiction: ${count} contradicted events in ${windowDays}d`, "auto");
|
|
193
193
|
return { quarantined: true, entryId, contradictionsInWindow: count };
|
|
194
194
|
} catch {
|
package/dist/cli/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getPluginLockFilePaths,
|
|
8
8
|
package_default,
|
|
9
9
|
resolveCommand
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-snmfqhez.js";
|
|
11
11
|
import"./index-npxmfj48.js";
|
|
12
12
|
import"./index-c8s9a3zh.js";
|
|
13
13
|
import"./index-xehrmy76.js";
|
|
@@ -18,11 +18,11 @@ import"./index-d0w40jm3.js";
|
|
|
18
18
|
import"./index-scww5b77.js";
|
|
19
19
|
import"./index-9fxs0rm1.js";
|
|
20
20
|
import"./index-q1jaeynn.js";
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
21
|
+
import"./index-82v0d72f.js";
|
|
22
|
+
import"./index-30ejh1tx.js";
|
|
23
|
+
import"./index-t6wfwdm1.js";
|
|
24
|
+
import"./index-hpp2r0sd.js";
|
|
25
|
+
import"./index-32bx4kch.js";
|
|
26
26
|
import"./index-bfwt3abw.js";
|
|
27
27
|
import"./index-db1fh1fv.js";
|
|
28
28
|
import"./index-jt58s751.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
maybeEscalateOnViolation,
|
|
9
9
|
maybeQuarantineOnContradiction,
|
|
10
10
|
readRecentEscalations
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
11
|
+
} from "./index-t6wfwdm1.js";
|
|
12
|
+
import"./index-hpp2r0sd.js";
|
|
13
|
+
import"./index-32bx4kch.js";
|
|
14
14
|
import"./index-bfwt3abw.js";
|
|
15
15
|
import"./index-db1fh1fv.js";
|
|
16
16
|
import"./index-jtqkh8jf.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
resolveKnowledgeCounterBaselinePath,
|
|
26
26
|
resolveKnowledgeEventsPath,
|
|
27
27
|
resolveLegacyApplicationLogPath
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-hpp2r0sd.js";
|
|
29
29
|
import"./index-db1fh1fv.js";
|
|
30
30
|
import"./index-zgwm4ryv.js";
|
|
31
31
|
import"./index-0dab9w37.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
+
MAX_CONFIRMED_BY,
|
|
3
4
|
OUTCOME_SIGNAL_SMOOTHING,
|
|
4
5
|
_internals,
|
|
5
6
|
appendKnowledge,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
bumpKnowledgeConfidenceBatch,
|
|
10
11
|
computeConfidence,
|
|
11
12
|
computeOutcomeSignal,
|
|
13
|
+
confirmEntriesPhase,
|
|
12
14
|
enforceKnowledgeCap,
|
|
13
15
|
findNearDuplicate,
|
|
14
16
|
getArchivedKnowledgeIds,
|
|
@@ -32,7 +34,7 @@ import {
|
|
|
32
34
|
transactFile,
|
|
33
35
|
transactKnowledge,
|
|
34
36
|
wordBigrams
|
|
35
|
-
} from "./index-
|
|
37
|
+
} from "./index-32bx4kch.js";
|
|
36
38
|
import"./index-bfwt3abw.js";
|
|
37
39
|
import"./index-db1fh1fv.js";
|
|
38
40
|
import"./index-jtqkh8jf.js";
|
|
@@ -67,6 +69,7 @@ export {
|
|
|
67
69
|
getArchivedKnowledgeIds,
|
|
68
70
|
findNearDuplicate,
|
|
69
71
|
enforceKnowledgeCap,
|
|
72
|
+
confirmEntriesPhase,
|
|
70
73
|
computeOutcomeSignal,
|
|
71
74
|
computeConfidence,
|
|
72
75
|
bumpKnowledgeConfidenceBatch,
|
|
@@ -75,5 +78,6 @@ export {
|
|
|
75
78
|
appendKnowledgeWithCapEnforcement,
|
|
76
79
|
appendKnowledge,
|
|
77
80
|
_internals,
|
|
78
|
-
OUTCOME_SIGNAL_SMOOTHING
|
|
81
|
+
OUTCOME_SIGNAL_SMOOTHING,
|
|
82
|
+
MAX_CONFIRMED_BY
|
|
79
83
|
};
|
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
validateLesson,
|
|
23
23
|
validateSkillCandidatePath,
|
|
24
24
|
validateSkillPath
|
|
25
|
-
} from "./index-
|
|
26
|
-
import"./index-
|
|
25
|
+
} from "./index-30ejh1tx.js";
|
|
26
|
+
import"./index-32bx4kch.js";
|
|
27
27
|
import"./index-bfwt3abw.js";
|
|
28
28
|
import"./index-db1fh1fv.js";
|
|
29
29
|
import"./index-jtqkh8jf.js";
|
|
@@ -33,10 +33,10 @@ import {
|
|
|
33
33
|
sanitizeSlug,
|
|
34
34
|
selectCandidateEntries,
|
|
35
35
|
writeEvalStub
|
|
36
|
-
} from "./index-
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
39
|
-
import"./index-
|
|
36
|
+
} from "./index-82v0d72f.js";
|
|
37
|
+
import"./index-30ejh1tx.js";
|
|
38
|
+
import"./index-hpp2r0sd.js";
|
|
39
|
+
import"./index-32bx4kch.js";
|
|
40
40
|
import"./index-bfwt3abw.js";
|
|
41
41
|
import"./index-db1fh1fv.js";
|
|
42
42
|
import"./index-jtqkh8jf.js";
|
|
@@ -144,7 +144,27 @@ export interface SkillStaleBatchEvent {
|
|
|
144
144
|
retiredCount: number;
|
|
145
145
|
staleCount: number;
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
/**
|
|
148
|
+
* A diagnostic tombstone: the architect auto-injection hook skipped injection
|
|
149
|
+
* for a diagnosable reason (issue #1768). Every silent early-return in
|
|
150
|
+
* `createKnowledgeInjectorHook` emits one of these so the dead-path cause is
|
|
151
|
+
* recoverable from `.swarm/knowledge-events.jsonl`. Diagnostic only —
|
|
152
|
+
* `recomputeCounters` intentionally ignores it (no counter mutation).
|
|
153
|
+
*/
|
|
154
|
+
export interface InjectionSkipEvent {
|
|
155
|
+
type: 'injection_skip';
|
|
156
|
+
schema_version?: number;
|
|
157
|
+
event_id: string;
|
|
158
|
+
timestamp: string;
|
|
159
|
+
/** Machine-readable reason tag (e.g. 'headroom_budget', 'no_agent_name'). */
|
|
160
|
+
reason: string;
|
|
161
|
+
agent?: string;
|
|
162
|
+
session_id?: string;
|
|
163
|
+
phase?: number;
|
|
164
|
+
/** Structured, redactable detail (char counts, model id, etc.). */
|
|
165
|
+
detail?: Record<string, unknown>;
|
|
166
|
+
}
|
|
167
|
+
export type KnowledgeEvent = RetrievedEvent | ReceiptEvent | OutcomeEvent | ArchivedEvent | EscalationEvent | SkillStaleBatchEvent | InjectionSkipEvent;
|
|
148
168
|
export type KnowledgeEventType = KnowledgeEvent['type'];
|
|
149
169
|
/**
|
|
150
170
|
* Event shape accepted by {@link appendKnowledgeEvent} / {@link recordKnowledgeEvent}.
|