@sdd-method/sdd-cli 0.23.1 → 0.25.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/README.md +9 -0
- package/dist/lib/catalogue/aggregate.d.ts.map +1 -1
- package/dist/lib/catalogue/aggregate.js +34 -0
- package/dist/lib/catalogue/aggregate.js.map +1 -1
- package/dist/lib/catalogue/build.d.ts.map +1 -1
- package/dist/lib/catalogue/build.js +25 -1
- package/dist/lib/catalogue/build.js.map +1 -1
- package/dist/lib/catalogue/builders/c4-containers.d.ts.map +1 -1
- package/dist/lib/catalogue/builders/c4-containers.js +12 -8
- package/dist/lib/catalogue/builders/c4-containers.js.map +1 -1
- package/dist/lib/catalogue/builders/c4-external-systems.d.ts +15 -0
- package/dist/lib/catalogue/builders/c4-external-systems.d.ts.map +1 -0
- package/dist/lib/catalogue/builders/c4-external-systems.js +150 -0
- package/dist/lib/catalogue/builders/c4-external-systems.js.map +1 -0
- package/dist/lib/catalogue/builders/index.d.ts +6 -0
- package/dist/lib/catalogue/builders/index.d.ts.map +1 -1
- package/dist/lib/catalogue/builders/index.js +3 -0
- package/dist/lib/catalogue/builders/index.js.map +1 -1
- package/dist/lib/catalogue/builders/persona-c4system.d.ts +13 -0
- package/dist/lib/catalogue/builders/persona-c4system.d.ts.map +1 -0
- package/dist/lib/catalogue/builders/persona-c4system.js +104 -0
- package/dist/lib/catalogue/builders/persona-c4system.js.map +1 -0
- package/dist/lib/catalogue/builders/system-external-dependency.d.ts +14 -0
- package/dist/lib/catalogue/builders/system-external-dependency.d.ts.map +1 -0
- package/dist/lib/catalogue/builders/system-external-dependency.js +111 -0
- package/dist/lib/catalogue/builders/system-external-dependency.js.map +1 -0
- package/dist/lib/catalogue/canonical-schema.yaml +69 -2
- package/dist/lib/mcp/resources/catalogue.d.ts +19 -0
- package/dist/lib/mcp/resources/catalogue.d.ts.map +1 -0
- package/dist/lib/mcp/resources/catalogue.js +240 -0
- package/dist/lib/mcp/resources/catalogue.js.map +1 -0
- package/dist/lib/mcp/server.d.ts.map +1 -1
- package/dist/lib/mcp/server.js +4 -0
- package/dist/lib/mcp/server.js.map +1 -1
- package/dist/lib/mcp/tools/catalogue.d.ts +16 -0
- package/dist/lib/mcp/tools/catalogue.d.ts.map +1 -0
- package/dist/lib/mcp/tools/catalogue.js +268 -0
- package/dist/lib/mcp/tools/catalogue.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// persona_c4system edge builder — emits one row per `Person(...)` actor on
|
|
2
|
+
// the L1 context diagram that maps to a known persona (per ADR 0155). This
|
|
3
|
+
// captures the C4 "Person uses System" relationship; the C4 Person
|
|
4
|
+
// abstraction reuses the existing Persona entity rather than a parallel one.
|
|
5
|
+
//
|
|
6
|
+
// Resolution: `Person(id, "name", "desc")` actors are matched to personas
|
|
7
|
+
// rows by name (case-insensitive) then by name-slug, using the maps the
|
|
8
|
+
// personas builder produces. Unmatched actors log a `coverage` finding and
|
|
9
|
+
// are skipped (no dangling FK). The optional interaction label comes from a
|
|
10
|
+
// `Rel(person, system, "label")` line.
|
|
11
|
+
import { readFile, stat } from "node:fs/promises";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
// `Person(id, "name", "desc")` / `Person_Ext(id, "name", "desc")`.
|
|
14
|
+
const PERSON_RE = /Person(?:_Ext)?\s*\(\s*(\w+)\s*,\s*"([^"]+)"\s*(?:,\s*"([^"]*)")?\s*\)/;
|
|
15
|
+
const REL_RE = /^(?:Bi)?Rel(?:_[A-Za-z]+)?\s*\(\s*(\w+)\s*,\s*(\w+)\s*(?:,\s*"([^"]*)")?/;
|
|
16
|
+
const L1_CANDIDATES = [
|
|
17
|
+
"docs/platform/diagrams/c4-l1-context.mermaid.md",
|
|
18
|
+
"docs/diagrams/c4-l1-context.mermaid.md",
|
|
19
|
+
"docs/application/c4-l1.md",
|
|
20
|
+
"docs/c4-l1.md",
|
|
21
|
+
];
|
|
22
|
+
export async function buildPersonaC4System(inputs) {
|
|
23
|
+
const systemId = `${inputs.manifest.sddId}-system`;
|
|
24
|
+
if (!inputs.knownSystemIds.has(systemId))
|
|
25
|
+
return [];
|
|
26
|
+
const content = await readL1(inputs.sddPath);
|
|
27
|
+
if (content === "")
|
|
28
|
+
return [];
|
|
29
|
+
const persons = parsePersons(content);
|
|
30
|
+
if (persons.length === 0)
|
|
31
|
+
return [];
|
|
32
|
+
const interactionByEntryId = relInteractionsTo(content, systemId);
|
|
33
|
+
const rows = [];
|
|
34
|
+
const seen = new Set();
|
|
35
|
+
for (const person of persons) {
|
|
36
|
+
const personaId = inputs.personaIdByName.get(person.name.toLowerCase()) ??
|
|
37
|
+
inputs.personaIdBySlug.get(slugify(person.name));
|
|
38
|
+
if (personaId === undefined) {
|
|
39
|
+
inputs.findings.add("coverage", `persona_c4system: Person "${person.name}" on the L1 diagram has no matching persona row — edge skipped`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const id = `${personaId}__${systemId}`;
|
|
43
|
+
if (seen.has(id))
|
|
44
|
+
continue;
|
|
45
|
+
seen.add(id);
|
|
46
|
+
rows.push({
|
|
47
|
+
id,
|
|
48
|
+
persona_id: personaId,
|
|
49
|
+
c4_system_id: systemId,
|
|
50
|
+
interaction: interactionByEntryId.get(person.entryId) ?? "",
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
rows.sort((a, b) => String(a["id"]).localeCompare(String(b["id"])));
|
|
54
|
+
return rows;
|
|
55
|
+
}
|
|
56
|
+
function parsePersons(content) {
|
|
57
|
+
const out = [];
|
|
58
|
+
for (const raw of content.split(/\r?\n/)) {
|
|
59
|
+
const m = PERSON_RE.exec(raw.trim());
|
|
60
|
+
if (m)
|
|
61
|
+
out.push({ entryId: m[1] ?? "", name: m[2] ?? "" });
|
|
62
|
+
}
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
// Map a person entry-id → the label of a Rel connecting it to the system.
|
|
66
|
+
function relInteractionsTo(content, systemId) {
|
|
67
|
+
const out = new Map();
|
|
68
|
+
// The system's diagram entry-id is unknown here, so we accept any Rel
|
|
69
|
+
// whose `from` is a person and keep its label; the common L1 shape is
|
|
70
|
+
// `Rel(personEntryId, appSystem, "Uses", ...)`.
|
|
71
|
+
void systemId;
|
|
72
|
+
for (const raw of content.split(/\r?\n/)) {
|
|
73
|
+
const m = REL_RE.exec(raw.trim());
|
|
74
|
+
if (m && m[3]) {
|
|
75
|
+
const from = m[1] ?? "";
|
|
76
|
+
if (!out.has(from))
|
|
77
|
+
out.set(from, m[3]);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
async function readL1(sddPath) {
|
|
83
|
+
for (const rel of L1_CANDIDATES) {
|
|
84
|
+
const abs = join(sddPath, rel);
|
|
85
|
+
try {
|
|
86
|
+
const s = await stat(abs);
|
|
87
|
+
if (s.isFile())
|
|
88
|
+
return await readFile(abs, "utf-8");
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
if (err.code !== "ENOENT")
|
|
92
|
+
throw err;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return "";
|
|
96
|
+
}
|
|
97
|
+
function slugify(s) {
|
|
98
|
+
return s
|
|
99
|
+
.toLowerCase()
|
|
100
|
+
.replace(/\s*\([^)]+\)/g, "")
|
|
101
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
102
|
+
.replace(/^-+|-+$/g, "");
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=persona-c4system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona-c4system.js","sourceRoot":"","sources":["../../../../src/lib/catalogue/builders/persona-c4system.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2EAA2E;AAC3E,mEAAmE;AACnE,6EAA6E;AAC7E,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,2EAA2E;AAC3E,4EAA4E;AAC5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OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CatalogueRow } from "../csv-writer.js";
|
|
2
|
+
import type { FindingsLog } from "../findings.js";
|
|
3
|
+
import type { SddManifest } from "../manifest-loader.js";
|
|
4
|
+
export interface SystemExternalDependencyInputs {
|
|
5
|
+
readonly sddPath: string;
|
|
6
|
+
readonly manifest: SddManifest;
|
|
7
|
+
readonly findings: FindingsLog;
|
|
8
|
+
/** known c4_systems ids — for single-system ecosystems, a one-element set. */
|
|
9
|
+
readonly knownSystemIds: ReadonlySet<string>;
|
|
10
|
+
/** diagram entry-id → c4_external_systems row id (from buildC4ExternalSystems). */
|
|
11
|
+
readonly externalIdByEntryId: ReadonlyMap<string, string>;
|
|
12
|
+
}
|
|
13
|
+
export declare function buildSystemExternalDependency(inputs: SystemExternalDependencyInputs): Promise<CatalogueRow[]>;
|
|
14
|
+
//# sourceMappingURL=system-external-dependency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-external-dependency.d.ts","sourceRoot":"","sources":["../../../../src/lib/catalogue/builders/system-external-dependency.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7C,mFAAmF;IACnF,QAAQ,CAAC,mBAAmB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3D;AAeD,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,YAAY,EAAE,CAAC,CAmCzB"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// system_external_dependency edge builder — emits one row per
|
|
2
|
+
// `Rel(...)` line on an L1/L2 diagram that connects the SDD's own system
|
|
3
|
+
// (or one of its containers) to an external system (per ADR 0155).
|
|
4
|
+
//
|
|
5
|
+
// Resolution: the c4-external-systems builder supplies `externalIdByEntryId`
|
|
6
|
+
// (diagram entry-id → ext-... row id). For each `Rel(a, b, "label")` where
|
|
7
|
+
// exactly one endpoint is a known external entry-id, we emit an edge from
|
|
8
|
+
// the SDD's c4_systems row to that external system. Container-level external
|
|
9
|
+
// dependencies are intentionally collapsed to the system level — ADR 0155
|
|
10
|
+
// §4.2 keeps the edge system-scoped.
|
|
11
|
+
import { readdir, readFile, stat } from "node:fs/promises";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
// Any C4-PlantUML relationship macro: Rel, Rel_U/D/L/R, BiRel, Rel_Back, etc.
|
|
14
|
+
// Capture the first two positional args (from, to) and an optional label.
|
|
15
|
+
const REL_RE = /^(?:Bi)?Rel(?:_[A-Za-z]+)?\s*\(\s*(\w+)\s*,\s*(\w+)\s*(?:,\s*"([^"]*)")?/;
|
|
16
|
+
const L1_CANDIDATES = [
|
|
17
|
+
"docs/platform/diagrams/c4-l1-context.mermaid.md",
|
|
18
|
+
"docs/diagrams/c4-l1-context.mermaid.md",
|
|
19
|
+
"docs/application/c4-l1.md",
|
|
20
|
+
"docs/c4-l1.md",
|
|
21
|
+
];
|
|
22
|
+
const L2_BASENAME = "c4-l2-container.mermaid.md";
|
|
23
|
+
export async function buildSystemExternalDependency(inputs) {
|
|
24
|
+
const systemId = `${inputs.manifest.sddId}-system`;
|
|
25
|
+
if (!inputs.knownSystemIds.has(systemId)) {
|
|
26
|
+
// Non-architectural SDD — no c4_systems FK target. Skip silently.
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
if (inputs.externalIdByEntryId.size === 0)
|
|
30
|
+
return [];
|
|
31
|
+
const files = await collectDiagramFiles(inputs.sddPath);
|
|
32
|
+
const rows = [];
|
|
33
|
+
const seen = new Set();
|
|
34
|
+
for (const abs of files) {
|
|
35
|
+
const content = await readFile(abs, "utf-8");
|
|
36
|
+
for (const rel of parseRels(content)) {
|
|
37
|
+
const fromExt = inputs.externalIdByEntryId.get(rel.from);
|
|
38
|
+
const toExt = inputs.externalIdByEntryId.get(rel.to);
|
|
39
|
+
// Exactly one endpoint external — otherwise it's internal↔internal or
|
|
40
|
+
// external↔external (neither is a system→external dependency).
|
|
41
|
+
if ((fromExt === undefined) === (toExt === undefined))
|
|
42
|
+
continue;
|
|
43
|
+
const externalSystemId = (fromExt ?? toExt);
|
|
44
|
+
const id = `${systemId}__${externalSystemId}`;
|
|
45
|
+
if (seen.has(id))
|
|
46
|
+
continue;
|
|
47
|
+
seen.add(id);
|
|
48
|
+
rows.push({
|
|
49
|
+
id,
|
|
50
|
+
c4_system_id: systemId,
|
|
51
|
+
external_system_id: externalSystemId,
|
|
52
|
+
interaction: rel.label,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
rows.sort((a, b) => String(a["id"]).localeCompare(String(b["id"])));
|
|
57
|
+
return rows;
|
|
58
|
+
}
|
|
59
|
+
function parseRels(content) {
|
|
60
|
+
const out = [];
|
|
61
|
+
for (const raw of content.split(/\r?\n/)) {
|
|
62
|
+
const m = REL_RE.exec(raw.trim());
|
|
63
|
+
if (m)
|
|
64
|
+
out.push({ from: m[1] ?? "", to: m[2] ?? "", label: m[3] ?? "" });
|
|
65
|
+
}
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
async function collectDiagramFiles(sddPath) {
|
|
69
|
+
const out = [];
|
|
70
|
+
for (const rel of L1_CANDIDATES) {
|
|
71
|
+
const abs = join(sddPath, rel);
|
|
72
|
+
if (await isFile(abs))
|
|
73
|
+
out.push(abs);
|
|
74
|
+
}
|
|
75
|
+
const domainsDir = join(sddPath, "docs", "domains");
|
|
76
|
+
try {
|
|
77
|
+
const entries = (await readdir(domainsDir, { withFileTypes: true }))
|
|
78
|
+
.filter((e) => e.isDirectory())
|
|
79
|
+
.map((e) => e.name)
|
|
80
|
+
.sort((a, b) => a.localeCompare(b));
|
|
81
|
+
for (const name of entries) {
|
|
82
|
+
const abs = join(sddPath, "docs", "domains", name, "architecture", "diagrams", L2_BASENAME);
|
|
83
|
+
if (await isFile(abs))
|
|
84
|
+
out.push(abs);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
if (err.code !== "ENOENT")
|
|
89
|
+
throw err;
|
|
90
|
+
}
|
|
91
|
+
for (const rel of [
|
|
92
|
+
join("docs", "platform", "diagrams", L2_BASENAME),
|
|
93
|
+
join("docs", L2_BASENAME),
|
|
94
|
+
]) {
|
|
95
|
+
const abs = join(sddPath, rel);
|
|
96
|
+
if (await isFile(abs))
|
|
97
|
+
out.push(abs);
|
|
98
|
+
}
|
|
99
|
+
return out;
|
|
100
|
+
}
|
|
101
|
+
async function isFile(path) {
|
|
102
|
+
try {
|
|
103
|
+
return (await stat(path)).isFile();
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
if (err.code === "ENOENT")
|
|
107
|
+
return false;
|
|
108
|
+
throw err;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=system-external-dependency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-external-dependency.js","sourceRoot":"","sources":["../../../../src/lib/catalogue/builders/system-external-dependency.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,yEAAyE;AACzE,mEAAmE;AACnE,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAC7E,0EAA0E;AA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AE,WAAW,CAAC;QACjD,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC;KAC1B,EAAE,CAAC;QACF,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC/B,IAAI,MAAM,MAAM,CAAC,GAAG,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,IAAY;IAChC,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACrC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QACnE,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
# Builder contract: see docs/method/methods/catalogue-builder-specification.md.
|
|
46
46
|
# Category taxonomy: see docs/method/methods/product-category-taxonomy.md.
|
|
47
47
|
|
|
48
|
-
schema_version: "2.
|
|
48
|
+
schema_version: "2.10.0"
|
|
49
49
|
schema_owner: "sdd-method"
|
|
50
50
|
schema_status: "canonical"
|
|
51
51
|
# Bump rationale (2.9.0 — additive minor): adds the Track 2 cohort-sweep
|
|
@@ -87,6 +87,29 @@ enums:
|
|
|
87
87
|
- { value: application, description: "An application-product system, consumes platform services and contracts." }
|
|
88
88
|
- { value: integration, description: "An integration-provider system, bridges an external provider into the platform." }
|
|
89
89
|
|
|
90
|
+
c4_container_type:
|
|
91
|
+
description: >
|
|
92
|
+
Canonical C4 container kind for `c4_containers.type`, aligned with
|
|
93
|
+
c4model.com/abstractions (per ADR 0155). A C4 container is something
|
|
94
|
+
that must be running for the system to work — an application or a
|
|
95
|
+
data store.
|
|
96
|
+
|
|
97
|
+
Staged enforcement: this enum is ADVISORY during the 2.x schema line.
|
|
98
|
+
It is intentionally NOT bound via `c4_containers.column_enums` yet, so
|
|
99
|
+
a non-canonical value does not fail the build. The legacy values
|
|
100
|
+
`Infrastructure` and `External System` are recognised-but-deprecated:
|
|
101
|
+
builders accept them and emit a `convention` finding (WARN) prompting
|
|
102
|
+
migration. `External System` boxes belong in `c4_external_systems`
|
|
103
|
+
(they are C4 L1 peer systems, not L2 containers); running
|
|
104
|
+
infrastructure (broker, gateway, cache) retypes to Application or
|
|
105
|
+
Data Store; pure deployment infrastructure (load balancer, DNS) leaves
|
|
106
|
+
the container catalogue (it belongs in a C4 deployment diagram, which
|
|
107
|
+
is not catalogued). The breaking removal of the legacy values and the
|
|
108
|
+
column-enum binding land at the 3.0.0 major bump.
|
|
109
|
+
values:
|
|
110
|
+
- { value: Application, description: "A separately deployable/runnable application — a service, BFF, UI, consumer, worker, etc." }
|
|
111
|
+
- { value: "Data Store", description: "A database or persistence layer (also covers running stores like a message broker when modelled as a container)." }
|
|
112
|
+
|
|
90
113
|
service_type:
|
|
91
114
|
description: >
|
|
92
115
|
Type of repository, declared in `orchestration/repo-config/*.yaml` as
|
|
@@ -387,7 +410,7 @@ catalogues:
|
|
|
387
410
|
- { name: system_id, type: string, nullable: false, description: "Owning C4 system (every container is in exactly one system)." }
|
|
388
411
|
- { name: domain_id, type: string, nullable: true, description: "Optional organisational domain tag (denormalised; not C4-structural)." }
|
|
389
412
|
- { name: service_id, type: string, nullable: true, description: "Matched by container name ↔ service name/repo where possible." }
|
|
390
|
-
- { name: type, type: string, nullable: true, description: "Application | Data Store
|
|
413
|
+
- { name: type, type: string, nullable: true, description: "Canonical C4 container kind — see enums.c4_container_type (Application | Data Store). Legacy values Infrastructure | External System are recognised-but-deprecated during 2.x (WARN); External System boxes belong in c4_external_systems. Per ADR 0155. Enum binding is advisory until 3.0.0." }
|
|
391
414
|
- { name: technology, type: string, nullable: true }
|
|
392
415
|
- { name: description, type: string, nullable: true }
|
|
393
416
|
- { name: source_sdd_id, type: string, nullable: true, description: "Originating SDD slug. Populated by the aggregator per ADR 0134." }
|
|
@@ -411,6 +434,26 @@ catalogues:
|
|
|
411
434
|
- { name: responsibility, type: string, nullable: true }
|
|
412
435
|
- { name: source_sdd_id, type: string, nullable: true, description: "Originating SDD slug. Populated by the aggregator per ADR 0134." }
|
|
413
436
|
|
|
437
|
+
c4_external_systems:
|
|
438
|
+
primary_key: id
|
|
439
|
+
description: >
|
|
440
|
+
C4 external software systems — peer systems at the L1 context level
|
|
441
|
+
that the ecosystem integrates with but does not own (per ADR 0155).
|
|
442
|
+
Rendered `System_Ext(...)` on L1/L2 diagrams. NOT a c4_container
|
|
443
|
+
(external systems are not inside your system) and NOT a c4_system
|
|
444
|
+
(they have no owning Product). External systems are inherently shared
|
|
445
|
+
references: the same external system may be declared by multiple SDDs,
|
|
446
|
+
so the aggregator dedups identical rows by PK rather than failing on
|
|
447
|
+
duplicate (the one narrowly-scoped exception to ADR 0134's
|
|
448
|
+
duplicate-PK rule); conflicting attributes on the same id surface as a
|
|
449
|
+
`convention` finding.
|
|
450
|
+
columns:
|
|
451
|
+
- { name: id, type: string, nullable: false, description: "Bare slug, e.g. ext-google-maps." }
|
|
452
|
+
- { name: name, type: string, nullable: false, description: "Display name from the System_Ext label." }
|
|
453
|
+
- { name: technology, type: string, nullable: true, description: "Optional stack/protocol hint." }
|
|
454
|
+
- { name: description, type: string, nullable: true, description: "What the external system provides." }
|
|
455
|
+
- { name: source_sdd_id, type: string, nullable: true, description: "Originating SDD slug. Populated by the aggregator per ADR 0134." }
|
|
456
|
+
|
|
414
457
|
repositories:
|
|
415
458
|
primary_key: id
|
|
416
459
|
foreign_keys:
|
|
@@ -679,6 +722,30 @@ catalogues:
|
|
|
679
722
|
- { name: journey_id, type: string, nullable: false }
|
|
680
723
|
- { name: role, type: string, nullable: false, description: "primary | handoff | supporting." }
|
|
681
724
|
|
|
725
|
+
persona_c4system:
|
|
726
|
+
primary_key: id
|
|
727
|
+
description: "Edge: persona (C4 Person) uses a C4 system. Captures the L1 context 'Person uses System' relationship, extracted from Person(...) macros on the L1 context diagram and matched to personas rows. Per ADR 0155. Added in schema 2.10.0."
|
|
728
|
+
foreign_keys:
|
|
729
|
+
- { column: persona_id, references: personas.id, nullable: false }
|
|
730
|
+
- { column: c4_system_id, references: c4_systems.id, nullable: false }
|
|
731
|
+
columns:
|
|
732
|
+
- { name: id, type: string, nullable: false, description: "{persona_id}__{c4_system_id}." }
|
|
733
|
+
- { name: persona_id, type: string, nullable: false }
|
|
734
|
+
- { name: c4_system_id, type: string, nullable: false }
|
|
735
|
+
- { name: interaction, type: string, nullable: true, description: "Optional interaction label from the Rel(...) line, e.g. 'Web browser' / 'Mobile app'." }
|
|
736
|
+
|
|
737
|
+
system_external_dependency:
|
|
738
|
+
primary_key: id
|
|
739
|
+
description: "Edge: a C4 system integrates with an external software system. Captures the L1 context 'System integrates with External System' relationship, extracted from System_Ext(...) + Rel(...) on L1/L2 diagrams. Per ADR 0155. Container-level external dependencies are out of scope (system-level only). Added in schema 2.10.0."
|
|
740
|
+
foreign_keys:
|
|
741
|
+
- { column: c4_system_id, references: c4_systems.id, nullable: false }
|
|
742
|
+
- { column: external_system_id, references: c4_external_systems.id, nullable: false }
|
|
743
|
+
columns:
|
|
744
|
+
- { name: id, type: string, nullable: false, description: "{c4_system_id}__{external_system_id}." }
|
|
745
|
+
- { name: c4_system_id, type: string, nullable: false }
|
|
746
|
+
- { name: external_system_id, type: string, nullable: false }
|
|
747
|
+
- { name: interaction, type: string, nullable: true, description: "Optional integration label/protocol from the Rel(...) line." }
|
|
748
|
+
|
|
682
749
|
capability_adr:
|
|
683
750
|
primary_key: id
|
|
684
751
|
description: "Edge: ADR informs capability. Forward: declared in capability spec Architecture Decisions. Reverse: same plus heuristic match supplements with confidence."
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalogue resources (sdd-mcp Phase 8).
|
|
3
|
+
*
|
|
4
|
+
* Exposes the canonical catalogue schema + metamodel + category taxonomy,
|
|
5
|
+
* and the consumer repo's built catalogue rows, as read-only MCP resources.
|
|
6
|
+
* Mirrors the resource pattern in resources/adrs.ts / resources/data-models.ts
|
|
7
|
+
* and reuses the existing catalogue subsystem (schema-loader, csv-reader)
|
|
8
|
+
* rather than re-parsing.
|
|
9
|
+
*
|
|
10
|
+
* URIs:
|
|
11
|
+
* sdd://catalogue/schema — canonical schema (vendored), parsed to JSON
|
|
12
|
+
* sdd://catalogue/metamodel — catalogue-metamodel.md (synced markdown)
|
|
13
|
+
* sdd://catalogue/category-taxonomy — product-category-taxonomy.md (synced markdown)
|
|
14
|
+
* sdd://catalogue — list of catalogue names present in catalogues/
|
|
15
|
+
* sdd://catalogue/{name} — rows of one catalogue from catalogues/{name}.csv
|
|
16
|
+
*/
|
|
17
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
18
|
+
export declare function register(server: McpServer, sddRoot: string): void;
|
|
19
|
+
//# sourceMappingURL=catalogue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogue.d.ts","sourceRoot":"","sources":["../../../../src/lib/mcp/resources/catalogue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EACL,SAAS,EAEV,MAAM,yCAAyC,CAAC;AAoFjD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CA4LjE"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalogue resources (sdd-mcp Phase 8).
|
|
3
|
+
*
|
|
4
|
+
* Exposes the canonical catalogue schema + metamodel + category taxonomy,
|
|
5
|
+
* and the consumer repo's built catalogue rows, as read-only MCP resources.
|
|
6
|
+
* Mirrors the resource pattern in resources/adrs.ts / resources/data-models.ts
|
|
7
|
+
* and reuses the existing catalogue subsystem (schema-loader, csv-reader)
|
|
8
|
+
* rather than re-parsing.
|
|
9
|
+
*
|
|
10
|
+
* URIs:
|
|
11
|
+
* sdd://catalogue/schema — canonical schema (vendored), parsed to JSON
|
|
12
|
+
* sdd://catalogue/metamodel — catalogue-metamodel.md (synced markdown)
|
|
13
|
+
* sdd://catalogue/category-taxonomy — product-category-taxonomy.md (synced markdown)
|
|
14
|
+
* sdd://catalogue — list of catalogue names present in catalogues/
|
|
15
|
+
* sdd://catalogue/{name} — rows of one catalogue from catalogues/{name}.csv
|
|
16
|
+
*/
|
|
17
|
+
import { readFile, readdir, stat } from "node:fs/promises";
|
|
18
|
+
import { join } from "node:path";
|
|
19
|
+
import { ResourceTemplate, } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
20
|
+
import { McpEnvelopeError } from "../errors.js";
|
|
21
|
+
import { loadCanonicalSchema, findCatalogue, } from "../../catalogue/schema-loader.js";
|
|
22
|
+
import { readCatalogueCsv } from "../../catalogue/csv-reader.js";
|
|
23
|
+
// Candidate locations for the two synced markdown docs. The post-IA-move
|
|
24
|
+
// path is tried first; the pre-IA path is kept as a fallback so the
|
|
25
|
+
// resource resolves against repos synced from older baselines.
|
|
26
|
+
const METAMODEL_PATHS = [
|
|
27
|
+
["docs", "method", "methods", "guides", "catalogue-metamodel.md"],
|
|
28
|
+
["docs", "method", "methods", "catalogue-metamodel.md"],
|
|
29
|
+
];
|
|
30
|
+
const TAXONOMY_PATHS = [
|
|
31
|
+
["docs", "method", "methods", "standards", "product-category-taxonomy.md"],
|
|
32
|
+
["docs", "method", "methods", "product-category-taxonomy.md"],
|
|
33
|
+
];
|
|
34
|
+
async function isFile(path) {
|
|
35
|
+
try {
|
|
36
|
+
return (await stat(path)).isFile();
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function firstExisting(sddRoot, candidates) {
|
|
43
|
+
for (const parts of candidates) {
|
|
44
|
+
const p = join(sddRoot, ...parts);
|
|
45
|
+
if (await isFile(p))
|
|
46
|
+
return p;
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
/** Transform the loaded schema into the plan's JSON shape (catalogues keyed by name). */
|
|
51
|
+
function schemaToJson(schema) {
|
|
52
|
+
const catalogues = {};
|
|
53
|
+
for (const c of schema.catalogues) {
|
|
54
|
+
catalogues[c.name] = {
|
|
55
|
+
primary_key: c.primaryKey,
|
|
56
|
+
...(c.description !== undefined ? { description: c.description } : {}),
|
|
57
|
+
foreign_keys: c.foreignKeys.map((fk) => ({
|
|
58
|
+
column: fk.column,
|
|
59
|
+
references: fk.references,
|
|
60
|
+
nullable: fk.nullable,
|
|
61
|
+
external: fk.external,
|
|
62
|
+
})),
|
|
63
|
+
columns: c.columns.map((col) => ({
|
|
64
|
+
name: col.name,
|
|
65
|
+
type: col.type,
|
|
66
|
+
nullable: col.nullable,
|
|
67
|
+
...(col.description !== undefined
|
|
68
|
+
? { description: col.description }
|
|
69
|
+
: {}),
|
|
70
|
+
})),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
schema_version: schema.schemaVersion,
|
|
75
|
+
schema_owner: schema.schemaOwner,
|
|
76
|
+
schema_status: schema.schemaStatus,
|
|
77
|
+
catalogues,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
async function listCatalogueNames(sddRoot) {
|
|
81
|
+
const dir = join(sddRoot, "catalogues");
|
|
82
|
+
try {
|
|
83
|
+
const entries = await readdir(dir);
|
|
84
|
+
return entries
|
|
85
|
+
.filter((f) => f.endsWith(".csv"))
|
|
86
|
+
.map((f) => f.slice(0, -".csv".length))
|
|
87
|
+
.sort();
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export function register(server, sddRoot) {
|
|
94
|
+
// --- sdd://catalogue/schema (vendored canonical schema) ---
|
|
95
|
+
server.registerResource("catalogue-schema", "sdd://catalogue/schema", {
|
|
96
|
+
title: "Catalogue schema",
|
|
97
|
+
description: "The canonical catalogue-schema.yaml (vendored from sdd-method) parsed to JSON: every catalogue's primary key, columns, and foreign keys.",
|
|
98
|
+
mimeType: "application/json",
|
|
99
|
+
}, async (uri) => {
|
|
100
|
+
const schema = await loadCanonicalSchema();
|
|
101
|
+
return {
|
|
102
|
+
contents: [
|
|
103
|
+
{
|
|
104
|
+
uri: uri.href,
|
|
105
|
+
mimeType: "application/json",
|
|
106
|
+
text: JSON.stringify(schemaToJson(schema), null, 2),
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
// --- sdd://catalogue/metamodel (synced markdown) ---
|
|
112
|
+
server.registerResource("catalogue-metamodel", "sdd://catalogue/metamodel", {
|
|
113
|
+
title: "Catalogue metamodel",
|
|
114
|
+
description: "The catalogue metamodel narrative (catalogue-metamodel.md), describing the entity/edge model the schema encodes.",
|
|
115
|
+
mimeType: "text/markdown",
|
|
116
|
+
}, async (uri) => {
|
|
117
|
+
const path = await firstExisting(sddRoot, METAMODEL_PATHS);
|
|
118
|
+
if (path === null) {
|
|
119
|
+
throw new McpEnvelopeError({
|
|
120
|
+
code: "CATALOGUE_METAMODEL_NOT_FOUND",
|
|
121
|
+
message: `No catalogue-metamodel.md under SDD root ${sddRoot}.`,
|
|
122
|
+
remediation: "The metamodel is synced from sdd-method. Run `sdd-cli sync` to pull the current method baseline, which ships docs/method/methods/guides/catalogue-metamodel.md.",
|
|
123
|
+
context: {
|
|
124
|
+
sdd_root: sddRoot,
|
|
125
|
+
tried: METAMODEL_PATHS.map((p) => join(...p)),
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
contents: [
|
|
131
|
+
{ uri: uri.href, mimeType: "text/markdown", text: await readFile(path, "utf8") },
|
|
132
|
+
],
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
// --- sdd://catalogue/category-taxonomy (synced markdown) ---
|
|
136
|
+
server.registerResource("catalogue-category-taxonomy", "sdd://catalogue/category-taxonomy", {
|
|
137
|
+
title: "Product category taxonomy",
|
|
138
|
+
description: "The product-category-taxonomy.md: allowed category values and the L1-emission rules an agent reasons about when reading product rows.",
|
|
139
|
+
mimeType: "text/markdown",
|
|
140
|
+
}, async (uri) => {
|
|
141
|
+
const path = await firstExisting(sddRoot, TAXONOMY_PATHS);
|
|
142
|
+
if (path === null) {
|
|
143
|
+
throw new McpEnvelopeError({
|
|
144
|
+
code: "CATALOGUE_TAXONOMY_NOT_FOUND",
|
|
145
|
+
message: `No product-category-taxonomy.md under SDD root ${sddRoot}.`,
|
|
146
|
+
remediation: "The taxonomy is synced from sdd-method. Run `sdd-cli sync` to pull the current method baseline, which ships docs/method/methods/standards/product-category-taxonomy.md.",
|
|
147
|
+
context: {
|
|
148
|
+
sdd_root: sddRoot,
|
|
149
|
+
tried: TAXONOMY_PATHS.map((p) => join(...p)),
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
contents: [
|
|
155
|
+
{ uri: uri.href, mimeType: "text/markdown", text: await readFile(path, "utf8") },
|
|
156
|
+
],
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
// --- sdd://catalogue (list of built catalogues) ---
|
|
160
|
+
server.registerResource("catalogue-list", "sdd://catalogue", {
|
|
161
|
+
title: "Catalogue list",
|
|
162
|
+
description: "The catalogue names present in the consumer repo's catalogues/ directory. Use to discover what is built without reading every file.",
|
|
163
|
+
mimeType: "application/json",
|
|
164
|
+
}, async (uri) => {
|
|
165
|
+
const names = await listCatalogueNames(sddRoot);
|
|
166
|
+
return {
|
|
167
|
+
contents: [
|
|
168
|
+
{
|
|
169
|
+
uri: uri.href,
|
|
170
|
+
mimeType: "application/json",
|
|
171
|
+
text: JSON.stringify({ row_count: names.length, catalogues: names }, null, 2),
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
};
|
|
175
|
+
});
|
|
176
|
+
// --- sdd://catalogue/{name} (rows of one catalogue) ---
|
|
177
|
+
server.registerResource("catalogue-rows", new ResourceTemplate("sdd://catalogue/{name}", {
|
|
178
|
+
list: async () => {
|
|
179
|
+
const names = await listCatalogueNames(sddRoot);
|
|
180
|
+
return {
|
|
181
|
+
resources: names.map((name) => ({
|
|
182
|
+
uri: `sdd://catalogue/${name}`,
|
|
183
|
+
name: `Catalogue: ${name}`,
|
|
184
|
+
mimeType: "application/json",
|
|
185
|
+
})),
|
|
186
|
+
};
|
|
187
|
+
},
|
|
188
|
+
}), {
|
|
189
|
+
title: "Catalogue rows",
|
|
190
|
+
description: "Rows of one built catalogue from catalogues/{name}.csv, with the schema_version they were built against.",
|
|
191
|
+
mimeType: "application/json",
|
|
192
|
+
}, async (uri, { name }) => {
|
|
193
|
+
if (typeof name !== "string") {
|
|
194
|
+
throw new McpEnvelopeError({
|
|
195
|
+
code: "CATALOGUE_URI_INVALID",
|
|
196
|
+
message: `Catalogue URI ${uri.href} is missing the {name} parameter.`,
|
|
197
|
+
remediation: "Use the shape sdd://catalogue/{name}. List available catalogues via sdd://catalogue.",
|
|
198
|
+
context: { uri: uri.href },
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
const schema = await loadCanonicalSchema();
|
|
202
|
+
try {
|
|
203
|
+
findCatalogue(schema, name);
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
throw new McpEnvelopeError({
|
|
207
|
+
code: "CATALOGUE_NOT_DECLARED",
|
|
208
|
+
message: `"${name}" is not a catalogue declared in the canonical schema (version ${schema.schemaVersion}).`,
|
|
209
|
+
remediation: "Query sdd://catalogue/schema for the declared catalogue names, or sdd://catalogue for the ones this repo has built.",
|
|
210
|
+
context: { name, schema_version: schema.schemaVersion },
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
const csvPath = join(sddRoot, "catalogues", `${name}.csv`);
|
|
214
|
+
if (!(await isFile(csvPath))) {
|
|
215
|
+
throw new McpEnvelopeError({
|
|
216
|
+
code: "CATALOGUE_NOT_BUILT",
|
|
217
|
+
message: `Catalogue "${name}" is declared but catalogues/${name}.csv does not exist under ${sddRoot}.`,
|
|
218
|
+
remediation: "Build catalogues for this repo (e.g. via the catalogue-integrity-gate skill or `sdd-cli catalogue build`) before querying their rows.",
|
|
219
|
+
context: { name, expected_path: csvPath, sdd_root: sddRoot },
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
const parsed = await readCatalogueCsv(csvPath);
|
|
223
|
+
return {
|
|
224
|
+
contents: [
|
|
225
|
+
{
|
|
226
|
+
uri: uri.href,
|
|
227
|
+
mimeType: "application/json",
|
|
228
|
+
text: JSON.stringify({
|
|
229
|
+
catalogue: name,
|
|
230
|
+
schema_version: schema.schemaVersion,
|
|
231
|
+
row_count: parsed.rows.length,
|
|
232
|
+
columns: parsed.columns,
|
|
233
|
+
rows: parsed.rows,
|
|
234
|
+
}, null, 2),
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
};
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=catalogue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogue.js","sourceRoot":"","sources":["../../../../src/lib/mcp/resources/catalogue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAEL,gBAAgB,GACjB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,aAAa,GAEd,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,yEAAyE;AACzE,oEAAoE;AACpE,+DAA+D;AAC/D,MAA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AI,EACJ,CAAC,CACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/lib/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/lib/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA4BpE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,kCAAkC;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAsB,WAAW,CAC/B,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,iBAAiB,CAAC,CAwF5B"}
|