kibi-cli 2.5.1 → 2.6.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.
- package/README.md +41 -0
- package/dist/intent-search.d.ts.map +1 -1
- package/dist/intent-search.js +12 -32
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +108 -8
- package/dist/operations/bootstrap/intent-claims.d.ts.map +1 -1
- package/dist/operations/bootstrap/intent-claims.js +161 -4
- package/dist/operations/bootstrap/presentation.d.ts +8 -0
- package/dist/operations/bootstrap/presentation.d.ts.map +1 -1
- package/dist/operations/bootstrap/presentation.js +92 -8
- package/dist/operations/bootstrap/types.d.ts +21 -0
- package/dist/operations/bootstrap/types.d.ts.map +1 -1
- package/dist/operations/bootstrap/types.js +10 -0
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts +7 -2
- package/dist/operations/semantic-advisor/ingestion-boundary.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/ingestion-boundary.js +61 -24
- package/dist/plugins/approved-source-analyzers.generated.d.ts +5 -5
- package/dist/plugins/approved-source-analyzers.generated.js +5 -5
- package/dist/public/operations/catalog.d.ts +46 -4
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/discovery-entities.d.ts +5 -3
- package/dist/public/operations/discovery-entities.d.ts.map +1 -1
- package/dist/public/operations/discovery-entities.js +8 -4
- package/dist/public/operations/specs/bootstrap.d.ts +46 -4
- package/dist/public/operations/specs/bootstrap.d.ts.map +1 -1
- package/dist/public/operations/specs/bootstrap.js +41 -5
- package/dist/public/skills/kibi-bootstrap/SKILL.md +13 -7
- package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +4 -1
- package/package.json +11 -6
- package/src/public/operations/discovery-entities.ts +14 -5
- package/src/public/operations/specs/bootstrap.ts +44 -4
- package/src/public/skills/kibi-bootstrap/SKILL.md +13 -7
- package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +4 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { buildGuidance } from "./guidance.js";
|
|
2
|
-
import { KNOWLEDGE_SOURCE_AUTHORITIES, KNOWLEDGE_SOURCE_KINDS, bootstrapPlanHash, } from "./types.js";
|
|
2
|
+
import { INTENT_CLAIM_KINDS, KNOWLEDGE_SOURCE_AUTHORITIES, KNOWLEDGE_SOURCE_KINDS, bootstrapPlanHash, } from "./types.js";
|
|
3
3
|
function strings(values) {
|
|
4
4
|
return [
|
|
5
5
|
...new Set((values ?? []).map((value) => value.trim()).filter(Boolean)),
|
|
@@ -41,9 +41,12 @@ function intentClaims(values) {
|
|
|
41
41
|
const statement = value.statement?.trim().replace(/\s+/g, " ");
|
|
42
42
|
const sourceId = value.sourceId?.trim();
|
|
43
43
|
const reference = value.reference?.trim();
|
|
44
|
+
const kind = value.kind ?? "intent";
|
|
44
45
|
if (!statement || !sourceId || !reference)
|
|
45
46
|
continue;
|
|
46
|
-
|
|
47
|
+
if (!INTENT_CLAIM_KINDS.includes(kind))
|
|
48
|
+
continue;
|
|
49
|
+
const key = `${sourceId}\u0000${reference}\u0000${statement}\u0000${kind}`;
|
|
47
50
|
if (seen.has(key))
|
|
48
51
|
continue;
|
|
49
52
|
seen.add(key);
|
|
@@ -53,14 +56,42 @@ function intentClaims(values) {
|
|
|
53
56
|
sourceId,
|
|
54
57
|
reference,
|
|
55
58
|
...(excerpt ? { excerpt } : {}),
|
|
59
|
+
// The default stays implicit so plans that declare no kinds keep
|
|
60
|
+
// their established shape and hash.
|
|
61
|
+
...(kind !== "intent" ? { kind } : {}),
|
|
56
62
|
});
|
|
57
63
|
}
|
|
58
64
|
return result;
|
|
59
65
|
}
|
|
66
|
+
function conflicts(values) {
|
|
67
|
+
const seen = new Set();
|
|
68
|
+
const result = [];
|
|
69
|
+
for (const value of values ?? []) {
|
|
70
|
+
const note = value.note?.trim().replace(/\s+/g, " ");
|
|
71
|
+
const refs = new Map();
|
|
72
|
+
for (const ref of value.claimReferences ?? []) {
|
|
73
|
+
const sourceId = ref.sourceId?.trim();
|
|
74
|
+
const reference = ref.reference?.trim();
|
|
75
|
+
if (sourceId && reference)
|
|
76
|
+
refs.set(`${sourceId}\u0000${reference}`, { sourceId, reference });
|
|
77
|
+
}
|
|
78
|
+
if (!note || refs.size < 2)
|
|
79
|
+
continue;
|
|
80
|
+
const claimReferences = [...refs.values()];
|
|
81
|
+
const key = `${[...refs.keys()].sort().join("\u0001")}\u0002${note}`;
|
|
82
|
+
if (seen.has(key))
|
|
83
|
+
continue;
|
|
84
|
+
seen.add(key);
|
|
85
|
+
result.push({ claimReferences, note });
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
// implements REQ-bootstrap-claim-kinds-and-conflicts
|
|
60
90
|
export function normalizeBootstrapContext(input) {
|
|
61
91
|
const projectSummary = input?.projectSummary?.trim();
|
|
62
92
|
const sources = knowledgeSources(input?.knowledgeSources);
|
|
63
93
|
const claims = intentClaims(input?.intentClaims);
|
|
94
|
+
const declaredConflicts = conflicts(input?.conflicts);
|
|
64
95
|
return {
|
|
65
96
|
...(projectSummary ? { projectSummary } : {}),
|
|
66
97
|
sourceOfTruthPaths: strings(input?.sourceOfTruthPaths),
|
|
@@ -69,6 +100,7 @@ export function normalizeBootstrapContext(input) {
|
|
|
69
100
|
verificationAnchors: strings(input?.verificationAnchors),
|
|
70
101
|
...(sources.length > 0 ? { knowledgeSources: sources } : {}),
|
|
71
102
|
...(claims.length > 0 ? { intentClaims: claims } : {}),
|
|
103
|
+
...(declaredConflicts.length > 0 ? { conflicts: declaredConflicts } : {}),
|
|
72
104
|
};
|
|
73
105
|
}
|
|
74
106
|
function payoff(candidates) {
|
|
@@ -82,7 +114,40 @@ function payoff(candidates) {
|
|
|
82
114
|
delta: { ...projectedIfAllApplied },
|
|
83
115
|
};
|
|
84
116
|
}
|
|
85
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Suppressions per reason, most frequent first, so a plan with hundreds of
|
|
119
|
+
* suppressed rows still reads as a handful of lines.
|
|
120
|
+
*/
|
|
121
|
+
// implements REQ-bootstrap-discovered-candidate-budget
|
|
122
|
+
export function suppressionCounts(rows) {
|
|
123
|
+
const counts = new Map();
|
|
124
|
+
for (const row of rows) {
|
|
125
|
+
const reason = String(row.reason ?? "unspecified");
|
|
126
|
+
counts.set(reason, (counts.get(reason) ?? 0) + 1);
|
|
127
|
+
}
|
|
128
|
+
return [...counts]
|
|
129
|
+
.map(([reason, count]) => ({ reason, count }))
|
|
130
|
+
.sort((left, right) => right.count - left.count || left.reason.localeCompare(right.reason));
|
|
131
|
+
}
|
|
132
|
+
/** Declared claims per knowledge source against what the plan writes. */
|
|
133
|
+
// implements REQ-bootstrap-intent-claim-accounting
|
|
134
|
+
function claimAccounting(declared, candidates, suppressed) {
|
|
135
|
+
return (declared.knowledgeSources ?? []).flatMap((source) => {
|
|
136
|
+
const count = (declared.intentClaims ?? []).filter((claim) => claim.sourceId === source.id).length;
|
|
137
|
+
if (count === 0)
|
|
138
|
+
return [];
|
|
139
|
+
const prefix = `claim:${source.id}:`;
|
|
140
|
+
const planned = candidates.filter((candidate) => candidate.sourceKind === "intent_claim" &&
|
|
141
|
+
candidate.candidateId.startsWith(prefix)).length;
|
|
142
|
+
const rows = (reasons) => suppressed.filter((row) => reasons.includes(String(row.reason)) &&
|
|
143
|
+
String(row.candidateId).startsWith(prefix)).length;
|
|
144
|
+
const existing = rows(["entity_exists"]);
|
|
145
|
+
// Claims the caller filtered out (entityTypes, minConfidence) are not lost.
|
|
146
|
+
const filtered = rows(["filtered_by_entity_type", "below_min_confidence"]);
|
|
147
|
+
return [{ source, declared: count, planned, existing, filtered }];
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
// implements REQ-KIBI-BOOTSTRAP-PLAN, REQ-bootstrap-discovered-candidate-budget
|
|
86
151
|
export function presentBootstrap(input) {
|
|
87
152
|
const declaredContext = normalizeBootstrapContext(input.bootstrapContext);
|
|
88
153
|
const guidance = buildGuidance({
|
|
@@ -107,13 +172,19 @@ export function presentBootstrap(input) {
|
|
|
107
172
|
input.candidates.length + input.sourceOnlySignals.length > 0
|
|
108
173
|
? `Bootstrap plan is ready for review with ${input.candidates.length} safe candidate(s) and ${input.sourceOnlySignals.length} source-only authoring follow-up(s).`
|
|
109
174
|
: (input.activation.handoffMessage ?? blockedFallback);
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
|
|
175
|
+
const suppression = suppressionCounts(input.suppressedCandidates);
|
|
176
|
+
const suppressedTotal = suppression.reduce((sum, row) => sum + row.count, 0);
|
|
177
|
+
const suppressionSummary = suppressedTotal > 0
|
|
178
|
+
? ` Suppressed ${suppressedTotal} candidate(s) by reason: ${suppression.map((row) => `${row.reason} ${row.count}`).join(", ")}.`
|
|
179
|
+
: "";
|
|
180
|
+
const limitSummary = suppression.some((row) => row.reason === "over_limit")
|
|
181
|
+
? " Discovered candidates over maxCandidates are over_limit; raise the limit or narrow entityTypes. Declared intent claims do not count against it."
|
|
113
182
|
: "";
|
|
114
183
|
const tldr = (confidenceLevel === "low" && !input.activation.applyBlocked
|
|
115
184
|
? `Low-confidence bootstrap (${String(guidance.confidence.score)}): review diagnostics before proceeding. ${baseTldr}`
|
|
116
|
-
: baseTldr) +
|
|
185
|
+
: baseTldr) +
|
|
186
|
+
suppressionSummary +
|
|
187
|
+
limitSummary;
|
|
117
188
|
const rawActions = input.candidates.flatMap((candidate) => candidate.applyPlan.map((payload) => ({ candidate, payload })));
|
|
118
189
|
const actionIds = new Map();
|
|
119
190
|
rawActions.forEach(({ payload }, index) => {
|
|
@@ -148,15 +219,22 @@ export function presentBootstrap(input) {
|
|
|
148
219
|
candidateId: candidate.candidateId,
|
|
149
220
|
};
|
|
150
221
|
});
|
|
222
|
+
const accounting = claimAccounting(declaredContext, input.candidates, input.suppressedCandidates);
|
|
223
|
+
const droppedAuthoritative = accounting.filter((row) => row.source.authority === "authoritative" &&
|
|
224
|
+
row.planned + row.existing + row.filtered === 0);
|
|
151
225
|
const status = input.activation.activationState === "root_active_seeded"
|
|
152
226
|
? "handoff"
|
|
153
227
|
: applyBlocked
|
|
154
228
|
? "blocked"
|
|
155
|
-
: confidenceLevel === "high" &&
|
|
229
|
+
: confidenceLevel === "high" &&
|
|
230
|
+
actions.length > 0 &&
|
|
231
|
+
droppedAuthoritative.length === 0
|
|
156
232
|
? "ready"
|
|
157
233
|
: "needs_context";
|
|
158
234
|
const contextQuestions = [];
|
|
159
235
|
if (status === "needs_context") {
|
|
236
|
+
if (droppedAuthoritative.length > 0)
|
|
237
|
+
contextQuestions.push(`No declared claim from authoritative source(s) ${droppedAuthoritative.map((row) => `"${row.source.title}"`).join(", ")} could be planned; how should those claims be restated or authored before bootstrap applies?`);
|
|
160
238
|
if (!declaredContext.projectSummary)
|
|
161
239
|
contextQuestions.push("What is the one-sentence purpose of this repository?");
|
|
162
240
|
if (!declaredContext.knowledgeSources)
|
|
@@ -175,6 +253,12 @@ export function presentBootstrap(input) {
|
|
|
175
253
|
...input.discoverySummary.scanWarnings,
|
|
176
254
|
...bindingDiagnostics,
|
|
177
255
|
...strings(input.contextDiagnostics),
|
|
256
|
+
...(suppressedTotal > 0
|
|
257
|
+
? [
|
|
258
|
+
`Suppressed candidates by reason: ${suppression.map((row) => `${row.reason} ${row.count}`).join(", ")} (rows in suppressedCandidates).`,
|
|
259
|
+
]
|
|
260
|
+
: []),
|
|
261
|
+
...accounting.map((row) => `Knowledge source ${row.source.id} (${row.source.authority}): ${row.declared} declared claim(s), ${row.planned} planned, ${row.existing} already in the KB, ${row.filtered} filtered out, ${row.declared - row.planned - row.existing - row.filtered} not planned (see suppressedCandidates and source-only follow-ups).`),
|
|
178
262
|
];
|
|
179
263
|
const planBody = {
|
|
180
264
|
version: "kibi.bootstrap-plan.v1",
|
|
@@ -23,12 +23,31 @@ export type BootstrapKnowledgeSource = {
|
|
|
23
23
|
readonly connector?: string;
|
|
24
24
|
readonly notes?: string;
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* What a harvested claim is: intended behavior, an observation about how
|
|
28
|
+
* things are today, or a question the sources leave open. Only intent can
|
|
29
|
+
* become a requirement; the others stay explicit review facts.
|
|
30
|
+
*/
|
|
31
|
+
export declare const INTENT_CLAIM_KINDS: readonly ["intent", "observation", "open_question"];
|
|
32
|
+
export type BootstrapIntentClaimKind = (typeof INTENT_CLAIM_KINDS)[number];
|
|
26
33
|
/** One statement of intent the agent harvested from a declared source. */
|
|
27
34
|
export type BootstrapIntentClaim = {
|
|
28
35
|
readonly statement: string;
|
|
29
36
|
readonly sourceId: string;
|
|
30
37
|
readonly reference: string;
|
|
31
38
|
readonly excerpt?: string;
|
|
39
|
+
/** Defaults to intent; normalization omits the default. */
|
|
40
|
+
readonly kind?: BootstrapIntentClaimKind;
|
|
41
|
+
};
|
|
42
|
+
/** Identifies one declared claim by its source and exact citation. */
|
|
43
|
+
export type BootstrapClaimReference = {
|
|
44
|
+
readonly sourceId: string;
|
|
45
|
+
readonly reference: string;
|
|
46
|
+
};
|
|
47
|
+
/** Claims the agent found contradicting each other, left for the human. */
|
|
48
|
+
export type BootstrapClaimConflict = {
|
|
49
|
+
readonly claimReferences: readonly BootstrapClaimReference[];
|
|
50
|
+
readonly note: string;
|
|
32
51
|
};
|
|
33
52
|
export type BootstrapContext = {
|
|
34
53
|
readonly projectSummary?: string;
|
|
@@ -38,6 +57,7 @@ export type BootstrapContext = {
|
|
|
38
57
|
readonly verificationAnchors?: readonly string[];
|
|
39
58
|
readonly knowledgeSources?: readonly BootstrapKnowledgeSource[];
|
|
40
59
|
readonly intentClaims?: readonly BootstrapIntentClaim[];
|
|
60
|
+
readonly conflicts?: readonly BootstrapClaimConflict[];
|
|
41
61
|
};
|
|
42
62
|
export type PlanBootstrapArgs = {
|
|
43
63
|
readonly includeGenericMarkdown?: boolean;
|
|
@@ -66,6 +86,7 @@ export type BootstrapDeclaredContext = {
|
|
|
66
86
|
readonly verificationAnchors: readonly string[];
|
|
67
87
|
readonly knowledgeSources?: readonly BootstrapKnowledgeSource[];
|
|
68
88
|
readonly intentClaims?: readonly BootstrapIntentClaim[];
|
|
89
|
+
readonly conflicts?: readonly BootstrapClaimConflict[];
|
|
69
90
|
};
|
|
70
91
|
export type ActivationState = "root_uninitialized" | "root_partial" | "vendored_only" | "root_active_thin" | "root_active_seeded";
|
|
71
92
|
export type ActivationMode = "cold_start_bootstrap" | "repair_bootstrap" | "attached_thin_bootstrap" | "attached_thin_handoff" | "attached_seeded_handoff" | "vendored_blocked";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGxE,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACtC,MAAM,CAGR;AAED,mFAAmF;AACnF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;CAChE,GAAG,MAAM,CAWT;AAED,eAAO,MAAM,sBAAsB,8HAUzB,CAAC;AACX,eAAO,MAAM,4BAA4B,mDAI/B,CAAC;AAEX;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;IACvD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SA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AAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAClE,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,oBAAoB,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;IAC5E,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC7B,eAAe,CAAC,0BAA0B,CAAC,GAAG;IAC5C,QAAQ,CAAC,iBAAiB,EAAE,0BAA0B,CAAC;CACxD,CAAC"}
|
|
@@ -31,6 +31,16 @@ export const KNOWLEDGE_SOURCE_AUTHORITIES = [
|
|
|
31
31
|
"supporting",
|
|
32
32
|
"stale",
|
|
33
33
|
];
|
|
34
|
+
/**
|
|
35
|
+
* What a harvested claim is: intended behavior, an observation about how
|
|
36
|
+
* things are today, or a question the sources leave open. Only intent can
|
|
37
|
+
* become a requirement; the others stay explicit review facts.
|
|
38
|
+
*/
|
|
39
|
+
export const INTENT_CLAIM_KINDS = [
|
|
40
|
+
"intent",
|
|
41
|
+
"observation",
|
|
42
|
+
"open_question",
|
|
43
|
+
];
|
|
34
44
|
export const BOOTSTRAP_PROVIDER_ORDER = [
|
|
35
45
|
"typed_kibi_docs",
|
|
36
46
|
"generic_repo_docs",
|
|
@@ -6,15 +6,20 @@ export interface SemanticInventoryBoundaryResult {
|
|
|
6
6
|
readonly errors: readonly string[];
|
|
7
7
|
readonly sourceHash: string;
|
|
8
8
|
}
|
|
9
|
-
type SemanticRelationship = Readonly<{
|
|
9
|
+
export type SemanticRelationship = Readonly<{
|
|
10
10
|
type?: unknown;
|
|
11
11
|
from?: unknown;
|
|
12
12
|
to?: unknown;
|
|
13
13
|
}>;
|
|
14
14
|
export declare function validateSemanticInventoryBoundary(payload: Payload, relationships: readonly SemanticRelationship[], receipt: SemanticAdvisorReceipt): SemanticInventoryBoundaryResult;
|
|
15
15
|
export declare function assertSemanticInventoryBoundary(payload: Payload, relationships: readonly SemanticRelationship[], receipt: SemanticAdvisorReceipt): void;
|
|
16
|
+
/**
|
|
17
|
+
* The write-time claim_key check, run against planned writes only. Returns
|
|
18
|
+
* null when it passes or when a target is outside the plan (the write-time
|
|
19
|
+
* check reads that target from the KB).
|
|
20
|
+
*/
|
|
21
|
+
export declare function stagedLogicalGroundingError(payload: Payload, relationships: readonly SemanticRelationship[], planned: ReadonlyMap<string, Readonly<Record<string, unknown>>>): string | null;
|
|
16
22
|
export declare function assertLogicalGroundingClaimKeys(prolog: PrologPort, payload: Payload, relationships: readonly SemanticRelationship[], staged?: Readonly<{
|
|
17
23
|
entities: ReadonlyMap<string, Readonly<Record<string, unknown>>>;
|
|
18
24
|
}>): Promise<void>;
|
|
19
|
-
export {};
|
|
20
25
|
//# sourceMappingURL=ingestion-boundary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestion-boundary.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/ingestion-boundary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,EACL,KAAK,OAAO,EAOb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,YAAY,CAAC;AAgB9E,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,
|
|
1
|
+
{"version":3,"file":"ingestion-boundary.d.ts","sourceRoot":"","sources":["../../../src/operations/semantic-advisor/ingestion-boundary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,EAC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AAO,CAAC,IAAI,CAAC,CAwBf"}
|
|
@@ -135,27 +135,69 @@ export function assertSemanticInventoryBoundary(payload, relationships, receipt)
|
|
|
135
135
|
throw new Error(`Proposition-complete ingestion failed: ${result.errors.join("; ")}. Run kb_model mode analyze (CLI: semantic-advisor) with the complete prose and preserve its inventory contract before retrying.`);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
|
|
139
|
-
export async function assertLogicalGroundingClaimKeys(prolog, payload, relationships, staged) {
|
|
138
|
+
function modeledClaimKeysOf(payload) {
|
|
140
139
|
if (stringValue(payload.type) !== "req")
|
|
141
|
-
return;
|
|
140
|
+
return null;
|
|
142
141
|
if (propertiesOf(payload).semantic_inventory_version !==
|
|
143
142
|
SEMANTIC_INVENTORY_VERSION)
|
|
144
|
-
return;
|
|
145
|
-
|
|
143
|
+
return null;
|
|
144
|
+
return inventoryOf(payload)
|
|
146
145
|
.filter(({ status }) => status === "modeled")
|
|
147
146
|
.map(({ claim_key }) => stringValue(claim_key));
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
147
|
+
}
|
|
148
|
+
function groundingTargets(payload, relationships) {
|
|
149
|
+
return relationships
|
|
150
|
+
.filter((relationship) => relationship.from === payload.id &&
|
|
151
|
+
LOGICAL_RELATIONSHIPS.has(stringValue(relationship.type)))
|
|
152
|
+
.map((relationship) => stringValue(relationship.to));
|
|
153
|
+
}
|
|
154
|
+
function plannedClaimKey(planned) {
|
|
155
|
+
return planned.type === "fact" ? stringValue(planned.claim_key) : "";
|
|
156
|
+
}
|
|
157
|
+
function groundingClaimKeyError(modeledClaimKeys, grounded) {
|
|
158
|
+
const missing = grounded.find(([, claimKey]) => !claimKey);
|
|
159
|
+
if (missing)
|
|
160
|
+
return `Proposition-complete ingestion failed: logical grounding target '${missing[0]}' must declare a claim_key.`;
|
|
161
|
+
const groundedClaimKeys = grounded.map(([, claimKey]) => claimKey);
|
|
162
|
+
const duplicate = groundedClaimKeys.find((claimKey, index) => groundedClaimKeys.indexOf(claimKey) !== index);
|
|
163
|
+
if (duplicate)
|
|
164
|
+
return `Proposition-complete ingestion failed: claim '${duplicate}' has more than one logical grounding relationship.`;
|
|
165
|
+
if (groundedClaimKeys.length !== modeledClaimKeys.length ||
|
|
166
|
+
modeledClaimKeys.some((claimKey) => !groundedClaimKeys.includes(claimKey)))
|
|
167
|
+
return "Proposition-complete ingestion failed: modeled proposition claim_keys must match logical grounding target claim_keys exactly.";
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The write-time claim_key check, run against planned writes only. Returns
|
|
172
|
+
* null when it passes or when a target is outside the plan (the write-time
|
|
173
|
+
* check reads that target from the KB).
|
|
174
|
+
*/
|
|
175
|
+
// implements REQ-kibi-proposition-complete-ingestion, REQ-bootstrap-intent-claim-accounting
|
|
176
|
+
export function stagedLogicalGroundingError(payload, relationships, planned) {
|
|
177
|
+
const modeledClaimKeys = modeledClaimKeysOf(payload);
|
|
178
|
+
if (!modeledClaimKeys)
|
|
179
|
+
return null;
|
|
180
|
+
const grounded = [];
|
|
181
|
+
for (const target of groundingTargets(payload, relationships)) {
|
|
182
|
+
const entity = planned.get(target);
|
|
183
|
+
if (entity === undefined)
|
|
184
|
+
return null;
|
|
185
|
+
grounded.push([target, plannedClaimKey(entity)]);
|
|
186
|
+
}
|
|
187
|
+
return groundingClaimKeyError(modeledClaimKeys, grounded);
|
|
188
|
+
}
|
|
189
|
+
// implements REQ-kibi-proposition-complete-ingestion
|
|
190
|
+
export async function assertLogicalGroundingClaimKeys(prolog, payload, relationships, staged) {
|
|
191
|
+
const modeledClaimKeys = modeledClaimKeysOf(payload);
|
|
192
|
+
if (!modeledClaimKeys)
|
|
193
|
+
return;
|
|
194
|
+
const grounded = [];
|
|
195
|
+
for (const target of groundingTargets(payload, relationships)) {
|
|
154
196
|
// A grounding fact an earlier plan step writes is read from that write.
|
|
155
197
|
const planned = staged?.entities.get(target);
|
|
156
198
|
let claimKey = "";
|
|
157
199
|
if (planned !== undefined) {
|
|
158
|
-
claimKey =
|
|
200
|
+
claimKey = plannedClaimKey(planned);
|
|
159
201
|
}
|
|
160
202
|
else {
|
|
161
203
|
const result = await prolog.query(`once((kb_entity('${escapeAtom(target)}', fact, _SemanticGroundProps), memberchk(claim_key=_SemanticGroundRaw, _SemanticGroundProps), normalize_term_atom(_SemanticGroundRaw, ClaimKey)))`);
|
|
@@ -163,17 +205,12 @@ export async function assertLogicalGroundingClaimKeys(prolog, payload, relations
|
|
|
163
205
|
? stringValue(result.bindings.ClaimKey).replace(/^['"]|['"]$/g, "")
|
|
164
206
|
: "";
|
|
165
207
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
const duplicate = groundedClaimKeys.find((claimKey, index) => groundedClaimKeys.indexOf(claimKey) !== index);
|
|
172
|
-
if (duplicate) {
|
|
173
|
-
throw new Error(`Proposition-complete ingestion failed: claim '${duplicate}' has more than one logical grounding relationship.`);
|
|
174
|
-
}
|
|
175
|
-
if (groundedClaimKeys.length !== modeledClaimKeys.length ||
|
|
176
|
-
modeledClaimKeys.some((claimKey) => !groundedClaimKeys.includes(claimKey))) {
|
|
177
|
-
throw new Error("Proposition-complete ingestion failed: modeled proposition claim_keys must match logical grounding target claim_keys exactly.");
|
|
208
|
+
grounded.push([target, claimKey]);
|
|
209
|
+
// The first target without a claim_key is reported; later reads are moot.
|
|
210
|
+
if (!claimKey)
|
|
211
|
+
break;
|
|
178
212
|
}
|
|
213
|
+
const error = groundingClaimKeyError(modeledClaimKeys, grounded);
|
|
214
|
+
if (error)
|
|
215
|
+
throw new Error(error);
|
|
179
216
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const qualifiedSourceAnalyzers: readonly [{
|
|
2
2
|
readonly packageName: "kibi-plugin-treesitter";
|
|
3
|
-
readonly version: "1.0.
|
|
3
|
+
readonly version: "1.0.1";
|
|
4
4
|
readonly files: {
|
|
5
|
-
readonly "SBOM.spdx.json": "
|
|
5
|
+
readonly "SBOM.spdx.json": "82781126309b8e1e539f390ef6f0d7e46e38ee3b3b29e87cb4dd24315236c0d5";
|
|
6
6
|
readonly "THIRD_PARTY_NOTICES.md": "0b1ede96cb261dab73fd1ec8c51d7bb5b2492eed0502f6c10ed071736daa263c";
|
|
7
7
|
readonly "assets/queries/bash.scm": "6ca535e8fe652b51203ac272831881dab001f7ac508e50551bc2cdc4a15d7b6c";
|
|
8
8
|
readonly "assets/queries/c.scm": "774ca67cfe23b0e0d1d3a4f01788049a822beb1311feee72b20a595a37be1e28";
|
|
@@ -32,13 +32,13 @@ export declare const qualifiedSourceAnalyzers: readonly [{
|
|
|
32
32
|
readonly "assets/tree-sitter-ruby.wasm": "09a96427d7c72f0613ed470cd9812223fc4a91d6a9c025c0235cc6bd59ff96f4";
|
|
33
33
|
readonly "assets/tree-sitter-rust.wasm": "f65f354215611fd94ad34134b3427eb3d58cbb745df7b6509ba722184db73d57";
|
|
34
34
|
readonly "assets/tree-sitter-terraform.release.wasm": "59dbcbb0f08eb78b78f37510834559a48ce5c9d4866c978d62c6390796461cb5";
|
|
35
|
-
readonly "catalog.json": "
|
|
35
|
+
readonly "catalog.json": "9de667583cb69eb7dc1c04e2169cf864a063ee76a88bcc084a7f21da5d8e46f0";
|
|
36
36
|
readonly "dist/analysis-worker.js": "75a1e646f636c1d1ace9ae22a9141a51e94bddc70203bed08de7bd13dae1764e";
|
|
37
37
|
readonly "dist/catalog.js": "460243c48cb6a03b8c7971273729d8a1134955186978b6c0d04182c71960ebff";
|
|
38
38
|
readonly "dist/extractor.js": "1d8cd819e7ec8fcc291a44e5ffe4ccfe77099301677913fcfe0d92e7ce971f33";
|
|
39
39
|
readonly "dist/index.js": "adc03d77d94c0133b3188950b35f79db19e447cf7bfa1f7e1cf1f5c97a582a44";
|
|
40
40
|
readonly "dist/performance-timing.js": "56cce530f627c8fd079e8ec070322f84378ae50c40a6765d88b418850692940b";
|
|
41
|
-
readonly "integrity.json": "
|
|
41
|
+
readonly "integrity.json": "38f18dad5ab491562f4d0a6b82024e7c780c0b3a9bf1d53eee2c6744ab3da426";
|
|
42
42
|
readonly "licenses/tree-sitter-bash-MIT.txt": "49bf33cf78ef5897e4e161ce1517df7de1ae5042a65b6bcfd44401e0fc606559";
|
|
43
43
|
readonly "licenses/tree-sitter-c-MIT.txt": "2e0110e07abef7c2548b26ec9d6969775617ca539a0dc8dbeeb14d6452c711d1";
|
|
44
44
|
readonly "licenses/tree-sitter-c-sharp-MIT.txt": "778fb7d63b8c1844da315648c02f325c4713a6f4a5d19644fd413421422776d3";
|
|
@@ -51,7 +51,7 @@ export declare const qualifiedSourceAnalyzers: readonly [{
|
|
|
51
51
|
readonly "licenses/tree-sitter-ruby-MIT.txt": "9c99b99e93d3c6461bef9f6bac45d17b8bf014172625c24f76319bbd235a7b80";
|
|
52
52
|
readonly "licenses/tree-sitter-rust-MIT.txt": "31d5b6f4243d5c7c6e1c4ebbbb9f6407bd1457a08bcc4f706521710341acba36";
|
|
53
53
|
readonly "licenses/web-tree-sitter-MIT.txt": "c5cfb43042b6b72045f4ba997834d0a7786d2793d91680868b5815b39f14fc78";
|
|
54
|
-
readonly "package.json": "
|
|
54
|
+
readonly "package.json": "25f51aa2d923bf6446933b1c8da0e71485608518b92de668e21e10805a120749";
|
|
55
55
|
};
|
|
56
56
|
readonly dependencies: readonly [{
|
|
57
57
|
readonly packageName: "web-tree-sitter";
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
export const qualifiedSourceAnalyzers = [
|
|
5
5
|
{
|
|
6
6
|
packageName: "kibi-plugin-treesitter",
|
|
7
|
-
version: "1.0.
|
|
7
|
+
version: "1.0.1",
|
|
8
8
|
files: {
|
|
9
|
-
"SBOM.spdx.json": "
|
|
9
|
+
"SBOM.spdx.json": "82781126309b8e1e539f390ef6f0d7e46e38ee3b3b29e87cb4dd24315236c0d5",
|
|
10
10
|
"THIRD_PARTY_NOTICES.md": "0b1ede96cb261dab73fd1ec8c51d7bb5b2492eed0502f6c10ed071736daa263c",
|
|
11
11
|
"assets/queries/bash.scm": "6ca535e8fe652b51203ac272831881dab001f7ac508e50551bc2cdc4a15d7b6c",
|
|
12
12
|
"assets/queries/c.scm": "774ca67cfe23b0e0d1d3a4f01788049a822beb1311feee72b20a595a37be1e28",
|
|
@@ -36,13 +36,13 @@ export const qualifiedSourceAnalyzers = [
|
|
|
36
36
|
"assets/tree-sitter-ruby.wasm": "09a96427d7c72f0613ed470cd9812223fc4a91d6a9c025c0235cc6bd59ff96f4",
|
|
37
37
|
"assets/tree-sitter-rust.wasm": "f65f354215611fd94ad34134b3427eb3d58cbb745df7b6509ba722184db73d57",
|
|
38
38
|
"assets/tree-sitter-terraform.release.wasm": "59dbcbb0f08eb78b78f37510834559a48ce5c9d4866c978d62c6390796461cb5",
|
|
39
|
-
"catalog.json": "
|
|
39
|
+
"catalog.json": "9de667583cb69eb7dc1c04e2169cf864a063ee76a88bcc084a7f21da5d8e46f0",
|
|
40
40
|
"dist/analysis-worker.js": "75a1e646f636c1d1ace9ae22a9141a51e94bddc70203bed08de7bd13dae1764e",
|
|
41
41
|
"dist/catalog.js": "460243c48cb6a03b8c7971273729d8a1134955186978b6c0d04182c71960ebff",
|
|
42
42
|
"dist/extractor.js": "1d8cd819e7ec8fcc291a44e5ffe4ccfe77099301677913fcfe0d92e7ce971f33",
|
|
43
43
|
"dist/index.js": "adc03d77d94c0133b3188950b35f79db19e447cf7bfa1f7e1cf1f5c97a582a44",
|
|
44
44
|
"dist/performance-timing.js": "56cce530f627c8fd079e8ec070322f84378ae50c40a6765d88b418850692940b",
|
|
45
|
-
"integrity.json": "
|
|
45
|
+
"integrity.json": "38f18dad5ab491562f4d0a6b82024e7c780c0b3a9bf1d53eee2c6744ab3da426",
|
|
46
46
|
"licenses/tree-sitter-bash-MIT.txt": "49bf33cf78ef5897e4e161ce1517df7de1ae5042a65b6bcfd44401e0fc606559",
|
|
47
47
|
"licenses/tree-sitter-c-MIT.txt": "2e0110e07abef7c2548b26ec9d6969775617ca539a0dc8dbeeb14d6452c711d1",
|
|
48
48
|
"licenses/tree-sitter-c-sharp-MIT.txt": "778fb7d63b8c1844da315648c02f325c4713a6f4a5d19644fd413421422776d3",
|
|
@@ -55,7 +55,7 @@ export const qualifiedSourceAnalyzers = [
|
|
|
55
55
|
"licenses/tree-sitter-ruby-MIT.txt": "9c99b99e93d3c6461bef9f6bac45d17b8bf014172625c24f76319bbd235a7b80",
|
|
56
56
|
"licenses/tree-sitter-rust-MIT.txt": "31d5b6f4243d5c7c6e1c4ebbbb9f6407bd1457a08bcc4f706521710341acba36",
|
|
57
57
|
"licenses/web-tree-sitter-MIT.txt": "c5cfb43042b6b72045f4ba997834d0a7786d2793d91680868b5815b39f14fc78",
|
|
58
|
-
"package.json": "
|
|
58
|
+
"package.json": "25f51aa2d923bf6446933b1c8da0e71485608518b92de668e21e10805a120749",
|
|
59
59
|
},
|
|
60
60
|
dependencies: [
|
|
61
61
|
{
|
|
@@ -693,8 +693,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
693
693
|
readonly properties: {
|
|
694
694
|
readonly includeGenericMarkdown: {
|
|
695
695
|
readonly type: "boolean";
|
|
696
|
-
readonly
|
|
697
|
-
readonly description: "Whether to include generic markdown file content as candidate facts. Default: true.";
|
|
696
|
+
readonly description: "Whether to include generic markdown file content as candidate facts. Default: true, or false when bootstrapContext declares intentClaims (the declared sources already carry the intent); set it explicitly to override.";
|
|
698
697
|
};
|
|
699
698
|
readonly minConfidence: {
|
|
700
699
|
readonly type: "number";
|
|
@@ -708,7 +707,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
708
707
|
readonly default: 50;
|
|
709
708
|
readonly minimum: 1;
|
|
710
709
|
readonly maximum: 200;
|
|
711
|
-
readonly description: "
|
|
710
|
+
readonly description: "Budget for candidates Kibi discovers itself (symbols, tests, repository documents). Declared intentClaims sit outside it: they are never capped and never use its slots. Clamped to [1, 200]. Default: 50.";
|
|
712
711
|
};
|
|
713
712
|
readonly entityTypes: {
|
|
714
713
|
readonly type: "array";
|
|
@@ -799,7 +798,7 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
799
798
|
readonly intentClaims: {
|
|
800
799
|
readonly type: "array";
|
|
801
800
|
readonly maxItems: 200;
|
|
802
|
-
readonly description: "Statements
|
|
801
|
+
readonly description: "Statements the agent harvested from knowledgeSources, each citing its source. Intent claims (the default kind) that the strict modeler can ground become cited req candidates; the rest become explicit authoring follow-ups. Observation and open_question claims never become requirements: they become cited fact candidates with fact_kind observation, open questions tagged review:open-question. Bound into the plan hash.";
|
|
803
802
|
readonly items: {
|
|
804
803
|
readonly type: "object";
|
|
805
804
|
readonly required: readonly ["statement", "sourceId", "reference"];
|
|
@@ -823,6 +822,49 @@ export declare const OPERATION_CATALOG: readonly [{
|
|
|
823
822
|
readonly type: "string";
|
|
824
823
|
readonly description: "Optional short quote supporting the claim.";
|
|
825
824
|
};
|
|
825
|
+
readonly kind: {
|
|
826
|
+
readonly type: "string";
|
|
827
|
+
readonly enum: readonly ["intent", "observation", "open_question"];
|
|
828
|
+
readonly default: "intent";
|
|
829
|
+
readonly description: "intent: intended behavior (may become a req). observation: how things are today, without stating intent. open_question: something the sources leave undecided. Default: intent.";
|
|
830
|
+
};
|
|
831
|
+
};
|
|
832
|
+
};
|
|
833
|
+
};
|
|
834
|
+
readonly conflicts: {
|
|
835
|
+
readonly type: "array";
|
|
836
|
+
readonly maxItems: 50;
|
|
837
|
+
readonly description: "Contradictions the agent found between declared intentClaims and leaves for the human to resolve. Each becomes a cited fact candidate with fact_kind observation tagged review:conflict. Every claimReference must match a declared claim's sourceId and reference. Bound into the plan hash.";
|
|
838
|
+
readonly items: {
|
|
839
|
+
readonly type: "object";
|
|
840
|
+
readonly required: readonly ["claimReferences", "note"];
|
|
841
|
+
readonly additionalProperties: false;
|
|
842
|
+
readonly properties: {
|
|
843
|
+
readonly claimReferences: {
|
|
844
|
+
readonly type: "array";
|
|
845
|
+
readonly minItems: 2;
|
|
846
|
+
readonly maxItems: 10;
|
|
847
|
+
readonly items: {
|
|
848
|
+
readonly type: "object";
|
|
849
|
+
readonly required: readonly ["sourceId", "reference"];
|
|
850
|
+
readonly additionalProperties: false;
|
|
851
|
+
readonly properties: {
|
|
852
|
+
readonly sourceId: {
|
|
853
|
+
readonly type: "string";
|
|
854
|
+
readonly minLength: 1;
|
|
855
|
+
};
|
|
856
|
+
readonly reference: {
|
|
857
|
+
readonly type: "string";
|
|
858
|
+
readonly minLength: 1;
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
};
|
|
862
|
+
};
|
|
863
|
+
readonly note: {
|
|
864
|
+
readonly type: "string";
|
|
865
|
+
readonly minLength: 1;
|
|
866
|
+
readonly description: "What disagrees, in one sentence, without resolving it.";
|
|
867
|
+
};
|
|
826
868
|
};
|
|
827
869
|
};
|
|
828
870
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/public/operations/catalog.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/public/operations/catalog.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBe,CAAC;AAyF9C,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,aAAa,GAClB,qBAAqB,CA+BvB;AAQD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,qBAAqB,GAAG,SAAS,EACvC,IAAI,EAAE,aAAa,GAClB,qBAAqB,CAKvB;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,qBAAqB,CAElE;AAGD,wBAAgB,SAAS,IAAI,SAAS,qBAAqB,EAAE,CAE5D"}
|
|
@@ -38,12 +38,14 @@ export declare function loadSearchCandidates(prolog: Pick<PrologPort, "searchEnt
|
|
|
38
38
|
readonly maxCandidates?: number;
|
|
39
39
|
}, signal?: AbortSignal): Promise<Record<string, unknown>[]>;
|
|
40
40
|
/**
|
|
41
|
-
* Projected candidate rows for every entity (optionally of one type
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* Projected candidate rows for every entity (optionally of one type, and
|
|
42
|
+
* optionally only those whose source contains `sourceFile`), in id order,
|
|
43
|
+
* bounded by `maxCandidates`. For semantic discovery that has no lexical
|
|
44
|
+
* token to pre-filter candidates, and for source-located search.
|
|
44
45
|
*/
|
|
45
46
|
export declare function listSearchCandidates(prolog: Pick<PrologPort, "query">, input: {
|
|
46
47
|
readonly type?: string;
|
|
48
|
+
readonly sourceFile?: string;
|
|
47
49
|
readonly maxCandidates: number;
|
|
48
50
|
}, signal?: AbortSignal): Promise<Record<string, unknown>[]>;
|
|
49
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-entities.d.ts","sourceRoot":"","sources":["../../../src/public/operations/discovery-entities.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,UAAU,EAGX,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC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