kibi-cli 2.2.0 → 2.4.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 +2 -2
- package/dist/cli-operation-loader.d.ts.map +1 -1
- package/dist/cli-operation-loader.js +3 -0
- package/dist/cli-operation-metadata.d.ts +5 -1
- package/dist/cli-operation-metadata.d.ts.map +1 -1
- package/dist/cli-operation-metadata.js +6 -1
- package/dist/cli-register-maintenance.d.ts.map +1 -1
- package/dist/cli-register-maintenance.js +7 -0
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +4 -0
- package/dist/commands/check-diff.d.ts +5 -0
- package/dist/commands/check-diff.d.ts.map +1 -0
- package/dist/commands/check-diff.js +62 -0
- package/dist/commands/check-generated.d.ts.map +1 -1
- package/dist/commands/check-generated.js +41 -18
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +210 -73
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +63 -29
- package/dist/commands/github-init.d.ts.map +1 -1
- package/dist/commands/github-init.js +9 -2
- package/dist/commands/merge-driver.d.ts +31 -0
- package/dist/commands/merge-driver.d.ts.map +1 -0
- package/dist/commands/merge-driver.js +268 -0
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +3 -1
- package/dist/engine.d.ts +15 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +252 -52
- package/dist/extractors/symbols-coordinator.d.ts +7 -0
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.js +75 -39
- package/dist/operations/bootstrap/candidates.js +1 -1
- package/dist/operations/bootstrap/discovery.js +1 -1
- package/dist/operations/bootstrap/generate.d.ts.map +1 -1
- package/dist/operations/bootstrap/generate.js +21 -5
- package/dist/operations/bootstrap/guidance-actions.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance-actions.js +3 -0
- package/dist/operations/bootstrap/guidance.d.ts.map +1 -1
- package/dist/operations/bootstrap/guidance.js +7 -1
- package/dist/operations/bootstrap/intent-claims.d.ts +17 -0
- package/dist/operations/bootstrap/intent-claims.d.ts.map +1 -0
- package/dist/operations/bootstrap/intent-claims.js +95 -0
- package/dist/operations/bootstrap/presentation.d.ts +2 -0
- package/dist/operations/bootstrap/presentation.d.ts.map +1 -1
- package/dist/operations/bootstrap/presentation.js +60 -1
- package/dist/operations/bootstrap/types.d.ts +28 -0
- package/dist/operations/bootstrap/types.d.ts.map +1 -1
- package/dist/operations/bootstrap/types.js +16 -0
- package/dist/operations/modeling/predicate-inference-1.js +1 -1
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +175 -53
- package/dist/operations/mutation/symbol-refresh.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-refresh.js +4 -1
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +5 -7
- package/dist/operations/planning/apply-plan.d.ts.map +1 -1
- package/dist/operations/planning/apply-plan.js +5 -9
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +1 -0
- package/dist/operations/semantic-advisor/analysis-receipt.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analysis-receipt.js +7 -1
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +26 -4
- package/dist/operations/semantic-advisor/clauses.d.ts +1 -0
- package/dist/operations/semantic-advisor/clauses.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/clauses.js +7 -1
- package/dist/performance-trace.d.ts +17 -0
- package/dist/performance-trace.d.ts.map +1 -0
- package/dist/performance-trace.js +134 -0
- package/dist/plugins/approved-source-analyzers.d.ts +13 -0
- package/dist/plugins/approved-source-analyzers.d.ts.map +1 -0
- package/dist/plugins/approved-source-analyzers.generated.d.ts +71 -0
- package/dist/plugins/approved-source-analyzers.generated.d.ts.map +1 -0
- package/dist/plugins/approved-source-analyzers.generated.js +77 -0
- package/dist/plugins/approved-source-analyzers.js +3 -0
- package/dist/plugins/maintenance-source-analysis.d.ts +14 -0
- package/dist/plugins/maintenance-source-analysis.d.ts.map +1 -0
- package/dist/plugins/maintenance-source-analysis.js +191 -0
- package/dist/plugins/registry.d.ts +2 -1
- package/dist/plugins/registry.d.ts.map +1 -1
- package/dist/plugins/registry.js +6 -1
- package/dist/plugins/source-analysis-service.d.ts +36 -1
- package/dist/plugins/source-analysis-service.d.ts.map +1 -1
- package/dist/plugins/source-analysis-service.js +184 -27
- package/dist/plugins/source-change-analysis.d.ts +15 -0
- package/dist/plugins/source-change-analysis.d.ts.map +1 -0
- package/dist/plugins/source-change-analysis.js +54 -0
- package/dist/plugins/source-classification.d.ts +41 -0
- package/dist/plugins/source-classification.d.ts.map +1 -0
- package/dist/plugins/source-classification.js +490 -0
- package/dist/prolog/swipl-resolver.d.ts +88 -0
- package/dist/prolog/swipl-resolver.d.ts.map +1 -0
- package/dist/prolog/swipl-resolver.js +446 -0
- package/dist/prolog.d.ts +15 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +67 -6
- package/dist/public/diagnostic-usage.d.ts +14 -0
- package/dist/public/diagnostic-usage.d.ts.map +1 -1
- package/dist/public/diagnostic-usage.js +55 -1
- package/dist/public/impact/analyzer.d.ts.map +1 -1
- package/dist/public/impact/analyzer.js +56 -5
- package/dist/public/impact/diagnostics.d.ts.map +1 -1
- package/dist/public/impact/diagnostics.js +3 -1
- package/dist/public/impact/manifest.d.ts.map +1 -1
- package/dist/public/impact/manifest.js +15 -1
- package/dist/public/impact/source-changes.d.ts.map +1 -1
- package/dist/public/impact/source-changes.js +35 -27
- package/dist/public/impact/types.d.ts +2 -0
- package/dist/public/impact/types.d.ts.map +1 -1
- package/dist/public/operations/catalog.d.ts +117 -1
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/catalog.js +2 -0
- package/dist/public/operations/contracts.d.ts.map +1 -1
- package/dist/public/operations/contracts.js +309 -8
- package/dist/public/operations/impact-review-preparation.d.ts +14 -0
- package/dist/public/operations/impact-review-preparation.d.ts.map +1 -0
- package/dist/public/operations/impact-review-preparation.js +379 -0
- package/dist/public/operations/index.d.ts +2 -0
- package/dist/public/operations/index.d.ts.map +1 -1
- package/dist/public/operations/index.js +2 -0
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +1 -35
- package/dist/public/operations/proof-receipt-projection.d.ts +5 -0
- package/dist/public/operations/proof-receipt-projection.d.ts.map +1 -0
- package/dist/public/operations/proof-receipt-projection.js +36 -0
- package/dist/public/operations/specs/bootstrap.d.ts +73 -1
- package/dist/public/operations/specs/bootstrap.d.ts.map +1 -1
- package/dist/public/operations/specs/bootstrap.js +66 -1
- package/dist/public/operations/specs/impact-review-preparation.d.ts +47 -0
- package/dist/public/operations/specs/impact-review-preparation.d.ts.map +1 -0
- package/dist/public/operations/specs/impact-review-preparation.js +43 -0
- package/dist/public/operations/symbol-repair-plan.d.ts.map +1 -1
- package/dist/public/operations/symbol-repair-plan.js +3 -1
- package/dist/public/operations/types.d.ts +1 -1
- package/dist/public/operations/types.d.ts.map +1 -1
- package/dist/public/skills/kibi-bootstrap/SKILL.md +47 -11
- package/dist/public/skills/kibi-bootstrap/resources/bootstrap.md +6 -1
- package/dist/public/skills/kibi-usage/SKILL.md +14 -0
- package/dist/public/skills/kibi-usage/resources/operation-access.md +5 -0
- package/dist/public/telemetry-acceptance.d.ts +8 -0
- package/dist/public/telemetry-acceptance.d.ts.map +1 -1
- package/dist/public/telemetry-acceptance.js +10 -0
- package/dist/traceability/analysis-gate.d.ts +39 -0
- package/dist/traceability/analysis-gate.d.ts.map +1 -0
- package/dist/traceability/analysis-gate.js +51 -0
- package/dist/traceability/git-change-snapshot.d.ts +27 -0
- package/dist/traceability/git-change-snapshot.d.ts.map +1 -0
- package/dist/traceability/git-change-snapshot.js +411 -0
- package/dist/traceability/git-staged.d.ts +5 -1
- package/dist/traceability/git-staged.d.ts.map +1 -1
- package/dist/traceability/git-staged.js +16 -11
- package/dist/traceability/impact-evaluator.d.ts +54 -0
- package/dist/traceability/impact-evaluator.d.ts.map +1 -0
- package/dist/traceability/impact-evaluator.js +270 -0
- package/dist/traceability/impact-git-tree.d.ts +12 -0
- package/dist/traceability/impact-git-tree.d.ts.map +1 -0
- package/dist/traceability/impact-git-tree.js +46 -0
- package/dist/traceability/impact-knowledge.d.ts +16 -0
- package/dist/traceability/impact-knowledge.d.ts.map +1 -0
- package/dist/traceability/impact-knowledge.js +165 -0
- package/dist/traceability/impact-policy.d.ts +15 -0
- package/dist/traceability/impact-policy.d.ts.map +1 -0
- package/dist/traceability/impact-policy.js +48 -0
- package/dist/traceability/impact-policy.v1.schema.json +48 -0
- package/dist/traceability/impact-pr-diff.d.ts +5 -0
- package/dist/traceability/impact-pr-diff.d.ts.map +1 -0
- package/dist/traceability/impact-pr-diff.js +83 -0
- package/dist/traceability/impact-record-validation.d.ts +9 -0
- package/dist/traceability/impact-record-validation.d.ts.map +1 -0
- package/dist/traceability/impact-record-validation.js +113 -0
- package/dist/traceability/impact-review.d.ts +148 -0
- package/dist/traceability/impact-review.d.ts.map +1 -0
- package/dist/traceability/impact-review.js +494 -0
- package/dist/traceability/impact-review.schema.json +365 -0
- package/dist/traceability/impact-side-evidence.d.ts +13 -0
- package/dist/traceability/impact-side-evidence.d.ts.map +1 -0
- package/dist/traceability/impact-side-evidence.js +240 -0
- package/dist/traceability/reviewed-coordinate-refresh.d.ts +10 -0
- package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +1 -0
- package/dist/traceability/reviewed-coordinate-refresh.js +49 -0
- package/dist/traceability/snapshot-knowledge.d.ts +4 -0
- package/dist/traceability/snapshot-knowledge.d.ts.map +1 -0
- package/dist/traceability/snapshot-knowledge.js +98 -0
- package/dist/traceability/staged-file-coverage.d.ts +23 -0
- package/dist/traceability/staged-file-coverage.d.ts.map +1 -1
- package/dist/traceability/staged-impact-contract.d.ts.map +1 -1
- package/dist/traceability/staged-impact-contract.js +2 -16
- package/dist/traceability/staged-symbols-manifest.d.ts +4 -0
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +17 -6
- package/dist/traceability/symbol-extract.d.ts +3 -5
- package/dist/traceability/symbol-extract.d.ts.map +1 -1
- package/dist/traceability/symbol-extract.js +49 -34
- package/dist/traceability/temp-kb.d.ts +1 -1
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +49 -13
- package/dist/traceability/trusted-pr-event.d.ts +13 -0
- package/dist/traceability/trusted-pr-event.d.ts.map +1 -0
- package/dist/traceability/trusted-pr-event.js +105 -0
- package/dist/utils/canonical-path.d.ts +3 -0
- package/dist/utils/canonical-path.d.ts.map +1 -0
- package/dist/utils/canonical-path.js +33 -0
- package/package.json +14 -5
- package/src/public/diagnostic-usage.ts +59 -1
- package/src/public/impact/analyzer.ts +88 -5
- package/src/public/impact/diagnostics.ts +7 -5
- package/src/public/impact/manifest.ts +14 -1
- package/src/public/impact/source-changes.ts +39 -34
- package/src/public/impact/types.ts +5 -0
- package/src/public/operations/catalog.ts +2 -0
- package/src/public/operations/contracts.ts +385 -9
- package/src/public/operations/impact-review-preparation.ts +548 -0
- package/src/public/operations/index.ts +2 -0
- package/src/public/operations/node-ports.ts +1 -39
- package/src/public/operations/proof-receipt-projection.ts +39 -0
- package/src/public/operations/specs/bootstrap.ts +78 -4
- package/src/public/operations/specs/impact-review-preparation.ts +46 -0
- package/src/public/operations/symbol-repair-plan.ts +3 -1
- package/src/public/operations/types.ts +1 -0
- package/src/public/skills/kibi-bootstrap/SKILL.md +47 -11
- package/src/public/skills/kibi-bootstrap/resources/bootstrap.md +6 -1
- package/src/public/skills/kibi-usage/SKILL.md +14 -0
- package/src/public/skills/kibi-usage/resources/operation-access.md +5 -0
- package/src/public/telemetry-acceptance.ts +9 -0
- package/src/traceability/impact-policy.v1.schema.json +48 -0
- package/src/traceability/impact-review.schema.json +365 -0
- package/templates/github/kibi-badge.yml +0 -4
- package/templates/github/kibi-report.yml +0 -4
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { constants } from "node:fs";
|
|
2
|
+
import { closeSync, existsSync, lstatSync, openSync, realpathSync, statSync, writeSync, } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
export const KIBI_PERF_TRACE_DIR_ENV = "KIBI_PERF_TRACE_DIR";
|
|
5
|
+
export const KIBI_PERF_TIMINGS_ENV = "KIBI_PERF_TIMINGS";
|
|
6
|
+
export const KIBI_PERF_TRACE_MAX_EVENTS = 5_000;
|
|
7
|
+
export const KIBI_PERF_TRACE_MAX_BYTES = 512 * 1024;
|
|
8
|
+
const states = new Map();
|
|
9
|
+
const MAX_DURATION_MS = 60_000;
|
|
10
|
+
const TRACE_LIMIT_RESERVE_BYTES = 96;
|
|
11
|
+
function isWithin(parent, candidate) {
|
|
12
|
+
const relative = path.relative(parent, candidate);
|
|
13
|
+
return (relative === "" ||
|
|
14
|
+
(relative !== ".." &&
|
|
15
|
+
!relative.startsWith(`..${path.sep}`) &&
|
|
16
|
+
!path.isAbsolute(relative)));
|
|
17
|
+
}
|
|
18
|
+
function privateTraceFile() {
|
|
19
|
+
if (process.env[KIBI_PERF_TIMINGS_ENV] !== "1")
|
|
20
|
+
return null;
|
|
21
|
+
const configuredDirectory = process.env[KIBI_PERF_TRACE_DIR_ENV];
|
|
22
|
+
if (!configuredDirectory || !path.isAbsolute(configuredDirectory))
|
|
23
|
+
return null;
|
|
24
|
+
try {
|
|
25
|
+
const directoryInfo = lstatSync(configuredDirectory);
|
|
26
|
+
if (!directoryInfo.isDirectory() || directoryInfo.isSymbolicLink()) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const directory = realpathSync(configuredDirectory);
|
|
30
|
+
if (path.resolve(configuredDirectory) !== directory)
|
|
31
|
+
return null;
|
|
32
|
+
const directoryStats = statSync(directory);
|
|
33
|
+
if (typeof process.getuid !== "function" ||
|
|
34
|
+
directoryStats.uid !== process.getuid()) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
if ((directoryStats.mode & 0o077) !== 0) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const currentDirectory = realpathSync(process.cwd());
|
|
41
|
+
if (isWithin(currentDirectory, directory))
|
|
42
|
+
return null;
|
|
43
|
+
const file = path.join(directory, `kibi-performance-${process.pid}.jsonl`);
|
|
44
|
+
let state = states.get(file);
|
|
45
|
+
if (!state) {
|
|
46
|
+
if (existsSync(file))
|
|
47
|
+
return null;
|
|
48
|
+
state = { bytes: 0, events: 0, disabled: false };
|
|
49
|
+
states.set(file, state);
|
|
50
|
+
}
|
|
51
|
+
if (state.disabled)
|
|
52
|
+
return null;
|
|
53
|
+
return { file, state };
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function writeAll(fd, bytes) {
|
|
60
|
+
let offset = 0;
|
|
61
|
+
while (offset < bytes.length) {
|
|
62
|
+
const written = writeSync(fd, bytes, offset, bytes.length - offset);
|
|
63
|
+
if (written <= 0)
|
|
64
|
+
throw new Error("Performance trace write made no progress");
|
|
65
|
+
offset += written;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function appendLine(file, state, line, exclusive) {
|
|
69
|
+
const fileInfo = existsSync(file) ? lstatSync(file) : null;
|
|
70
|
+
if ((exclusive && fileInfo !== null) ||
|
|
71
|
+
(!exclusive &&
|
|
72
|
+
(!fileInfo?.isFile() ||
|
|
73
|
+
fileInfo.isSymbolicLink() ||
|
|
74
|
+
fileInfo.size !== state.bytes))) {
|
|
75
|
+
throw new Error("Performance trace file changed unexpectedly");
|
|
76
|
+
}
|
|
77
|
+
const flags = constants.O_WRONLY |
|
|
78
|
+
constants.O_CREAT |
|
|
79
|
+
constants.O_APPEND |
|
|
80
|
+
(constants.O_NOFOLLOW ?? 0) |
|
|
81
|
+
(exclusive ? constants.O_EXCL : 0);
|
|
82
|
+
const fd = openSync(file, flags, 0o600);
|
|
83
|
+
try {
|
|
84
|
+
const bytes = Buffer.from(line, "utf8");
|
|
85
|
+
writeAll(fd, bytes);
|
|
86
|
+
state.bytes += bytes.length;
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
closeSync(fd);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function appendLimitMarker(file, state, limit) {
|
|
93
|
+
const marker = `${JSON.stringify({ kind: "trace-limit", pid: process.pid, limit })}\n`;
|
|
94
|
+
const byteLength = Buffer.byteLength(marker, "utf8");
|
|
95
|
+
if (state.bytes + byteLength <= KIBI_PERF_TRACE_MAX_BYTES) {
|
|
96
|
+
appendLine(file, state, marker, state.events === 0);
|
|
97
|
+
}
|
|
98
|
+
state.disabled = true;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Append one bounded, payload-free timing observation to the explicitly
|
|
102
|
+
* supplied private host trace directory. Trace I/O is best-effort and never
|
|
103
|
+
* changes the operation result.
|
|
104
|
+
*/
|
|
105
|
+
export function writePerformanceTraceEvent(event) {
|
|
106
|
+
if (!Number.isFinite(event.durationMs) ||
|
|
107
|
+
event.durationMs < 0 ||
|
|
108
|
+
event.durationMs > MAX_DURATION_MS) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const trace = privateTraceFile();
|
|
112
|
+
if (!trace)
|
|
113
|
+
return;
|
|
114
|
+
const durationMs = Math.round(event.durationMs * 1000) / 1000;
|
|
115
|
+
const line = `${JSON.stringify({
|
|
116
|
+
kind: event.kind,
|
|
117
|
+
durationMs,
|
|
118
|
+
pid: process.pid,
|
|
119
|
+
})}\n`;
|
|
120
|
+
const byteLength = Buffer.byteLength(line, "utf8");
|
|
121
|
+
try {
|
|
122
|
+
if (trace.state.events >= KIBI_PERF_TRACE_MAX_EVENTS ||
|
|
123
|
+
trace.state.bytes + byteLength >
|
|
124
|
+
KIBI_PERF_TRACE_MAX_BYTES - TRACE_LIMIT_RESERVE_BYTES) {
|
|
125
|
+
appendLimitMarker(trace.file, trace.state, trace.state.events >= KIBI_PERF_TRACE_MAX_EVENTS ? "events" : "bytes");
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
appendLine(trace.file, trace.state, line, trace.state.events === 0);
|
|
129
|
+
trace.state.events += 1;
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
trace.state.disabled = true;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Release-qualified executable and asset closure. Updated only after qualification. */
|
|
2
|
+
export interface ApprovedSourceAnalyzer {
|
|
3
|
+
packageName: string;
|
|
4
|
+
version: string;
|
|
5
|
+
files: Readonly<Record<string, string>>;
|
|
6
|
+
dependencies: readonly {
|
|
7
|
+
packageName: string;
|
|
8
|
+
version: string;
|
|
9
|
+
files: Readonly<Record<string, string>>;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
export declare const APPROVED_SOURCE_ANALYZERS: readonly ApprovedSourceAnalyzer[];
|
|
13
|
+
//# sourceMappingURL=approved-source-analyzers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approved-source-analyzers.d.ts","sourceRoot":"","sources":["../../src/plugins/approved-source-analyzers.ts"],"names":[],"mappings":"AAEA,wFAAwF;AAExF,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACxC,YAAY,EAAE,SAAS;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KACzC,EAAE,CAAC;CACL;AAGD,eAAO,MAAM,yBAAyB,EAAE,SAAS,sBAAsB,EAC7C,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export declare const qualifiedSourceAnalyzers: readonly [{
|
|
2
|
+
readonly packageName: "kibi-plugin-treesitter";
|
|
3
|
+
readonly version: "1.0.0";
|
|
4
|
+
readonly files: {
|
|
5
|
+
readonly "SBOM.spdx.json": "92cf77d240ffc1e95116edd4742363e34ead66b455dbf940f24321a19e7f9571";
|
|
6
|
+
readonly "THIRD_PARTY_NOTICES.md": "0b1ede96cb261dab73fd1ec8c51d7bb5b2492eed0502f6c10ed071736daa263c";
|
|
7
|
+
readonly "assets/queries/bash.scm": "6ca535e8fe652b51203ac272831881dab001f7ac508e50551bc2cdc4a15d7b6c";
|
|
8
|
+
readonly "assets/queries/c.scm": "774ca67cfe23b0e0d1d3a4f01788049a822beb1311feee72b20a595a37be1e28";
|
|
9
|
+
readonly "assets/queries/cpp-extra.scm": "7cf486901eaf7e9196bc2c5dfe83785eed70d367136f8008af37eb4f1c12a68a";
|
|
10
|
+
readonly "assets/queries/cpp.scm": "029731ca946e32f919491d9f76c85a50e5deb5ad1934e37fd6849312c0d4a705";
|
|
11
|
+
readonly "assets/queries/csharp-extra.scm": "d3a55c3c67cb236921da5785d08d146ba53f70d9e2af83a365f59954f8878a57";
|
|
12
|
+
readonly "assets/queries/csharp.scm": "4ed08da0162ecd48206ac34bebe7ea9757a8c7b617f6ad8f70c168d685d514fe";
|
|
13
|
+
readonly "assets/queries/go.scm": "d1a9b1f678fe0278b85054e2dc56a28ef26aa478b8c88fb2b0dd83cdcdb9db35";
|
|
14
|
+
readonly "assets/queries/hcl.scm": "cad52e3fd81bc5584ea181c920bdb8fa4be007f05f8c5e08f95e9ccb40aee93a";
|
|
15
|
+
readonly "assets/queries/java-extra.scm": "5ce7857f2b52c10b3672bc09f39f287cff2eaa7caa0b75dafccbaa5fec58431d";
|
|
16
|
+
readonly "assets/queries/java.scm": "bcb22147b8582d92743fc973864cefb894a4c12b3957f16f3d472b2ec7cd4c49";
|
|
17
|
+
readonly "assets/queries/php.scm": "4ac5e30f99f3abe5417dcb42219e0790c66f9b4bb3be071bc60160dd012f3cd8";
|
|
18
|
+
readonly "assets/queries/python.scm": "d0f3e577878167bfabc30e526e497bce58d1699b9bcabf8ab3a50698efb5ca3e";
|
|
19
|
+
readonly "assets/queries/ruby.scm": "ed1e7dc07a95b87aef267e7f9715c6717a70f09efbd7b6f48bbd51c7b7510cf3";
|
|
20
|
+
readonly "assets/queries/rust-extra.scm": "511a492200e813f15b7ebec324eae69a245986a9d6813ddabe776075fd65976c";
|
|
21
|
+
readonly "assets/queries/rust.scm": "f22867fdebde5cb091861c08d34690dc2540f4318068bf81be9f6b0d348ab8c1";
|
|
22
|
+
readonly "assets/queries/terraform.scm": "8a6974a8eb48e13b5b8cd64e7c81262a825b4251df01ab383aee5cdda8151e7e";
|
|
23
|
+
readonly "assets/tree-sitter-bash.wasm": "8292919c88a0f7d3fb31d0cd0253ca5a9531bc1ede82b0537f2c63dd8abe6a7a";
|
|
24
|
+
readonly "assets/tree-sitter-c.wasm": "c852c2a85ebf2beb636aa3b0ef7f7e70458684d74f6741b20dcb296885bed9f9";
|
|
25
|
+
readonly "assets/tree-sitter-c_sharp.wasm": "6f69e1cae44e1c32c1eccc170dc5a9778fb94ff716f71113fe1f8c4299aa2f40";
|
|
26
|
+
readonly "assets/tree-sitter-cpp.wasm": "174eb0deb75b2ec7881bcacda9f995648d8e683956e5c2267e69ab6dc503fcbf";
|
|
27
|
+
readonly "assets/tree-sitter-go.wasm": "9504573f352b20be7f2f1911754d710622aedc15afff16d5ed8fb5645681aee7";
|
|
28
|
+
readonly "assets/tree-sitter-hcl.release.wasm": "2f9acf63e7c263215f283e2cf0f4ebbb9bfa77f58e18fa42b91094be201372a7";
|
|
29
|
+
readonly "assets/tree-sitter-java.wasm": "4fdeac4ca6ca089f06c6f7e562abcac1733cd465728cc7031ebb73c2019122c4";
|
|
30
|
+
readonly "assets/tree-sitter-php.wasm": "d4df6a6ff08c87c3ec4f9cbb785fe09998a0cb570e03f57d7b19b3acfb146aa7";
|
|
31
|
+
readonly "assets/tree-sitter-python.wasm": "16108b50df4ee9a30168794252ab55e7c93bfc5765d7fa0aa3e335752c515f47";
|
|
32
|
+
readonly "assets/tree-sitter-ruby.wasm": "09a96427d7c72f0613ed470cd9812223fc4a91d6a9c025c0235cc6bd59ff96f4";
|
|
33
|
+
readonly "assets/tree-sitter-rust.wasm": "f65f354215611fd94ad34134b3427eb3d58cbb745df7b6509ba722184db73d57";
|
|
34
|
+
readonly "assets/tree-sitter-terraform.release.wasm": "59dbcbb0f08eb78b78f37510834559a48ce5c9d4866c978d62c6390796461cb5";
|
|
35
|
+
readonly "catalog.json": "4075d988391b8c893f47722fb85f93d626d700af9b2a1b4909fd20ef0ec989b4";
|
|
36
|
+
readonly "dist/analysis-worker.js": "75a1e646f636c1d1ace9ae22a9141a51e94bddc70203bed08de7bd13dae1764e";
|
|
37
|
+
readonly "dist/catalog.js": "460243c48cb6a03b8c7971273729d8a1134955186978b6c0d04182c71960ebff";
|
|
38
|
+
readonly "dist/extractor.js": "1d8cd819e7ec8fcc291a44e5ffe4ccfe77099301677913fcfe0d92e7ce971f33";
|
|
39
|
+
readonly "dist/index.js": "adc03d77d94c0133b3188950b35f79db19e447cf7bfa1f7e1cf1f5c97a582a44";
|
|
40
|
+
readonly "dist/performance-timing.js": "56cce530f627c8fd079e8ec070322f84378ae50c40a6765d88b418850692940b";
|
|
41
|
+
readonly "integrity.json": "4f1530009fdf5f087ab0b7adcae062ca141f76aa6e5acdb20c695fee963dec38";
|
|
42
|
+
readonly "licenses/tree-sitter-bash-MIT.txt": "49bf33cf78ef5897e4e161ce1517df7de1ae5042a65b6bcfd44401e0fc606559";
|
|
43
|
+
readonly "licenses/tree-sitter-c-MIT.txt": "2e0110e07abef7c2548b26ec9d6969775617ca539a0dc8dbeeb14d6452c711d1";
|
|
44
|
+
readonly "licenses/tree-sitter-c-sharp-MIT.txt": "778fb7d63b8c1844da315648c02f325c4713a6f4a5d19644fd413421422776d3";
|
|
45
|
+
readonly "licenses/tree-sitter-cpp-MIT.txt": "2e0110e07abef7c2548b26ec9d6969775617ca539a0dc8dbeeb14d6452c711d1";
|
|
46
|
+
readonly "licenses/tree-sitter-go-MIT.txt": "2e0110e07abef7c2548b26ec9d6969775617ca539a0dc8dbeeb14d6452c711d1";
|
|
47
|
+
readonly "licenses/tree-sitter-hcl-Apache-2.0.txt": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4";
|
|
48
|
+
readonly "licenses/tree-sitter-java-MIT.txt": "52ed137b039cd9c46409bc22e89938af911c95b157feae2d040b51e6084369a7";
|
|
49
|
+
readonly "licenses/tree-sitter-php-MIT.txt": "664764fabf40c0b318e06324a5a12379092a2df25b8cbf2415f71bc0bb352346";
|
|
50
|
+
readonly "licenses/tree-sitter-python-MIT.txt": "d724405ce238a22c0d35769c5a36b386ad5958192efe8bbb304fb2896254575f";
|
|
51
|
+
readonly "licenses/tree-sitter-ruby-MIT.txt": "9c99b99e93d3c6461bef9f6bac45d17b8bf014172625c24f76319bbd235a7b80";
|
|
52
|
+
readonly "licenses/tree-sitter-rust-MIT.txt": "31d5b6f4243d5c7c6e1c4ebbbb9f6407bd1457a08bcc4f706521710341acba36";
|
|
53
|
+
readonly "licenses/web-tree-sitter-MIT.txt": "c5cfb43042b6b72045f4ba997834d0a7786d2793d91680868b5815b39f14fc78";
|
|
54
|
+
readonly "package.json": "433313c71ef7951eb8cb58d855089f08ccab583405ab85d6a417d9309782356c";
|
|
55
|
+
};
|
|
56
|
+
readonly dependencies: readonly [{
|
|
57
|
+
readonly packageName: "web-tree-sitter";
|
|
58
|
+
readonly version: "0.27.0";
|
|
59
|
+
readonly files: {
|
|
60
|
+
readonly LICENSE: "c5cfb43042b6b72045f4ba997834d0a7786d2793d91680868b5815b39f14fc78";
|
|
61
|
+
readonly "debug/web-tree-sitter.cjs": "3faca4a6e5a006ec8e95a8e1918923ee9a385a02f64154fb2a893d5a27200f24";
|
|
62
|
+
readonly "debug/web-tree-sitter.js": "4cd02f4b5510044807279f7064e6bcceab391af3c245fc9b6da2de7b1116ff84";
|
|
63
|
+
readonly "debug/web-tree-sitter.wasm": "91a157f507fabb836588e6537a1af1bae45d3d4b9278d06d003678460b011d8e";
|
|
64
|
+
readonly "package.json": "707dd14277ba63ca8dcaad6b6df8051e23df78c878b5cbdc27885b3cfd72bfac";
|
|
65
|
+
readonly "web-tree-sitter.cjs": "743de33347202f863b6714fc7218c455d93f751943d43500500f6c5c65654dce";
|
|
66
|
+
readonly "web-tree-sitter.js": "7c49e3c1d87e24e0bb4c2def909d17154dfde281f5f8280225450090bb4b8110";
|
|
67
|
+
readonly "web-tree-sitter.wasm": "c03bccdc3b448a32848f5ae327e209c982bbb0840d43eec8bc2d5759544a1ed3";
|
|
68
|
+
};
|
|
69
|
+
}];
|
|
70
|
+
}];
|
|
71
|
+
//# sourceMappingURL=approved-source-analyzers.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approved-source-analyzers.generated.d.ts","sourceRoot":"","sources":["../../src/plugins/approved-source-analyzers.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmI3B,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Generated by scripts/qualify-source-analyzers.mjs after release qualification.
|
|
2
|
+
// Do not approve changed bytes without reviewing the executable and asset closure.
|
|
3
|
+
// implements REQ-source-analysis-v2
|
|
4
|
+
export const qualifiedSourceAnalyzers = [
|
|
5
|
+
{
|
|
6
|
+
packageName: "kibi-plugin-treesitter",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
files: {
|
|
9
|
+
"SBOM.spdx.json": "92cf77d240ffc1e95116edd4742363e34ead66b455dbf940f24321a19e7f9571",
|
|
10
|
+
"THIRD_PARTY_NOTICES.md": "0b1ede96cb261dab73fd1ec8c51d7bb5b2492eed0502f6c10ed071736daa263c",
|
|
11
|
+
"assets/queries/bash.scm": "6ca535e8fe652b51203ac272831881dab001f7ac508e50551bc2cdc4a15d7b6c",
|
|
12
|
+
"assets/queries/c.scm": "774ca67cfe23b0e0d1d3a4f01788049a822beb1311feee72b20a595a37be1e28",
|
|
13
|
+
"assets/queries/cpp-extra.scm": "7cf486901eaf7e9196bc2c5dfe83785eed70d367136f8008af37eb4f1c12a68a",
|
|
14
|
+
"assets/queries/cpp.scm": "029731ca946e32f919491d9f76c85a50e5deb5ad1934e37fd6849312c0d4a705",
|
|
15
|
+
"assets/queries/csharp-extra.scm": "d3a55c3c67cb236921da5785d08d146ba53f70d9e2af83a365f59954f8878a57",
|
|
16
|
+
"assets/queries/csharp.scm": "4ed08da0162ecd48206ac34bebe7ea9757a8c7b617f6ad8f70c168d685d514fe",
|
|
17
|
+
"assets/queries/go.scm": "d1a9b1f678fe0278b85054e2dc56a28ef26aa478b8c88fb2b0dd83cdcdb9db35",
|
|
18
|
+
"assets/queries/hcl.scm": "cad52e3fd81bc5584ea181c920bdb8fa4be007f05f8c5e08f95e9ccb40aee93a",
|
|
19
|
+
"assets/queries/java-extra.scm": "5ce7857f2b52c10b3672bc09f39f287cff2eaa7caa0b75dafccbaa5fec58431d",
|
|
20
|
+
"assets/queries/java.scm": "bcb22147b8582d92743fc973864cefb894a4c12b3957f16f3d472b2ec7cd4c49",
|
|
21
|
+
"assets/queries/php.scm": "4ac5e30f99f3abe5417dcb42219e0790c66f9b4bb3be071bc60160dd012f3cd8",
|
|
22
|
+
"assets/queries/python.scm": "d0f3e577878167bfabc30e526e497bce58d1699b9bcabf8ab3a50698efb5ca3e",
|
|
23
|
+
"assets/queries/ruby.scm": "ed1e7dc07a95b87aef267e7f9715c6717a70f09efbd7b6f48bbd51c7b7510cf3",
|
|
24
|
+
"assets/queries/rust-extra.scm": "511a492200e813f15b7ebec324eae69a245986a9d6813ddabe776075fd65976c",
|
|
25
|
+
"assets/queries/rust.scm": "f22867fdebde5cb091861c08d34690dc2540f4318068bf81be9f6b0d348ab8c1",
|
|
26
|
+
"assets/queries/terraform.scm": "8a6974a8eb48e13b5b8cd64e7c81262a825b4251df01ab383aee5cdda8151e7e",
|
|
27
|
+
"assets/tree-sitter-bash.wasm": "8292919c88a0f7d3fb31d0cd0253ca5a9531bc1ede82b0537f2c63dd8abe6a7a",
|
|
28
|
+
"assets/tree-sitter-c.wasm": "c852c2a85ebf2beb636aa3b0ef7f7e70458684d74f6741b20dcb296885bed9f9",
|
|
29
|
+
"assets/tree-sitter-c_sharp.wasm": "6f69e1cae44e1c32c1eccc170dc5a9778fb94ff716f71113fe1f8c4299aa2f40",
|
|
30
|
+
"assets/tree-sitter-cpp.wasm": "174eb0deb75b2ec7881bcacda9f995648d8e683956e5c2267e69ab6dc503fcbf",
|
|
31
|
+
"assets/tree-sitter-go.wasm": "9504573f352b20be7f2f1911754d710622aedc15afff16d5ed8fb5645681aee7",
|
|
32
|
+
"assets/tree-sitter-hcl.release.wasm": "2f9acf63e7c263215f283e2cf0f4ebbb9bfa77f58e18fa42b91094be201372a7",
|
|
33
|
+
"assets/tree-sitter-java.wasm": "4fdeac4ca6ca089f06c6f7e562abcac1733cd465728cc7031ebb73c2019122c4",
|
|
34
|
+
"assets/tree-sitter-php.wasm": "d4df6a6ff08c87c3ec4f9cbb785fe09998a0cb570e03f57d7b19b3acfb146aa7",
|
|
35
|
+
"assets/tree-sitter-python.wasm": "16108b50df4ee9a30168794252ab55e7c93bfc5765d7fa0aa3e335752c515f47",
|
|
36
|
+
"assets/tree-sitter-ruby.wasm": "09a96427d7c72f0613ed470cd9812223fc4a91d6a9c025c0235cc6bd59ff96f4",
|
|
37
|
+
"assets/tree-sitter-rust.wasm": "f65f354215611fd94ad34134b3427eb3d58cbb745df7b6509ba722184db73d57",
|
|
38
|
+
"assets/tree-sitter-terraform.release.wasm": "59dbcbb0f08eb78b78f37510834559a48ce5c9d4866c978d62c6390796461cb5",
|
|
39
|
+
"catalog.json": "4075d988391b8c893f47722fb85f93d626d700af9b2a1b4909fd20ef0ec989b4",
|
|
40
|
+
"dist/analysis-worker.js": "75a1e646f636c1d1ace9ae22a9141a51e94bddc70203bed08de7bd13dae1764e",
|
|
41
|
+
"dist/catalog.js": "460243c48cb6a03b8c7971273729d8a1134955186978b6c0d04182c71960ebff",
|
|
42
|
+
"dist/extractor.js": "1d8cd819e7ec8fcc291a44e5ffe4ccfe77099301677913fcfe0d92e7ce971f33",
|
|
43
|
+
"dist/index.js": "adc03d77d94c0133b3188950b35f79db19e447cf7bfa1f7e1cf1f5c97a582a44",
|
|
44
|
+
"dist/performance-timing.js": "56cce530f627c8fd079e8ec070322f84378ae50c40a6765d88b418850692940b",
|
|
45
|
+
"integrity.json": "4f1530009fdf5f087ab0b7adcae062ca141f76aa6e5acdb20c695fee963dec38",
|
|
46
|
+
"licenses/tree-sitter-bash-MIT.txt": "49bf33cf78ef5897e4e161ce1517df7de1ae5042a65b6bcfd44401e0fc606559",
|
|
47
|
+
"licenses/tree-sitter-c-MIT.txt": "2e0110e07abef7c2548b26ec9d6969775617ca539a0dc8dbeeb14d6452c711d1",
|
|
48
|
+
"licenses/tree-sitter-c-sharp-MIT.txt": "778fb7d63b8c1844da315648c02f325c4713a6f4a5d19644fd413421422776d3",
|
|
49
|
+
"licenses/tree-sitter-cpp-MIT.txt": "2e0110e07abef7c2548b26ec9d6969775617ca539a0dc8dbeeb14d6452c711d1",
|
|
50
|
+
"licenses/tree-sitter-go-MIT.txt": "2e0110e07abef7c2548b26ec9d6969775617ca539a0dc8dbeeb14d6452c711d1",
|
|
51
|
+
"licenses/tree-sitter-hcl-Apache-2.0.txt": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
|
|
52
|
+
"licenses/tree-sitter-java-MIT.txt": "52ed137b039cd9c46409bc22e89938af911c95b157feae2d040b51e6084369a7",
|
|
53
|
+
"licenses/tree-sitter-php-MIT.txt": "664764fabf40c0b318e06324a5a12379092a2df25b8cbf2415f71bc0bb352346",
|
|
54
|
+
"licenses/tree-sitter-python-MIT.txt": "d724405ce238a22c0d35769c5a36b386ad5958192efe8bbb304fb2896254575f",
|
|
55
|
+
"licenses/tree-sitter-ruby-MIT.txt": "9c99b99e93d3c6461bef9f6bac45d17b8bf014172625c24f76319bbd235a7b80",
|
|
56
|
+
"licenses/tree-sitter-rust-MIT.txt": "31d5b6f4243d5c7c6e1c4ebbbb9f6407bd1457a08bcc4f706521710341acba36",
|
|
57
|
+
"licenses/web-tree-sitter-MIT.txt": "c5cfb43042b6b72045f4ba997834d0a7786d2793d91680868b5815b39f14fc78",
|
|
58
|
+
"package.json": "433313c71ef7951eb8cb58d855089f08ccab583405ab85d6a417d9309782356c",
|
|
59
|
+
},
|
|
60
|
+
dependencies: [
|
|
61
|
+
{
|
|
62
|
+
packageName: "web-tree-sitter",
|
|
63
|
+
version: "0.27.0",
|
|
64
|
+
files: {
|
|
65
|
+
LICENSE: "c5cfb43042b6b72045f4ba997834d0a7786d2793d91680868b5815b39f14fc78",
|
|
66
|
+
"debug/web-tree-sitter.cjs": "3faca4a6e5a006ec8e95a8e1918923ee9a385a02f64154fb2a893d5a27200f24",
|
|
67
|
+
"debug/web-tree-sitter.js": "4cd02f4b5510044807279f7064e6bcceab391af3c245fc9b6da2de7b1116ff84",
|
|
68
|
+
"debug/web-tree-sitter.wasm": "91a157f507fabb836588e6537a1af1bae45d3d4b9278d06d003678460b011d8e",
|
|
69
|
+
"package.json": "707dd14277ba63ca8dcaad6b6df8051e23df78c878b5cbdc27885b3cfd72bfac",
|
|
70
|
+
"web-tree-sitter.cjs": "743de33347202f863b6714fc7218c455d93f751943d43500500f6c5c65654dce",
|
|
71
|
+
"web-tree-sitter.js": "7c49e3c1d87e24e0bb4c2def909d17154dfde281f5f8280225450090bb4b8110",
|
|
72
|
+
"web-tree-sitter.wasm": "c03bccdc3b448a32848f5ae327e209c982bbb0840d43eec8bc2d5759544a1ed3",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ProjectKibiConfig } from "kibi-plugin-sdk";
|
|
2
|
+
import type { GitChangeSnapshot } from "../traceability/git-change-snapshot.js";
|
|
3
|
+
import type { Fingerprint } from "../traceability/impact-review.js";
|
|
4
|
+
import { type ApprovedSourceAnalyzer } from "./approved-source-analyzers.js";
|
|
5
|
+
import { type SourceAnalysisService } from "./source-analysis-service.js";
|
|
6
|
+
/** Hash the exact trusted source-extractor activation and its host-pinned closure. */
|
|
7
|
+
export declare function fingerprintMaintenanceSourceSet(workspaceRoot: string, projectConfig: ProjectKibiConfig): Fingerprint;
|
|
8
|
+
/** Verify the exact host-approved closure before any plugin entrypoint executes. */
|
|
9
|
+
export declare function verifyApprovedSourceAnalyzer(root: string, approval: ApprovedSourceAnalyzer): string;
|
|
10
|
+
/** Maintenance resolves source capabilities only; unrelated plugin code is never imported. */
|
|
11
|
+
export declare function createMaintenanceSourceAnalysisService(workspaceRoot: string, projectConfig?: ProjectKibiConfig): SourceAnalysisService;
|
|
12
|
+
/** Capture activation with the same source snapshot and retain baseline analyzers for code changes. */
|
|
13
|
+
export declare function readSnapshotSourceConfig(snapshot: GitChangeSnapshot, trustedTree?: string): ProjectKibiConfig;
|
|
14
|
+
//# sourceMappingURL=maintenance-source-analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintenance-source-analysis.d.ts","sourceRoot":"","sources":["../../src/plugins/maintenance-source-analysis.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,8BAA8B,CAAC;AA+DtC,sFAAsF;AAEtF,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,iBAAiB,GAC/B,WAAW,CAwCb;AAED,oFAAoF;AAEpF,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,sBAAsB,GAC/B,MAAM,CAwBR;AAED,8FAA8F;AAE9F,wBAAgB,sCAAsC,CACpD,aAAa,EAAE,MAAM,EACrB,aAAa,CAAC,EAAE,iBAAiB,GAChC,qBAAqB,CAyDvB;AAED,uGAAuG;AAEvG,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,CAAC,EAAE,MAAM,GACnB,iBAAiB,CA+CnB"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
5
|
+
import { validateProjectKibiConfig, } from "kibi-plugin-sdk";
|
|
6
|
+
import { SYMBOL_EXTRACTOR_V2_CAPABILITY_ID } from "kibi-plugin-sdk";
|
|
7
|
+
import { fingerprint } from "../traceability/impact-review.js";
|
|
8
|
+
import { APPROVED_SOURCE_ANALYZERS, } from "./approved-source-analyzers.js";
|
|
9
|
+
import { readProjectKibiConfig } from "./project-config.js";
|
|
10
|
+
import { CapabilityRegistry } from "./registry.js";
|
|
11
|
+
import { resolveProjectLocalPackage } from "./resolve-package.js";
|
|
12
|
+
import { createSourceAnalysisService, } from "./source-analysis-service.js";
|
|
13
|
+
function digestFile(root, file) {
|
|
14
|
+
const candidate = resolve(root, file);
|
|
15
|
+
const rel = relative(root, candidate);
|
|
16
|
+
if (!rel || rel.startsWith("..") || isAbsolute(rel))
|
|
17
|
+
throw new Error(`Invalid approved asset path: ${file}`);
|
|
18
|
+
const actual = realpathSync(candidate);
|
|
19
|
+
const actualRel = relative(realpathSync(root), actual);
|
|
20
|
+
if (actualRel.startsWith("..") || isAbsolute(actualRel))
|
|
21
|
+
throw new Error(`Approved asset escapes its package: ${file}`);
|
|
22
|
+
return createHash("sha256").update(readFileSync(actual)).digest("hex");
|
|
23
|
+
}
|
|
24
|
+
function verifyFiles(root, files) {
|
|
25
|
+
if (Object.keys(files).length === 0)
|
|
26
|
+
throw new Error("An approved analyzer must pin its executable closure");
|
|
27
|
+
for (const [file, expected] of Object.entries(files)) {
|
|
28
|
+
if (digestFile(root, file) !== expected)
|
|
29
|
+
throw new Error(`Source analyzer integrity mismatch: ${file}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function dependencyRoot(importer, packageName) {
|
|
33
|
+
const require = createRequire(join(importer, "package.json"));
|
|
34
|
+
let current = dirname(require.resolve(packageName));
|
|
35
|
+
for (;;) {
|
|
36
|
+
try {
|
|
37
|
+
const json = JSON.parse(readFileSync(join(current, "package.json"), "utf8"));
|
|
38
|
+
if (json.name === packageName)
|
|
39
|
+
return current;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
/* Walk through a package's dist directories. */
|
|
43
|
+
}
|
|
44
|
+
const parent = dirname(current);
|
|
45
|
+
if (parent === current)
|
|
46
|
+
throw new Error(`Cannot locate approved dependency: ${packageName}`);
|
|
47
|
+
current = parent;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Identify the host's first-party builtin analyzer by its published package
|
|
52
|
+
* identity. Content integrity of an installed release is the package
|
|
53
|
+
* manager's job; hashing the installed tree made the fingerprint differ
|
|
54
|
+
* between a workspace checkout, an npm install and a bundled runtime.
|
|
55
|
+
*/
|
|
56
|
+
function builtinRuntimeIdentity() {
|
|
57
|
+
const manifest = createRequire(import.meta.url)("kibi-plugin-builtin/package.json");
|
|
58
|
+
if (manifest.name !== "kibi-plugin-builtin" ||
|
|
59
|
+
typeof manifest.version !== "string")
|
|
60
|
+
throw new Error("Builtin source analyzer identity is invalid");
|
|
61
|
+
return { name: manifest.name, version: manifest.version };
|
|
62
|
+
}
|
|
63
|
+
/** Hash the exact trusted source-extractor activation and its host-pinned closure. */
|
|
64
|
+
// implements REQ-impact-policy-stage-e-content-bound-review
|
|
65
|
+
export function fingerprintMaintenanceSourceSet(workspaceRoot, projectConfig) {
|
|
66
|
+
const sourceEntries = (projectConfig.plugins ?? [])
|
|
67
|
+
.map((entry) => ({
|
|
68
|
+
package: entry.package,
|
|
69
|
+
capability: entry.capabilities[SYMBOL_EXTRACTOR_V2_CAPABILITY_ID] ?? null,
|
|
70
|
+
}))
|
|
71
|
+
.filter((entry) => entry.capability !== null)
|
|
72
|
+
.sort((a, b) => a.package.localeCompare(b.package));
|
|
73
|
+
const bindings = sourceEntries.map(({ package: packageName, capability }) => {
|
|
74
|
+
const approval = APPROVED_SOURCE_ANALYZERS.find((item) => item.packageName === packageName);
|
|
75
|
+
if (!approval)
|
|
76
|
+
throw new Error(`Source analyzer is not approved for impact review: ${packageName}`);
|
|
77
|
+
const resolved = resolveProjectLocalPackage(workspaceRoot, packageName);
|
|
78
|
+
const entryRelative = relative(resolved.packageRoot, resolved.entryPath).replaceAll("\\", "/");
|
|
79
|
+
if (!approval.files[entryRelative])
|
|
80
|
+
throw new Error("Source analyzer entrypoint is outside its approved closure");
|
|
81
|
+
return {
|
|
82
|
+
packageName,
|
|
83
|
+
capability,
|
|
84
|
+
approvalFingerprint: verifyApprovedSourceAnalyzer(resolved.packageRoot, approval),
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
return fingerprint({
|
|
88
|
+
contractVersion: "kibi.maintenance-source-set.v2",
|
|
89
|
+
builtinRuntime: builtinRuntimeIdentity(),
|
|
90
|
+
sdkContract: SYMBOL_EXTRACTOR_V2_CAPABILITY_ID,
|
|
91
|
+
bindings,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/** Verify the exact host-approved closure before any plugin entrypoint executes. */
|
|
95
|
+
// implements REQ-capability-plugin-activation-disclosure-v1
|
|
96
|
+
export function verifyApprovedSourceAnalyzer(root, approval) {
|
|
97
|
+
verifyFiles(root, approval.files);
|
|
98
|
+
const manifest = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
99
|
+
if (manifest.name !== approval.packageName ||
|
|
100
|
+
manifest.version !== approval.version)
|
|
101
|
+
throw new Error("Source analyzer package identity does not match host approval");
|
|
102
|
+
for (const dependency of approval.dependencies) {
|
|
103
|
+
const depRoot = dependencyRoot(root, dependency.packageName);
|
|
104
|
+
verifyFiles(depRoot, dependency.files);
|
|
105
|
+
const metadata = JSON.parse(readFileSync(join(depRoot, "package.json"), "utf8"));
|
|
106
|
+
if (metadata.version !== dependency.version)
|
|
107
|
+
throw new Error(`Unapproved source runtime version: ${dependency.packageName}`);
|
|
108
|
+
}
|
|
109
|
+
return createHash("sha256").update(JSON.stringify(approval)).digest("hex");
|
|
110
|
+
}
|
|
111
|
+
/** Maintenance resolves source capabilities only; unrelated plugin code is never imported. */
|
|
112
|
+
// implements REQ-capability-plugin-activation-disclosure-v1
|
|
113
|
+
export function createMaintenanceSourceAnalysisService(workspaceRoot, projectConfig) {
|
|
114
|
+
const config = projectConfig ?? readProjectKibiConfig(workspaceRoot);
|
|
115
|
+
const fingerprints = {};
|
|
116
|
+
const sourceEntries = (config.plugins ?? []).filter((entry) => entry.capabilities[SYMBOL_EXTRACTOR_V2_CAPABILITY_ID]);
|
|
117
|
+
const registry = new CapabilityRegistry({
|
|
118
|
+
workspaceRoot,
|
|
119
|
+
projectConfig: {
|
|
120
|
+
plugins: sourceEntries.flatMap((entry) => {
|
|
121
|
+
const capability = entry.capabilities[SYMBOL_EXTRACTOR_V2_CAPABILITY_ID];
|
|
122
|
+
return capability
|
|
123
|
+
? [
|
|
124
|
+
{
|
|
125
|
+
package: entry.package,
|
|
126
|
+
capabilities: {
|
|
127
|
+
[SYMBOL_EXTRACTOR_V2_CAPABILITY_ID]: capability,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
]
|
|
131
|
+
: [];
|
|
132
|
+
}),
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
return createSourceAnalysisService({
|
|
136
|
+
registry,
|
|
137
|
+
providerFingerprints: fingerprints,
|
|
138
|
+
resolveExtractorsV2: async () => {
|
|
139
|
+
for (const entry of sourceEntries) {
|
|
140
|
+
const approval = APPROVED_SOURCE_ANALYZERS.find((item) => item.packageName === entry.package);
|
|
141
|
+
if (!approval)
|
|
142
|
+
throw new Error(`Source analyzer is not approved for maintenance: ${entry.package}`);
|
|
143
|
+
const resolved = resolveProjectLocalPackage(workspaceRoot, entry.package);
|
|
144
|
+
const entryRelative = relative(resolved.packageRoot, resolved.entryPath).replaceAll("\\", "/");
|
|
145
|
+
if (!approval.files[entryRelative])
|
|
146
|
+
throw new Error("Source analyzer entrypoint is outside its approved closure");
|
|
147
|
+
fingerprints[entry.package] = verifyApprovedSourceAnalyzer(resolved.packageRoot, approval);
|
|
148
|
+
}
|
|
149
|
+
return registry.resolveSymbolExtractorsV2();
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/** Capture activation with the same source snapshot and retain baseline analyzers for code changes. */
|
|
154
|
+
// implements REQ-source-analysis-v2
|
|
155
|
+
export function readSnapshotSourceConfig(snapshot, trustedTree) {
|
|
156
|
+
const readConfig = (tree) => {
|
|
157
|
+
const entry = snapshot
|
|
158
|
+
.readGit(["ls-tree", tree, "--", "package.json"])
|
|
159
|
+
.toString("utf8");
|
|
160
|
+
if (!entry)
|
|
161
|
+
return {};
|
|
162
|
+
if (!/^100(?:644|755) blob /.test(entry))
|
|
163
|
+
throw new Error("Source analyzer configuration must be a regular snapshot file");
|
|
164
|
+
return validateProjectKibiConfig(JSON.parse(snapshot.readGit(["show", `${tree}:package.json`]).toString("utf8")).kibi);
|
|
165
|
+
};
|
|
166
|
+
if (trustedTree !== undefined)
|
|
167
|
+
return readConfig(trustedTree);
|
|
168
|
+
const entries = new Map();
|
|
169
|
+
for (const entry of readConfig(snapshot.headTree).plugins ?? [])
|
|
170
|
+
entries.set(entry.package, entry);
|
|
171
|
+
const configurationPaths = new Set([
|
|
172
|
+
"package.json",
|
|
173
|
+
"bun.lock",
|
|
174
|
+
"package-lock.json",
|
|
175
|
+
"pnpm-lock.yaml",
|
|
176
|
+
"yarn.lock",
|
|
177
|
+
]);
|
|
178
|
+
if (snapshot.inventory.some((file) => !configurationPaths.has(file.path) && !file.path.startsWith(".kb/"))) {
|
|
179
|
+
for (const entry of readConfig(snapshot.baseTree).plugins ?? []) {
|
|
180
|
+
const baseline = entry.capabilities[SYMBOL_EXTRACTOR_V2_CAPABILITY_ID];
|
|
181
|
+
if (!baseline || baseline.mode === "shadow")
|
|
182
|
+
continue;
|
|
183
|
+
const selected = entries.get(entry.package)?.capabilities[SYMBOL_EXTRACTOR_V2_CAPABILITY_ID];
|
|
184
|
+
if (selected?.mode === "shadow")
|
|
185
|
+
throw new Error(`Cannot downgrade active source analyzer '${entry.package}' to shadow while changing source; separate the configuration change`);
|
|
186
|
+
if (!selected)
|
|
187
|
+
entries.set(entry.package, entry);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return { plugins: [...entries.values()] };
|
|
191
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CapabilityId, type KibiPluginV1, type OntologyPackV1, type PluginMode, type PluginPermissions, type PluginProviderStamp, type ProjectKibiConfig, type SemanticClassifierV1, type SymbolExtractorV1, type VocabularyAlignmentV1 } from "kibi-plugin-sdk";
|
|
1
|
+
import { type CapabilityId, type KibiPluginV1, type OntologyPackV1, type PluginMode, type PluginPermissions, type PluginProviderStamp, type ProjectKibiConfig, type SemanticClassifierV1, type SymbolExtractorV1, type SymbolExtractorV2, type VocabularyAlignmentV1 } from "kibi-plugin-sdk";
|
|
2
2
|
import { type LoadPluginOptions, loadPluginPackage } from "./load-plugin.js";
|
|
3
3
|
export type BuiltinPluginFactory = () => KibiPluginV1 | Promise<KibiPluginV1>;
|
|
4
4
|
export type CapabilityProviderBinding<T> = Readonly<{
|
|
@@ -59,6 +59,7 @@ export declare class CapabilityRegistry {
|
|
|
59
59
|
resolveSemanticClassifiers(): Promise<CapabilityModeResolution<SemanticClassifierV1>>;
|
|
60
60
|
resolveOntologyPacks(): Promise<CapabilityModeResolution<OntologyPackV1>>;
|
|
61
61
|
resolveSymbolExtractors(): Promise<CapabilityModeResolution<SymbolExtractorV1>>;
|
|
62
|
+
resolveSymbolExtractorsV2(): Promise<CapabilityModeResolution<SymbolExtractorV2>>;
|
|
62
63
|
resolveVocabularyAlignment(): Promise<CapabilityModeResolution<VocabularyAlignmentV1>>;
|
|
63
64
|
resolveCapability(capabilityId: CapabilityId): Promise<CapabilityModeResolution<unknown>>;
|
|
64
65
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/plugins/registry.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAEjB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/plugins/registry.ts"],"names":[],"mappings":"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"}
|
package/dist/plugins/registry.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import { KIBI_PLUGIN_API_VERSION, ONTOLOGY_PACK_CAPABILITY_ID, SEMANTIC_CLASSIFIER_CAPABILITY_ID, SYMBOL_EXTRACTOR_CAPABILITY_ID, VOCABULARY_ALIGNMENT_CAPABILITY_ID, defineKibiPlugin, validateKibiPlugin, } from "kibi-plugin-sdk";
|
|
18
|
+
import { KIBI_PLUGIN_API_VERSION, ONTOLOGY_PACK_CAPABILITY_ID, SEMANTIC_CLASSIFIER_CAPABILITY_ID, SYMBOL_EXTRACTOR_CAPABILITY_ID, SYMBOL_EXTRACTOR_V2_CAPABILITY_ID, VOCABULARY_ALIGNMENT_CAPABILITY_ID, defineKibiPlugin, validateKibiPlugin, } from "kibi-plugin-sdk";
|
|
19
19
|
import { loadPluginPackage } from "./load-plugin.js";
|
|
20
20
|
import { readProjectKibiConfig } from "./project-config.js";
|
|
21
21
|
import { PluginResolutionError } from "./resolve-package.js";
|
|
@@ -23,6 +23,7 @@ const CAPABILITY_SLOT = {
|
|
|
23
23
|
[SEMANTIC_CLASSIFIER_CAPABILITY_ID]: "semanticClassifier",
|
|
24
24
|
[ONTOLOGY_PACK_CAPABILITY_ID]: "ontologyPack",
|
|
25
25
|
[SYMBOL_EXTRACTOR_CAPABILITY_ID]: "symbolExtractor",
|
|
26
|
+
[SYMBOL_EXTRACTOR_V2_CAPABILITY_ID]: "symbolExtractorV2",
|
|
26
27
|
[VOCABULARY_ALIGNMENT_CAPABILITY_ID]: "vocabularyAlignment",
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
@@ -197,6 +198,10 @@ export class CapabilityRegistry {
|
|
|
197
198
|
async resolveSymbolExtractors() {
|
|
198
199
|
return this.resolveCapability(SYMBOL_EXTRACTOR_CAPABILITY_ID);
|
|
199
200
|
}
|
|
201
|
+
// implements REQ-capability-plugin-activation-disclosure-v1
|
|
202
|
+
async resolveSymbolExtractorsV2() {
|
|
203
|
+
return this.resolveCapability(SYMBOL_EXTRACTOR_V2_CAPABILITY_ID);
|
|
204
|
+
}
|
|
200
205
|
async resolveVocabularyAlignment() {
|
|
201
206
|
return this.resolveCapability(VOCABULARY_ALIGNMENT_CAPABILITY_ID);
|
|
202
207
|
}
|