@sdd-method/verify-cli 0.1.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/LICENSE +201 -0
- package/NOTICE +17 -0
- package/README.md +7 -0
- package/dist/lib/catalogue/baseline-check.js +136 -0
- package/dist/lib/catalogue/canonical-schema.yaml +3557 -0
- package/dist/lib/catalogue/cli-version.js +10 -0
- package/dist/lib/catalogue/coverage-predicates.js +603 -0
- package/dist/lib/catalogue/coverage-render.js +522 -0
- package/dist/lib/catalogue/coverage-run.js +115 -0
- package/dist/lib/catalogue/csv-reader.js +97 -0
- package/dist/lib/catalogue/csv-writer.js +96 -0
- package/dist/lib/catalogue/ddl-generator.js +233 -0
- package/dist/lib/catalogue/engine-validator.js +222 -0
- package/dist/lib/catalogue/finding-identity.js +183 -0
- package/dist/lib/catalogue/findings.js +46 -0
- package/dist/lib/catalogue/fk-validator.js +136 -0
- package/dist/lib/catalogue/gate-checks.js +338 -0
- package/dist/lib/catalogue/graph-projection.js +329 -0
- package/dist/lib/catalogue/impact-run.js +228 -0
- package/dist/lib/catalogue/manifest-loader.js +422 -0
- package/dist/lib/catalogue/relationship-semantics.js +66 -0
- package/dist/lib/catalogue/rubric-coverage-map.yaml +764 -0
- package/dist/lib/catalogue/scaffold-delta.js +261 -0
- package/dist/lib/catalogue/schema-compat.js +52 -0
- package/dist/lib/catalogue/schema-loader.js +87 -0
- package/dist/lib/catalogue/scores-coverage.js +535 -0
- package/dist/lib/catalogue/staleness-verdicts.js +345 -0
- package/dist/lib/catalogue/validate.js +176 -0
- package/dist/lib/catalogue/version.js +18 -0
- package/dist/lib/list/discover.js +100 -0
- package/dist/lib/list/format.js +84 -0
- package/dist/lib/list/index.js +16 -0
- package/dist/lib/lock-file.js +413 -0
- package/dist/lib/pack/log.js +18 -0
- package/dist/lib/pack/schema.js +121 -0
- package/dist/lib/pack/seed.js +182 -0
- package/dist/lib/pack/validate.js +49 -0
- package/dist/lib/package-version.js +25 -0
- package/dist/lib/repo-kind.js +129 -0
- package/dist/lib/scripts.js +7 -0
- package/dist/lib/validate/aggregate.js +35 -0
- package/dist/lib/validate/bundle-coherence.js +69 -0
- package/dist/lib/validate/dispatch.js +218 -0
- package/dist/lib/validate/index.js +88 -0
- package/dist/lib/validate/runner.js +85 -0
- package/dist/verbs/catalogue-verify.js +114 -0
- package/dist/verbs/list.js +45 -0
- package/dist/verbs/pack-validate.js +17 -0
- package/dist/verbs/path-option.js +25 -0
- package/dist/verbs/validate.js +22 -0
- package/dist/verify-bin.js +8 -0
- package/dist/verify-program.js +115 -0
- package/package.json +32 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Relationship semantics and catalogue kinds, read from the vendored
|
|
2
|
+
// rubric-coverage-map.yaml — READ-ONLY. Split out of `graph-run.ts`, which also
|
|
3
|
+
// holds `runCatalogueGraph`, the verb that writes `<catalogues-dir>-graph.jsonl`
|
|
4
|
+
// by default. `catalogue impact` needs these loaders and nothing that writes,
|
|
5
|
+
// and the verify-only CLI ships `impact` (M-ADR 0212 §4.3b): while they lived in
|
|
6
|
+
// graph-run the writer came along with them, and the package build caught it.
|
|
7
|
+
// `graph-run.ts` re-exports everything here, so existing imports are unchanged.
|
|
8
|
+
import { readFile } from "node:fs/promises";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
import { parse as parseYaml } from "yaml";
|
|
12
|
+
/**
|
|
13
|
+
* Vendored copy of sdd-method's orchestration/rubric-coverage-map.yaml —
|
|
14
|
+
* byte-identical to the canonical (rubric-coverage-map-drift.test.ts guards
|
|
15
|
+
* it, same one-way contract as canonical-schema.yaml). The build copies it
|
|
16
|
+
* alongside the compiled module via scripts/copy-yaml-assets.mjs.
|
|
17
|
+
*/
|
|
18
|
+
export const VENDORED_COVERAGE_MAP_PATH = join(fileURLToPath(new URL(".", import.meta.url)), "rubric-coverage-map.yaml");
|
|
19
|
+
function toDecl(where, e) {
|
|
20
|
+
if (e.class === undefined) {
|
|
21
|
+
throw new Error(`rubric-coverage-map: ${where} has no class declaration (M-ADR 0206)`);
|
|
22
|
+
}
|
|
23
|
+
if ((e.impact_flow === undefined) === (e.impact_flow_by === undefined)) {
|
|
24
|
+
throw new Error(`rubric-coverage-map: ${where} must declare exactly one of impact_flow / impact_flow_by`);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
class: e.class,
|
|
28
|
+
...(e.impact_flow !== undefined
|
|
29
|
+
? { impactFlow: e.impact_flow }
|
|
30
|
+
: {}),
|
|
31
|
+
...(e.impact_flow_by !== undefined
|
|
32
|
+
? {
|
|
33
|
+
impactFlowBy: {
|
|
34
|
+
column: e.impact_flow_by.column,
|
|
35
|
+
values: e.impact_flow_by.values,
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
: {}),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export async function loadRelationshipSemantics(mapPath = VENDORED_COVERAGE_MAP_PATH) {
|
|
42
|
+
const raw = parseYaml(await readFile(mapPath, "utf-8"));
|
|
43
|
+
const kinds = new Map();
|
|
44
|
+
const edges = new Map();
|
|
45
|
+
const entityFks = new Map();
|
|
46
|
+
for (const [name, entry] of Object.entries(raw.coverage)) {
|
|
47
|
+
kinds.set(name, entry.kind);
|
|
48
|
+
if (entry.kind === "edge" || entry.kind === "annotation") {
|
|
49
|
+
// an annotation classifies at top level exactly as an edge does (schema 3.9.0)
|
|
50
|
+
edges.set(name, toDecl(`edge ${name}`, entry));
|
|
51
|
+
}
|
|
52
|
+
for (const [col, decl] of Object.entries(entry.relationships ?? {})) {
|
|
53
|
+
entityFks.set(`${name}.${col}`, toDecl(`entity FK ${name}.${col}`, decl));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return { kinds, edges, entityFks };
|
|
57
|
+
}
|
|
58
|
+
export async function loadCatalogueKinds(mapPath = VENDORED_COVERAGE_MAP_PATH) {
|
|
59
|
+
const raw = parseYaml(await readFile(mapPath, "utf-8"));
|
|
60
|
+
const kinds = new Map();
|
|
61
|
+
for (const [name, entry] of Object.entries(raw.coverage)) {
|
|
62
|
+
kinds.set(name, entry.kind);
|
|
63
|
+
}
|
|
64
|
+
return kinds;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=relationship-semantics.js.map
|