kibi-cli 2.38.0 → 2.40.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/dist/cli-json-command.d.ts.map +1 -1
- package/dist/cli-json-command.js +4 -0
- package/dist/cli-register-foundation.js +2 -2
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +33 -9
- package/dist/commands/coverage.d.ts +1 -0
- package/dist/commands/coverage.d.ts.map +1 -1
- package/dist/commands/coverage.js +40 -0
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +29 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +4 -0
- package/dist/commands/migrate-plan-record.d.ts +18 -0
- package/dist/commands/migrate-plan-record.d.ts.map +1 -0
- package/dist/commands/migrate-plan-record.js +112 -0
- package/dist/commands/migrate.d.ts +11 -2
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +60 -8
- package/dist/commands/prove.d.ts.map +1 -1
- package/dist/commands/prove.js +18 -3
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +17 -4
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +6 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +8 -0
- package/dist/commands/telemetry.d.ts.map +1 -1
- package/dist/commands/telemetry.js +12 -2
- package/dist/extractors/markdown.d.ts +6 -0
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +21 -0
- package/dist/extractors/symbol-title-match.d.ts +31 -0
- package/dist/extractors/symbol-title-match.d.ts.map +1 -0
- package/dist/extractors/symbol-title-match.js +133 -0
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.js +81 -12
- package/dist/operations/bootstrap/discovery-evidence.d.ts.map +1 -1
- package/dist/operations/bootstrap/discovery-evidence.js +44 -2
- package/dist/operations/bootstrap/discovery.d.ts.map +1 -1
- package/dist/operations/bootstrap/discovery.js +1 -0
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +12 -1
- package/dist/operations/bootstrap/plugin-offers.d.ts +7 -1
- package/dist/operations/bootstrap/plugin-offers.d.ts.map +1 -1
- package/dist/operations/bootstrap/plugin-offers.js +73 -3
- package/dist/operations/modeling/logic-modeling.d.ts.map +1 -1
- package/dist/operations/modeling/logic-modeling.js +2 -1
- package/dist/operations/modeling/model-requirement.d.ts.map +1 -1
- package/dist/operations/modeling/model-requirement.js +2 -1
- package/dist/operations/mutation/symbol-refresh.d.ts +2 -0
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-refresh.js +6 -1
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +7 -0
- package/dist/operations/planning/compile-intent.d.ts.map +1 -1
- package/dist/operations/planning/compile-intent.js +2 -1
- package/dist/operations/proof/claim-bindings.d.ts +11 -0
- package/dist/operations/proof/claim-bindings.d.ts.map +1 -1
- package/dist/operations/proof/claim-bindings.js +144 -1
- package/dist/operations/proof/code-certificates.d.ts +10 -3
- package/dist/operations/proof/code-certificates.d.ts.map +1 -1
- package/dist/operations/proof/code-certificates.js +65 -13
- package/dist/operations/proof/code-languages.d.ts +104 -0
- package/dist/operations/proof/code-languages.d.ts.map +1 -0
- package/dist/operations/proof/code-languages.js +119 -0
- package/dist/operations/proof/code-models.d.ts +2 -0
- package/dist/operations/proof/code-models.d.ts.map +1 -1
- package/dist/operations/proof/code-models.js +11 -5
- package/dist/operations/proof/code-runner.d.ts +12 -9
- package/dist/operations/proof/code-runner.d.ts.map +1 -1
- package/dist/operations/proof/code-runner.js +81 -38
- package/dist/operations/proof/code-scope.d.ts +8 -0
- package/dist/operations/proof/code-scope.d.ts.map +1 -1
- package/dist/operations/proof/code-scope.js +30 -1
- package/dist/operations/proof/explain.d.ts +76 -0
- package/dist/operations/proof/explain.d.ts.map +1 -1
- package/dist/operations/proof/explain.js +228 -0
- package/dist/operations/proof/ingest-proof.d.ts +2 -0
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +1 -0
- package/dist/operations/proof/java-package-shadow.d.ts +14 -0
- package/dist/operations/proof/java-package-shadow.d.ts.map +1 -0
- package/dist/operations/proof/java-package-shadow.js +389 -0
- package/dist/operations/proof/prolog-evaluator.d.ts +14 -0
- package/dist/operations/proof/prolog-evaluator.d.ts.map +1 -0
- package/dist/operations/proof/prolog-evaluator.js +247 -0
- package/dist/operations/proof/prolog-source-reader.d.ts +20 -0
- package/dist/operations/proof/prolog-source-reader.d.ts.map +1 -0
- package/dist/operations/proof/prolog-source-reader.js +1123 -0
- package/dist/operations/proof/source-code-readers.d.ts +6 -0
- package/dist/operations/proof/source-code-readers.d.ts.map +1 -1
- package/dist/operations/proof/source-code-readers.js +879 -75
- package/dist/operations/semantic-advisor/analyze-prose.d.ts +9 -1
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +21 -0
- package/dist/operations/semantic-advisor/case-preview.d.ts +24 -0
- package/dist/operations/semantic-advisor/case-preview.d.ts.map +1 -0
- package/dist/operations/semantic-advisor/case-preview.js +216 -0
- package/dist/operations/semantic-advisor/shared.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/shared.js +3 -0
- package/dist/operations/semantic-advisor/types.d.ts +23 -0
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/plugins/approved-source-analyzers.generated.d.ts +15 -34
- package/dist/plugins/approved-source-analyzers.generated.d.ts.map +1 -1
- package/dist/plugins/approved-source-analyzers.generated.js +15 -34
- package/dist/plugins/plugin-install-check.d.ts +21 -0
- package/dist/plugins/plugin-install-check.d.ts.map +1 -0
- package/dist/plugins/plugin-install-check.js +62 -0
- package/dist/plugins/proof-reference-extractors.d.ts +20 -0
- package/dist/plugins/proof-reference-extractors.d.ts.map +1 -0
- package/dist/plugins/proof-reference-extractors.js +104 -0
- package/dist/plugins/reference-language-suggestion.d.ts +51 -0
- package/dist/plugins/reference-language-suggestion.d.ts.map +1 -0
- package/dist/plugins/reference-language-suggestion.js +277 -0
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +3 -1
- package/dist/plugins/source-analysis-service.d.ts.map +1 -1
- package/dist/plugins/source-analysis-service.js +4 -0
- package/dist/plugins/source-change-analysis.d.ts +26 -1
- package/dist/plugins/source-change-analysis.d.ts.map +1 -1
- package/dist/plugins/source-change-analysis.js +77 -5
- package/dist/plugins/source-classification.d.ts +2 -2
- package/dist/plugins/source-classification.d.ts.map +1 -1
- package/dist/plugins/source-classification.js +45 -1
- package/dist/public/operations/catalog.d.ts +62 -7
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +3 -0
- package/dist/public/operations/evidence-floor.d.ts +8 -0
- package/dist/public/operations/evidence-floor.d.ts.map +1 -1
- package/dist/public/operations/evidence-floor.js +19 -1
- package/dist/public/operations/repair-plan.d.ts +46 -0
- package/dist/public/operations/repair-plan.d.ts.map +1 -1
- package/dist/public/operations/repair-plan.js +110 -1
- package/dist/public/operations/schema6-check-actions.js +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts +1 -1
- package/dist/public/operations/specs/check-rules.generated.d.ts.map +1 -1
- package/dist/public/operations/specs/check-rules.generated.js +3 -1
- package/dist/public/operations/specs/check.d.ts +1 -1
- package/dist/public/operations/specs/mutation-schemas.d.ts +61 -6
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +30 -0
- package/dist/public/operations/specs/reporting.d.ts +8 -0
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +26 -3
- package/dist/public/operations/specs/semantic.d.ts.map +1 -1
- package/dist/public/operations/specs/semantic.js +2 -1
- package/dist/public/operations/specs/upsert.d.ts +61 -6
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/operations/symbol-coordinates-check.d.ts +11 -0
- package/dist/public/operations/symbol-coordinates-check.d.ts.map +1 -0
- package/dist/public/operations/symbol-coordinates-check.js +66 -0
- package/dist/public/proof-protocol.d.ts +31 -6
- package/dist/public/proof-protocol.d.ts.map +1 -1
- package/dist/public/proof-protocol.js +45 -15
- package/dist/public/proof-sources.d.ts +4 -2
- package/dist/public/proof-sources.d.ts.map +1 -1
- package/dist/public/proof-sources.js +43 -4
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +59 -0
- package/dist/public/skills/kibi-commit-review/SKILL.md +6 -2
- package/dist/public/skills/kibi-decisions/SKILL.md +7 -2
- package/dist/public/skills/kibi-decisions/resources/signoff-views.md +3 -1
- package/dist/public/skills/kibi-usage/SKILL.md +14 -3
- package/dist/public/skills/kibi-usage/resources/prolog-proofs.md +207 -0
- package/dist/public/skills/kibi-usage/resources/proof.md +44 -3
- package/dist/schemas/entity.schema.json +126 -6
- package/dist/search-answer.d.ts +3 -2
- package/dist/search-answer.d.ts.map +1 -1
- package/dist/search-answer.js +56 -3
- package/dist/traceability/analysis-gate.d.ts +3 -1
- package/dist/traceability/analysis-gate.d.ts.map +1 -1
- package/dist/traceability/analysis-gate.js +9 -1
- package/dist/traceability/impact-knowledge.d.ts.map +1 -1
- package/dist/traceability/impact-knowledge.js +2 -0
- package/dist/traceability/staged-file-coverage.d.ts.map +1 -1
- package/dist/traceability/staged-file-coverage.js +7 -2
- package/dist/traceability/symbol-extract.d.ts +17 -0
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +69 -15
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +11 -1
- package/dist/traceability/validate.d.ts.map +1 -1
- package/dist/traceability/validate.js +5 -7
- package/dist/types/entities.d.ts +12 -0
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/usage-telemetry.d.ts +9 -0
- package/dist/usage-telemetry.d.ts.map +1 -1
- package/dist/usage-telemetry.js +50 -4
- package/dist/utils/first-sentence.d.ts +9 -0
- package/dist/utils/first-sentence.d.ts.map +1 -0
- package/dist/utils/first-sentence.js +52 -0
- package/dist/utils/rule-registry.generated.d.ts +11 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +13 -0
- package/package.json +5 -5
- package/schema/entities.pl +12 -0
- package/src/public/operations/check-executor.ts +8 -0
- package/src/public/operations/evidence-floor.ts +29 -1
- package/src/public/operations/repair-plan.ts +152 -1
- package/src/public/operations/schema6-check-actions.ts +1 -1
- package/src/public/operations/specs/check-rules.generated.ts +3 -1
- package/src/public/operations/specs/mutation-schemas.ts +34 -0
- package/src/public/operations/specs/reporting.ts +38 -3
- package/src/public/operations/specs/semantic.ts +2 -1
- package/src/public/operations/symbol-coordinates-check.ts +79 -0
- package/src/public/proof-protocol-types.d.ts +22 -5
- package/src/public/proof-protocol.ts +78 -19
- package/src/public/proof-sources.ts +51 -3
- package/src/public/schemas/entity.ts +65 -0
- package/src/public/skills/kibi-commit-review/SKILL.md +6 -2
- package/src/public/skills/kibi-decisions/SKILL.md +7 -2
- package/src/public/skills/kibi-decisions/resources/signoff-views.md +3 -1
- package/src/public/skills/kibi-usage/SKILL.md +14 -3
- package/src/public/skills/kibi-usage/resources/prolog-proofs.md +207 -0
- package/src/public/skills/kibi-usage/resources/proof.md +44 -3
- package/src/schemas/entity.schema.json +126 -6
|
@@ -20,7 +20,9 @@ import * as path from "node:path";
|
|
|
20
20
|
import { createMaintenanceSourceAnalysisService } from "../plugins/maintenance-source-analysis.js";
|
|
21
21
|
import { createSourceAnalysisService, } from "../plugins/source-analysis-service.js";
|
|
22
22
|
import { extensionLanguage, isTsJsSourcePath, } from "../plugins/source-classification.js";
|
|
23
|
+
import { analysisObligation } from "../traceability/analysis-gate.js";
|
|
23
24
|
import { resolveWorkspaceSourceAbsolute } from "../utils/repo-relative-path.js";
|
|
25
|
+
import { matchDeclarationTitle } from "./symbol-title-match.js";
|
|
24
26
|
import { createTsMorphSourceAnalysisProvider, enrichSymbolCoordinatesWithTsMorph, } from "./symbols-ts.js";
|
|
25
27
|
const DEFAULT_SOURCE_ANALYSIS_PROVIDERS = [
|
|
26
28
|
createTsMorphSourceAnalysisProvider(),
|
|
@@ -83,6 +85,31 @@ export async function analyzeSourceTextWithRegistry(filePath, content, registry)
|
|
|
83
85
|
return analyzeSourceText(filePath, content);
|
|
84
86
|
}
|
|
85
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* The uncovered ranges of a partial analysis whose gaps are local (a macro,
|
|
90
|
+
* an include, a dynamic definition), or null when the gap affects the whole
|
|
91
|
+
* file (syntax, parse, timeout, integrity, a diagnostic limit) or the provider
|
|
92
|
+
* named no ranges. A symbol declared outside every local range was parsed in
|
|
93
|
+
* full, so its span stays trustworthy.
|
|
94
|
+
*/
|
|
95
|
+
// implements REQ-source-analysis-v2
|
|
96
|
+
function localPartialRanges(analysis) {
|
|
97
|
+
const codes = analysis.diagnostics.map((diagnostic) => diagnostic.code);
|
|
98
|
+
if (codes.some((code) => /LIMIT/i.test(code)))
|
|
99
|
+
return null;
|
|
100
|
+
const obligation = analysisObligation("after", {
|
|
101
|
+
status: "partial",
|
|
102
|
+
diagnosticCodes: codes,
|
|
103
|
+
uncoveredRanges: analysis.uncoveredRanges,
|
|
104
|
+
}, []);
|
|
105
|
+
return obligation.kind === "blocked" ? null : analysis.uncoveredRanges;
|
|
106
|
+
}
|
|
107
|
+
/** Diagnostics as `CODE (line N): message`, one per distinct message. */
|
|
108
|
+
function describeAnalysisDiagnostics(diagnostics) {
|
|
109
|
+
return [
|
|
110
|
+
...new Set(diagnostics.map((diagnostic) => `${diagnostic.code}${diagnostic.range ? ` (line ${diagnostic.range.startLine})` : ""}: ${diagnostic.message}`)),
|
|
111
|
+
].join("; ");
|
|
112
|
+
}
|
|
86
113
|
function isCoordinateOnlyDecoratorPartial(analysis) {
|
|
87
114
|
if (analysis.status !== "partial" ||
|
|
88
115
|
analysis.language !== "python" ||
|
|
@@ -124,8 +151,14 @@ export async function enrichSymbolCoordinates(entries, workspaceRoot, deps) {
|
|
|
124
151
|
if (!entry)
|
|
125
152
|
continue;
|
|
126
153
|
const resolved = resolveSourcePath(entry.sourceFile, workspaceRoot);
|
|
127
|
-
if (!resolved || !fs.statSync(resolved.absolutePath).isFile())
|
|
154
|
+
if (!resolved || !fs.statSync(resolved.absolutePath).isFile()) {
|
|
155
|
+
if (entry.sourceFile)
|
|
156
|
+
output[index] = {
|
|
157
|
+
...entry,
|
|
158
|
+
coordinateRefreshFailure: unreadableSourceReason(entry.sourceFile, workspaceRoot),
|
|
159
|
+
};
|
|
128
160
|
continue;
|
|
161
|
+
}
|
|
129
162
|
const ext = path.extname(resolved.absolutePath).toLowerCase();
|
|
130
163
|
if (isTsJsSourcePath(resolved.absolutePath)) {
|
|
131
164
|
tsIndices.push(index);
|
|
@@ -143,27 +176,55 @@ export async function enrichSymbolCoordinates(entries, workspaceRoot, deps) {
|
|
|
143
176
|
}
|
|
144
177
|
const coordinateOnlyPartial = deps?.allowPythonDecoratorCoordinates === true &&
|
|
145
178
|
isCoordinateOnlyDecoratorPartial(analysis);
|
|
179
|
+
const localGaps = analysis.status === "partial" && !coordinateOnlyPartial
|
|
180
|
+
? localPartialRanges(analysis)
|
|
181
|
+
: null;
|
|
146
182
|
if (analysis.status === "failed" ||
|
|
147
|
-
(analysis.status === "partial" && !coordinateOnlyPartial))
|
|
148
|
-
|
|
183
|
+
(analysis.status === "partial" && !coordinateOnlyPartial && !localGaps)) {
|
|
184
|
+
// A file the analyzer cannot read as a whole (a syntax error, which a
|
|
185
|
+
// grammar may also report for valid code, a timeout, a changed grammar)
|
|
186
|
+
// gives its own symbols no coordinates; every other file still refreshes.
|
|
187
|
+
const reason = `Cannot refresh incomplete source analysis for ${logicalPath}: ${describeAnalysisDiagnostics(analysis.diagnostics)}`;
|
|
188
|
+
if (firstAnalysis)
|
|
189
|
+
console.warn(`[kibi] ${reason}`);
|
|
190
|
+
output[index] = { ...entry, coordinateRefreshFailure: reason };
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
if (localGaps && firstAnalysis) {
|
|
194
|
+
console.warn(`[kibi] ${logicalPath}: source analysis is partial; symbols declared on ${localGaps.map((range) => (range.startLine === range.endLine ? `line ${range.startLine}` : `lines ${range.startLine}-${range.endLine}`)).join(", ")} keep no coordinates (${describeAnalysisDiagnostics(analysis.diagnostics)})`);
|
|
195
|
+
}
|
|
149
196
|
if (coordinateOnlyPartial && firstAnalysis) {
|
|
150
197
|
console.warn(`[kibi] Coordinate-only refresh for ${logicalPath}; source analysis remains partial: ${analysis.diagnostics.map((diagnostic) => diagnostic.message).join("; ")}`);
|
|
151
198
|
}
|
|
152
199
|
if (analysis.status === "unsupported") {
|
|
200
|
+
const pack = analysis.diagnostics.find((diagnostic) => diagnostic.code.startsWith("TREESITTER_LANGUAGE_PACK_"));
|
|
201
|
+
const fileLevel = analysis.diagnostics.find((diagnostic) => diagnostic.code === "source_file_level_only");
|
|
202
|
+
if (fileLevel && !pack && firstAnalysis)
|
|
203
|
+
console.warn(`[kibi] ${logicalPath}: symbol coordinates are approximate (placed by text match). ${fileLevel.message}`);
|
|
204
|
+
if (pack && firstAnalysis)
|
|
205
|
+
console.warn(`[kibi] ${logicalPath}: symbol coordinates are approximate until its grammar pack is installed. ${pack.message}`);
|
|
153
206
|
// Preserve the legacy coarse heuristic until the file-level migration;
|
|
154
207
|
// it is never exposed as parser-backed symbol evidence.
|
|
155
|
-
|
|
208
|
+
const placed = enrichWithRegexHeuristic(entry, resolved.absolutePath);
|
|
209
|
+
output[index] =
|
|
210
|
+
placed.sourceLine === undefined
|
|
211
|
+
? {
|
|
212
|
+
...placed,
|
|
213
|
+
coordinateRefreshFailure: `no text match for '${entry.title}' in ${logicalPath}, which has no parser-backed declarations (${(pack ?? fileLevel)?.message ?? "no symbol extractor reads this file type"})`,
|
|
214
|
+
}
|
|
215
|
+
: placed;
|
|
156
216
|
continue;
|
|
157
217
|
}
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
: analysis.symbols
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (!symbol)
|
|
218
|
+
const declared = localGaps
|
|
219
|
+
? analysis.symbols.filter((symbol) => !localGaps.some((range) => range.startLine <= symbol.startLine &&
|
|
220
|
+
symbol.startLine <= range.endLine))
|
|
221
|
+
: analysis.symbols;
|
|
222
|
+
const match = matchDeclarationTitle(entry.title, declared, logicalPath, analysis.symbols);
|
|
223
|
+
if ("failure" in match) {
|
|
224
|
+
output[index] = { ...entry, coordinateRefreshFailure: match.failure };
|
|
166
225
|
continue;
|
|
226
|
+
}
|
|
227
|
+
const symbol = match.symbol;
|
|
167
228
|
output[index] = {
|
|
168
229
|
...entry,
|
|
169
230
|
sourceLine: symbol.startLine,
|
|
@@ -227,6 +288,14 @@ function enrichWithRegexHeuristic(entry, absolutePath) {
|
|
|
227
288
|
return entry;
|
|
228
289
|
}
|
|
229
290
|
}
|
|
291
|
+
function unreadableSourceReason(sourceFile, workspaceRoot) {
|
|
292
|
+
const absolute = resolveWorkspaceSourceAbsolute(workspaceRoot, sourceFile);
|
|
293
|
+
if (absolute === null)
|
|
294
|
+
return `${sourceFile} is not a file path inside the workspace`;
|
|
295
|
+
if (!fs.existsSync(absolute))
|
|
296
|
+
return `${sourceFile} does not exist`;
|
|
297
|
+
return `${sourceFile} is not a regular file`;
|
|
298
|
+
}
|
|
230
299
|
function resolveSourcePath(sourceFile, workspaceRoot) {
|
|
231
300
|
if (!sourceFile)
|
|
232
301
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-evidence.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/discovery-evidence.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discovery-evidence.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/discovery-evidence.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAGV,gBAAgB,EACjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EAGlB,MAAM,YAAY,CAAC;AA0BpB,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC;AA6NF,wBAAsB,YAAY,CAChC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,YAAY,CAAC,CA4DvB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { OperationError } from "../../cli-errors.js";
|
|
3
|
+
import { classifySource } from "../../plugins/source-classification.js";
|
|
3
4
|
const SCAN_PATTERNS = [
|
|
4
5
|
"**/*.md",
|
|
5
6
|
"**/symbols.{yml,yaml}",
|
|
@@ -9,9 +10,9 @@ const SCAN_PATTERNS = [
|
|
|
9
10
|
"**/Cargo.toml",
|
|
10
11
|
"**/go.mod",
|
|
11
12
|
"**/opencode.json",
|
|
12
|
-
"**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs,py,rb,go,rs,java,kt,swift,php,c,cc,cpp,h,hpp}",
|
|
13
|
+
"**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs,py,pyi,rb,go,rs,java,kt,swift,php,c,cc,cpp,cxx,h,hh,hpp,hxx,cs,sh,bash,tf,hcl,pl,plt}",
|
|
13
14
|
];
|
|
14
|
-
const CODE_EXTENSION = /\.(ts|tsx|mts|cts|js|jsx|mjs|cjs|py|rb|go|rs|java|kt|swift|php|c|cc|cpp|h|hpp)$/i;
|
|
15
|
+
const CODE_EXTENSION = /\.(ts|tsx|mts|cts|js|jsx|mjs|cjs|py|pyi|rb|go|rs|java|kt|swift|php|c|cc|cpp|cxx|h|hh|hpp|hxx|cs|sh|bash|tf|hcl|pl|plt)$/i;
|
|
15
16
|
const LAYOUT_ROOTS = new Set([
|
|
16
17
|
"src",
|
|
17
18
|
"app",
|
|
@@ -41,6 +42,9 @@ function isTypedKibiMarkdownPath(relativePath) {
|
|
|
41
42
|
function classifyFile(relativePath, content) {
|
|
42
43
|
if (/^\.kb\/symbols\.ya?ml$/i.test(relativePath))
|
|
43
44
|
return ["typed_kibi_docs", "symbol_manifest"];
|
|
45
|
+
// Kibi's own generated schema (.kb/schema/*.pl) is not project source.
|
|
46
|
+
if (/^\.kb\//.test(relativePath) && CODE_EXTENSION.test(relativePath))
|
|
47
|
+
return null;
|
|
44
48
|
if (/\.md$/i.test(relativePath)) {
|
|
45
49
|
return /^---\s*[\r\n]/.test(content) &&
|
|
46
50
|
isTypedKibiMarkdownPath(relativePath)
|
|
@@ -50,12 +54,47 @@ function classifyFile(relativePath, content) {
|
|
|
50
54
|
if (/(^|\/)(package\.json|tsconfig[^/]*\.json|pyproject\.toml|Cargo\.toml|go\.mod)$/.test(relativePath))
|
|
51
55
|
return ["repo_metadata", "repo_metadata"];
|
|
52
56
|
if (/\.(test|spec)\.[^.]+$/i.test(relativePath) ||
|
|
57
|
+
/\.plt$/i.test(relativePath) ||
|
|
53
58
|
/(^|\/)__tests__\//.test(relativePath))
|
|
54
59
|
return ["test_topology", "test_topology"];
|
|
60
|
+
// `.pl` is shared by Perl and Prolog; only Prolog source is scanned.
|
|
61
|
+
if (/\.pl$/i.test(relativePath) &&
|
|
62
|
+
classifySource(relativePath, content).language !== "prolog")
|
|
63
|
+
return null;
|
|
55
64
|
if (CODE_EXTENSION.test(relativePath))
|
|
56
65
|
return ["source_symbols", "source_symbols"];
|
|
57
66
|
return null;
|
|
58
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* A Prolog file's `:- module(Name, Exports)` declaration. The export list is
|
|
70
|
+
* a claim the source makes about its public predicates.
|
|
71
|
+
*/
|
|
72
|
+
// implements REQ-KIBI-BOOTSTRAP-PLAN
|
|
73
|
+
function prologModuleEvidence(relativePath, content) {
|
|
74
|
+
const declaration = content.match(/^:-\s*module\(\s*([a-z][A-Za-z0-9_]*|'(?:[^'\\]|'')*')\s*,\s*\[([^\]]*)\]/m);
|
|
75
|
+
const moduleName = declaration?.[1]?.replace(/^'|'$/g, "");
|
|
76
|
+
const exports = [
|
|
77
|
+
...(declaration?.[2] ?? "")
|
|
78
|
+
.replace(/%[^\n]*/g, "")
|
|
79
|
+
.matchAll(/([a-z][A-Za-z0-9_]*|'(?:[^'\\]|'')*')\s*(\/\/?)\s*(\d+)/g),
|
|
80
|
+
].map(([, name, slash, arity]) => `${name}${slash}${arity}`);
|
|
81
|
+
const title = `Source module: ${moduleName ?? path.basename(relativePath, ".pl")}`;
|
|
82
|
+
return {
|
|
83
|
+
title,
|
|
84
|
+
factKind: "observation",
|
|
85
|
+
confidence: 0.82,
|
|
86
|
+
evidence: [`source_symbols:${relativePath}`],
|
|
87
|
+
analysisMode: "parser",
|
|
88
|
+
symbolCount: exports.length,
|
|
89
|
+
...(moduleName === undefined ? {} : { module: moduleName }),
|
|
90
|
+
exports,
|
|
91
|
+
...(moduleName !== undefined && exports.length > 0
|
|
92
|
+
? {
|
|
93
|
+
claim: `Prolog module ${moduleName} (${relativePath}) exports ${exports.join(", ")}.`,
|
|
94
|
+
}
|
|
95
|
+
: {}),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
59
98
|
function evidenceData(provider, relativePath, content) {
|
|
60
99
|
if (provider === "repo_metadata") {
|
|
61
100
|
const languages = new Set();
|
|
@@ -91,6 +130,7 @@ function evidenceData(provider, relativePath, content) {
|
|
|
91
130
|
content.includes("bun:test") ? "bun:test" : "",
|
|
92
131
|
content.includes("vitest") ? "vitest" : "",
|
|
93
132
|
content.includes("node:test") ? "node:test" : "",
|
|
133
|
+
/^:-\s*begin_tests\(/m.test(content) ? "plunit" : "",
|
|
94
134
|
].filter(Boolean);
|
|
95
135
|
// A recognized framework is a claim about the file (it is a test that
|
|
96
136
|
// runs under that framework); without one the provider only found the
|
|
@@ -111,6 +151,8 @@ function evidenceData(provider, relativePath, content) {
|
|
|
111
151
|
: {}),
|
|
112
152
|
};
|
|
113
153
|
}
|
|
154
|
+
if (provider === "source_symbols" && /\.pl$/i.test(relativePath))
|
|
155
|
+
return prologModuleEvidence(relativePath, content);
|
|
114
156
|
if (provider === "source_symbols") {
|
|
115
157
|
const symbolCount = Array.from(content.matchAll(/\b(?:export\s+)?(?:function|class|const|let|var|interface|type)\s+([A-Za-z_$][\w$]*)/g)).length;
|
|
116
158
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/discovery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAKjF,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/discovery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAKjF,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AAgFpB,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAgD1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidance-actions.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance-actions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,wBAAwB,EAClC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,MAAM,GAAE,SAAS,WAAW,EAAO,GAClC,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"guidance-actions.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/guidance-actions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,wBAAwB,EAClC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,MAAM,GAAE,SAAS,WAAW,EAAO,GAClC,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CA6G9C"}
|
|
@@ -94,7 +94,18 @@ export function buildActions(root, activation, declared, candidates, signals, of
|
|
|
94
94
|
capability: offer.capability,
|
|
95
95
|
mode: offer.mode,
|
|
96
96
|
evidence: offer.evidence,
|
|
97
|
-
|
|
97
|
+
...(offer.alsoActivate === undefined
|
|
98
|
+
? {}
|
|
99
|
+
: { alsoActivate: offer.alsoActivate }),
|
|
100
|
+
...(offer.alsoInstall === undefined
|
|
101
|
+
? {}
|
|
102
|
+
: { alsoInstall: offer.alsoInstall }),
|
|
103
|
+
description: `${offer.reason} (${summary(offer.evidence)}). Ask the operator whether to enable the experimental ${offer.package}; on yes, install ${offer.alsoInstall === undefined ? "it as a dev dependency" : `it and ${offer.alsoInstall.join(", ")} as dev dependencies`} and add it to package.json kibi.plugins with ${[
|
|
104
|
+
[offer.capability, offer.mode],
|
|
105
|
+
...Object.entries(offer.alsoActivate ?? {}),
|
|
106
|
+
]
|
|
107
|
+
.map(([capability, mode]) => `"${capability}": { "mode": "${mode}" }`)
|
|
108
|
+
.join(", ")}; on no, add "${offer.package}" to kibi.declinedPlugins so bootstrap stops offering it.`,
|
|
98
109
|
});
|
|
99
110
|
result.push({
|
|
100
111
|
order,
|
|
@@ -8,6 +8,10 @@ export type PluginOffer = {
|
|
|
8
8
|
readonly reason: string;
|
|
9
9
|
readonly fileCount: number;
|
|
10
10
|
readonly evidence: readonly string[];
|
|
11
|
+
/** Further capabilities of the same package to activate, with their modes. */
|
|
12
|
+
readonly alsoActivate?: Readonly<Record<string, "augment" | "replace">>;
|
|
13
|
+
/** Data packages to install next to it, such as kibi-lang-* grammar packs. */
|
|
14
|
+
readonly alsoInstall?: readonly string[];
|
|
11
15
|
};
|
|
12
16
|
/**
|
|
13
17
|
* Below this many requirements a reader can scan the list, and a question
|
|
@@ -19,7 +23,9 @@ export declare const SEARCH_HINTS_OFFER_REQUIREMENTS = 50;
|
|
|
19
23
|
* offered when production React or Angular component files exist, and
|
|
20
24
|
* kibi-plugin-search-hints once the KB holds enough requirements that a
|
|
21
25
|
* question worded differently from them is likely to miss; neither is
|
|
22
|
-
* offered once the project activated or declined it.
|
|
26
|
+
* offered once the project activated or declined it. kibi-plugin-treesitter
|
|
27
|
+
* is offered for sources in any language it reads until it is listed, and
|
|
28
|
+
* for Go, Java, C# and Rust sources until it is active for source proofs.
|
|
23
29
|
*/
|
|
24
30
|
export declare function pluginOffers(context: OperationContext, files: readonly string[]): Promise<readonly PluginOffer[]>;
|
|
25
31
|
//# sourceMappingURL=plugin-offers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-offers.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/plugin-offers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-offers.d.ts","sourceRoot":"","sources":["../../../src/operations/bootstrap/plugin-offers.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAOjF,oFAAoF;AAEpF,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;IACxE,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C,CAAC;AAUF;;;GAGG;AAEH,eAAO,MAAM,+BAA+B,KAAK,CAAC;AA0GlD;;;;;;;;GAQG;AAEH,wBAAsB,YAAY,CAChC,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAoEjC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { REFERENCE_PLUGIN_PACKAGE } from "../../plugins/proof-reference-extractors.js";
|
|
3
|
+
import { describeReferenceLanguageSuggestion, manifestDeclares, pinnedPackVersions, referenceLanguageSuggestion, workspaceInstalledVersion, } from "../../plugins/reference-language-suggestion.js";
|
|
2
4
|
import { KB_PATHS } from "../../utils/kb-paths.js";
|
|
5
|
+
import { PLUGIN_LANGUAGE_PACKS, pluginReferenceLanguage, } from "../proof/code-languages.js";
|
|
3
6
|
const UI_PLUGIN = "kibi-plugin-ui";
|
|
4
7
|
const UI_CAPABILITY = "kibi.check-policy.v1";
|
|
5
8
|
const UI_SOURCE = /(?:\.(?:tsx|jsx)|\.component\.ts)$/i;
|
|
@@ -13,6 +16,47 @@ const HINTS_CAPABILITY = "kibi.search-hints.v1";
|
|
|
13
16
|
*/
|
|
14
17
|
// implements REQ-kibi-plugin-search-hints
|
|
15
18
|
export const SEARCH_HINTS_OFFER_REQUIREMENTS = 50;
|
|
19
|
+
/** The project's kibi block as written, for offers that look at capabilities. */
|
|
20
|
+
function kibiConfigOf(manifest) {
|
|
21
|
+
if (typeof manifest !== "object" || manifest === null)
|
|
22
|
+
return {};
|
|
23
|
+
const kibi = manifest.kibi;
|
|
24
|
+
if (typeof kibi !== "object" || kibi === null || Array.isArray(kibi))
|
|
25
|
+
return {};
|
|
26
|
+
const { plugins, declinedPlugins } = kibi;
|
|
27
|
+
return {
|
|
28
|
+
plugins: Array.isArray(plugins)
|
|
29
|
+
? plugins.flatMap((entry) => {
|
|
30
|
+
if (typeof entry !== "object" || entry === null)
|
|
31
|
+
return [];
|
|
32
|
+
const { package: name, capabilities } = entry;
|
|
33
|
+
return typeof name === "string"
|
|
34
|
+
? [
|
|
35
|
+
{
|
|
36
|
+
package: name,
|
|
37
|
+
capabilities: typeof capabilities === "object" && capabilities !== null
|
|
38
|
+
? capabilities
|
|
39
|
+
: {},
|
|
40
|
+
},
|
|
41
|
+
]
|
|
42
|
+
: [];
|
|
43
|
+
})
|
|
44
|
+
: [],
|
|
45
|
+
declinedPlugins: Array.isArray(declinedPlugins)
|
|
46
|
+
? declinedPlugins.filter((name) => typeof name === "string")
|
|
47
|
+
: [],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
async function readManifest(context) {
|
|
51
|
+
try {
|
|
52
|
+
if (!context.fs)
|
|
53
|
+
return undefined;
|
|
54
|
+
return JSON.parse(await context.fs.readFile(path.join(context.workspaceRoot, "package.json")));
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
16
60
|
/** Plugin names the project activated or declined, from its package.json. */
|
|
17
61
|
async function configuredPlugins(context) {
|
|
18
62
|
let manifest;
|
|
@@ -70,19 +114,45 @@ async function requirementFiles(context) {
|
|
|
70
114
|
* offered when production React or Angular component files exist, and
|
|
71
115
|
* kibi-plugin-search-hints once the KB holds enough requirements that a
|
|
72
116
|
* question worded differently from them is likely to miss; neither is
|
|
73
|
-
* offered once the project activated or declined it.
|
|
117
|
+
* offered once the project activated or declined it. kibi-plugin-treesitter
|
|
118
|
+
* is offered for sources in any language it reads until it is listed, and
|
|
119
|
+
* for Go, Java, C# and Rust sources until it is active for source proofs.
|
|
74
120
|
*/
|
|
75
|
-
// implements REQ-bootstrap-ui-plugin-offer, REQ-kibi-plugin-search-hints
|
|
121
|
+
// implements REQ-bootstrap-ui-plugin-offer, REQ-kibi-plugin-search-hints, REQ-kibi-tree-sitter-references
|
|
76
122
|
export async function pluginOffers(context, files) {
|
|
77
123
|
const uiFiles = files.filter((file) => UI_SOURCE.test(file) && !NOT_PRODUCTION.test(file));
|
|
78
124
|
const requirements = await requirementFiles(context);
|
|
79
125
|
const wantsHints = requirements.length >= SEARCH_HINTS_OFFER_REQUIREMENTS;
|
|
80
|
-
|
|
126
|
+
// Any language the plugin reads (for symbols, or for proofs too).
|
|
127
|
+
const wantsReferences = files.some((file) => pluginReferenceLanguage(file) !== null ||
|
|
128
|
+
PLUGIN_LANGUAGE_PACKS.some((language) => language.pattern.test(file)));
|
|
129
|
+
if (uiFiles.length === 0 && !wantsHints && !wantsReferences)
|
|
81
130
|
return [];
|
|
82
131
|
const configured = await configuredPlugins(context);
|
|
83
132
|
if (configured === undefined)
|
|
84
133
|
return [];
|
|
85
134
|
const offers = [];
|
|
135
|
+
const manifest = wantsReferences ? await readManifest(context) : undefined;
|
|
136
|
+
const references = wantsReferences
|
|
137
|
+
? referenceLanguageSuggestion(files, kibiConfigOf(manifest), workspaceInstalledVersion(context.workspaceRoot), pinnedPackVersions(context.workspaceRoot), undefined, manifestDeclares(manifest, REFERENCE_PLUGIN_PACKAGE))
|
|
138
|
+
: null;
|
|
139
|
+
if (references !== null && references.capabilities.length > 0) {
|
|
140
|
+
const [capability, ...more] = references.capabilities;
|
|
141
|
+
offers.push({
|
|
142
|
+
package: references.package,
|
|
143
|
+
capability: capability,
|
|
144
|
+
mode: "augment",
|
|
145
|
+
reason: describeReferenceLanguageSuggestion(references),
|
|
146
|
+
fileCount: references.languages.reduce((total, language) => total + language.files, 0),
|
|
147
|
+
evidence: references.evidence,
|
|
148
|
+
...(references.packs.length > 0 ? { alsoInstall: references.packs } : {}),
|
|
149
|
+
...(more.length > 0
|
|
150
|
+
? {
|
|
151
|
+
alsoActivate: Object.fromEntries(more.map((name) => [name, "augment"])),
|
|
152
|
+
}
|
|
153
|
+
: {}),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
86
156
|
if (uiFiles.length > 0 && !configured.has(UI_PLUGIN))
|
|
87
157
|
offers.push({
|
|
88
158
|
package: UI_PLUGIN,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logic-modeling.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/logic-modeling.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"logic-modeling.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/logic-modeling.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,mBAAmB,CAAC;AAU3B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD;AAUD,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,mBAAmB,GACzB,oBAAoB,CAoHtB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { logicSemanticKey, utf8Span, validateLogicIr, } from "../../logic/ir.js";
|
|
3
|
+
import { firstSentence } from "../../utils/first-sentence.js";
|
|
3
4
|
import { modeledClaimRole, normalizeSemanticClause, semanticClaimKey, } from "../semantic-advisor/clauses.js";
|
|
4
5
|
import { advisorPropositionRole } from "../semantic-advisor/proposition-role.js";
|
|
5
6
|
import { semanticSourceHash } from "../semantic-advisor/shared.js";
|
|
@@ -86,7 +87,7 @@ export function buildLogicApplyPlan(input) {
|
|
|
86
87
|
type: "req",
|
|
87
88
|
id: input.requirementId ?? `REQ-LOGIC-${shortId(claimText)}`,
|
|
88
89
|
properties: {
|
|
89
|
-
title: claimText
|
|
90
|
+
title: firstSentence(claimText) || "Typed logical requirement",
|
|
90
91
|
status: "open",
|
|
91
92
|
source: input.source,
|
|
92
93
|
semantic_text: input.text.trim(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-requirement.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/model-requirement.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"model-requirement.d.ts","sourceRoot":"","sources":["../../../src/operations/modeling/model-requirement.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAkBjF,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAUhC,YAAY,EACV,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAuBhC,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,cAAc,EACxB,cAAc,EAAE,MAAM,GACrB;IAAE,QAAQ,EAAE,cAAc,CAAC;IAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAuBhE;AA2KD,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,GACxB,CAAC;AAIF,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE;IACP,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,GACA,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+CzB;AAuOD,wBAAsB,4BAA4B,CAChD,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIxB;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,oBAAoB,EAC1B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAwHjC;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC,CAajC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildStrictWriteSet, } from "../../public/check-types.js";
|
|
2
|
+
import { firstSentence } from "../../utils/first-sentence.js";
|
|
2
3
|
import { readKbManifestStatus } from "../../utils/kb-manifest.js";
|
|
3
4
|
import { factSourcePath, isConventionalSubjectKey, normalizeSubjectKey, } from "../../utils/strict-modeling.js";
|
|
4
5
|
import { modeledClaimRole, normalizeSemanticClause, semanticClaimKey, } from "../semantic-advisor/clauses.js";
|
|
@@ -345,7 +346,7 @@ async function unresolvedConditionalResult(args, extracted, reason, workspaceRoo
|
|
|
345
346
|
type: "req",
|
|
346
347
|
id: args.requirementId,
|
|
347
348
|
properties: {
|
|
348
|
-
title: claimText
|
|
349
|
+
title: firstSentence(claimText) || "Conditional requirement",
|
|
349
350
|
status: "open",
|
|
350
351
|
source: extracted.source,
|
|
351
352
|
semantic_text: semanticText,
|
|
@@ -5,6 +5,8 @@ export type RefreshResult = {
|
|
|
5
5
|
readonly found: boolean;
|
|
6
6
|
readonly outcome?: TargetedRefreshOutcome;
|
|
7
7
|
readonly publication?: ArtifactPublicationReceipt;
|
|
8
|
+
/** Why the symbol got no coordinates, when the refresh could not place it. */
|
|
9
|
+
readonly unplaced?: string;
|
|
8
10
|
};
|
|
9
11
|
export type ArtifactPublicationReceipt = {
|
|
10
12
|
readonly path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-refresh.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/symbol-refresh.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAiBjF,MAAM,MAAM,sBAAsB,GAC9B,SAAS,GACT,WAAW,GACX,SAAS,GACT,WAAW,CAAC;AAGhB,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"symbol-refresh.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/symbol-refresh.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAiBjF,MAAM,MAAM,sBAAsB,GAC9B,SAAS,GACT,WAAW,GACX,SAAS,GACT,WAAW,CAAC;AAGhB,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,0BAA0B,CAAC;IAClD,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAGF,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,IAAI,IAAI,CAAC;CAClB,CAAC;AAEF,KAAK,qBAAqB,GAAG,CAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,gBAAgB,KACtB,OAAO,CAAC,aAAa,CAAC,CAAC;AAqD5B,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,IAAI,CAMN;AAuPD,4EAA4E;AAC5E,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,CAAC,CASxB;AAED,yEAAyE;AAEzE,wBAAsB,gCAAgC,CACpD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,CAAC,CAGxB;AAED;;;GAGG;AAEH,wBAAsB,mCAAmC,CACvD,QAAQ,EAAE,MAAM,EAChB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,aAAa,CAAC,CAOxB;AAGD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,qBAAqB,GAAG,SAAS,GACzC,IAAI,CAEN"}
|
|
@@ -183,8 +183,13 @@ async function refreshUnlocked(symbolId, context, options = {}) {
|
|
|
183
183
|
if (next === null || !isValidCoordinateSpan(next)) {
|
|
184
184
|
// No extractable coordinates: remove stale generated state so proof keeps
|
|
185
185
|
// failing closed instead of rebinding an old span to current source bytes.
|
|
186
|
+
const failure = typeof enriched?.coordinateRefreshFailure === "string"
|
|
187
|
+
? enriched.coordinateRefreshFailure
|
|
188
|
+
: sourceText === null
|
|
189
|
+
? `${sourceFile || "its source file"} cannot be read`
|
|
190
|
+
: `no declaration titled ${title} was found in ${sourceFile}`;
|
|
186
191
|
if (existingRecords[symbolId] === undefined) {
|
|
187
|
-
return { refreshed: false, found: true };
|
|
192
|
+
return { refreshed: false, found: true, unplaced: failure };
|
|
188
193
|
}
|
|
189
194
|
delete existingRecords[symbolId];
|
|
190
195
|
const publication = publishArtifact(artifactPath, writeTargetedArtifact(existingRecords, artifactFormat));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upsert.d.ts","sourceRoot":"","sources":["../../../src/operations/mutation/upsert.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAexE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AA8B3E,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,eAAe,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,wBAAwB,EAI9B,MAAM,wBAAwB,CAAC;AAsEhC,wBAAgB,gCAAgC,CAC9C,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,IAAI,CAkBN;AA8CD;;;;;;;GAOG;AAEH,wBAAsB,+BAA+B,CACnD,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,OAAO,EAAE,gBAAgB,EACzB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA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
526
|
// the complete canonical entity the next sync would compile. Failures
|
|
527
527
|
// abort before the RDF transaction so source and shard rollbacks keep all
|
|
528
528
|
// surfaces consistent; stale coordinates are never reused as a fallback.
|
|
529
|
+
// A symbol Kibi cannot place in its source file is linked to no code:
|
|
530
|
+
// say so at write time, not only in a later sync's output.
|
|
531
|
+
// implements REQ-generated-coordinate-persistence
|
|
532
|
+
const coordinateWarnings = [];
|
|
529
533
|
if (input.type === "symbol" &&
|
|
530
534
|
context.fs !== undefined &&
|
|
531
535
|
context.sourceFirst !== false &&
|
|
@@ -542,6 +546,8 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
542
546
|
if (!refresh.found || refresh.outcome === "removed") {
|
|
543
547
|
throw new Error(`Coordinate refresh could not find ${input.id} in the authored symbol manifest`);
|
|
544
548
|
}
|
|
549
|
+
if (refresh.unplaced !== undefined)
|
|
550
|
+
coordinateWarnings.push(`${input.id} has no symbol coordinates: ${refresh.unplaced}. Until Kibi places it, its link is not checked against the code (impact review, coverage and proofs do not see it there). Use the name the extractor gives the declaration, install the plugins and grammar packs kibi doctor names, or add symbol_role and granularity_reason for a file-level link.`);
|
|
545
551
|
const canonical = reextractCanonicalSymbolEntity(input.id, sourceWrite.receipt.path, context.workspaceRoot);
|
|
546
552
|
if (canonical === null) {
|
|
547
553
|
throw new Error(`Canonical symbol manifest ${sourceWrite.receipt.path} no longer contains ${input.id} after coordinate refresh`);
|
|
@@ -684,6 +690,7 @@ export async function executeUpsert(input, context, options = {}) {
|
|
|
684
690
|
...idStyleWarnings,
|
|
685
691
|
...entityContextWarnings(input, commitEntity ?? validated.entity, context.workspaceRoot, { writtenPath: sourceWrite?.receipt.path }),
|
|
686
692
|
...shardWarnings,
|
|
693
|
+
...coordinateWarnings,
|
|
687
694
|
],
|
|
688
695
|
...advisorReceipt(semantic.receipt),
|
|
689
696
|
...storedClaimKey(commitEntity ?? validated.entity),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-intent.d.ts","sourceRoot":"","sources":["../../../src/operations/planning/compile-intent.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAEpB,MAAM,wBAAwB,CAAC;AAMhC,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"compile-intent.d.ts","sourceRoot":"","sources":["../../../src/operations/planning/compile-intent.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAEpB,MAAM,wBAAwB,CAAC;AAMhC,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,0CAA0C,CAAC;AAMlD,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAEV,2BAA2B,EAE5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAG3B,KAAK,eAAe,EAIrB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,oBAAoB,EAAG,sBAA+B,CAAC;AAGpE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,eAAe,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;IACzD,cAAc,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAClC,iBAAiB,CAAC,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C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAyWH,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,EAAE,GAAG,EAAE,IAAI,GAAG,MAAM,CAqC5E;AAwYD,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;CAC5B,CAAC,CAAC;AAGH;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EAC/C,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,aAAa,CAAC,CAoExB;AAGD,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC;IACT,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,iBAAiB,EAAE,aAAa,CAAC;CAClC,CAAC,CAobD"}
|
|
@@ -6,6 +6,7 @@ import { publicCapabilityStamp } from "../../plugins/compose-semantic-classifier
|
|
|
6
6
|
import { loadEntities } from "../../public/operations/discovery-entities.js";
|
|
7
7
|
import { executeStatus } from "../../public/operations/discovery-executors.js";
|
|
8
8
|
import { readAuthoredEntity } from "../../public/operations/entity-context.js";
|
|
9
|
+
import { firstSentence } from "../../utils/first-sentence.js";
|
|
9
10
|
import { buildWhatIfAnalysisGoal } from "../mutation/contradictions.js";
|
|
10
11
|
import { canonicalSourcePath } from "../mutation/source-authoring.js";
|
|
11
12
|
import { validateUpsertInput } from "../mutation/validation.js";
|
|
@@ -799,7 +800,7 @@ export async function executeCompileIntent(args, context) {
|
|
|
799
800
|
const existingEntity = existing[0] ?? {};
|
|
800
801
|
const title = text(args.title) ||
|
|
801
802
|
text(existingEntity.title) ||
|
|
802
|
-
intent
|
|
803
|
+
firstSentence(intent) ||
|
|
803
804
|
intent;
|
|
804
805
|
const requirementDocument = requirementDocumentPath(args.sourceLocations);
|
|
805
806
|
const source = requirementDocument ??
|
|
@@ -17,6 +17,17 @@ export declare function setEqualityWitness(importPath: string, members: readonly
|
|
|
17
17
|
export declare function requiredFieldsWitness(importPath: string, typeExpression: string, fields: readonly string[]): string;
|
|
18
18
|
/** Which fields a failed required-fields witness rejected, and how. */
|
|
19
19
|
export declare function requiredFieldsFailures(witness: string, fields: readonly string[], errorLines: readonly number[]): string[];
|
|
20
|
+
export declare function environmentGetterCallee(callee: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The project files a claim names in its subject key or claim text (for
|
|
23
|
+
* example `src/match.c`, `utils.sh`, `fzy/src/match.c`, `src/Match.c` or
|
|
24
|
+
* `src/match`): a token resolves, ignoring case, to the file at that path,
|
|
25
|
+
* else to every project file with that name or path suffix, else (for a
|
|
26
|
+
* slashed name without an extension) to the files with that stem. Tokens
|
|
27
|
+
* that name no file (dotted subject keys such as `kibi.cli`) resolve to
|
|
28
|
+
* nothing.
|
|
29
|
+
*/
|
|
30
|
+
export declare function namedClaimFiles(workspaceRoot: string, texts: readonly string[]): Map<string, string[]>;
|
|
20
31
|
/**
|
|
21
32
|
* The evidence level a receipt records. A certificate that re-checks but
|
|
22
33
|
* derives none of the claims it names from the code proves nothing about
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claim-bindings.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/claim-bindings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claim-bindings.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/claim-bindings.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,wBAAwB,CAAC;AAgDhC;;;GAGG;AAEH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,WAAW,EAAE,MAAM,GAClB,MAAM,CAWR;AAgED;;;;;;GAMG;AAEH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,MAAM,CAgBR;AAED,uEAAuE;AACvE,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,MAAM,EAAE,CAaV;AAoKD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE/D;AAwBD;;;;;;;;GAQG;AAEH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAqBvB;AAyFD;;;;;;GAMG;AAEH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,QAAQ,GAAG,QAAQ,EAC1B,QAAQ,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,GAC5C,QAAQ,GAAG,QAAQ,CAQrB;AAED;;;;;;GAMG;AAEH,wBAAsB,kBAAkB,C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