@sdd-method/verify-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/lib/behaviour-store/archive.js +28 -1
- package/dist/lib/behaviour-store/schema.js +85 -0
- package/dist/lib/catalogue/canonical-schema.yaml +138 -2
- package/dist/lib/catalogue/coverage-render.js +15 -15
- package/dist/lib/catalogue/csv-writer.js +1 -1
- package/dist/lib/catalogue/findings.js +1 -1
- package/dist/lib/catalogue/fk-validator.js +2 -2
- package/dist/lib/catalogue/manifest-loader.js +3 -3
- package/dist/lib/catalogue/rubric-coverage-map.yaml +28 -0
- package/dist/lib/catalogue/schema-compat.js +2 -2
- package/dist/lib/catalogue/schema-loader.js +1 -1
- package/dist/lib/metamodel/tql-subset-parser.js +280 -0
- package/dist/lib/pack/schema.js +2 -2
- package/dist/lib/pack/seed.js +2 -2
- package/dist/lib/pack/validate.js +1 -1
- package/dist/lib/repo-kind.js +4 -12
- package/dist/lib/scaffold/archetype-behaviour.js +173 -0
- package/dist/lib/scaffold/registry.js +136 -0
- package/dist/lib/sync/bundle-cache.js +109 -0
- package/dist/lib/validate/archetype-citations.js +169 -0
- package/dist/lib/validate/behaviour-store.js +161 -6
- package/dist/lib/validate/dispatch.js +8 -1
- package/dist/maintain-version.json +2 -2
- package/dist/verbs/list.js +1 -1
- package/dist/verify-program.js +2 -2
- package/dist/verify-version.json +2 -2
- package/package.json +2 -2
- package/scripts/validate-app-dependencies.sh +1 -1
- package/scripts/validate-integration-docs.sh +1 -1
|
@@ -64,6 +64,33 @@ export function renamedFrom(text) {
|
|
|
64
64
|
}
|
|
65
65
|
return out;
|
|
66
66
|
}
|
|
67
|
+
/** The FROM -> TO pairs of a RENAMED section, in file order. */
|
|
68
|
+
export function renamePairs(text) {
|
|
69
|
+
const out = [];
|
|
70
|
+
let op = null;
|
|
71
|
+
let from = null;
|
|
72
|
+
for (const line of text.split("\n")) {
|
|
73
|
+
const section = /^##\s+(ADDED|MODIFIED|REMOVED|RENAMED)\s+Requirements\b/.exec(line);
|
|
74
|
+
if (section) {
|
|
75
|
+
op = section[1];
|
|
76
|
+
from = null;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (op !== "RENAMED")
|
|
80
|
+
continue;
|
|
81
|
+
const f = /^\s*-\s*FROM:\s*`?###\s+Requirement:\s*(.+?)`?\s*$/.exec(line);
|
|
82
|
+
if (f) {
|
|
83
|
+
from = f[1].trim();
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const t = /^\s*-\s*TO:\s*`?###\s+Requirement:\s*(.+?)`?\s*$/.exec(line);
|
|
87
|
+
if (t && from !== null) {
|
|
88
|
+
out.push({ from, to: t[1].trim() });
|
|
89
|
+
from = null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
67
94
|
/** Each archive directory's position in the SDD's history: the index of the first commit that added a file under it. */
|
|
68
95
|
async function archiveHistory(sddPath, archiveRel) {
|
|
69
96
|
let stdout;
|
|
@@ -100,7 +127,7 @@ export async function orderArchives(sddPath, archiveRel, names) {
|
|
|
100
127
|
if (date(a) === date(b) && position(a) === position(b))
|
|
101
128
|
ties.push([a, b]);
|
|
102
129
|
}
|
|
103
|
-
return { order, ties };
|
|
130
|
+
return { order, ties, history: history !== null };
|
|
104
131
|
}
|
|
105
132
|
/** The repositories a baseline was observed in: its evidence file's `**Observed in:** repo[@sha], repo[@sha]` line. */
|
|
106
133
|
export function observedIn(evidence) {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// The method's OpenSpec change schema (M-ADR 0223 §4.2) and its copy in a behaviour store.
|
|
2
|
+
//
|
|
3
|
+
// The method ships the schema inert, at docs/method/foundations/openspec/sdd-change/, because
|
|
4
|
+
// sync writes an SDD's managed paths and a store is created only when its SDD first needs one
|
|
5
|
+
// (M-ADR 0221 §4.2): a managed path at openspec/ would create a store in every SDD.
|
|
6
|
+
// OpenSpec reads a project schema only from <store>/openspec/schemas/<name>/, so the store
|
|
7
|
+
// holds a copy. The copy is method-managed: sync refreshes it, scaffold writes it, and the
|
|
8
|
+
// behaviour-store validator fails when it differs. Adopter guidance goes in the store's
|
|
9
|
+
// config.yaml (`context:`, per-artifact `rules:`), never in the copy.
|
|
10
|
+
import { cp, mkdir, readdir, readFile, rm } from "node:fs/promises";
|
|
11
|
+
import { join, relative } from "node:path";
|
|
12
|
+
import { parseDocument } from "yaml";
|
|
13
|
+
export const SCHEMA_NAME = "sdd-change";
|
|
14
|
+
export const SHIPPED_SCHEMA_DIR = "docs/method/foundations/openspec/sdd-change";
|
|
15
|
+
export const SHIPPED_CONFIG_TEMPLATE = "docs/method/foundations/openspec/config-template.yaml";
|
|
16
|
+
export const STORE_SCHEMA_DIR = `openspec/schemas/${SCHEMA_NAME}`;
|
|
17
|
+
export const STORE_CONFIG = "openspec/config.yaml";
|
|
18
|
+
async function files(dir) {
|
|
19
|
+
const out = [];
|
|
20
|
+
async function walk(d) {
|
|
21
|
+
for (const e of await readdir(d, { withFileTypes: true })) {
|
|
22
|
+
const p = join(d, e.name);
|
|
23
|
+
if (e.isDirectory())
|
|
24
|
+
await walk(p);
|
|
25
|
+
else if (e.isFile())
|
|
26
|
+
out.push(relative(dir, p));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
await walk(dir);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return out.sort();
|
|
36
|
+
}
|
|
37
|
+
async function read(p) {
|
|
38
|
+
try {
|
|
39
|
+
return await readFile(p);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/** The schema the store's config.yaml selects: its name, null without a config, or "" without a `schema:` key. */
|
|
46
|
+
export async function storeSchemaName(repo) {
|
|
47
|
+
const text = await read(join(repo, STORE_CONFIG));
|
|
48
|
+
if (text === null)
|
|
49
|
+
return null;
|
|
50
|
+
const v = parseDocument(text.toString("utf8")).toJS()?.schema;
|
|
51
|
+
return typeof v === "string" ? v : "";
|
|
52
|
+
}
|
|
53
|
+
/** Compare the store's copy of the schema with the one the SDD's method bundle shipped, file by file. */
|
|
54
|
+
export async function compareStoreSchema(repo) {
|
|
55
|
+
const shipped = await files(join(repo, SHIPPED_SCHEMA_DIR));
|
|
56
|
+
if (shipped === null || shipped.length === 0)
|
|
57
|
+
return { shipped: false, missing: [], differing: [], extra: [] };
|
|
58
|
+
const store = (await files(join(repo, STORE_SCHEMA_DIR))) ?? [];
|
|
59
|
+
const missing = shipped.filter((f) => !store.includes(f));
|
|
60
|
+
const extra = store.filter((f) => !shipped.includes(f));
|
|
61
|
+
const differing = [];
|
|
62
|
+
for (const f of shipped.filter((x) => store.includes(x))) {
|
|
63
|
+
const a = await read(join(repo, SHIPPED_SCHEMA_DIR, f));
|
|
64
|
+
const b = await read(join(repo, STORE_SCHEMA_DIR, f));
|
|
65
|
+
if (a === null || b === null || !a.equals(b))
|
|
66
|
+
differing.push(f);
|
|
67
|
+
}
|
|
68
|
+
return { shipped: true, missing, differing, extra };
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Replace the store's copy of the schema with the shipped one. Returns what changed, as a
|
|
72
|
+
* comparison taken before the write; a store already current returns empty lists.
|
|
73
|
+
*/
|
|
74
|
+
export async function writeStoreSchema(repo) {
|
|
75
|
+
const before = await compareStoreSchema(repo);
|
|
76
|
+
if (!before.shipped)
|
|
77
|
+
return before;
|
|
78
|
+
if (before.missing.length + before.differing.length + before.extra.length === 0)
|
|
79
|
+
return before;
|
|
80
|
+
await rm(join(repo, STORE_SCHEMA_DIR), { recursive: true, force: true });
|
|
81
|
+
await mkdir(join(repo, STORE_SCHEMA_DIR), { recursive: true });
|
|
82
|
+
await cp(join(repo, SHIPPED_SCHEMA_DIR), join(repo, STORE_SCHEMA_DIR), { recursive: true });
|
|
83
|
+
return before;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# Emitted by sdd-cli's YAML emitter with no line folding; the three header scalars are quoted for the
|
|
8
8
|
# textual readers downstream. The one deliberate difference from the authored form is schema_status:
|
|
9
9
|
# the authored form says canonical; a projection never does.
|
|
10
|
-
schema_version: "4.
|
|
10
|
+
schema_version: "4.2.0"
|
|
11
11
|
schema_owner: "sdd-method"
|
|
12
12
|
schema_status: "generated"
|
|
13
13
|
enums:
|
|
@@ -643,6 +643,31 @@ enums:
|
|
|
643
643
|
- value: observed
|
|
644
644
|
description: Independent evidence from this repository's code matches (a baseline's characterization tests or a reverse snapshot).
|
|
645
645
|
description: A requirement's status in one implementing repository (M-ADR 0221 §4.5).
|
|
646
|
+
change_status:
|
|
647
|
+
values:
|
|
648
|
+
- value: proposed
|
|
649
|
+
description: Open, with a proposed agreement record or none yet.
|
|
650
|
+
- value: agreed
|
|
651
|
+
description: "Open, with an agreed record: being built."
|
|
652
|
+
- value: superseded
|
|
653
|
+
description: Open, its record superseded by another change.
|
|
654
|
+
- value: withdrawn
|
|
655
|
+
description: Open, its record withdrawn.
|
|
656
|
+
- value: archived
|
|
657
|
+
description: Archived into the living specs.
|
|
658
|
+
description: Where a change stands (M-ADR 0222 §4.6, M-ADR 0223 §4.6).
|
|
659
|
+
judge_verdict:
|
|
660
|
+
values:
|
|
661
|
+
- value: PASS
|
|
662
|
+
- value: FAIL
|
|
663
|
+
description: The judge's verdict on a change (M-ADR 0223 §4.5).
|
|
664
|
+
work_order_status:
|
|
665
|
+
values:
|
|
666
|
+
- value: agreed
|
|
667
|
+
description: Agreed; the repository's work is not yet judged.
|
|
668
|
+
- value: completed
|
|
669
|
+
description: Marked completed by a passing judge.
|
|
670
|
+
description: A work order's status in its change's agreement record (M-ADR 0223 §4.2, §4.6).
|
|
646
671
|
catalogues:
|
|
647
672
|
domains:
|
|
648
673
|
primary_key: id
|
|
@@ -4200,7 +4225,7 @@ catalogues:
|
|
|
4200
4225
|
- name: change_id
|
|
4201
4226
|
type: string
|
|
4202
4227
|
nullable: false
|
|
4203
|
-
description: The archived change's directory name (its archive date prefix included).
|
|
4228
|
+
description: The archived change's directory name (its archive date prefix included); a changes.id.
|
|
4204
4229
|
- name: change_kind
|
|
4205
4230
|
type: string
|
|
4206
4231
|
nullable: false
|
|
@@ -4226,6 +4251,9 @@ catalogues:
|
|
|
4226
4251
|
- column: requirement_id
|
|
4227
4252
|
references: requirements.id
|
|
4228
4253
|
nullable: false
|
|
4254
|
+
- column: change_id
|
|
4255
|
+
references: changes.id
|
|
4256
|
+
nullable: false
|
|
4229
4257
|
column_enums:
|
|
4230
4258
|
change_kind: enums.requirement_change_kind
|
|
4231
4259
|
operation: enums.requirement_operation
|
|
@@ -4269,3 +4297,111 @@ catalogues:
|
|
|
4269
4297
|
nullable: false
|
|
4270
4298
|
column_enums:
|
|
4271
4299
|
status: enums.requirement_status_value
|
|
4300
|
+
changes:
|
|
4301
|
+
primary_key: id
|
|
4302
|
+
columns:
|
|
4303
|
+
- name: id
|
|
4304
|
+
type: string
|
|
4305
|
+
nullable: false
|
|
4306
|
+
description: "The change's directory name: the open change's name, or the archived change's directory (its archive date prefix included). requirement_lineage.change_id references it."
|
|
4307
|
+
- name: name
|
|
4308
|
+
type: string
|
|
4309
|
+
nullable: false
|
|
4310
|
+
description: "The change's name without the archive date prefix: the same before and after archive, so a work item that cites the change keeps its link."
|
|
4311
|
+
- name: change_kind
|
|
4312
|
+
type: string
|
|
4313
|
+
nullable: false
|
|
4314
|
+
description: "Bound to requirement_change_kind: baseline (it carries baseline-evidence.md) or change."
|
|
4315
|
+
- name: status
|
|
4316
|
+
type: string
|
|
4317
|
+
nullable: false
|
|
4318
|
+
description: "Bound to change_status: archived for an archived change; otherwise the agreement record's status, or proposed when there is no record yet."
|
|
4319
|
+
- name: archived_on
|
|
4320
|
+
type: string
|
|
4321
|
+
nullable: true
|
|
4322
|
+
description: The archive date (YYYY-MM-DD) from the archived change's directory name; empty for an open change.
|
|
4323
|
+
- name: verdict
|
|
4324
|
+
type: string
|
|
4325
|
+
nullable: true
|
|
4326
|
+
description: "Bound to judge_verdict: the agreement record's verdict result (M-ADR 0223 §4.6). Empty for a baseline, and for a change not yet judged."
|
|
4327
|
+
- name: source_sdd_id
|
|
4328
|
+
type: string
|
|
4329
|
+
nullable: true
|
|
4330
|
+
description: Originating SDD (stamped at aggregation; empty in a per-SDD build).
|
|
4331
|
+
- name: platform_sdd_id
|
|
4332
|
+
type: string
|
|
4333
|
+
nullable: true
|
|
4334
|
+
description: The platform SDD the row belongs to (stamped at aggregation).
|
|
4335
|
+
description: "A change in the SDD's behaviour store (M-ADR 0223 §4.2), open or archived, including baseline changes. Derived, never authored: from the store's change directories and their agreement records (M-ADR 0222 §4.6)."
|
|
4336
|
+
column_enums:
|
|
4337
|
+
change_kind: enums.requirement_change_kind
|
|
4338
|
+
status: enums.change_status
|
|
4339
|
+
verdict: enums.judge_verdict
|
|
4340
|
+
change_work_order:
|
|
4341
|
+
primary_key: id
|
|
4342
|
+
columns:
|
|
4343
|
+
- name: id
|
|
4344
|
+
type: string
|
|
4345
|
+
nullable: false
|
|
4346
|
+
description: <change_id>__<repo_id>.
|
|
4347
|
+
- name: change_id
|
|
4348
|
+
type: string
|
|
4349
|
+
nullable: false
|
|
4350
|
+
- name: repo_id
|
|
4351
|
+
type: string
|
|
4352
|
+
nullable: false
|
|
4353
|
+
description: The repository the work order is for.
|
|
4354
|
+
- name: status
|
|
4355
|
+
type: string
|
|
4356
|
+
nullable: false
|
|
4357
|
+
description: "Bound to work_order_status: the record's status for the work order; a judge PASS marks it completed (M-ADR 0223 §4.6)."
|
|
4358
|
+
- name: source_sdd_id
|
|
4359
|
+
type: string
|
|
4360
|
+
nullable: true
|
|
4361
|
+
description: Originating SDD (stamped at aggregation; empty in a per-SDD build).
|
|
4362
|
+
- name: platform_sdd_id
|
|
4363
|
+
type: string
|
|
4364
|
+
nullable: true
|
|
4365
|
+
description: The platform SDD the row belongs to (stamped at aggregation).
|
|
4366
|
+
description: "Edge: a change's work order for one implementing repository (M-ADR 0223 §4.2), from the change's agreement record. Derived, never authored."
|
|
4367
|
+
foreign_keys:
|
|
4368
|
+
- column: change_id
|
|
4369
|
+
references: changes.id
|
|
4370
|
+
nullable: false
|
|
4371
|
+
- column: repo_id
|
|
4372
|
+
references: repositories.id
|
|
4373
|
+
nullable: false
|
|
4374
|
+
column_enums:
|
|
4375
|
+
status: enums.work_order_status
|
|
4376
|
+
change_work_item:
|
|
4377
|
+
primary_key: id
|
|
4378
|
+
columns:
|
|
4379
|
+
- name: id
|
|
4380
|
+
type: string
|
|
4381
|
+
nullable: false
|
|
4382
|
+
description: "<change_name>__<work_item_id>: keyed by the change's undated name, so the row is the same before and after archive."
|
|
4383
|
+
- name: change_id
|
|
4384
|
+
type: string
|
|
4385
|
+
nullable: false
|
|
4386
|
+
description: "The change as it stands now: its open name, or its archive directory."
|
|
4387
|
+
- name: change_name
|
|
4388
|
+
type: string
|
|
4389
|
+
nullable: false
|
|
4390
|
+
description: The change's undated name.
|
|
4391
|
+
- name: work_item_id
|
|
4392
|
+
type: string
|
|
4393
|
+
nullable: false
|
|
4394
|
+
description: The work item's id in the adopter's work-item tool, as the proposal's Work Items section gives it.
|
|
4395
|
+
- name: source_sdd_id
|
|
4396
|
+
type: string
|
|
4397
|
+
nullable: true
|
|
4398
|
+
description: Originating SDD (stamped at aggregation; empty in a per-SDD build).
|
|
4399
|
+
- name: platform_sdd_id
|
|
4400
|
+
type: string
|
|
4401
|
+
nullable: true
|
|
4402
|
+
description: The platform SDD the row belongs to (stamped at aggregation).
|
|
4403
|
+
description: "Annotation: a work item a change's proposal says it delivers (M-ADR 0223 §4.2), giving the roll-up from work item to changes to requirements. The work item's id is the adopter's work-item tool's (M-ADR 0035), so it has no foreign key."
|
|
4404
|
+
foreign_keys:
|
|
4405
|
+
- column: change_id
|
|
4406
|
+
references: changes.id
|
|
4407
|
+
nullable: false
|
|
@@ -281,47 +281,47 @@ export function renderContractCoverage(res, tier) {
|
|
|
281
281
|
}
|
|
282
282
|
// ─── the nine Phase-0 gate checks ────────────────────────────────────────
|
|
283
283
|
export function renderEventCatalogueCheck(gaps) {
|
|
284
|
-
return gaps.map((g) => `[finding] coverage: domain ${g.domain} event-catalog.yaml declares ${g.declared} events but events.csv contains ${g.emitted} rows for that domain (per ADR 0156 Phase 0)`);
|
|
284
|
+
return gaps.map((g) => `[finding] coverage: domain ${g.domain} event-catalog.yaml declares ${g.declared} events but events.csv contains ${g.emitted} rows for that domain (per M-ADR 0156 Phase 0)`);
|
|
285
285
|
}
|
|
286
286
|
export function renderRepoEdgesCheck(res) {
|
|
287
287
|
const lines = [];
|
|
288
288
|
if (res.repoCapabilityGap) {
|
|
289
289
|
const g = res.repoCapabilityGap;
|
|
290
|
-
lines.push(`[finding] coverage: repo_capability.csv is empty but ${g.capabilityService} capability_service rows + ${g.servicesWithRepo} services with primary_repo_id present — reverse-method derivation likely missing (per ADR 0157 §4.3, Phase 0)`);
|
|
290
|
+
lines.push(`[finding] coverage: repo_capability.csv is empty but ${g.capabilityService} capability_service rows + ${g.servicesWithRepo} services with primary_repo_id present — reverse-method derivation likely missing (per M-ADR 0157 §4.3, Phase 0)`);
|
|
291
291
|
}
|
|
292
292
|
if (res.repoContractForwardGap) {
|
|
293
293
|
const g = res.repoContractForwardGap;
|
|
294
|
-
lines.push(`[finding] coverage: repo_contract.csv is empty but ${g.contracts} contracts and ${g.repoConfigsWithContracts} repo-configs with contracts: blocks present — forward-method derivation likely missing (per ADR 0157 §4.2, Phase 0)`);
|
|
294
|
+
lines.push(`[finding] coverage: repo_contract.csv is empty but ${g.contracts} contracts and ${g.repoConfigsWithContracts} repo-configs with contracts: blocks present — forward-method derivation likely missing (per M-ADR 0157 §4.2, Phase 0)`);
|
|
295
295
|
}
|
|
296
296
|
if (res.repoContractPathXGap) {
|
|
297
297
|
const g = res.repoContractPathXGap;
|
|
298
|
-
lines.push(`[finding] coverage: repo_contract.csv is empty but ${g.serviceContracts} service_contract rows + ${g.servicesWithRepo} services with primary_repo_id present — reverse-method Path X (service_contract ⋈ services.primary_repo_id) derivation likely missing (per ADR 0157 §4.2, Phase 0)`);
|
|
298
|
+
lines.push(`[finding] coverage: repo_contract.csv is empty but ${g.serviceContracts} service_contract rows + ${g.servicesWithRepo} services with primary_repo_id present — reverse-method Path X (service_contract ⋈ services.primary_repo_id) derivation likely missing (per M-ADR 0157 §4.2, Phase 0)`);
|
|
299
299
|
}
|
|
300
300
|
if (res.repoContractReverseGap) {
|
|
301
301
|
const g = res.repoContractReverseGap;
|
|
302
|
-
lines.push(`[finding] coverage: repo_contract.csv is empty with ${g.contracts} contracts present and no repo-config.contracts: blocks or service_contract rows — reverse-method derivation via contracts.source_repo_id likely missing (per ADR 0157 §4.2, Phase 0)`);
|
|
302
|
+
lines.push(`[finding] coverage: repo_contract.csv is empty with ${g.contracts} contracts present and no repo-config.contracts: blocks or service_contract rows — reverse-method derivation via contracts.source_repo_id likely missing (per M-ADR 0157 §4.2, Phase 0)`);
|
|
303
303
|
}
|
|
304
304
|
return lines;
|
|
305
305
|
}
|
|
306
306
|
export function renderGlossaryXrefCheck(finding) {
|
|
307
307
|
return finding
|
|
308
308
|
? [
|
|
309
|
-
`[finding] coverage: docs/platform/reference/glossary-alignment-manifest.yaml exists but glossary_xref.csv emits 0 rows — multi-source derivation likely missing (per ADR 0158 §4.5, Phase 0)`,
|
|
309
|
+
`[finding] coverage: docs/platform/reference/glossary-alignment-manifest.yaml exists but glossary_xref.csv emits 0 rows — multi-source derivation likely missing (per M-ADR 0158 §4.5, Phase 0)`,
|
|
310
310
|
]
|
|
311
311
|
: [];
|
|
312
312
|
}
|
|
313
313
|
export function renderDataModelEntitiesCheck(res) {
|
|
314
314
|
const lines = [];
|
|
315
315
|
if (res.entitiesGap) {
|
|
316
|
-
lines.push(`[finding] coverage: ${res.entitiesGap.domainModels} domain-model files catalogued but entities.csv emits 0 rows — reverse-method entity extraction missing (per ADR 0159 Phase 0)`);
|
|
316
|
+
lines.push(`[finding] coverage: ${res.entitiesGap.domainModels} domain-model files catalogued but entities.csv emits 0 rows — reverse-method entity extraction missing (per M-ADR 0159 Phase 0)`);
|
|
317
317
|
}
|
|
318
318
|
if (res.serviceEntityGap) {
|
|
319
319
|
const g = res.serviceEntityGap;
|
|
320
|
-
lines.push(`[finding] coverage: ${g.entities} entities + ${g.services} services catalogued but service_entity.csv emits 0 rows — Data Store Mapping ingestion missing (per ADR 0159 Phase 0)`);
|
|
320
|
+
lines.push(`[finding] coverage: ${g.entities} entities + ${g.services} services catalogued but service_entity.csv emits 0 rows — Data Store Mapping ingestion missing (per M-ADR 0159 Phase 0)`);
|
|
321
321
|
}
|
|
322
322
|
if (res.containerEntityGap) {
|
|
323
323
|
const g = res.containerEntityGap;
|
|
324
|
-
lines.push(`[finding] coverage: ${g.containersWithService} containers map to services + ${g.serviceEntity} service_entity edges present but c4_container_entity.csv emits 0 rows — Phase 3 derivation missing (per ADR 0159 Phase 0)`);
|
|
324
|
+
lines.push(`[finding] coverage: ${g.containersWithService} containers map to services + ${g.serviceEntity} service_entity edges present but c4_container_entity.csv emits 0 rows — Phase 3 derivation missing (per M-ADR 0159 Phase 0)`);
|
|
325
325
|
}
|
|
326
326
|
return lines;
|
|
327
327
|
}
|
|
@@ -329,24 +329,24 @@ export function renderCapabilityEventCheck(res) {
|
|
|
329
329
|
const lines = [];
|
|
330
330
|
if (res.derivableGap) {
|
|
331
331
|
const g = res.derivableGap;
|
|
332
|
-
lines.push(`[finding] coverage: service_event (${g.serviceEvent}) + capability_service (${g.capabilityService}) populated but capability_event emits 0 rows — reverse-derivable edge missing (per ADR 0160 Phase 0)`);
|
|
332
|
+
lines.push(`[finding] coverage: service_event (${g.serviceEvent}) + capability_service (${g.capabilityService}) populated but capability_event emits 0 rows — reverse-derivable edge missing (per M-ADR 0160 Phase 0)`);
|
|
333
333
|
}
|
|
334
334
|
if (res.authoredGap) {
|
|
335
|
-
lines.push(`[finding] coverage: capability_event has ${res.authoredGap.derived} derived rows but 0 authored rows — no traceability.events[] or traceability.contracts.{published,consumed}_events declarations are landing in the catalogue. Governance queries filtering to source=authored will return empty (per ADR 0160 Phase 0)`);
|
|
335
|
+
lines.push(`[finding] coverage: capability_event has ${res.authoredGap.derived} derived rows but 0 authored rows — no traceability.events[] or traceability.contracts.{published,consumed}_events declarations are landing in the catalogue. Governance queries filtering to source=authored will return empty (per M-ADR 0160 Phase 0)`);
|
|
336
336
|
}
|
|
337
337
|
return lines;
|
|
338
338
|
}
|
|
339
339
|
export function renderFeatureEventCheck(res) {
|
|
340
340
|
return res.gap
|
|
341
341
|
? [
|
|
342
|
-
`[finding] coverage: service_event (${res.gap.serviceEvent}) + feature_service (${res.gap.featureService}) populated but feature_event emits 0 rows — reverse-derivable edge missing (per ADR 0161 Phase 0)`,
|
|
342
|
+
`[finding] coverage: service_event (${res.gap.serviceEvent}) + feature_service (${res.gap.featureService}) populated but feature_event emits 0 rows — reverse-derivable edge missing (per M-ADR 0161 Phase 0)`,
|
|
343
343
|
]
|
|
344
344
|
: [];
|
|
345
345
|
}
|
|
346
346
|
export function renderPlatformDependenciesCheck(finding) {
|
|
347
347
|
return finding
|
|
348
348
|
? [
|
|
349
|
-
`[finding] coverage: app-platform-dependencies.yaml declares a platform_dependencies block but product_platform_dependencies.csv emits 0 rows — forward-method ingestion missing (per ADR 0162 Phase 0). Resolves once the builder reads the forward source.`,
|
|
349
|
+
`[finding] coverage: app-platform-dependencies.yaml declares a platform_dependencies block but product_platform_dependencies.csv emits 0 rows — forward-method ingestion missing (per M-ADR 0162 Phase 0). Resolves once the builder reads the forward source.`,
|
|
350
350
|
]
|
|
351
351
|
: [];
|
|
352
352
|
}
|
|
@@ -358,7 +358,7 @@ export function renderFeatureSpecPromotionCheck(res) {
|
|
|
358
358
|
`[finding] coverage: ${f.intermediate} of ${f.total} features are reverse-intermediate ` +
|
|
359
359
|
`(capability-spec/feature-grounding) not yet promoted to feature-spec — ` +
|
|
360
360
|
`unresolvable as realises:/FK targets (${f.pctResolvable}% resolvable, ${f.note}; ` +
|
|
361
|
-
`per ADR 0177 §4.2)`,
|
|
361
|
+
`per M-ADR 0177 §4.2)`,
|
|
362
362
|
];
|
|
363
363
|
}
|
|
364
364
|
export function renderFeatureSurfaceDuplicationCheck(res) {
|
|
@@ -370,7 +370,7 @@ export function renderFeatureSurfaceDuplicationCheck(res) {
|
|
|
370
370
|
`[finding] coverage: ${f.pairs} near-duplicate feature surface(s) across ` +
|
|
371
371
|
`${f.capabilities} ${capWord} — a capability-spec (rollup) and feature-grounding ` +
|
|
372
372
|
`(detailed) slug naming the same surface; reconcile to one slug per surface, ` +
|
|
373
|
-
`detailed slug canonical (per ADR 0177 §4.3)`,
|
|
373
|
+
`detailed slug canonical (per M-ADR 0177 §4.3)`,
|
|
374
374
|
];
|
|
375
375
|
}
|
|
376
376
|
// ─── Scores coverage (M-ADR 0205 §4.5, B2 — the fourteenth check) ─────────
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Deterministic CSV writer for catalogues.
|
|
3
3
|
*
|
|
4
|
-
* Emits headers + sorted rows per ADR 0134 builder contract:
|
|
4
|
+
* Emits headers + sorted rows per M-ADR 0134 builder contract:
|
|
5
5
|
* - column order matches the canonical schema exactly,
|
|
6
6
|
* - rows sorted by primary-key value,
|
|
7
7
|
* - cells with embedded comma/quote/newline are RFC-4180 quoted,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Findings collector for the canonical builder per ADR 0134 / builder-spec
|
|
2
|
+
* Findings collector for the canonical builder per M-ADR 0134 / builder-spec
|
|
3
3
|
* §"Emit findings as it parses".
|
|
4
4
|
*
|
|
5
5
|
* Findings are human-readable AND machine-parseable. Format per finding:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* FK validator per ADR 0134 builder-spec §"Run internal FK validation
|
|
2
|
+
* FK validator per M-ADR 0134 builder-spec §"Run internal FK validation
|
|
3
3
|
* before exiting" + §"External FK handling".
|
|
4
4
|
*
|
|
5
5
|
* For each catalogue's foreign keys:
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - External FKs (external=true, or external for the build's profile via
|
|
10
10
|
* `externalForProfiles` — schema 2.23.0): every non-empty value is logged
|
|
11
11
|
* as a `[finding] external` line and skipped from validation. The
|
|
12
|
-
* aggregator resolves these post-merge per ADR 0134 §4.5. A required
|
|
12
|
+
* aggregator resolves these post-merge per M-ADR 0134 §4.5. A required
|
|
13
13
|
* (non-nullable) external FK still fails when EMPTY — the value must be
|
|
14
14
|
* named even if it resolves cross-SDD.
|
|
15
15
|
*
|
|
@@ -223,8 +223,8 @@ const ManifestSchema = z.object({
|
|
|
223
223
|
// shape here. Whether the value resolves against the active vocabulary
|
|
224
224
|
// (method ∪ RA-bundle ∪ adopter) is checked in the build step, which has
|
|
225
225
|
// the bundle cache. Absent reads as "unclassified" (with a finding). Named
|
|
226
|
-
// application_archetype to stay distinct from the ADR 0173 domain archetype
|
|
227
|
-
// and the ADR 0169 openui archetype.
|
|
226
|
+
// application_archetype to stay distinct from the M-ADR 0173 domain archetype
|
|
227
|
+
// and the M-ADR 0169 openui archetype.
|
|
228
228
|
application_archetype: z
|
|
229
229
|
.string()
|
|
230
230
|
.regex(/^[a-z][a-z0-9-]*$/, {
|
|
@@ -298,7 +298,7 @@ export async function loadSddManifest(sddPath, options) {
|
|
|
298
298
|
const code = err.code;
|
|
299
299
|
if (code === "ENOENT") {
|
|
300
300
|
throw new Error(`SDD manifest not found at ${sourcePath}\n\n` +
|
|
301
|
-
`Every SDD repo MUST declare an .sdd/sdd-manifest.yaml per ADR 0134 §4.6.\n` +
|
|
301
|
+
`Every SDD repo MUST declare an .sdd/sdd-manifest.yaml per M-ADR 0134 §4.6.\n` +
|
|
302
302
|
`Schema: docs/method/methods/sdd-manifest-schema.yaml in sdd-method.\n` +
|
|
303
303
|
`Bootstrap: \`sdd-cli init\` (when migrated to support manifest authoring).`);
|
|
304
304
|
}
|
|
@@ -905,3 +905,31 @@ coverage:
|
|
|
905
905
|
kind: enum
|
|
906
906
|
scoring: not-applicable
|
|
907
907
|
reason: closed vocabulary, not an artefact
|
|
908
|
+
changes:
|
|
909
|
+
kind: entity
|
|
910
|
+
scoring: not-applicable
|
|
911
|
+
reason: projected from the behaviour store, whose change gate and judge hold its quality (M-ADR 0222, M-ADR 0223)
|
|
912
|
+
change_work_order:
|
|
913
|
+
kind: edge
|
|
914
|
+
scoring: derived-edge
|
|
915
|
+
class: realisation
|
|
916
|
+
impact_flow: both
|
|
917
|
+
reason: derived from agreement records and verdicts
|
|
918
|
+
change_work_item:
|
|
919
|
+
kind: annotation
|
|
920
|
+
scoring: derived-edge
|
|
921
|
+
class: traceability
|
|
922
|
+
impact_flow: none
|
|
923
|
+
reason: derived from each change's proposal
|
|
924
|
+
change_status:
|
|
925
|
+
kind: enum
|
|
926
|
+
scoring: not-applicable
|
|
927
|
+
reason: closed vocabulary, not an artefact
|
|
928
|
+
judge_verdict:
|
|
929
|
+
kind: enum
|
|
930
|
+
scoring: not-applicable
|
|
931
|
+
reason: closed vocabulary, not an artefact
|
|
932
|
+
work_order_status:
|
|
933
|
+
kind: enum
|
|
934
|
+
scoring: not-applicable
|
|
935
|
+
reason: closed vocabulary, not an artefact
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
* release; migration tooling (`sdd-cli migrate <schema> --to <v>`,
|
|
24
24
|
* planned) covers downgrade paths.
|
|
25
25
|
*
|
|
26
|
-
* See ADR 0132 (catalogue-integrity gate's schema-drift digest hook) +
|
|
27
|
-
* ADR 0134 §4.6 (canonical builder + aggregator).
|
|
26
|
+
* See M-ADR 0132 (catalogue-integrity gate's schema-drift digest hook) +
|
|
27
|
+
* M-ADR 0134 §4.6 (canonical builder + aggregator).
|
|
28
28
|
*/
|
|
29
29
|
export const SCHEMA_COMPAT = {
|
|
30
30
|
catalogue_schema: "^4.0.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Loader for the canonical catalogue-schema.yaml vendored from sdd-method.
|
|
3
3
|
*
|
|
4
|
-
* Per ADR 0134 §4.6 the canonical builder reads the schema rather than
|
|
4
|
+
* Per M-ADR 0134 §4.6 the canonical builder reads the schema rather than
|
|
5
5
|
* hardcoding column shapes or FK rules. This loader is the only place in
|
|
6
6
|
* the CLI that knows the schema file's location.
|
|
7
7
|
*/
|