opencode-swarm 7.110.0 → 7.110.1
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/agents/explorer.d.ts +1 -1
- package/dist/cli/{config-doctor-9vjyj9m3.js → config-doctor-q5e9yzn6.js} +2 -2
- package/dist/cli/{curator-4qqzpd85.js → curator-c7dzf9rt.js} +13 -11
- package/dist/cli/{curator-llm-factory-y4kvr1ph.js → curator-llm-factory-v4gxfnhd.js} +11 -11
- package/dist/cli/{explorer-ksr3xq7n.js → explorer-t5srbq64.js} +1 -1
- package/dist/cli/{guardrail-explain-10hh57cr.js → guardrail-explain-qc02w4yb.js} +12 -12
- package/dist/cli/{guardrail-log-5240bawg.js → guardrail-log-973nan7m.js} +3 -3
- package/dist/cli/{hive-promoter-wvxqyayt.js → hive-promoter-kr56vt08.js} +11 -11
- package/dist/cli/{index-18690p15.js → index-0g5xsrp4.js} +19 -7
- package/dist/cli/{index-xhsba2sn.js → index-1k5arp07.js} +2 -2
- package/dist/cli/{index-2nt4mq9n.js → index-40h0yp9e.js} +69 -1
- package/dist/cli/{index-d3txrx5q.js → index-53z1afgh.js} +1 -1
- package/dist/cli/{index-1mc2yfc2.js → index-5d0t7npd.js} +1218 -1016
- package/dist/cli/{index-p5vm9gy9.js → index-5rfxzgmt.js} +1 -1
- package/dist/cli/{index-41fgssqr.js → index-c483hnn4.js} +2 -2
- package/dist/cli/{index-b15qbvph.js → index-cmjq1kg7.js} +43 -34
- package/dist/cli/{index-09xpycan.js → index-jt58s751.js} +1 -1
- package/dist/cli/{index-mtzjbaaa.js → index-mvg66d9n.js} +3 -3
- package/dist/cli/{index-khj0knr0.js → index-r3ck99jh.js} +17 -17
- package/dist/cli/{index-8f10r7ay.js → index-v8pk35h7.js} +5 -5
- package/dist/cli/{index-zjh648z4.js → index-xddysq89.js} +1 -1
- package/dist/cli/{index-y5z2qdvk.js → index-yhmt3dw3.js} +2 -2
- package/dist/cli/index.js +13 -13
- package/dist/cli/{knowledge-escalator-9ksrgq7h.js → knowledge-escalator-0dkkenp2.js} +4 -4
- package/dist/cli/{knowledge-events-ymysgtrr.js → knowledge-events-bckbj6ah.js} +2 -2
- package/dist/cli/{knowledge-store-562fefjy.js → knowledge-store-dvjbdn00.js} +3 -2
- package/dist/cli/{knowledge-validator-b9nvmzjc.js → knowledge-validator-bqr936sg.js} +3 -3
- package/dist/cli/{schema-5vmb5dh8.js → schema-s48je8zt.js} +1 -1
- package/dist/cli/{skill-generator-mjfqvnn0.js → skill-generator-5rsjmmfq.js} +7 -5
- package/dist/hooks/curator-postmortem.d.ts +33 -2
- package/dist/hooks/curator-types.d.ts +2 -2
- package/dist/hooks/curator.d.ts +2 -1
- package/dist/hooks/knowledge-link.d.ts +9 -0
- package/dist/hooks/knowledge-reader.d.ts +14 -0
- package/dist/index.js +81 -65
- package/dist/services/skill-generator.d.ts +1 -0
- package/dist/services/warning-buffer.d.ts +25 -0
- package/dist/tools/tool-metadata.d.ts +4 -4
- package/package.json +1 -1
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
resolveSwarmKnowledgePath,
|
|
7
7
|
resolveSwarmRejectedPath,
|
|
8
8
|
transactKnowledge
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-v8pk35h7.js";
|
|
10
10
|
import {
|
|
11
11
|
resolveKnowledgeStoreDir
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-40h0yp9e.js";
|
|
13
13
|
import {
|
|
14
14
|
init_logger,
|
|
15
15
|
warn
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
effectiveRetrievalOutcomes,
|
|
4
|
-
readKnowledgeCounterRollups
|
|
5
|
-
} from "./index-y5z2qdvk.js";
|
|
6
2
|
import {
|
|
7
3
|
ALLOWED_SKILL_PATH_PREFIXES,
|
|
8
4
|
validateSkillPath
|
|
9
|
-
} from "./index-
|
|
5
|
+
} from "./index-c483hnn4.js";
|
|
6
|
+
import {
|
|
7
|
+
effectiveRetrievalOutcomes,
|
|
8
|
+
readKnowledgeCounterRollups
|
|
9
|
+
} from "./index-yhmt3dw3.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-v8pk35h7.js";
|
|
17
|
+
import {
|
|
18
|
+
isActiveStatus
|
|
19
|
+
} from "./index-bfwt3abw.js";
|
|
17
20
|
import {
|
|
18
21
|
init_logger,
|
|
19
22
|
warn
|
|
@@ -587,31 +590,33 @@ function clusterEntries(entries) {
|
|
|
587
590
|
if (c.members.length < MIN_CLUSTER_SIZE && !isSkillSingletonEligible(c.members[0])) {
|
|
588
591
|
continue;
|
|
589
592
|
}
|
|
590
|
-
|
|
591
|
-
const triggers = uniqueStrings(arr.flatMap((e) => e.triggers ?? []));
|
|
592
|
-
const required = uniqueStrings(arr.flatMap((e) => e.required_actions ?? []));
|
|
593
|
-
const forbidden = uniqueStrings(arr.flatMap((e) => e.forbidden_actions ?? []));
|
|
594
|
-
const agents = uniqueStrings(arr.flatMap((e) => e.applies_to_agents ?? []));
|
|
595
|
-
const checks = uniqueStrings(arr.flatMap((e) => e.verification_checks ?? []));
|
|
596
|
-
const avgConf = arr.reduce((s, e) => s + e.confidence, 0) / Math.max(1, arr.length);
|
|
597
|
-
const slugSeed = triggers[0] ?? required[0] ?? arr[0]?.tags?.[0] ?? arr[0]?.category ?? "lesson";
|
|
598
|
-
const slug = sanitizeSlug(slugSeed);
|
|
599
|
-
const title = triggers[0] ?? required[0] ?? `Lessons: ${arr[0]?.category ?? "general"} (${arr.length})`;
|
|
600
|
-
result.push({
|
|
601
|
-
slug: isValidSlug2(slug) ? slug : sanitizeSlug(`cluster-${slugSeed.slice(0, 12)}`),
|
|
602
|
-
title,
|
|
603
|
-
entries: arr,
|
|
604
|
-
triggers,
|
|
605
|
-
required_actions: required,
|
|
606
|
-
forbidden_actions: forbidden,
|
|
607
|
-
target_agents: agents,
|
|
608
|
-
verification_checks: checks,
|
|
609
|
-
avgConfidence: avgConf
|
|
610
|
-
});
|
|
593
|
+
result.push(buildKnowledgeCluster(c.members));
|
|
611
594
|
}
|
|
612
595
|
result.sort((a, b) => b.entries.length - a.entries.length || b.avgConfidence - a.avgConfidence || a.slug.localeCompare(b.slug));
|
|
613
596
|
return result;
|
|
614
597
|
}
|
|
598
|
+
function buildKnowledgeCluster(entries) {
|
|
599
|
+
const triggers = uniqueStrings(entries.flatMap((e) => e.triggers ?? []));
|
|
600
|
+
const required = uniqueStrings(entries.flatMap((e) => e.required_actions ?? []));
|
|
601
|
+
const forbidden = uniqueStrings(entries.flatMap((e) => e.forbidden_actions ?? []));
|
|
602
|
+
const agents = uniqueStrings(entries.flatMap((e) => e.applies_to_agents ?? []));
|
|
603
|
+
const checks = uniqueStrings(entries.flatMap((e) => e.verification_checks ?? []));
|
|
604
|
+
const avgConf = entries.reduce((s, e) => s + e.confidence, 0) / Math.max(1, entries.length);
|
|
605
|
+
const slugSeed = triggers[0] ?? required[0] ?? entries[0]?.tags?.[0] ?? entries[0]?.category ?? "lesson";
|
|
606
|
+
const slug = sanitizeSlug(slugSeed);
|
|
607
|
+
const title = triggers[0] ?? required[0] ?? `Lessons: ${entries[0]?.category ?? "general"} (${entries.length})`;
|
|
608
|
+
return {
|
|
609
|
+
slug: isValidSlug2(slug) ? slug : sanitizeSlug(`cluster-${slugSeed.slice(0, 12)}`),
|
|
610
|
+
title,
|
|
611
|
+
entries,
|
|
612
|
+
triggers,
|
|
613
|
+
required_actions: required,
|
|
614
|
+
forbidden_actions: forbidden,
|
|
615
|
+
target_agents: agents,
|
|
616
|
+
verification_checks: checks,
|
|
617
|
+
avgConfidence: avgConf
|
|
618
|
+
};
|
|
619
|
+
}
|
|
615
620
|
function isSkillSingletonEligible(entry) {
|
|
616
621
|
if (!entry)
|
|
617
622
|
return false;
|
|
@@ -734,20 +739,24 @@ async function generateSkills(req) {
|
|
|
734
739
|
minConfirmations
|
|
735
740
|
});
|
|
736
741
|
let pool;
|
|
742
|
+
let clusters;
|
|
737
743
|
if (req.sourceKnowledgeIds && req.sourceKnowledgeIds.length > 0) {
|
|
738
|
-
const
|
|
744
|
+
const requestedIds = [...new Set(req.sourceKnowledgeIds)];
|
|
745
|
+
const idSet = new Set(requestedIds);
|
|
746
|
+
const idOrder = new Map(requestedIds.map((id, index) => [id, index]));
|
|
739
747
|
const swarm = await readKnowledge(resolveSwarmKnowledgePath(req.directory));
|
|
740
748
|
const hivePath = resolveHiveKnowledgePath();
|
|
741
749
|
const hive = existsSync2(hivePath) ? await readKnowledge(hivePath) : [];
|
|
742
750
|
const rollups = await readKnowledgeCounterRollups(req.directory);
|
|
743
|
-
pool = [...swarm, ...hive].filter((e) => idSet.has(e.id) && e.status
|
|
751
|
+
pool = [...swarm, ...hive].filter((e) => idSet.has(e.id) && isActiveStatus(e.status)).sort((a, b) => (idOrder.get(a.id) ?? 0) - (idOrder.get(b.id) ?? 0)).map((e) => ({
|
|
744
752
|
...e,
|
|
745
753
|
retrieval_outcomes: effectiveRetrievalOutcomes(e.retrieval_outcomes, rollups.get(e.id))
|
|
746
754
|
}));
|
|
755
|
+
clusters = pool.length > 0 ? [buildKnowledgeCluster(pool)] : [];
|
|
747
756
|
} else {
|
|
748
757
|
pool = candidates;
|
|
758
|
+
clusters = clusterEntries(pool);
|
|
749
759
|
}
|
|
750
|
-
const clusters = clusterEntries(pool);
|
|
751
760
|
const result = { written: [], skipped: [] };
|
|
752
761
|
for (let i = 0;i < clusters.length; i++) {
|
|
753
762
|
const cluster = clusters[i];
|
|
@@ -1655,16 +1664,16 @@ async function regenerateSkill(directory, slug, options = {}) {
|
|
|
1655
1664
|
}
|
|
1656
1665
|
}
|
|
1657
1666
|
if (matchedEntries.length > 0) {
|
|
1658
|
-
const activeEntries = matchedEntries.filter((e) => e.status
|
|
1667
|
+
const activeEntries = matchedEntries.filter((e) => isActiveStatus(e.status));
|
|
1659
1668
|
if (activeEntries.length === 0) {
|
|
1660
1669
|
try {
|
|
1661
|
-
await _internals.retireSkill(directory, cleanSlug, "auto-retire: all matched source knowledge entries
|
|
1670
|
+
await _internals.retireSkill(directory, cleanSlug, "auto-retire: all matched source knowledge entries inactive at regeneration time");
|
|
1662
1671
|
} catch {}
|
|
1663
1672
|
return {
|
|
1664
1673
|
regenerated: false,
|
|
1665
1674
|
path: skillPath,
|
|
1666
1675
|
entryCount: 0,
|
|
1667
|
-
reason: "all matched source knowledge
|
|
1676
|
+
reason: "all matched source knowledge inactive \u2014 skill retired",
|
|
1668
1677
|
retired: true
|
|
1669
1678
|
};
|
|
1670
1679
|
}
|
|
@@ -1806,4 +1815,4 @@ var _internals = {
|
|
|
1806
1815
|
clearRetiredSkillLinks
|
|
1807
1816
|
};
|
|
1808
1817
|
|
|
1809
|
-
export { appendSkillChangelog, evaluateSkillChange, appendRejectedSkillEdit, sanitizeSlug, isValidSlug2 as isValidSlug, proposalPath, activePath, activeRepoRelativePath, proposalRepoRelativePath, generateEvalStub, writeEvalStub, DEFAULT_SKILL_MIN_CONFIDENCE, DEFAULT_SKILL_MIN_CONFIRMATIONS, STRONG_SKILL_OUTCOME_COUNT, HIGH_PRIORITY_SKILL_MIN_CONFIDENCE, selectCandidateEntries, isSkillMaturityEligible, clusterEntries, renderSkillMarkdown, generateSkills, parseDraftFrontmatter, activateProposal, findSkillsBySourceKnowledgeId, findStaleSkillsBySourceKnowledgeId, listSkills, autoApplyProposals, inspectSkill, retireSkill, clearDraftSkillLinks, clearRetiredSkillLinks, markSkillStale, clearSkillStale, retireOrMarkStale, regenerateSkill, _internals };
|
|
1818
|
+
export { appendSkillChangelog, evaluateSkillChange, appendRejectedSkillEdit, sanitizeSlug, isValidSlug2 as isValidSlug, proposalPath, activePath, activeRepoRelativePath, proposalRepoRelativePath, generateEvalStub, writeEvalStub, DEFAULT_SKILL_MIN_CONFIDENCE, DEFAULT_SKILL_MIN_CONFIRMATIONS, STRONG_SKILL_OUTCOME_COUNT, HIGH_PRIORITY_SKILL_MIN_CONFIDENCE, selectCandidateEntries, isSkillMaturityEligible, clusterEntries, buildKnowledgeCluster, renderSkillMarkdown, generateSkills, parseDraftFrontmatter, activateProposal, findSkillsBySourceKnowledgeId, findStaleSkillsBySourceKnowledgeId, listSkills, autoApplyProposals, inspectSkill, retireSkill, clearDraftSkillLinks, clearRetiredSkillLinks, markSkillStale, clearSkillStale, retireOrMarkStale, regenerateSkill, _internals };
|
|
@@ -382,7 +382,7 @@ Append exactly one fenced JSON block after SUMMARY. This block is the executable
|
|
|
382
382
|
{
|
|
383
383
|
"summary": "3-line executive summary for architect briefing",
|
|
384
384
|
"curation_recommendations": [
|
|
385
|
-
{"action": "promote", "entry_id": "<uuid or omit for new>", "lesson": "concise lesson text", "reason": "evidence-backed reason", "category": "process", "confidence": 0.8}
|
|
385
|
+
{"action": "promote", "entry_id": "<full uuid, unique 8+ hex prefix, or omit for new>", "lesson": "concise lesson text", "reason": "evidence-backed reason", "category": "process", "confidence": 0.8, "applies_to_agents": ["coder"], "required_actions": ["concrete required action"], "triggers": ["short trigger phrase"], "directive_priority": "medium"}
|
|
386
386
|
],
|
|
387
387
|
"queue_triage": [
|
|
388
388
|
{"proposal_id": "proposal-slug", "action": "apply", "reason": "one-line reason"}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
countEntryViolationsInWindow,
|
|
5
5
|
readKnowledgeEvents,
|
|
6
6
|
recordKnowledgeEvent
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-yhmt3dw3.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-v8pk35h7.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-bqr936sg.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 {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-1k5arp07.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailLog
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-5rfxzgmt.js";
|
|
8
8
|
import {
|
|
9
9
|
COMMAND_REGISTRY,
|
|
10
10
|
SWARM_COMMAND_TOOL_ALLOWLIST,
|
|
@@ -80,27 +80,27 @@ import {
|
|
|
80
80
|
handleWriteRetroCommand,
|
|
81
81
|
normalizeSwarmCommandInput,
|
|
82
82
|
resolveCommand
|
|
83
|
-
} from "./index-
|
|
84
|
-
import"./index-
|
|
85
|
-
import"./index-mtzjbaaa.js";
|
|
83
|
+
} from "./index-5d0t7npd.js";
|
|
84
|
+
import"./index-53z1afgh.js";
|
|
86
85
|
import"./index-c8s9a3zh.js";
|
|
87
|
-
import"./index-
|
|
88
|
-
import"./index-j2v3w1ds.js";
|
|
89
|
-
import"./index-scww5b77.js";
|
|
90
|
-
import"./index-yw8qpf51.js";
|
|
91
|
-
import"./index-85bacexr.js";
|
|
92
|
-
import"./index-09xpycan.js";
|
|
86
|
+
import"./index-xddysq89.js";
|
|
93
87
|
import {
|
|
94
88
|
AGENT_TOOL_MAP,
|
|
95
89
|
ORCHESTRATOR_NAME,
|
|
96
90
|
stripKnownSwarmPrefix
|
|
97
|
-
} from "./index-
|
|
98
|
-
import"./index-
|
|
99
|
-
import"./index-
|
|
100
|
-
import"./index-
|
|
101
|
-
import"./index-
|
|
102
|
-
import"./index-
|
|
91
|
+
} from "./index-0g5xsrp4.js";
|
|
92
|
+
import"./index-j2v3w1ds.js";
|
|
93
|
+
import"./index-scww5b77.js";
|
|
94
|
+
import"./index-yw8qpf51.js";
|
|
95
|
+
import"./index-85bacexr.js";
|
|
96
|
+
import"./index-cmjq1kg7.js";
|
|
97
|
+
import"./index-c483hnn4.js";
|
|
98
|
+
import"./index-mvg66d9n.js";
|
|
99
|
+
import"./index-yhmt3dw3.js";
|
|
100
|
+
import"./index-v8pk35h7.js";
|
|
103
101
|
import"./index-bfwt3abw.js";
|
|
102
|
+
import"./index-40h0yp9e.js";
|
|
103
|
+
import"./index-jt58s751.js";
|
|
104
104
|
import"./index-wvrj16f0.js";
|
|
105
105
|
import"./index-q1exe2b3.js";
|
|
106
106
|
import"./index-x2q0gnt8.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
resolveKnowledgeStoreDir
|
|
4
|
-
} from "./index-2nt4mq9n.js";
|
|
5
2
|
import {
|
|
6
3
|
isActiveStatus
|
|
7
4
|
} from "./index-bfwt3abw.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveKnowledgeStoreDir
|
|
7
|
+
} from "./index-40h0yp9e.js";
|
|
8
8
|
import {
|
|
9
9
|
readCachedParsedFile
|
|
10
10
|
} from "./index-jtqkh8jf.js";
|
|
@@ -525,7 +525,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
525
525
|
const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
|
|
526
526
|
if (atFloor.length === 0 && recovered.length === 0)
|
|
527
527
|
return;
|
|
528
|
-
const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-
|
|
528
|
+
const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-bckbj6ah.js");
|
|
529
529
|
const rollups = await readKnowledgeCounterRollups(directory);
|
|
530
530
|
const flagIds = new Set;
|
|
531
531
|
for (const e of atFloor) {
|
|
@@ -592,7 +592,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
592
592
|
});
|
|
593
593
|
}
|
|
594
594
|
if (action === "quarantine" && toQuarantine.length > 0) {
|
|
595
|
-
const { quarantineEntry } = await import("./knowledge-validator-
|
|
595
|
+
const { quarantineEntry } = await import("./knowledge-validator-bqr936sg.js");
|
|
596
596
|
for (const { id } of toQuarantine) {
|
|
597
597
|
await quarantineEntry(directory, id, "confidence_floor_negative_outcome", "auto").catch((err) => {
|
|
598
598
|
console.warn("[knowledge-store] confidence-floor quarantine failed (best-effort):", err instanceof Error ? err.message : String(err));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
resolveKnowledgeStoreDir
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-40h0yp9e.js";
|
|
5
5
|
import {
|
|
6
6
|
init_logger,
|
|
7
7
|
warn
|
|
@@ -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-dvjbdn00.js");
|
|
598
598
|
await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
|
|
599
599
|
}
|
|
600
600
|
return {
|
package/dist/cli/index.js
CHANGED
|
@@ -7,25 +7,25 @@ import {
|
|
|
7
7
|
getPluginLockFilePaths,
|
|
8
8
|
package_default,
|
|
9
9
|
resolveCommand
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-mtzjbaaa.js";
|
|
10
|
+
} from "./index-5d0t7npd.js";
|
|
11
|
+
import"./index-53z1afgh.js";
|
|
13
12
|
import"./index-c8s9a3zh.js";
|
|
14
|
-
import"./index-
|
|
13
|
+
import"./index-xddysq89.js";
|
|
14
|
+
import {
|
|
15
|
+
DEFAULT_AGENT_CONFIGS
|
|
16
|
+
} from "./index-0g5xsrp4.js";
|
|
15
17
|
import"./index-j2v3w1ds.js";
|
|
16
18
|
import"./index-scww5b77.js";
|
|
17
19
|
import"./index-yw8qpf51.js";
|
|
18
20
|
import"./index-85bacexr.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-y5z2qdvk.js";
|
|
25
|
-
import"./index-41fgssqr.js";
|
|
26
|
-
import"./index-8f10r7ay.js";
|
|
27
|
-
import"./index-2nt4mq9n.js";
|
|
21
|
+
import"./index-cmjq1kg7.js";
|
|
22
|
+
import"./index-c483hnn4.js";
|
|
23
|
+
import"./index-mvg66d9n.js";
|
|
24
|
+
import"./index-yhmt3dw3.js";
|
|
25
|
+
import"./index-v8pk35h7.js";
|
|
28
26
|
import"./index-bfwt3abw.js";
|
|
27
|
+
import"./index-40h0yp9e.js";
|
|
28
|
+
import"./index-jt58s751.js";
|
|
29
29
|
import"./index-wvrj16f0.js";
|
|
30
30
|
import"./index-q1exe2b3.js";
|
|
31
31
|
import"./index-x2q0gnt8.js";
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
maybeEscalateOnViolation,
|
|
9
9
|
maybeQuarantineOnContradiction,
|
|
10
10
|
readRecentEscalations
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-2nt4mq9n.js";
|
|
11
|
+
} from "./index-mvg66d9n.js";
|
|
12
|
+
import"./index-yhmt3dw3.js";
|
|
13
|
+
import"./index-v8pk35h7.js";
|
|
15
14
|
import"./index-bfwt3abw.js";
|
|
15
|
+
import"./index-40h0yp9e.js";
|
|
16
16
|
import"./index-jtqkh8jf.js";
|
|
17
17
|
import"./index-zgwm4ryv.js";
|
|
18
18
|
import"./index-1cn967sa.js";
|
|
@@ -25,8 +25,8 @@ import {
|
|
|
25
25
|
resolveKnowledgeCounterBaselinePath,
|
|
26
26
|
resolveKnowledgeEventsPath,
|
|
27
27
|
resolveLegacyApplicationLogPath
|
|
28
|
-
} from "./index-
|
|
29
|
-
import"./index-
|
|
28
|
+
} from "./index-yhmt3dw3.js";
|
|
29
|
+
import"./index-40h0yp9e.js";
|
|
30
30
|
import"./index-zgwm4ryv.js";
|
|
31
31
|
import"./index-1cn967sa.js";
|
|
32
32
|
import"./index-5mkc2f9z.js";
|
|
@@ -32,10 +32,11 @@ import {
|
|
|
32
32
|
transactFile,
|
|
33
33
|
transactKnowledge,
|
|
34
34
|
wordBigrams
|
|
35
|
-
} from "./index-
|
|
36
|
-
import"./index-2nt4mq9n.js";
|
|
35
|
+
} from "./index-v8pk35h7.js";
|
|
37
36
|
import"./index-bfwt3abw.js";
|
|
37
|
+
import"./index-40h0yp9e.js";
|
|
38
38
|
import"./index-jtqkh8jf.js";
|
|
39
|
+
import"./index-zgwm4ryv.js";
|
|
39
40
|
import"./index-1cn967sa.js";
|
|
40
41
|
import"./index-5mkc2f9z.js";
|
|
41
42
|
import"./index-vn263hqt.js";
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
validateLesson,
|
|
23
23
|
validateSkillCandidatePath,
|
|
24
24
|
validateSkillPath
|
|
25
|
-
} from "./index-
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-2nt4mq9n.js";
|
|
25
|
+
} from "./index-c483hnn4.js";
|
|
26
|
+
import"./index-v8pk35h7.js";
|
|
28
27
|
import"./index-bfwt3abw.js";
|
|
28
|
+
import"./index-40h0yp9e.js";
|
|
29
29
|
import"./index-jtqkh8jf.js";
|
|
30
30
|
import"./index-zgwm4ryv.js";
|
|
31
31
|
import"./index-1cn967sa.js";
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
activePath,
|
|
10
10
|
activeRepoRelativePath,
|
|
11
11
|
autoApplyProposals,
|
|
12
|
+
buildKnowledgeCluster,
|
|
12
13
|
clearDraftSkillLinks,
|
|
13
14
|
clearRetiredSkillLinks,
|
|
14
15
|
clearSkillStale,
|
|
@@ -32,12 +33,12 @@ import {
|
|
|
32
33
|
sanitizeSlug,
|
|
33
34
|
selectCandidateEntries,
|
|
34
35
|
writeEvalStub
|
|
35
|
-
} from "./index-
|
|
36
|
-
import"./index-
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
39
|
-
import"./index-2nt4mq9n.js";
|
|
36
|
+
} from "./index-cmjq1kg7.js";
|
|
37
|
+
import"./index-c483hnn4.js";
|
|
38
|
+
import"./index-yhmt3dw3.js";
|
|
39
|
+
import"./index-v8pk35h7.js";
|
|
40
40
|
import"./index-bfwt3abw.js";
|
|
41
|
+
import"./index-40h0yp9e.js";
|
|
41
42
|
import"./index-jtqkh8jf.js";
|
|
42
43
|
import"./index-zgwm4ryv.js";
|
|
43
44
|
import"./index-1cn967sa.js";
|
|
@@ -70,6 +71,7 @@ export {
|
|
|
70
71
|
clearSkillStale,
|
|
71
72
|
clearRetiredSkillLinks,
|
|
72
73
|
clearDraftSkillLinks,
|
|
74
|
+
buildKnowledgeCluster,
|
|
73
75
|
autoApplyProposals,
|
|
74
76
|
activeRepoRelativePath,
|
|
75
77
|
activePath,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Outputs route through existing gated paths (knowledge_add, skill proposals,
|
|
12
12
|
* hive promotion) — no new ungated injection source.
|
|
13
13
|
*/
|
|
14
|
-
import type
|
|
14
|
+
import { type CuratorLLMDelegate } from './curator.js';
|
|
15
15
|
import type { KnowledgeRecommendation } from './curator-types.js';
|
|
16
16
|
import type { KnowledgeConfig, SwarmKnowledgeEntry } from './knowledge-types.js';
|
|
17
17
|
export interface PostMortemResult {
|
|
@@ -49,6 +49,14 @@ interface ParsedPostMortemActions {
|
|
|
49
49
|
}>;
|
|
50
50
|
diagnostics: string[];
|
|
51
51
|
}
|
|
52
|
+
type KnowledgeActionVerificationStatus = 'new_entry' | 'exact_match' | 'prefix_match' | 'not_found' | 'ambiguous_prefix' | 'missing_entry_id';
|
|
53
|
+
interface KnowledgeActionVerification {
|
|
54
|
+
action: KnowledgeRecommendation['action'];
|
|
55
|
+
input_entry_id: string | null;
|
|
56
|
+
resolved_entry_id: string | null;
|
|
57
|
+
status: KnowledgeActionVerificationStatus;
|
|
58
|
+
reason: string;
|
|
59
|
+
}
|
|
52
60
|
export interface PostMortemActionResult {
|
|
53
61
|
knowledge_applied: number;
|
|
54
62
|
knowledge_skipped: number;
|
|
@@ -65,6 +73,22 @@ declare function executePostMortemActions(directory: string, parsed: ParsedPostM
|
|
|
65
73
|
result: PostMortemActionResult;
|
|
66
74
|
warnings: string[];
|
|
67
75
|
}>;
|
|
76
|
+
declare function verifyPostMortemKnowledgeActions(directory: string, recommendations: KnowledgeRecommendation[]): Promise<KnowledgeActionVerification[]>;
|
|
77
|
+
declare function buildStateFreshnessSection(args: {
|
|
78
|
+
planId: string;
|
|
79
|
+
scope: 'session' | 'project';
|
|
80
|
+
sessionID?: string;
|
|
81
|
+
planLoaded: boolean;
|
|
82
|
+
knowledgeSummary: KnowledgeEventSummary[];
|
|
83
|
+
proposals: Array<{
|
|
84
|
+
source: string;
|
|
85
|
+
content: string;
|
|
86
|
+
}>;
|
|
87
|
+
unactionable: unknown[];
|
|
88
|
+
retrospectives: string[];
|
|
89
|
+
driftReports: string[];
|
|
90
|
+
}): string;
|
|
91
|
+
declare function buildActionVerificationSection(verification: KnowledgeActionVerification[]): string;
|
|
68
92
|
declare function repairPostMortemActions(llmOutput: string, diagnostics: string[], options: PostMortemOptions): Promise<ParsedPostMortemActions | null>;
|
|
69
93
|
declare function readJsonlFile(filePath: string, maxLines?: number): unknown[];
|
|
70
94
|
declare function collectRetrospectives(directory: string): string[];
|
|
@@ -81,7 +105,11 @@ declare function acquirePostMortemLock(directory: string, planId: string): Promi
|
|
|
81
105
|
declare function buildDataOnlyReport(planId: string, planSummary: string, knowledgeSummary: KnowledgeEventSummary[], curatorDigest: string | null, proposals: Array<{
|
|
82
106
|
source: string;
|
|
83
107
|
content: string;
|
|
84
|
-
}>, unactionable: unknown[], retrospectives: string[], driftReports: string[]
|
|
108
|
+
}>, unactionable: unknown[], retrospectives: string[], driftReports: string[], context?: {
|
|
109
|
+
scope: 'session' | 'project';
|
|
110
|
+
sessionID?: string;
|
|
111
|
+
planLoaded: boolean;
|
|
112
|
+
}): string;
|
|
85
113
|
declare function assembleLLMInput(planId: string, scope: 'session' | 'project', sessionID: string | undefined, planSummary: string, knowledgeSummary: KnowledgeEventSummary[], curatorDigest: string | null, proposals: Array<{
|
|
86
114
|
source: string;
|
|
87
115
|
content: string;
|
|
@@ -96,9 +124,12 @@ export declare const _internals: {
|
|
|
96
124
|
readJsonlFile: typeof readJsonlFile;
|
|
97
125
|
buildDataOnlyReport: typeof buildDataOnlyReport;
|
|
98
126
|
assembleLLMInput: typeof assembleLLMInput;
|
|
127
|
+
buildStateFreshnessSection: typeof buildStateFreshnessSection;
|
|
128
|
+
buildActionVerificationSection: typeof buildActionVerificationSection;
|
|
99
129
|
isReportValid: typeof isReportValid;
|
|
100
130
|
parsePostMortemActions: typeof parsePostMortemActions;
|
|
101
131
|
executePostMortemActions: typeof executePostMortemActions;
|
|
132
|
+
verifyPostMortemKnowledgeActions: typeof verifyPostMortemKnowledgeActions;
|
|
102
133
|
repairPostMortemActions: typeof repairPostMortemActions;
|
|
103
134
|
loadDefaultKnowledgeConfig: () => Promise<KnowledgeConfig>;
|
|
104
135
|
applyCuratorKnowledgeUpdates: (directory: string, recommendations: KnowledgeRecommendation[], knowledgeConfig: KnowledgeConfig) => Promise<{
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Curator types — phase context consolidation and drift detection.
|
|
3
3
|
* No runtime logic. Types only.
|
|
4
4
|
*/
|
|
5
|
-
import type { KnowledgeCategory } from './knowledge-types.js';
|
|
5
|
+
import type { ActionableDirectiveFields, KnowledgeCategory } from './knowledge-types.js';
|
|
6
6
|
/** Curator summary — anchored iterative format. Persisted to .swarm/curator-summary.json */
|
|
7
7
|
export interface CuratorSummary {
|
|
8
8
|
schema_version: 1;
|
|
@@ -35,7 +35,7 @@ export interface ComplianceObservation {
|
|
|
35
35
|
description: string;
|
|
36
36
|
severity: 'info' | 'warning';
|
|
37
37
|
}
|
|
38
|
-
export interface KnowledgeRecommendation {
|
|
38
|
+
export interface KnowledgeRecommendation extends Pick<ActionableDirectiveFields, 'triggers' | 'required_actions' | 'forbidden_actions' | 'applies_to_agents' | 'applies_to_tools' | 'verification_checks' | 'directive_priority'> {
|
|
39
39
|
action: 'promote' | 'archive' | 'flag_contradiction' | 'rewrite';
|
|
40
40
|
entry_id?: string;
|
|
41
41
|
lesson: string;
|
package/dist/hooks/curator.d.ts
CHANGED
|
@@ -58,10 +58,11 @@ export declare const _internals: {
|
|
|
58
58
|
readLatestPostMortemDigest: (directory: string) => string | null;
|
|
59
59
|
};
|
|
60
60
|
export interface RecommendationParseDiagnostic {
|
|
61
|
-
section: 'OBSERVATIONS';
|
|
61
|
+
section: 'OBSERVATIONS' | 'RECOMMENDATION_ID';
|
|
62
62
|
line: string;
|
|
63
63
|
reason: string;
|
|
64
64
|
}
|
|
65
|
+
export declare function normalizeRecommendationEntryIdToken(token: string): string | undefined;
|
|
65
66
|
/**
|
|
66
67
|
* Auto-retire generated skills whose violation rate exceeds 30% or
|
|
67
68
|
* whose source knowledge entries are all archived.
|
|
@@ -37,6 +37,13 @@ export interface LinkPointer {
|
|
|
37
37
|
/** How the link was established. */
|
|
38
38
|
source: 'manual' | 'auto';
|
|
39
39
|
}
|
|
40
|
+
export interface LinkedLocalKnowledgeStatus {
|
|
41
|
+
linked: boolean;
|
|
42
|
+
orphaned: boolean;
|
|
43
|
+
localKnowledgePath: string;
|
|
44
|
+
resolvedKnowledgePath: string;
|
|
45
|
+
reason?: 'not_linked' | 'local_missing' | 'local_symlink' | 'local_regular_file';
|
|
46
|
+
}
|
|
40
47
|
export declare const LINK_POINTER_FILENAME = "link.json";
|
|
41
48
|
/** Root directory under which all shared link stores live: `<dataDir>/links`. */
|
|
42
49
|
export declare function resolveLinkBaseDir(): string;
|
|
@@ -50,6 +57,7 @@ export declare function resolveLinkDir(linkId: string): string;
|
|
|
50
57
|
export declare function sanitizeLinkId(name: string): string | null;
|
|
51
58
|
/** Read and validate the link pointer for a worktree. Null if absent/invalid. */
|
|
52
59
|
export declare function readLinkPointer(directory: string): LinkPointer | null;
|
|
60
|
+
export declare function getLinkedLocalKnowledgeStatus(directory: string): LinkedLocalKnowledgeStatus;
|
|
53
61
|
/** Write the link pointer atomically and invalidate the resolution cache. */
|
|
54
62
|
export declare function writeLinkPointer(directory: string, pointer: LinkPointer): Promise<void>;
|
|
55
63
|
/** Remove the link pointer (idempotent) and invalidate the resolution cache. */
|
|
@@ -75,6 +83,7 @@ export declare const _internals: {
|
|
|
75
83
|
readLinkPointer: typeof readLinkPointer;
|
|
76
84
|
writeLinkPointer: typeof writeLinkPointer;
|
|
77
85
|
removeLinkPointer: typeof removeLinkPointer;
|
|
86
|
+
getLinkedLocalKnowledgeStatus: typeof getLinkedLocalKnowledgeStatus;
|
|
78
87
|
invalidateKnowledgeStoreDirCache: typeof invalidateKnowledgeStoreDirCache;
|
|
79
88
|
resolveLinkDir: typeof resolveLinkDir;
|
|
80
89
|
resolveLinkBaseDir: typeof resolveLinkBaseDir;
|
|
@@ -19,6 +19,20 @@ export interface RankedEntry extends KnowledgeEntryBase {
|
|
|
19
19
|
};
|
|
20
20
|
finalScore: number;
|
|
21
21
|
coldStartBoost?: number;
|
|
22
|
+
score_breakdown?: {
|
|
23
|
+
text_score: number;
|
|
24
|
+
metadata_score: number;
|
|
25
|
+
directive_score: number;
|
|
26
|
+
confidence_boost: number;
|
|
27
|
+
generated_skill_boost: number;
|
|
28
|
+
outcome_boost: number;
|
|
29
|
+
cold_start_boost: number;
|
|
30
|
+
synonym_boost: number;
|
|
31
|
+
trigger_recall_boost: number;
|
|
32
|
+
status_boost: number;
|
|
33
|
+
final_score: number;
|
|
34
|
+
synonym_matches?: string[];
|
|
35
|
+
};
|
|
22
36
|
}
|
|
23
37
|
declare function transactShownFile(shownFile: string, mutate: (data: Record<string, string[]>) => Record<string, string[]> | null): Promise<boolean>;
|
|
24
38
|
export declare function readMergedKnowledge(directory: string, config: KnowledgeConfig, context?: ProjectContext, opts?: {
|