kibi-cli 2.31.1 → 2.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-register-proof.d.ts.map +1 -1
- package/dist/cli-register-proof.js +19 -7
- package/dist/cli-register-reporting.d.ts.map +1 -1
- package/dist/cli-register-reporting.js +2 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +5 -1
- package/dist/commands/check-generated.d.ts +5 -1
- package/dist/commands/check-generated.d.ts.map +1 -1
- package/dist/commands/check-generated.js +24 -35
- package/dist/commands/check.d.ts +1 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +14 -5
- package/dist/commands/discovery-table.d.ts.map +1 -1
- package/dist/commands/discovery-table.js +51 -4
- package/dist/commands/doctor.js +19 -4
- package/dist/commands/init-helpers.d.ts.map +1 -1
- package/dist/commands/init-helpers.js +8 -5
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +109 -5
- package/dist/commands/prove.d.ts +48 -1
- package/dist/commands/prove.d.ts.map +1 -1
- package/dist/commands/prove.js +293 -8
- package/dist/commands/report.d.ts +1 -0
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/report.js +70 -5
- package/dist/commands/signoff.d.ts.map +1 -1
- package/dist/commands/signoff.js +20 -1
- package/dist/commands/sync/manifest.d.ts +10 -1
- package/dist/commands/sync/manifest.d.ts.map +1 -1
- package/dist/commands/sync/manifest.js +106 -17
- package/dist/commands/sync/persistence.d.ts.map +1 -1
- package/dist/commands/sync/persistence.js +16 -5
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +19 -0
- package/dist/diagnostics.js +1 -1
- package/dist/engine.js +1 -1
- package/dist/extractors/markdown.d.ts +4 -2
- package/dist/extractors/markdown.d.ts.map +1 -1
- package/dist/extractors/markdown.js +17 -0
- package/dist/extractors/symbol-coordinates.js +2 -2
- package/dist/extractors/symbols-coordinator.d.ts +2 -4
- package/dist/extractors/symbols-coordinator.d.ts.map +1 -1
- package/dist/extractors/symbols-coordinator.js +1 -2
- package/dist/operations/bootstrap/candidate-helpers.d.ts +3 -0
- package/dist/operations/bootstrap/candidate-helpers.d.ts.map +1 -1
- package/dist/operations/bootstrap/candidate-helpers.js +4 -0
- package/dist/operations/migration/evidence-floor.d.ts +41 -0
- package/dist/operations/migration/evidence-floor.d.ts.map +1 -0
- package/dist/operations/migration/evidence-floor.js +230 -0
- package/dist/operations/migration/proof-contract-claims.d.ts +72 -0
- package/dist/operations/migration/proof-contract-claims.d.ts.map +1 -0
- package/dist/operations/migration/proof-contract-claims.js +215 -0
- package/dist/operations/migration/schema6.d.ts +6 -0
- package/dist/operations/migration/schema6.d.ts.map +1 -1
- package/dist/operations/migration/schema6.js +92 -0
- package/dist/operations/migration/symbol-coordinates-refresh.d.ts +3 -2
- package/dist/operations/migration/symbol-coordinates-refresh.d.ts.map +1 -1
- package/dist/operations/migration/symbol-coordinates-refresh.js +4 -3
- package/dist/operations/migration/untrack-symbol-coordinates.d.ts +23 -0
- package/dist/operations/migration/untrack-symbol-coordinates.d.ts.map +1 -0
- package/dist/operations/migration/untrack-symbol-coordinates.js +67 -0
- package/dist/operations/modeling/requirement-modeler.d.ts.map +1 -1
- package/dist/operations/modeling/requirement-modeler.js +48 -1
- package/dist/operations/modeling/requirement-types.d.ts +2 -1
- package/dist/operations/modeling/requirement-types.d.ts.map +1 -1
- package/dist/operations/modeling/requirement-utils.d.ts +1 -1
- package/dist/operations/modeling/requirement-utils.d.ts.map +1 -1
- package/dist/operations/modeling/requirement-utils.js +8 -1
- package/dist/operations/mutation/omitted-properties.d.ts +11 -0
- package/dist/operations/mutation/omitted-properties.d.ts.map +1 -0
- package/dist/operations/mutation/omitted-properties.js +76 -0
- package/dist/operations/mutation/serialization.d.ts.map +1 -1
- package/dist/operations/mutation/serialization.js +1 -0
- package/dist/operations/mutation/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +39 -20
- package/dist/operations/mutation/strict-fact.d.ts.map +1 -1
- package/dist/operations/mutation/strict-fact.js +6 -2
- package/dist/operations/mutation/symbol-granularity.d.ts.map +1 -1
- package/dist/operations/mutation/symbol-granularity.js +5 -3
- package/dist/operations/mutation/upsert.d.ts.map +1 -1
- package/dist/operations/mutation/upsert.js +7 -1
- package/dist/operations/mutation/validation.d.ts +2 -0
- package/dist/operations/mutation/validation.d.ts.map +1 -1
- package/dist/operations/mutation/validation.js +4 -0
- package/dist/operations/proof/claim-bindings.d.ts +41 -0
- package/dist/operations/proof/claim-bindings.d.ts.map +1 -0
- package/dist/operations/proof/claim-bindings.js +364 -0
- package/dist/operations/proof/code-certificates.d.ts +155 -0
- package/dist/operations/proof/code-certificates.d.ts.map +1 -0
- package/dist/operations/proof/code-certificates.js +894 -0
- package/dist/operations/proof/code-models.d.ts +96 -0
- package/dist/operations/proof/code-models.d.ts.map +1 -0
- package/dist/operations/proof/code-models.js +601 -0
- package/dist/operations/proof/code-runner.d.ts +40 -0
- package/dist/operations/proof/code-runner.d.ts.map +1 -0
- package/dist/operations/proof/code-runner.js +164 -0
- package/dist/operations/proof/code-scope.d.ts +14 -1
- package/dist/operations/proof/code-scope.d.ts.map +1 -1
- package/dist/operations/proof/code-scope.js +44 -2
- package/dist/operations/proof/compact-receipts.d.ts.map +1 -1
- package/dist/operations/proof/compact-receipts.js +4 -3
- package/dist/operations/proof/explain.d.ts +32 -0
- package/dist/operations/proof/explain.d.ts.map +1 -1
- package/dist/operations/proof/explain.js +91 -0
- package/dist/operations/proof/ingest-proof.d.ts +9 -1
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +42 -2
- package/dist/operations/proof/receipt-compaction.d.ts +2 -0
- package/dist/operations/proof/receipt-compaction.d.ts.map +1 -1
- package/dist/operations/proof/receipt-compaction.js +6 -2
- package/dist/operations/proof/regular-language.d.ts +89 -0
- package/dist/operations/proof/regular-language.d.ts.map +1 -0
- package/dist/operations/proof/regular-language.js +943 -0
- package/dist/operations/proof/source-code-readers.d.ts +12 -0
- package/dist/operations/proof/source-code-readers.d.ts.map +1 -0
- package/dist/operations/proof/source-code-readers.js +699 -0
- package/dist/operations/semantic-advisor/analyze-prose.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/analyze-prose.js +2 -1
- package/dist/operations/semantic-advisor/shared.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/shared.js +4 -0
- package/dist/operations/semantic-advisor/strict-count-rules.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/strict-count-rules.js +8 -2
- package/dist/operations/semantic-advisor/strict-rules.d.ts +8 -0
- package/dist/operations/semantic-advisor/strict-rules.d.ts.map +1 -1
- package/dist/operations/semantic-advisor/strict-rules.js +234 -4
- package/dist/operations/semantic-advisor/types.d.ts +3 -2
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/plugins/approved-source-analyzers.generated.d.ts +6 -6
- package/dist/plugins/approved-source-analyzers.generated.js +6 -6
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +13 -3
- package/dist/proof/command-test-report.d.ts +4 -3
- package/dist/proof/command-test-report.d.ts.map +1 -1
- package/dist/proof/command-test-report.js +4 -10
- package/dist/proof/evaluate.d.ts.map +1 -1
- package/dist/proof/evaluate.js +18 -2
- package/dist/proof/inspect.d.ts.map +1 -1
- package/dist/proof/inspect.js +58 -0
- package/dist/proof/producers/playwright-reporter.d.ts +3 -0
- package/dist/proof/producers/playwright-reporter.d.ts.map +1 -1
- package/dist/proof/producers/playwright-reporter.js +25 -2
- package/dist/proof/step-runner.d.ts +36 -0
- package/dist/proof/step-runner.d.ts.map +1 -0
- package/dist/proof/step-runner.js +234 -0
- package/dist/public/evidence-levels.d.ts +12 -0
- package/dist/public/evidence-levels.d.ts.map +1 -0
- package/dist/public/evidence-levels.js +19 -0
- package/dist/public/impact/coverage-depth-quality.d.ts +7 -0
- package/dist/public/impact/coverage-depth-quality.d.ts.map +1 -1
- package/dist/public/impact/coverage-depth-quality.js +59 -0
- package/dist/public/impact/full-kb-quality.d.ts.map +1 -1
- package/dist/public/impact/full-kb-quality.js +3 -1
- package/dist/public/operations/catalog.d.ts +315 -11
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/check-executor.d.ts +2 -0
- package/dist/public/operations/check-executor.d.ts.map +1 -1
- package/dist/public/operations/check-executor.js +6 -0
- package/dist/public/operations/evidence-floor.d.ts +48 -0
- package/dist/public/operations/evidence-floor.d.ts.map +1 -0
- package/dist/public/operations/evidence-floor.js +143 -0
- package/dist/public/operations/migration-plan.d.ts +19 -5
- package/dist/public/operations/migration-plan.d.ts.map +1 -1
- package/dist/public/operations/migration-plan.js +22 -5
- package/dist/public/operations/node-ports.d.ts.map +1 -1
- package/dist/public/operations/node-ports.js +4 -1
- package/dist/public/operations/proof-contract-claims.d.ts +26 -0
- package/dist/public/operations/proof-contract-claims.d.ts.map +1 -0
- package/dist/public/operations/proof-contract-claims.js +71 -0
- 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/composite.d.ts +16 -3
- package/dist/public/operations/specs/composite.d.ts.map +1 -1
- package/dist/public/operations/specs/modeling.d.ts +16 -3
- package/dist/public/operations/specs/modeling.d.ts.map +1 -1
- package/dist/public/operations/specs/modeling.js +22 -3
- package/dist/public/operations/specs/mutation-schemas.d.ts +289 -7
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +28 -4
- package/dist/public/operations/specs/proof.d.ts +9 -0
- package/dist/public/operations/specs/proof.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.d.ts.map +1 -1
- package/dist/public/operations/specs/reporting.js +19 -10
- package/dist/public/operations/specs/upsert.d.ts +289 -7
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/proof-certificates.d.ts +163 -0
- package/dist/public/proof-certificates.d.ts.map +1 -0
- package/dist/public/proof-certificates.js +419 -0
- package/dist/public/proof-protocol.d.ts +259 -3
- package/dist/public/proof-protocol.d.ts.map +1 -1
- package/dist/public/proof-protocol.js +524 -3
- package/dist/public/proof-receipt.d.ts +90 -6
- package/dist/public/proof-receipt.d.ts.map +1 -1
- package/dist/public/proof-receipt.js +88 -7
- package/dist/public/proof-sources.d.ts +102 -0
- package/dist/public/proof-sources.d.ts.map +1 -0
- package/dist/public/proof-sources.js +1292 -0
- package/dist/public/schemas/entity.d.ts.map +1 -1
- package/dist/public/schemas/entity.js +39 -2
- package/dist/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/dist/public/skills/kibi-commit-review/SKILL.md +8 -8
- package/dist/public/skills/kibi-commit-review/resources/staged-gate.md +12 -7
- package/dist/public/skills/kibi-decisions/SKILL.md +13 -2
- package/dist/public/skills/kibi-decisions/resources/decision-records.md +9 -1
- package/dist/public/skills/kibi-freshness/SKILL.md +5 -1
- package/dist/public/skills/kibi-traceability/SKILL.md +12 -1
- package/dist/public/skills/kibi-usage/SKILL.md +8 -4
- package/dist/public/skills/kibi-usage/resources/proof.md +221 -20
- package/dist/public/skills/kibi-usage/resources/workflows.md +4 -4
- package/dist/report/html-report.css +83 -11
- package/dist/report/html-report.d.ts +8 -0
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +214 -22
- package/dist/report/report-view.d.ts +2 -2
- package/dist/report/report-view.d.ts.map +1 -1
- package/dist/report/report-view.js +8 -0
- package/dist/schemas/entity.schema.json +404 -5
- package/dist/search-answer.d.ts.map +1 -1
- package/dist/search-answer.js +1 -0
- package/dist/signoff/html.d.ts.map +1 -1
- package/dist/signoff/html.js +3 -0
- package/dist/signoff/markdown.d.ts.map +1 -1
- package/dist/signoff/markdown.js +3 -0
- package/dist/signoff/model.d.ts +20 -0
- package/dist/signoff/model.d.ts.map +1 -1
- package/dist/signoff/model.js +20 -1
- package/dist/traceability/evidence-model.d.ts +13 -12
- package/dist/traceability/evidence-model.d.ts.map +1 -1
- package/dist/traceability/evidence-model.js +1 -1
- package/dist/traceability/impact-knowledge.d.ts.map +1 -1
- package/dist/traceability/impact-knowledge.js +1 -0
- package/dist/traceability/staged-diagnostics.d.ts.map +1 -1
- package/dist/traceability/staged-diagnostics.js +24 -20
- package/dist/traceability/staged-impact-contract.d.ts +4 -4
- package/dist/traceability/staged-impact-contract.js +9 -9
- package/dist/traceability/staged-symbols-manifest.d.ts +11 -3
- package/dist/traceability/staged-symbols-manifest.d.ts.map +1 -1
- package/dist/traceability/staged-symbols-manifest.js +47 -140
- package/dist/traceability/temp-kb.d.ts.map +1 -1
- package/dist/traceability/temp-kb.js +1 -0
- package/dist/types/entities.d.ts +5 -2
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/merge-driver-setup.d.ts +8 -1
- package/dist/utils/merge-driver-setup.d.ts.map +1 -1
- package/dist/utils/merge-driver-setup.js +23 -2
- package/dist/utils/rule-registry.generated.d.ts +10 -0
- package/dist/utils/rule-registry.generated.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.js +12 -0
- package/dist/utils/schema-version.d.ts +1 -1
- package/dist/utils/schema-version.d.ts.map +1 -1
- package/dist/utils/schema-version.js +7 -1
- package/dist/utils/strict-modeling.d.ts +3 -2
- package/dist/utils/strict-modeling.d.ts.map +1 -1
- package/dist/utils/strict-modeling.js +37 -4
- package/dist/workspace-cwd.d.ts +15 -0
- package/dist/workspace-cwd.d.ts.map +1 -0
- package/dist/workspace-cwd.js +86 -0
- package/package.json +6 -2
- package/schema/entities.pl +6 -0
- package/schema/validation.pl +7 -2
- package/src/public/evidence-levels.ts +23 -0
- package/src/public/impact/coverage-depth-quality.ts +73 -0
- package/src/public/impact/full-kb-quality.ts +6 -1
- package/src/public/operations/check-executor.ts +13 -0
- package/src/public/operations/evidence-floor.ts +203 -0
- package/src/public/operations/migration-plan.ts +39 -6
- package/src/public/operations/node-ports.ts +3 -1
- package/src/public/operations/proof-contract-claims.ts +103 -0
- package/src/public/operations/specs/check-rules.generated.ts +3 -1
- package/src/public/operations/specs/modeling.ts +24 -5
- package/src/public/operations/specs/mutation-schemas.ts +30 -4
- package/src/public/operations/specs/reporting.ts +20 -10
- package/src/public/proof-certificates.ts +566 -0
- package/src/public/proof-protocol-types.d.ts +69 -1
- package/src/public/proof-protocol.ts +694 -3
- package/src/public/proof-receipt.ts +133 -7
- package/src/public/proof-sources.ts +1656 -0
- package/src/public/schemas/entity.ts +51 -3
- package/src/public/skills/kibi-bootstrap/SKILL.md +2 -2
- package/src/public/skills/kibi-commit-review/SKILL.md +8 -8
- package/src/public/skills/kibi-commit-review/resources/staged-gate.md +12 -7
- package/src/public/skills/kibi-decisions/SKILL.md +13 -2
- package/src/public/skills/kibi-decisions/resources/decision-records.md +9 -1
- package/src/public/skills/kibi-freshness/SKILL.md +5 -1
- package/src/public/skills/kibi-traceability/SKILL.md +12 -1
- package/src/public/skills/kibi-usage/SKILL.md +8 -4
- package/src/public/skills/kibi-usage/resources/proof.md +221 -20
- package/src/public/skills/kibi-usage/resources/workflows.md +4 -4
- package/src/schemas/entity.schema.json +404 -5
- package/dist/commands/proof-impact.d.ts +0 -7
- package/dist/commands/proof-impact.d.ts.map +0 -1
- package/dist/commands/proof-impact.js +0 -39
- package/dist/operations/proof/baseline-diff.d.ts +0 -41
- package/dist/operations/proof/baseline-diff.d.ts.map +0 -1
- package/dist/operations/proof/baseline-diff.js +0 -153
- package/dist/operations/proof/impact.d.ts +0 -51
- package/dist/operations/proof/impact.d.ts.map +0 -1
- package/dist/operations/proof/impact.js +0 -138
- package/dist/traceability/reviewed-coordinate-refresh.d.ts +0 -10
- package/dist/traceability/reviewed-coordinate-refresh.d.ts.map +0 -1
- package/dist/traceability/reviewed-coordinate-refresh.js +0 -49
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Kibi — repo-local, per-branch, queryable long-term memory for software projects
|
|
3
|
-
Copyright (C) 2026 Piotr Franczyk
|
|
4
|
-
|
|
5
|
-
This program is free software: you can redistribute it and/or modify
|
|
6
|
-
it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
(at your option) any later version.
|
|
9
|
-
*/
|
|
10
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
11
|
-
export const PROOF_BASELINE_VERSION = "kibi.proof-baseline.v3";
|
|
12
|
-
function asStringArray(value) {
|
|
13
|
-
if (!Array.isArray(value))
|
|
14
|
-
return [];
|
|
15
|
-
return value
|
|
16
|
-
.map((item) => (typeof item === "string" ? item : String(item)))
|
|
17
|
-
.sort();
|
|
18
|
-
}
|
|
19
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
20
|
-
export function fingerprintRequirements(rows) {
|
|
21
|
-
const requirements = {};
|
|
22
|
-
for (const row of rows) {
|
|
23
|
-
const id = typeof row.id === "string" ? row.id : "";
|
|
24
|
-
const proofStatus = typeof row.proofStatus === "string" ? row.proofStatus : "";
|
|
25
|
-
if (id === "" || proofStatus === "not_applicable")
|
|
26
|
-
continue;
|
|
27
|
-
requirements[id] = {
|
|
28
|
-
proofStatus,
|
|
29
|
-
gaps: asStringArray(row.proofGaps),
|
|
30
|
-
uncoveredSymbols: asStringArray(row.proofStages?.productionSymbols?.uncoveredSymbols),
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
return requirements;
|
|
34
|
-
}
|
|
35
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
36
|
-
export function diffFingerprints(baseline, current) {
|
|
37
|
-
const before = baseline ?? {};
|
|
38
|
-
const ids = [
|
|
39
|
-
...new Set([...Object.keys(before), ...Object.keys(current)]),
|
|
40
|
-
].sort();
|
|
41
|
-
const changes = [];
|
|
42
|
-
for (const id of ids) {
|
|
43
|
-
const left = before[id];
|
|
44
|
-
const right = current[id];
|
|
45
|
-
if (left === undefined && right !== undefined) {
|
|
46
|
-
changes.push({ id, kind: "added", after: right });
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
if (left !== undefined && right === undefined) {
|
|
50
|
-
changes.push({ id, kind: "removed", before: left });
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
if (left === undefined || right === undefined)
|
|
54
|
-
continue;
|
|
55
|
-
if (left.proofStatus !== right.proofStatus ||
|
|
56
|
-
JSON.stringify(left.gaps) !== JSON.stringify(right.gaps) ||
|
|
57
|
-
JSON.stringify(left.uncoveredSymbols) !==
|
|
58
|
-
JSON.stringify(right.uncoveredSymbols)) {
|
|
59
|
-
changes.push({ id, kind: "changed", before: left, after: right });
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return changes;
|
|
63
|
-
}
|
|
64
|
-
export function explanationsForRequirement(rows, requirementId) {
|
|
65
|
-
const row = rows.find((item) => item.id === requirementId);
|
|
66
|
-
const explanations = row?.proofStages?.productionSymbols?.explanations;
|
|
67
|
-
return Array.isArray(explanations)
|
|
68
|
-
? explanations
|
|
69
|
-
: [];
|
|
70
|
-
}
|
|
71
|
-
function renderCandidate(candidate) {
|
|
72
|
-
const testId = typeof candidate.testId === "string" ? candidate.testId : "?";
|
|
73
|
-
const reason = typeof candidate.reason === "string" ? candidate.reason : "";
|
|
74
|
-
const secondaries = Array.isArray(candidate.secondaryReasons)
|
|
75
|
-
? candidate.secondaryReasons.filter((item) => typeof item === "string")
|
|
76
|
-
: [];
|
|
77
|
-
const secondaryText = secondaries.length > 0 ? ` secondary=${secondaries.join(",")}` : "";
|
|
78
|
-
return ` covered_by ${testId}: ${reason}${secondaryText}`;
|
|
79
|
-
}
|
|
80
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
81
|
-
export function renderRequirementDiffs(changes, rows = []) {
|
|
82
|
-
if (changes.length === 0)
|
|
83
|
-
return "";
|
|
84
|
-
const lines = [
|
|
85
|
-
"Requirement fingerprint diffs vs committed proof/baseline.json:",
|
|
86
|
-
];
|
|
87
|
-
for (const change of changes) {
|
|
88
|
-
if (change.kind === "added" && change.after) {
|
|
89
|
-
lines.push(` ${change.id}: added (${change.after.proofStatus}; gaps=${change.after.gaps.join(",") || "none"})`);
|
|
90
|
-
}
|
|
91
|
-
else if (change.kind === "removed" && change.before) {
|
|
92
|
-
lines.push(` ${change.id}: removed (was ${change.before.proofStatus})`);
|
|
93
|
-
}
|
|
94
|
-
else if (change.kind === "changed" && change.before && change.after) {
|
|
95
|
-
if (change.before.proofStatus !== change.after.proofStatus) {
|
|
96
|
-
lines.push(` ${change.id}: ${change.before.proofStatus} -> ${change.after.proofStatus}`);
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
lines.push(` ${change.id}: fingerprint changed`);
|
|
100
|
-
}
|
|
101
|
-
const beforeGaps = new Set(change.before.gaps);
|
|
102
|
-
const afterGaps = new Set(change.after.gaps);
|
|
103
|
-
for (const gap of change.after.gaps) {
|
|
104
|
-
if (!beforeGaps.has(gap))
|
|
105
|
-
lines.push(` gap added: ${gap}`);
|
|
106
|
-
}
|
|
107
|
-
for (const gap of change.before.gaps) {
|
|
108
|
-
if (!afterGaps.has(gap))
|
|
109
|
-
lines.push(` gap removed: ${gap}`);
|
|
110
|
-
}
|
|
111
|
-
const beforeSymbols = new Set(change.before.uncoveredSymbols);
|
|
112
|
-
const afterSymbols = new Set(change.after.uncoveredSymbols);
|
|
113
|
-
for (const symbol of change.after.uncoveredSymbols) {
|
|
114
|
-
if (!beforeSymbols.has(symbol))
|
|
115
|
-
lines.push(` uncovered symbol added: ${symbol}`);
|
|
116
|
-
}
|
|
117
|
-
for (const symbol of change.before.uncoveredSymbols) {
|
|
118
|
-
if (!afterSymbols.has(symbol))
|
|
119
|
-
lines.push(` uncovered symbol removed: ${symbol}`);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
const explanations = explanationsForRequirement(rows, change.id);
|
|
123
|
-
for (const explanation of explanations) {
|
|
124
|
-
const symbolId = typeof explanation.symbolId === "string" ? explanation.symbolId : "";
|
|
125
|
-
const reason = typeof explanation.reason === "string" ? explanation.reason : "";
|
|
126
|
-
if (symbolId !== "")
|
|
127
|
-
lines.push(` ${symbolId}: ${reason}`);
|
|
128
|
-
const candidates = Array.isArray(explanation.coverageCandidates)
|
|
129
|
-
? explanation.coverageCandidates
|
|
130
|
-
: [];
|
|
131
|
-
for (const candidate of candidates) {
|
|
132
|
-
if (candidate && typeof candidate === "object")
|
|
133
|
-
lines.push(renderCandidate(candidate));
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return `${lines.join("\n")}\n`;
|
|
138
|
-
}
|
|
139
|
-
export function parseSpawnJson(result) {
|
|
140
|
-
if (result.error)
|
|
141
|
-
throw result.error;
|
|
142
|
-
const text = `${result.stdout ?? ""}`.trim();
|
|
143
|
-
try {
|
|
144
|
-
return JSON.parse(text);
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
const detail = `${result.stderr || result.stdout || ""}`.trim();
|
|
148
|
-
if (result.status !== 0 && result.status !== null) {
|
|
149
|
-
throw new Error(detail || String(error));
|
|
150
|
-
}
|
|
151
|
-
throw error;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { OperationContext } from "../../public/operations/runtime-types.js";
|
|
2
|
-
import { type CoverageRowLike, type RequirementFingerprints, diffFingerprints } from "./baseline-diff.js";
|
|
3
|
-
export declare const COMMITTED_BASELINE_PATH = "proof/baseline.json";
|
|
4
|
-
export type ProofBaselineFile = {
|
|
5
|
-
readonly version?: string;
|
|
6
|
-
readonly mode?: string;
|
|
7
|
-
readonly currentRequirements?: number;
|
|
8
|
-
readonly proofTested?: number;
|
|
9
|
-
readonly currentUntested?: number;
|
|
10
|
-
readonly trackedGaps?: Record<string, number>;
|
|
11
|
-
readonly requirements?: RequirementFingerprints;
|
|
12
|
-
};
|
|
13
|
-
export type ProofImpactResult = {
|
|
14
|
-
readonly comparisonTarget: typeof COMMITTED_BASELINE_PATH;
|
|
15
|
-
readonly baselineVersion: string;
|
|
16
|
-
readonly currentRequirements: number;
|
|
17
|
-
readonly proofTested: number;
|
|
18
|
-
readonly currentUntested: number;
|
|
19
|
-
readonly changes: ReturnType<typeof diffFingerprints>;
|
|
20
|
-
};
|
|
21
|
-
export type ReadCommittedFile = (workspaceRoot: string, relativePath: string) => string | Promise<string>;
|
|
22
|
-
export type ProofImpactExecuteOptions = {
|
|
23
|
-
readonly readCommittedFile?: ReadCommittedFile;
|
|
24
|
-
readonly loadCoverage?: (context: OperationContext) => Promise<{
|
|
25
|
-
structuredContent: unknown;
|
|
26
|
-
}>;
|
|
27
|
-
};
|
|
28
|
-
export declare function readCommittedHeadFile(workspaceRoot: string, relativePath: string): string;
|
|
29
|
-
export declare function loadCommittedBaseline(workspaceRoot: string, readCommittedFile?: ReadCommittedFile): Promise<ProofBaselineFile>;
|
|
30
|
-
/**
|
|
31
|
-
* A baseline committed before kibi.proof-baseline.v3 records a fully tested
|
|
32
|
-
* requirement as `proven`. Read it as `tested`, so the comparison shows real
|
|
33
|
-
* changes instead of a rename on every row.
|
|
34
|
-
*/
|
|
35
|
-
export declare function upgradeBaselineStatuses(baseline: ProofBaselineFile): ProofBaselineFile;
|
|
36
|
-
/** Diagnostic only: successful evaluation always exits 0. Ratchet lives in check-proof-baseline.mjs. */
|
|
37
|
-
export declare function proofImpactExitCode(_result: ProofImpactResult): 0;
|
|
38
|
-
export declare function buildProofImpact(baseline: ProofBaselineFile, coverage: {
|
|
39
|
-
summary?: Record<string, unknown>;
|
|
40
|
-
rows?: unknown;
|
|
41
|
-
}): {
|
|
42
|
-
result: ProofImpactResult;
|
|
43
|
-
rows: CoverageRowLike[];
|
|
44
|
-
};
|
|
45
|
-
export declare function renderProofImpact(result: ProofImpactResult, rows: readonly CoverageRowLike[]): string;
|
|
46
|
-
export declare function executeProofImpact(context: OperationContext, options?: ProofImpactExecuteOptions): Promise<{
|
|
47
|
-
result: ProofImpactResult;
|
|
48
|
-
rows: CoverageRowLike[];
|
|
49
|
-
text: string;
|
|
50
|
-
}>;
|
|
51
|
-
//# sourceMappingURL=impact.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impact.d.ts","sourceRoot":"","sources":["../../../src/operations/proof/impact.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,uBAAuB,EAC5B,gBAAgB,EAGjB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,uBAAuB,CAAC;IAC1D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAC9B,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,KACjB,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE9B,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAC/C,QAAQ,CAAC,YAAY,CAAC,EAAE,CACtB,OAAO,EAAE,gBAAgB,KACtB,OAAO,CAAC;QAAE,iBAAiB,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAC9C,CAAC;AAgDF,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,GACnB,MAAM,CAcR;AAGD,wBAAsB,qBAAqB,CACzC,aAAa,EAAE,MAAM,EACrB,iBAAiB,GAAE,iBAAyC,GAC3D,OAAO,CAAC,iBAAiB,CAAC,CAW5B;AAED;;;;GAIG;AAEH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,iBAAiB,GAC1B,iBAAiB,CAUnB;AAED,wGAAwG;AACxG,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,GAAG,CAAC,CAEjE;AAGD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAC9D;IAAE,MAAM,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,eAAe,EAAE,CAAA;CAAE,CAuBxD;AAGD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,SAAS,eAAe,EAAE,GAC/B,MAAM,CAYR;AAGD,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,gBAAgB,EACzB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC;IACT,MAAM,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAmBD"}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Kibi — repo-local, per-branch, queryable long-term memory for software projects
|
|
3
|
-
Copyright (C) 2026 Piotr Franczyk
|
|
4
|
-
|
|
5
|
-
This program is free software: you can redistribute it and/or modify
|
|
6
|
-
it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
(at your option) any later version.
|
|
9
|
-
*/
|
|
10
|
-
import { execFileSync } from "node:child_process";
|
|
11
|
-
import { executeCoverage } from "../../public/operations/specs/reporting.js";
|
|
12
|
-
import { diffFingerprints, fingerprintRequirements, renderRequirementDiffs, } from "./baseline-diff.js";
|
|
13
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
14
|
-
export const COMMITTED_BASELINE_PATH = "proof/baseline.json";
|
|
15
|
-
function asNumber(value) {
|
|
16
|
-
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
17
|
-
}
|
|
18
|
-
function gitErrorText(error) {
|
|
19
|
-
if (error && typeof error === "object" && "stderr" in error) {
|
|
20
|
-
const stderr = error.stderr;
|
|
21
|
-
if (typeof stderr === "string" && stderr.trim() !== "")
|
|
22
|
-
return stderr;
|
|
23
|
-
if (Buffer.isBuffer(stderr) && stderr.length > 0) {
|
|
24
|
-
return stderr.toString("utf8");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return error instanceof Error ? error.message : String(error);
|
|
28
|
-
}
|
|
29
|
-
function committedBaselineReadError(relativePath, error) {
|
|
30
|
-
const text = gitErrorText(error);
|
|
31
|
-
if (/not a git repository/i.test(text) ||
|
|
32
|
-
/ambiguous argument 'HEAD'/i.test(text) ||
|
|
33
|
-
/unknown revision/i.test(text) ||
|
|
34
|
-
/needed a single revision/i.test(text) ||
|
|
35
|
-
/bad revision 'HEAD'/i.test(text)) {
|
|
36
|
-
return new Error(`proof impact: repository is not in a suitable Git state to read HEAD:${relativePath}`);
|
|
37
|
-
}
|
|
38
|
-
if (/does not exist in 'HEAD'/i.test(text) ||
|
|
39
|
-
/exists on disk, but not in 'HEAD'/i.test(text) ||
|
|
40
|
-
/path '.*' does not exist/i.test(text)) {
|
|
41
|
-
return new Error(`proof impact: HEAD:${relativePath} is missing or unreadable`);
|
|
42
|
-
}
|
|
43
|
-
return new Error(`proof impact: could not read HEAD:${relativePath}: ${text.trim()}`);
|
|
44
|
-
}
|
|
45
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
46
|
-
export function readCommittedHeadFile(workspaceRoot, relativePath) {
|
|
47
|
-
try {
|
|
48
|
-
return execFileSync("git", ["-C", workspaceRoot, "show", `HEAD:${relativePath}`], {
|
|
49
|
-
encoding: "utf8",
|
|
50
|
-
maxBuffer: 64 * 1024 * 1024,
|
|
51
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
throw committedBaselineReadError(relativePath, error);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
59
|
-
export async function loadCommittedBaseline(workspaceRoot, readCommittedFile = readCommittedHeadFile) {
|
|
60
|
-
const raw = await readCommittedFile(workspaceRoot, COMMITTED_BASELINE_PATH);
|
|
61
|
-
let parsed;
|
|
62
|
-
try {
|
|
63
|
-
parsed = JSON.parse(raw);
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
throw new Error(`proof impact: HEAD:${COMMITTED_BASELINE_PATH} is not valid JSON`);
|
|
67
|
-
}
|
|
68
|
-
return upgradeBaselineStatuses(parsed);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* A baseline committed before kibi.proof-baseline.v3 records a fully tested
|
|
72
|
-
* requirement as `proven`. Read it as `tested`, so the comparison shows real
|
|
73
|
-
* changes instead of a rename on every row.
|
|
74
|
-
*/
|
|
75
|
-
// implements REQ-kibi-evidence-levels
|
|
76
|
-
export function upgradeBaselineStatuses(baseline) {
|
|
77
|
-
if (baseline.requirements === undefined)
|
|
78
|
-
return baseline;
|
|
79
|
-
const requirements = {};
|
|
80
|
-
for (const [id, entry] of Object.entries(baseline.requirements)) {
|
|
81
|
-
requirements[id] =
|
|
82
|
-
entry?.proofStatus === "proven"
|
|
83
|
-
? { ...entry, proofStatus: "tested" }
|
|
84
|
-
: entry;
|
|
85
|
-
}
|
|
86
|
-
return { ...baseline, requirements };
|
|
87
|
-
}
|
|
88
|
-
/** Diagnostic only: successful evaluation always exits 0. Ratchet lives in check-proof-baseline.mjs. */
|
|
89
|
-
export function proofImpactExitCode(_result) {
|
|
90
|
-
return 0;
|
|
91
|
-
}
|
|
92
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
93
|
-
export function buildProofImpact(baseline, coverage) {
|
|
94
|
-
const rows = Array.isArray(coverage.rows)
|
|
95
|
-
? coverage.rows
|
|
96
|
-
: [];
|
|
97
|
-
const summary = coverage.summary ?? {};
|
|
98
|
-
const proofNotApplicable = asNumber(summary.proofNotApplicable);
|
|
99
|
-
const total = asNumber(summary.total);
|
|
100
|
-
const proofTested = asNumber(summary.proofTested);
|
|
101
|
-
const currentUntested = asNumber(summary.proofMissing) + asNumber(summary.proofUnresolved);
|
|
102
|
-
const current = fingerprintRequirements(rows);
|
|
103
|
-
const changes = diffFingerprints(baseline.requirements, current);
|
|
104
|
-
return {
|
|
105
|
-
rows,
|
|
106
|
-
result: {
|
|
107
|
-
comparisonTarget: COMMITTED_BASELINE_PATH,
|
|
108
|
-
baselineVersion: baseline.version ?? "unknown",
|
|
109
|
-
currentRequirements: total - proofNotApplicable,
|
|
110
|
-
proofTested,
|
|
111
|
-
currentUntested,
|
|
112
|
-
changes,
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
117
|
-
export function renderProofImpact(result, rows) {
|
|
118
|
-
const header = [
|
|
119
|
-
`Proof impact compared to committed ${result.comparisonTarget}`,
|
|
120
|
-
`baseline version: ${result.baselineVersion}`,
|
|
121
|
-
`current requirements: ${result.currentRequirements}`,
|
|
122
|
-
`proofTested: ${result.proofTested}`,
|
|
123
|
-
`currentUntested: ${result.currentUntested}`,
|
|
124
|
-
`changed requirements: ${result.changes.length}`,
|
|
125
|
-
"",
|
|
126
|
-
];
|
|
127
|
-
const diff = renderRequirementDiffs(result.changes, rows);
|
|
128
|
-
return `${header.join("\n")}${diff || "No requirement fingerprint changes versus the committed baseline.\n"}`;
|
|
129
|
-
}
|
|
130
|
-
// implements REQ-kibi-verification-evidence-contract
|
|
131
|
-
export async function executeProofImpact(context, options = {}) {
|
|
132
|
-
const baseline = await loadCommittedBaseline(context.workspaceRoot, options.readCommittedFile ?? readCommittedHeadFile);
|
|
133
|
-
const coverage = options.loadCoverage
|
|
134
|
-
? await options.loadCoverage(context)
|
|
135
|
-
: await executeCoverage({ by: "req", includePassing: true, limit: 100_000, offset: 0 }, context);
|
|
136
|
-
const { result, rows } = buildProofImpact(baseline, coverage.structuredContent);
|
|
137
|
-
return { result, rows, text: renderProofImpact(result, rows) };
|
|
138
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HostSourceAnalysisResultV2, SourceAnalysisService } from "../plugins/source-analysis-service.js";
|
|
2
|
-
import type { GitChangeSnapshot } from "./git-change-snapshot.js";
|
|
3
|
-
import type { Fingerprint } from "./impact-review.js";
|
|
4
|
-
/** Authorize lexical coordinate migration only from a captured local staged review.
|
|
5
|
-
* Protected PR hosts must use their target-base evaluator, not this HEAD policy. */
|
|
6
|
-
export declare function createReviewedDecoratorCoordinateVerifier(snapshot: GitChangeSnapshot, service: SourceAnalysisService, bindings: {
|
|
7
|
-
providerSetFingerprint: Fingerprint;
|
|
8
|
-
evaluatorFingerprint: Fingerprint;
|
|
9
|
-
}): (path: string, analysis: HostSourceAnalysisResultV2) => Promise<void>;
|
|
10
|
-
//# sourceMappingURL=reviewed-coordinate-refresh.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reviewed-coordinate-refresh.d.ts","sourceRoot":"","sources":["../../src/traceability/reviewed-coordinate-refresh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;oFACoF;AACpF,wBAAgB,yCAAyC,CACvD,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE;IACR,sBAAsB,EAAE,WAAW,CAAC;IACpC,oBAAoB,EAAE,WAAW,CAAC;CACnC,GACA,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,0BAA0B,KAAK,OAAO,CAAC,IAAI,CAAC,CA4DvE"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { analyzeSourceChanges } from "../plugins/source-change-analysis.js";
|
|
2
|
-
import { evaluateImpactReview, loadBaseImpactPolicy, } from "./impact-evaluator.js";
|
|
3
|
-
/** Authorize lexical coordinate migration only from a captured local staged review.
|
|
4
|
-
* Protected PR hosts must use their target-base evaluator, not this HEAD policy. */
|
|
5
|
-
export function createReviewedDecoratorCoordinateVerifier(snapshot, service, bindings) {
|
|
6
|
-
if (process.env.CI)
|
|
7
|
-
throw new Error("Reviewed partial coordinate migration is unavailable in CI without a protected target-base snapshot");
|
|
8
|
-
const policy = loadBaseImpactPolicy(snapshot);
|
|
9
|
-
let reviewValidation;
|
|
10
|
-
return async (path, analysis) => {
|
|
11
|
-
snapshot.assertUnchanged();
|
|
12
|
-
if (analysis.status !== "partial" ||
|
|
13
|
-
analysis.language !== "python" ||
|
|
14
|
-
analysis.sourceFile !== path ||
|
|
15
|
-
analysis.module.analysisMode !== "parser" ||
|
|
16
|
-
analysis.stamp?.pluginId !== "kibi-plugin-treesitter" ||
|
|
17
|
-
analysis.uncoveredRanges.length === 0 ||
|
|
18
|
-
analysis.providerId !== "kibi-plugin-treesitter.tree-sitter.v2" ||
|
|
19
|
-
analysis.diagnostics.length === 0 ||
|
|
20
|
-
analysis.providerFingerprint === null ||
|
|
21
|
-
!analysis.diagnostics.every((diagnostic) => diagnostic.code === "TREESITTER_DECORATOR_EXPANSION_UNAVAILABLE" &&
|
|
22
|
-
policy.allowedPartial.some((allowed) => allowed.providerId === analysis.providerId &&
|
|
23
|
-
allowed.providerFingerprint ===
|
|
24
|
-
`sha256:${analysis.providerFingerprint}` &&
|
|
25
|
-
allowed.diagnosticCode === diagnostic.code &&
|
|
26
|
-
allowed.limitationClass === "python-decorator-expansion")))
|
|
27
|
-
throw new Error(`Decorator coordinates for ${path} are not allowed by the captured base policy`);
|
|
28
|
-
reviewValidation ??= (async () => {
|
|
29
|
-
const analyses = await analyzeSourceChanges(snapshot.inventory, service);
|
|
30
|
-
// Use the same host normalization as staged check, without changing the
|
|
31
|
-
// original captured inventory used by the generated-byte comparison.
|
|
32
|
-
const evaluatedSnapshot = {
|
|
33
|
-
...snapshot,
|
|
34
|
-
inventory: snapshot.inventory.map((file) => analyses.get(file.path)?.after?.status === "ok"
|
|
35
|
-
? { ...file, analysisDepth: "symbol", disposition: "checked" }
|
|
36
|
-
: { ...file }),
|
|
37
|
-
};
|
|
38
|
-
const result = evaluateImpactReview(evaluatedSnapshot, {
|
|
39
|
-
...bindings,
|
|
40
|
-
analyses,
|
|
41
|
-
});
|
|
42
|
-
if (!result.passed)
|
|
43
|
-
throw new Error(`Reviewed coordinate migration failed: ${result.diagnostics.map((diagnostic) => diagnostic.message).join("; ")}`);
|
|
44
|
-
snapshot.assertUnchanged();
|
|
45
|
-
})();
|
|
46
|
-
await reviewValidation;
|
|
47
|
-
snapshot.assertUnchanged();
|
|
48
|
-
};
|
|
49
|
-
}
|