kibi-cli 2.32.0 → 2.36.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.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/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 +23 -5
- 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 +87 -14
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +19 -0
- package/dist/extractors/markdown.d.ts +1 -1
- package/dist/extractors/markdown.d.ts.map +1 -1
- 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/migration/proof-contract-claims.d.ts +23 -10
- package/dist/operations/migration/proof-contract-claims.d.ts.map +1 -1
- package/dist/operations/migration/proof-contract-claims.js +35 -2
- package/dist/operations/migration/schema6.d.ts.map +1 -1
- package/dist/operations/migration/schema6.js +2 -4
- 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/source-authoring.d.ts.map +1 -1
- package/dist/operations/mutation/source-authoring.js +39 -20
- package/dist/operations/proof/claim-bindings.d.ts +18 -0
- package/dist/operations/proof/claim-bindings.d.ts.map +1 -1
- package/dist/operations/proof/claim-bindings.js +157 -4
- package/dist/operations/proof/code-certificates.d.ts +34 -14
- package/dist/operations/proof/code-certificates.d.ts.map +1 -1
- package/dist/operations/proof/code-certificates.js +266 -157
- 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 +3 -0
- package/dist/operations/proof/code-scope.d.ts.map +1 -1
- package/dist/operations/proof/code-scope.js +26 -2
- package/dist/operations/proof/ingest-proof.d.ts.map +1 -1
- package/dist/operations/proof/ingest-proof.js +2 -1
- 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/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 +231 -1
- package/dist/operations/semantic-advisor/types.d.ts +1 -1
- package/dist/operations/semantic-advisor/types.d.ts.map +1 -1
- package/dist/prolog.d.ts.map +1 -1
- package/dist/prolog.js +13 -3
- package/dist/public/operations/catalog.d.ts +156 -13
- package/dist/public/operations/catalog.d.ts.map +1 -1
- package/dist/public/operations/evidence-floor.js +1 -1
- package/dist/public/operations/proof-contract-claims.js +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 +140 -10
- package/dist/public/operations/specs/mutation-schemas.d.ts.map +1 -1
- package/dist/public/operations/specs/mutation-schemas.js +14 -3
- package/dist/public/operations/specs/upsert.d.ts +140 -10
- package/dist/public/operations/specs/upsert.d.ts.map +1 -1
- package/dist/public/proof-certificates.d.ts +75 -1
- package/dist/public/proof-certificates.d.ts.map +1 -1
- package/dist/public/proof-certificates.js +212 -0
- package/dist/public/proof-protocol.d.ts +143 -10
- package/dist/public/proof-protocol.d.ts.map +1 -1
- package/dist/public/proof-protocol.js +301 -16
- package/dist/public/proof-receipt.d.ts +4 -3
- package/dist/public/proof-receipt.d.ts.map +1 -1
- package/dist/public/proof-receipt.js +6 -1
- 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 +21 -1
- package/dist/public/skills/kibi-commit-review/SKILL.md +8 -8
- package/dist/public/skills/kibi-commit-review/resources/staged-gate.md +6 -6
- package/dist/public/skills/kibi-decisions/SKILL.md +5 -2
- package/dist/public/skills/kibi-decisions/resources/decision-records.md +4 -1
- package/dist/public/skills/kibi-freshness/SKILL.md +2 -2
- package/dist/public/skills/kibi-traceability/SKILL.md +3 -2
- package/dist/public/skills/kibi-usage/SKILL.md +5 -3
- package/dist/public/skills/kibi-usage/resources/proof.md +105 -9
- package/dist/report/html-report.css +45 -10
- package/dist/report/html-report.d.ts.map +1 -1
- package/dist/report/html-report.js +74 -17
- package/dist/report/report-view.d.ts +1 -1
- package/dist/report/report-view.d.ts.map +1 -1
- package/dist/report/report-view.js +1 -0
- package/dist/schemas/entity.schema.json +199 -8
- 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/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/types/entities.d.ts +1 -1
- package/dist/types/entities.d.ts.map +1 -1
- package/dist/utils/rule-registry.generated.d.ts +1 -1
- package/dist/utils/rule-registry.generated.js +1 -1
- 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 +3 -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 +2 -2
- package/schema/validation.pl +3 -1
- package/src/public/operations/evidence-floor.ts +1 -1
- package/src/public/operations/proof-contract-claims.ts +1 -1
- package/src/public/operations/specs/modeling.ts +24 -5
- package/src/public/operations/specs/mutation-schemas.ts +14 -3
- package/src/public/proof-certificates.ts +296 -1
- package/src/public/proof-protocol-types.d.ts +54 -2
- package/src/public/proof-protocol.ts +396 -20
- package/src/public/proof-receipt.ts +8 -2
- package/src/public/proof-sources.ts +1656 -0
- package/src/public/schemas/entity.ts +32 -2
- package/src/public/skills/kibi-commit-review/SKILL.md +8 -8
- package/src/public/skills/kibi-commit-review/resources/staged-gate.md +6 -6
- package/src/public/skills/kibi-decisions/SKILL.md +5 -2
- package/src/public/skills/kibi-decisions/resources/decision-records.md +4 -1
- package/src/public/skills/kibi-freshness/SKILL.md +2 -2
- package/src/public/skills/kibi-traceability/SKILL.md +3 -2
- package/src/public/skills/kibi-usage/SKILL.md +5 -3
- package/src/public/skills/kibi-usage/resources/proof.md +105 -9
- package/src/schemas/entity.schema.json +199 -8
- 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,10 +1,4 @@
|
|
|
1
|
-
import * as path from "node:path";
|
|
2
1
|
import { KIBI_STAGED_IMPACT_EVIDENCE_DOC, KIBI_SYMBOLS_MANIFEST_PATH, getBehaviorSourcePaths, getMissingBehaviorSourcePaths, hasOverrideRationale, } from "./evidence-model.js";
|
|
3
|
-
function deriveCoordinatesPath(symbolsManifestPath) {
|
|
4
|
-
return path
|
|
5
|
-
.join(path.dirname(symbolsManifestPath), "symbol-coordinates.yaml")
|
|
6
|
-
.replace(/\\/g, "/");
|
|
7
|
-
}
|
|
8
2
|
function formatFileList(paths) {
|
|
9
3
|
return paths.join(", ");
|
|
10
4
|
}
|
|
@@ -32,7 +26,7 @@ function manifestDetailLines(detail, symbolsManifestPath) {
|
|
|
32
26
|
}
|
|
33
27
|
return lines;
|
|
34
28
|
}
|
|
35
|
-
function createMissingEvidenceDiagnostic(paths, symbolsManifestPath,
|
|
29
|
+
function createMissingEvidenceDiagnostic(paths, symbolsManifestPath, fileDetails = []) {
|
|
36
30
|
const uncoveredByPath = new Map(fileDetails
|
|
37
31
|
.filter((detail) => detail.missing.length > 0)
|
|
38
32
|
.map((detail) => [detail.path, detail]));
|
|
@@ -55,7 +49,7 @@ function createMissingEvidenceDiagnostic(paths, symbolsManifestPath, coordinates
|
|
|
55
49
|
files: [...paths],
|
|
56
50
|
docs: [KIBI_STAGED_IMPACT_EVIDENCE_DOC],
|
|
57
51
|
message: `Behavior-changing staged files are missing staged Kibi impact evidence (see ${KIBI_STAGED_IMPACT_EVIDENCE_DOC}): ${formatFileList(paths)}`,
|
|
58
|
-
suggestion: `Query Kibi via MCP before deciding. MCP writes update KB state but do not stage tracked evidence; also stage requirement/scenario/test/fact/symbol markdown
|
|
52
|
+
suggestion: `Query Kibi via MCP before deciding. MCP writes update KB state but do not stage tracked evidence; also stage requirement/scenario/test/fact/symbol markdown or authored ${symbolsManifestPath} metadata. Re-run kibi check --staged after staging tracked evidence.${suggestionSuffix}`,
|
|
59
53
|
...(details.length > 0
|
|
60
54
|
? {
|
|
61
55
|
details,
|
|
@@ -69,21 +63,33 @@ function createMissingEvidenceDiagnostic(paths, symbolsManifestPath, coordinates
|
|
|
69
63
|
: {}),
|
|
70
64
|
};
|
|
71
65
|
}
|
|
72
|
-
function createSymbolsManifestStaleDiagnostic(paths, symbolsManifestPath,
|
|
66
|
+
function createSymbolsManifestStaleDiagnostic(paths, symbolsManifestPath, fileDetails = []) {
|
|
73
67
|
const hasMissingSymbols = fileDetails.some((detail) => detail.missing.length > 0);
|
|
68
|
+
const hasExtraSymbols = fileDetails.some((detail) => detail.extra.length > 0);
|
|
74
69
|
const details = fileDetails.flatMap((detail) => manifestDetailLines(detail, symbolsManifestPath));
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
const steps = [
|
|
71
|
+
...(hasMissingSymbols
|
|
72
|
+
? [
|
|
73
|
+
`author ${symbolsManifestPath} entries for the uncovered symbols (kibi upsert, with implements/covered_by links)`,
|
|
74
|
+
]
|
|
75
|
+
: []),
|
|
76
|
+
...(hasExtraSymbols
|
|
77
|
+
? [
|
|
78
|
+
`re-point or remove (kibi delete) the ${symbolsManifestPath} entries whose declaration is gone`,
|
|
79
|
+
]
|
|
80
|
+
: []),
|
|
81
|
+
];
|
|
82
|
+
const suggestion = `${steps.length > 0
|
|
83
|
+
? `${steps.join(", and ").replace(/^./, (first) => first.toUpperCase())}. `
|
|
84
|
+
: ""}Stage ${symbolsManifestPath} with the behavior edit, then re-run kibi check --staged.`;
|
|
79
85
|
return {
|
|
80
86
|
id: "symbols_manifest_stale",
|
|
81
87
|
severity: "error",
|
|
82
88
|
blocking: true,
|
|
83
89
|
category: "symbol",
|
|
84
|
-
files: [
|
|
90
|
+
files: [symbolsManifestPath, ...paths],
|
|
85
91
|
docs: [KIBI_STAGED_IMPACT_EVIDENCE_DOC],
|
|
86
|
-
message: `${
|
|
92
|
+
message: `${symbolsManifestPath} does not cover the declarations of staged source files: ${formatFileList(paths)}`,
|
|
87
93
|
suggestion,
|
|
88
94
|
...(fileDetails.length > 0
|
|
89
95
|
? {
|
|
@@ -126,20 +132,18 @@ export function createMissingOverrideRationaleDiagnostic(evidence) {
|
|
|
126
132
|
*/
|
|
127
133
|
export function collectStagedKibiDiagnostics(evidence, symbolsManifestPath = KIBI_SYMBOLS_MANIFEST_PATH) {
|
|
128
134
|
const diagnostics = [];
|
|
129
|
-
const coordinatesPath = evidence.symbolsManifest.path || deriveCoordinatesPath(symbolsManifestPath);
|
|
130
135
|
if (evidence.mode.kind === "no_impact_override" &&
|
|
131
136
|
!hasOverrideRationale(evidence)) {
|
|
132
137
|
diagnostics.push(createMissingOverrideRationaleDiagnostic(evidence));
|
|
133
138
|
}
|
|
134
|
-
if (
|
|
135
|
-
evidence.symbolsManifest.state === "missing") &&
|
|
139
|
+
if (evidence.symbolsManifest.state === "stale" &&
|
|
136
140
|
evidence.symbolsManifest.sourcePaths.length > 0) {
|
|
137
141
|
const stalePaths = [...evidence.symbolsManifest.sourcePaths].sort();
|
|
138
|
-
diagnostics.push(createSymbolsManifestStaleDiagnostic(stalePaths, symbolsManifestPath,
|
|
142
|
+
diagnostics.push(createSymbolsManifestStaleDiagnostic(stalePaths, symbolsManifestPath, symbolsManifestFileDetails(evidence, stalePaths)));
|
|
139
143
|
}
|
|
140
144
|
const missingBehaviorPaths = getMissingBehaviorSourcePaths(evidence);
|
|
141
145
|
if (missingBehaviorPaths.length > 0) {
|
|
142
|
-
diagnostics.push(createMissingEvidenceDiagnostic(missingBehaviorPaths, symbolsManifestPath,
|
|
146
|
+
diagnostics.push(createMissingEvidenceDiagnostic(missingBehaviorPaths, symbolsManifestPath, symbolsManifestFileDetails(evidence, missingBehaviorPaths)));
|
|
143
147
|
}
|
|
144
148
|
if (evidence.mode.kind === "no_impact_override" &&
|
|
145
149
|
evidence.mode.override.sourcePaths.length === 0 &&
|
|
@@ -36,10 +36,10 @@ export interface AuditedNoImpactOverrideInput {
|
|
|
36
36
|
* intersect exported or other behavior-bearing/user-facing surfaces and whose
|
|
37
37
|
* changed lines are not comment-only or formatting-only.
|
|
38
38
|
* - `kibi_impact_evidence` is staged entity markdown under `.kb/`, staged
|
|
39
|
-
* authored `.kb/symbols.yaml` metadata,
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
39
|
+
* authored `.kb/symbols.yaml` metadata, a symbol manifest that covers
|
|
40
|
+
* every declaration of the edited file, or an explicit audited
|
|
41
|
+
* `Kibi-Impact: none` declaration with rationale for
|
|
42
|
+
* false positives/non-behavior-only edits.
|
|
43
43
|
* - `Kibi-Impact: none` never satisfies a genuine behavior change.
|
|
44
44
|
* - Test-only edits do not require new KB evidence unless they introduce
|
|
45
45
|
* executable test symbols that need traceability.
|
|
@@ -14,10 +14,10 @@ export const KIBI_IMPACT_DIAGNOSTIC_IDS = [
|
|
|
14
14
|
* intersect exported or other behavior-bearing/user-facing surfaces and whose
|
|
15
15
|
* changed lines are not comment-only or formatting-only.
|
|
16
16
|
* - `kibi_impact_evidence` is staged entity markdown under `.kb/`, staged
|
|
17
|
-
* authored `.kb/symbols.yaml` metadata,
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* authored `.kb/symbols.yaml` metadata, a symbol manifest that covers
|
|
18
|
+
* every declaration of the edited file, or an explicit audited
|
|
19
|
+
* `Kibi-Impact: none` declaration with rationale for
|
|
20
|
+
* false positives/non-behavior-only edits.
|
|
21
21
|
* - `Kibi-Impact: none` never satisfies a genuine behavior change.
|
|
22
22
|
* - Test-only edits do not require new KB evidence unless they introduce
|
|
23
23
|
* executable test symbols that need traceability.
|
|
@@ -32,17 +32,17 @@ export const KIBI_IMPACT_DIAGNOSTICS = {
|
|
|
32
32
|
title: "Behavior edit requires staged Kibi impact evidence",
|
|
33
33
|
resolution: [
|
|
34
34
|
"Query Kibi via visible MCP tools or the trusted project-local CLI (peer surfaces): use kb_search for discovery, then kb_query for exact follow-up.",
|
|
35
|
-
"MCP writes update KB state but do not stage tracked evidence; also stage related KB entity markdown under .kb
|
|
35
|
+
"MCP writes update KB state but do not stage tracked evidence; also stage related KB entity markdown under .kb/ or authored .kb/symbols.yaml metadata (the Detail lines name the symbols lacking evidence).",
|
|
36
36
|
"Re-run or let the hook run kibi check --staged.",
|
|
37
37
|
],
|
|
38
38
|
},
|
|
39
39
|
symbols_manifest_stale: {
|
|
40
40
|
id: "symbols_manifest_stale",
|
|
41
|
-
title: "Symbol
|
|
41
|
+
title: "Symbol manifest does not cover the staged declarations",
|
|
42
42
|
resolution: [
|
|
43
|
-
"Read the Detail lines: they name the extracted symbols the staged .kb/symbols.yaml
|
|
44
|
-
"Author .kb/symbols.yaml entries for the uncovered symbols (kibi upsert, with implements/covered_by links)
|
|
45
|
-
"Stage .kb/
|
|
43
|
+
"Read the Detail lines: they name the extracted symbols the staged .kb/symbols.yaml does not cover, and the entries whose declaration is gone.",
|
|
44
|
+
"Author .kb/symbols.yaml entries for the uncovered symbols (kibi upsert, with implements/covered_by links); re-point or remove (kibi delete) entries whose declaration is gone.",
|
|
45
|
+
"Stage .kb/symbols.yaml in the same change as the behavior edit, then re-run or let the hook run kibi check --staged. Symbol coordinates are derived locally and never staged.",
|
|
46
46
|
],
|
|
47
47
|
},
|
|
48
48
|
kibi_impact_override_missing_rationale: {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { SourceAnalysisResult } from "kibi-plugin-sdk";
|
|
2
|
-
import { type ParsedCoordinateArtifact } from "../extractors/symbol-coordinates.js";
|
|
3
2
|
import type { KibiImpactSymbolsManifestFileDetail } from "./evidence-model.js";
|
|
4
3
|
import type { StagedFile } from "./git-staged.js";
|
|
5
4
|
export interface StagedSymbolsManifestAssessment {
|
|
6
|
-
state: "fresh" | "stale" | "
|
|
5
|
+
state: "fresh" | "stale" | "not_required";
|
|
7
6
|
sourcePaths: string[];
|
|
8
7
|
path: string;
|
|
9
8
|
/**
|
|
@@ -26,11 +25,20 @@ export interface StagedAuthoredSymbolsManifestEvidence {
|
|
|
26
25
|
*/
|
|
27
26
|
migrationOnlyEntityIds?: string[];
|
|
28
27
|
}
|
|
29
|
-
export declare function parsedCoordinateOrNull(parse: () => ParsedCoordinateArtifact): ParsedCoordinateArtifact | null;
|
|
30
28
|
export declare function manifestRecordSourcePath(record: {
|
|
31
29
|
sourceFile?: unknown;
|
|
32
30
|
source?: unknown;
|
|
33
31
|
}): string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the staged symbol manifest covers the declarations of the staged
|
|
34
|
+
* behavior files.
|
|
35
|
+
*
|
|
36
|
+
* Coordinates are derived from source and never committed, so the check
|
|
37
|
+
* compares symbol titles only: every declaration extracted from a staged
|
|
38
|
+
* file must have a manifest record and every granular record must still name
|
|
39
|
+
* a declaration. A covered file is `fresh` evidence for its behavior edit; a
|
|
40
|
+
* gap is `stale` and lists the uncovered and orphaned symbols.
|
|
41
|
+
*/
|
|
34
42
|
export declare function assessStagedSymbolsManifest(options: {
|
|
35
43
|
symbolsManifestPath: string;
|
|
36
44
|
sourceFiles: StagedFile[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staged-symbols-manifest.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-symbols-manifest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"staged-symbols-manifest.d.ts","sourceRoot":"","sources":["../../src/traceability/staged-symbols-manifest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AASzB,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAyClD,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,cAAc,CAAC;IAC1C,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,WAAW,CAAC,EAAE,mCAAmC,EAAE,CAAC;CACrD;AAED,MAAM,WAAW,qCAAqC;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC5D,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAkED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAC/C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,MAAM,GAAG,IAAI,CAMhB;AA0RD;;;;;;;;;GASG;AAGH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE;IACnD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACnD,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,oBAAoB,CAAC;CAC7E,GAAG,+BAA+B,CAwFlC;AAED,wBAAgB,4CAA4C,CAAC,OAAO,EAAE;IACpE,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACnD;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,GAAG,qCAAqC,CA4ExC"}
|
|
@@ -2,16 +2,15 @@ import { execFileSync } from "node:child_process";
|
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { CONTEXT_MISSING_TAG } from "../entity-body-context.js";
|
|
4
4
|
import { extractManifestSymbolRecordsString, } from "../extractors/manifest.js";
|
|
5
|
-
import { mergeCoordinatesWithManifest, parseCoordinateArtifact as parseStrict, } from "../extractors/symbol-coordinates.js";
|
|
6
5
|
import { analyzeSourceText } from "../extractors/symbols-coordinator.js";
|
|
7
6
|
import { isCoarseGranularityReason } from "../public/symbol-granularity.js";
|
|
8
7
|
import { resolveSymbolsManifestPaths } from "../utils/manifest-paths.js";
|
|
9
8
|
/**
|
|
10
9
|
* True when a manifest record documents coarse file/module-level coverage using
|
|
11
|
-
* a canonical granularity reason that legitimately
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* a canonical granularity reason that legitimately stands for no single
|
|
11
|
+
* declaration. Such records do not participate in declaration coverage.
|
|
12
|
+
* `legacy-link` records remain declaration-bound, and unknown or malformed
|
|
13
|
+
* reasons cannot bypass the comparison.
|
|
15
14
|
*/
|
|
16
15
|
function isDocumentedCoarseRecord(record) {
|
|
17
16
|
return isCoarseGranularityReason(record.granularity_reason);
|
|
@@ -26,18 +25,10 @@ function toRepoRelativePath(absoluteOrRelativePath) {
|
|
|
26
25
|
function resolveRelativeManifestPaths(symbolsManifestPath) {
|
|
27
26
|
if (symbolsManifestPath) {
|
|
28
27
|
const normalizedSymbolsPath = toRepoRelativePath(symbolsManifestPath);
|
|
29
|
-
return {
|
|
30
|
-
symbolsPath: normalizedSymbolsPath,
|
|
31
|
-
coordinatesPath: path
|
|
32
|
-
.join(path.dirname(normalizedSymbolsPath), "symbol-coordinates.yaml")
|
|
33
|
-
.replace(/\\/g, "/"),
|
|
34
|
-
};
|
|
28
|
+
return { symbolsPath: toRepoRelativePath(symbolsManifestPath) };
|
|
35
29
|
}
|
|
36
|
-
const {
|
|
37
|
-
return {
|
|
38
|
-
symbolsPath: toRepoRelativePath(symbolsPath),
|
|
39
|
-
coordinatesPath: toRepoRelativePath(coordinatesPath),
|
|
40
|
-
};
|
|
30
|
+
const { symbolsPath } = resolveSymbolsManifestPaths(process.cwd());
|
|
31
|
+
return { symbolsPath: toRepoRelativePath(symbolsPath) };
|
|
41
32
|
}
|
|
42
33
|
function readHeadFileContent(filePath, cache) {
|
|
43
34
|
const normalizedPath = filePath.replace(/\\/g, "/");
|
|
@@ -74,15 +65,6 @@ function parseManifestRecords(content, filePath) {
|
|
|
74
65
|
return null;
|
|
75
66
|
}
|
|
76
67
|
}
|
|
77
|
-
export function parsedCoordinateOrNull(parse) {
|
|
78
|
-
try {
|
|
79
|
-
const parsed = parse();
|
|
80
|
-
return parsed.status === "invalid" ? null : parsed;
|
|
81
|
-
}
|
|
82
|
-
catch {
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
68
|
export function manifestRecordSourcePath(record) {
|
|
87
69
|
return typeof record.sourceFile === "string"
|
|
88
70
|
? record.sourceFile
|
|
@@ -90,16 +72,6 @@ export function manifestRecordSourcePath(record) {
|
|
|
90
72
|
? record.source
|
|
91
73
|
: null;
|
|
92
74
|
}
|
|
93
|
-
function parseCoordinateArtifact(content) {
|
|
94
|
-
// An absent artifact must not masquerade as an empty authoritative one:
|
|
95
|
-
// inline authored coordinates stay comparable until the artifact exists.
|
|
96
|
-
// The strict parser preserves identity bindings so versioned artifacts
|
|
97
|
-
// overlay without falling back to source-text heuristics.
|
|
98
|
-
if (content === null || content === undefined) {
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
return parsedCoordinateOrNull(() => parseStrict(content));
|
|
102
|
-
}
|
|
103
75
|
function normalizeNumber(value) {
|
|
104
76
|
return typeof value === "number" ? value : null;
|
|
105
77
|
}
|
|
@@ -159,9 +131,7 @@ function normalizeManifestSymbolsForSourceFile(records, sourceFile) {
|
|
|
159
131
|
sourceEndColumn: normalizeNumber(record.sourceEndColumn),
|
|
160
132
|
}))
|
|
161
133
|
.sort(compareNormalizedSymbols);
|
|
162
|
-
// Several logical records may own the same declaration
|
|
163
|
-
// validated spans collapse; a stale duplicate still carries null coordinates
|
|
164
|
-
// and must remain visible to the equality check.
|
|
134
|
+
// Several logical records may own the same declaration; they collapse.
|
|
165
135
|
return symbols.filter((symbol, index) => index === 0 ||
|
|
166
136
|
JSON.stringify(symbol) !== JSON.stringify(symbols[index - 1]));
|
|
167
137
|
}
|
|
@@ -274,26 +244,6 @@ function signaturesEqual(left, right) {
|
|
|
274
244
|
function uniqueSorted(paths) {
|
|
275
245
|
return Array.from(new Set(paths)).sort();
|
|
276
246
|
}
|
|
277
|
-
function mergeManifestRecordsWithCoordinates(manifestRecords, coordinateArtifact, options = {}) {
|
|
278
|
-
return mergeCoordinatesWithManifest(manifestRecords ?? [], coordinateArtifact, options);
|
|
279
|
-
}
|
|
280
|
-
function getEffectiveManifestRecords(options) {
|
|
281
|
-
const { headCoordinateArtifact, headManifestRecords, paths, stagedFiles } = options;
|
|
282
|
-
const stagedManifestFile = stagedFiles.find((file) => file.path === paths.symbolsPath);
|
|
283
|
-
const stagedCoordinatesFile = stagedFiles.find((file) => file.path === paths.coordinatesPath);
|
|
284
|
-
const stagedManifestRecords = stagedManifestFile
|
|
285
|
-
? parseManifestRecords(stagedManifestFile.content, paths.symbolsPath)
|
|
286
|
-
: headManifestRecords;
|
|
287
|
-
const stagedCoordinateArtifact = stagedCoordinatesFile
|
|
288
|
-
? parseCoordinateArtifact(stagedCoordinatesFile.content)
|
|
289
|
-
: headCoordinateArtifact;
|
|
290
|
-
return {
|
|
291
|
-
stagedManifestFile,
|
|
292
|
-
stagedCoordinatesFile,
|
|
293
|
-
stagedManifestRecords,
|
|
294
|
-
stagedCoordinateArtifact,
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
247
|
// implements REQ-cli-staged-impact-enforcement
|
|
298
248
|
function diffSymbolEvidence(sourcePath, expectedSymbols, stagedSymbols) {
|
|
299
249
|
const stagedTitles = new Set(stagedSymbols.map((symbol) => symbol.title));
|
|
@@ -320,47 +270,32 @@ function diffSymbolEvidence(sourcePath, expectedSymbols, stagedSymbols) {
|
|
|
320
270
|
extra,
|
|
321
271
|
};
|
|
322
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* Whether the staged symbol manifest covers the declarations of the staged
|
|
275
|
+
* behavior files.
|
|
276
|
+
*
|
|
277
|
+
* Coordinates are derived from source and never committed, so the check
|
|
278
|
+
* compares symbol titles only: every declaration extracted from a staged
|
|
279
|
+
* file must have a manifest record and every granular record must still name
|
|
280
|
+
* a declaration. A covered file is `fresh` evidence for its behavior edit; a
|
|
281
|
+
* gap is `stale` and lists the uncovered and orphaned symbols.
|
|
282
|
+
*/
|
|
283
|
+
// implements REQ-cli-staged-impact-enforcement
|
|
284
|
+
// implements REQ-symbol-coordinates-derived-locally
|
|
323
285
|
export function assessStagedSymbolsManifest(options) {
|
|
324
286
|
const { sourceFiles, stagedFiles, symbolsManifestPath } = options;
|
|
325
287
|
const paths = resolveRelativeManifestPaths(symbolsManifestPath);
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
const
|
|
334
|
-
const headCoordinateArtifact = parseCoordinateArtifact(readAssessmentHeadFileContent(paths.coordinatesPath));
|
|
335
|
-
const { stagedCoordinatesFile, stagedCoordinateArtifact, stagedManifestRecords, } = getEffectiveManifestRecords({
|
|
336
|
-
stagedFiles,
|
|
337
|
-
paths,
|
|
338
|
-
headManifestRecords,
|
|
339
|
-
headCoordinateArtifact,
|
|
340
|
-
});
|
|
341
|
-
const stagedSourceText = new Map(stagedFiles.map((stagedFile) => [
|
|
342
|
-
stagedFile.path.replace(/\\/g, "/"),
|
|
343
|
-
typeof stagedFile.content === "string" ? stagedFile.content : null,
|
|
344
|
-
]));
|
|
345
|
-
const resolveStagedSourceText = (sourceFile) => {
|
|
346
|
-
const normalizedSourceFile = sourceFile.replace(/\\/g, "/");
|
|
347
|
-
return stagedSourceText.has(normalizedSourceFile)
|
|
348
|
-
? (stagedSourceText.get(normalizedSourceFile) ?? null)
|
|
349
|
-
: readAssessmentHeadFileContent(sourceFile);
|
|
350
|
-
};
|
|
351
|
-
const baselineMergedRecords = mergeManifestRecordsWithCoordinates(headManifestRecords, headCoordinateArtifact,
|
|
352
|
-
// Existing bindings must also be valid for the proposed source. Comparing
|
|
353
|
-
// them against HEAD would miss body edits that leave spans unchanged.
|
|
354
|
-
{ resolveSourceText: resolveStagedSourceText });
|
|
355
|
-
const stagedMergedRecords = mergeManifestRecordsWithCoordinates(stagedManifestRecords, stagedCoordinateArtifact, { resolveSourceText: resolveStagedSourceText });
|
|
356
|
-
const requiredRefreshPaths = [];
|
|
357
|
-
const freshPaths = new Set();
|
|
288
|
+
const stagedManifestFile = stagedFiles.find((file) => file.path === paths.symbolsPath);
|
|
289
|
+
const stagedManifestRecords = stagedManifestFile
|
|
290
|
+
? parseManifestRecords(stagedManifestFile.content, paths.symbolsPath)
|
|
291
|
+
: parseManifestRecords(options.readBaseFile
|
|
292
|
+
? options.readBaseFile(paths.symbolsPath)
|
|
293
|
+
: readHeadFileContent(paths.symbolsPath), paths.symbolsPath);
|
|
294
|
+
const coveredPaths = [];
|
|
295
|
+
const uncoveredPaths = [];
|
|
358
296
|
const symbolDetails = [];
|
|
359
297
|
for (const sourceFile of sourceFiles) {
|
|
360
|
-
const manifestRecordsForFile = (stagedManifestRecords ?? []).filter((record) =>
|
|
361
|
-
const recordSource = manifestRecordSourcePath(record);
|
|
362
|
-
return recordSource === sourceFile.path;
|
|
363
|
-
});
|
|
298
|
+
const manifestRecordsForFile = (stagedManifestRecords ?? []).filter((record) => manifestRecordSourcePath(record) === sourceFile.path);
|
|
364
299
|
const coarseCovered = manifestRecordsForFile.length > 0 &&
|
|
365
300
|
manifestRecordsForFile.every(isDocumentedCoarseRecord);
|
|
366
301
|
if (coarseCovered) {
|
|
@@ -374,68 +309,40 @@ export function assessStagedSymbolsManifest(options) {
|
|
|
374
309
|
records.push(record);
|
|
375
310
|
recordsByTitle.set(record.title, records);
|
|
376
311
|
}
|
|
377
|
-
// A coarse anchor
|
|
378
|
-
//
|
|
379
|
-
// If a granular record shares the title, keep the declaration in the
|
|
380
|
-
// equality check so a duplicate anchor cannot hide stale coordinates.
|
|
312
|
+
// A coarse anchor stands in for its extracted declaration only when
|
|
313
|
+
// every authored record with that title is explicitly coarse.
|
|
381
314
|
const coarseTitles = new Set([...recordsByTitle.entries()]
|
|
382
315
|
.filter(([, records]) => records.every(isDocumentedCoarseRecord))
|
|
383
316
|
.map(([title]) => title));
|
|
384
317
|
const expectedSymbols = normalizeExpectedSymbolsForStagedFile(sourceFile, options.analyzeSource, new Set(recordsByTitle.keys())).filter((symbol) => !coarseTitles.has(symbol.title));
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
318
|
+
const stagedSymbols = normalizeManifestSymbolsForSourceFile(stagedManifestRecords ?? [], sourceFile.path);
|
|
319
|
+
if (expectedSymbols.length === 0 && stagedSymbols.length === 0) {
|
|
387
320
|
continue;
|
|
388
321
|
}
|
|
389
|
-
requiredRefreshPaths.push(sourceFile.path);
|
|
390
|
-
// Without a usable staged coordinate artifact there is nothing to diff
|
|
391
|
-
// against: every extracted symbol counts as uncovered evidence.
|
|
392
|
-
const stagedSymbols = stagedCoordinateArtifact === null
|
|
393
|
-
? []
|
|
394
|
-
: normalizeManifestSymbolsForSourceFile(stagedMergedRecords, sourceFile.path);
|
|
395
322
|
const detail = diffSymbolEvidence(sourceFile.path, expectedSymbols, stagedSymbols);
|
|
396
|
-
if (detail
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
if (!stagedCoordinatesFile) {
|
|
400
|
-
continue;
|
|
323
|
+
if (detail === null) {
|
|
324
|
+
coveredPaths.push(sourceFile.path);
|
|
401
325
|
}
|
|
402
|
-
|
|
403
|
-
|
|
326
|
+
else {
|
|
327
|
+
uncoveredPaths.push(sourceFile.path);
|
|
328
|
+
symbolDetails.push(detail);
|
|
404
329
|
}
|
|
405
330
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
return {
|
|
409
|
-
state: "not_required",
|
|
410
|
-
sourcePaths: [],
|
|
411
|
-
path: paths.coordinatesPath,
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
if (sourcePaths.every((sourcePath) => freshPaths.has(sourcePath))) {
|
|
415
|
-
return { state: "fresh", sourcePaths, path: paths.coordinatesPath };
|
|
331
|
+
if (coveredPaths.length === 0 && uncoveredPaths.length === 0) {
|
|
332
|
+
return { state: "not_required", sourcePaths: [], path: paths.symbolsPath };
|
|
416
333
|
}
|
|
417
|
-
|
|
418
|
-
// fresh refresh carries no uncovered symbols by definition, and the stale
|
|
419
|
-
// state cites only the non-fresh paths, so details follow that filter.
|
|
420
|
-
const nonFreshDetails = symbolDetails.filter((detail) => !freshPaths.has(detail.path));
|
|
421
|
-
const detailSpread = nonFreshDetails.length > 0
|
|
422
|
-
? {
|
|
423
|
-
fileDetails: nonFreshDetails.sort((left, right) => left.path.localeCompare(right.path)),
|
|
424
|
-
}
|
|
425
|
-
: {};
|
|
426
|
-
if (!stagedCoordinatesFile) {
|
|
334
|
+
if (uncoveredPaths.length === 0) {
|
|
427
335
|
return {
|
|
428
|
-
state: "
|
|
429
|
-
sourcePaths,
|
|
430
|
-
path: paths.
|
|
431
|
-
...detailSpread,
|
|
336
|
+
state: "fresh",
|
|
337
|
+
sourcePaths: uniqueSorted(coveredPaths),
|
|
338
|
+
path: paths.symbolsPath,
|
|
432
339
|
};
|
|
433
340
|
}
|
|
434
341
|
return {
|
|
435
342
|
state: "stale",
|
|
436
|
-
sourcePaths:
|
|
437
|
-
path: paths.
|
|
438
|
-
|
|
343
|
+
sourcePaths: uniqueSorted(uncoveredPaths),
|
|
344
|
+
path: paths.symbolsPath,
|
|
345
|
+
fileDetails: symbolDetails.sort((left, right) => left.path.localeCompare(right.path)),
|
|
439
346
|
};
|
|
440
347
|
}
|
|
441
348
|
export function collectStagedAuthoredSymbolsManifestEvidence(options) {
|
package/dist/types/entities.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface FactFields {
|
|
|
21
21
|
fact_kind?: "subject" | "property_value" | "observation" | "meta" | "predicate_schema" | "predicate";
|
|
22
22
|
subject_key?: string;
|
|
23
23
|
property_key?: string;
|
|
24
|
-
operator?: "eq" | "neq" | "lt" | "lte" | "gt" | "gte";
|
|
24
|
+
operator?: "eq" | "neq" | "lt" | "lte" | "gt" | "gte" | "matches" | "includes" | "subset_of" | "excludes";
|
|
25
25
|
value_type?: "string" | "int" | "number" | "bool" | "set";
|
|
26
26
|
value_string?: string;
|
|
27
27
|
value_set?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/types/entities.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAA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AAiB,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAC;IACpE,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AACzD,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,sBAAsB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAChF,MAAM,MAAM,GAAG,GAAG,UAAU,GAAG;IAC7B,IAAI,EAAE,KAAK,CAAC;IACZ,gGAAgG;IAChG,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC;CAC/C,CAAC;AACF,MAAM,MAAM,IAAI,GAAG,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACjD,MAAM,MAAM,KAAK,GAAG,UAAU,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AACnD,MAAM,MAAM,MAAM,GAAG,UAAU,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AACrD,MAAM,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,MAAM,GACd,WAAW,GACX,QAAQ,GACR,UAAU,GACV,GAAG,GACH,IAAI,GACJ,KAAK,GACL,MAAM,GACN,IAAI,CAAC"}
|
|
@@ -286,7 +286,7 @@ export declare const GENERATED_RULES: readonly [{
|
|
|
286
286
|
readonly category: "integrity";
|
|
287
287
|
}, {
|
|
288
288
|
readonly name: "proof-contract-claims";
|
|
289
|
-
readonly description: "From schema 12, every certificate-kind proof contract (exhaustive, typecheck, arithmetic, smt) must name the claims it proves in proves, and each named claim must be a modeled claim of a current requirement the test reaches through its scenarios, grounded by a fact that proof kind can express or attest";
|
|
289
|
+
readonly description: "From schema 12, every certificate-kind proof contract (exhaustive, typecheck, arithmetic, smt, rule, state_machine, regex) must name the claims it proves in proves, and each named claim must be a modeled claim of a current requirement the test reaches through its scenarios, grounded by a fact that proof kind can express or attest";
|
|
290
290
|
readonly enforcementClass: "canonical";
|
|
291
291
|
readonly category: "integrity";
|
|
292
292
|
}];
|
|
@@ -352,7 +352,7 @@ export const GENERATED_RULES = [
|
|
|
352
352
|
},
|
|
353
353
|
{
|
|
354
354
|
name: "proof-contract-claims",
|
|
355
|
-
description: "From schema 12, every certificate-kind proof contract (exhaustive, typecheck, arithmetic, smt) must name the claims it proves in proves, and each named claim must be a modeled claim of a current requirement the test reaches through its scenarios, grounded by a fact that proof kind can express or attest",
|
|
355
|
+
description: "From schema 12, every certificate-kind proof contract (exhaustive, typecheck, arithmetic, smt, rule, state_machine, regex) must name the claims it proves in proves, and each named claim must be a modeled claim of a current requirement the test reaches through its scenarios, grounded by a fact that proof kind can express or attest",
|
|
356
356
|
enforcementClass: "canonical",
|
|
357
357
|
category: "integrity",
|
|
358
358
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-version.d.ts","sourceRoot":"","sources":["../../src/utils/schema-version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-version.d.ts","sourceRoot":"","sources":["../../src/utils/schema-version.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IAC9D,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,GACrD,IAAI,GACJ,SAAS,CAAC;AAGd,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAChD,MAAM,GAAG,IAAI,CAgBf;AAGD,wBAAgB,sBAAsB,CACpC,MAAM,CAAC,EAAE,mBAAmB,GAC3B,mBAAmB,CAgDrB"}
|
|
@@ -26,7 +26,9 @@
|
|
|
26
26
|
// floor (required_evidence, else tested when firm).
|
|
27
27
|
// Schema 12 requires every certificate-kind proof contract to name the
|
|
28
28
|
// claims it proves.
|
|
29
|
-
|
|
29
|
+
// Schema 13 derives symbol coordinates on every sync and keeps
|
|
30
|
+
// .kb/symbol-coordinates.yaml out of Git.
|
|
31
|
+
export const LATEST_KB_SCHEMA_VERSION = 13;
|
|
30
32
|
// implements REQ-003
|
|
31
33
|
export function normalizeSchemaVersion(schemaVersion) {
|
|
32
34
|
if (schemaVersion === undefined || schemaVersion === null) {
|
|
@@ -4,8 +4,9 @@ export interface SemanticClaim {
|
|
|
4
4
|
source: string;
|
|
5
5
|
subjectKey: string;
|
|
6
6
|
propertyKey: string;
|
|
7
|
-
operator: "eq" | "gt" | "gte" | "lt" | "lte" | "neq" | "bool" | "polarity";
|
|
8
|
-
value
|
|
7
|
+
operator: "eq" | "gt" | "gte" | "lt" | "lte" | "neq" | "bool" | "polarity" | "matches" | "includes" | "subset_of" | "excludes";
|
|
8
|
+
/** A list of strings is a set value (operator eq, includes, subset_of or excludes). */
|
|
9
|
+
value: string | number | boolean | readonly string[];
|
|
9
10
|
confidence: number;
|
|
10
11
|
provenance?: string;
|
|
11
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strict-modeling.d.ts","sourceRoot":"","sources":["../../src/utils/strict-modeling.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,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