@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
package/dist/lib/mcp/server.js
CHANGED
|
@@ -12,12 +12,14 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
12
12
|
import { SERVER_VERSION } from "./build-info.js";
|
|
13
13
|
import { envelopeFromUnknown } from "./errors.js";
|
|
14
14
|
import { register as registerAdrs } from "./resources/adrs.js";
|
|
15
|
+
import { register as registerCatalogue } from "./resources/catalogue.js";
|
|
15
16
|
import { register as registerDataModels } from "./resources/data-models.js";
|
|
16
17
|
import { register as registerGates } from "./resources/gates.js";
|
|
17
18
|
import { register as registerGlossary } from "./resources/glossary.js";
|
|
18
19
|
import { register as registerSpecs } from "./resources/specs.js";
|
|
19
20
|
import { register as registerVersion } from "./resources/version.js";
|
|
20
21
|
import { register as registerCascadeImpact } from "./tools/cascade-impact.js";
|
|
22
|
+
import { register as registerCatalogueTools } from "./tools/catalogue.js";
|
|
21
23
|
import { register as registerFindConsumers } from "./tools/find-consumers.js";
|
|
22
24
|
import { register as registerFindConsumersOfContract } from "./tools/find-consumers-of-contract.js";
|
|
23
25
|
import { register as registerFindDependencies } from "./tools/find-dependencies.js";
|
|
@@ -67,6 +69,7 @@ export async function runMcpServe(opts = {}) {
|
|
|
67
69
|
registerDataModels(server, sddRepoPath);
|
|
68
70
|
registerGates(server, sddRepoPath);
|
|
69
71
|
registerGlossary(server, sddRepoPath);
|
|
72
|
+
registerCatalogue(server, sddRepoPath);
|
|
70
73
|
registerListAdrs(server, sddRepoPath);
|
|
71
74
|
registerQueryGateStatus(server, sddRepoPath);
|
|
72
75
|
registerSearchSpecs(server, sddRepoPath);
|
|
@@ -77,6 +80,7 @@ export async function runMcpServe(opts = {}) {
|
|
|
77
80
|
registerFindDependents(server, sddRepoPath);
|
|
78
81
|
registerFindConsumersOfContract(server, sddRepoPath);
|
|
79
82
|
registerCascadeImpact(server, sddRepoPath);
|
|
83
|
+
registerCatalogueTools(server, sddRepoPath);
|
|
80
84
|
registerAllPrompts(server, sddRepoPath);
|
|
81
85
|
if (opts.testMode) {
|
|
82
86
|
return { server, sddRepoPath };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/lib/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,QAAQ,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,QAAQ,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,QAAQ,IAAI,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;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oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,iEAAiE;IACjE,kEAAkE;IAClE,2CAA2C;IAC3C,MAAM,IAAI,OAAO,CAAO,CAAC,WAAW,EAAE,EAAE;QACtC,SAAS,CAAC,OAAO,GAAG,GAAG,EAAE;YACvB,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC;QACF,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QACnD,CAAC,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,IAAI,EAAE,CAAC;IACf,oBAAoB,EAAE,CAAC;IAEvB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalogue tools (sdd-mcp Phase 8, Step 4). Read-only, on-demand
|
|
3
|
+
* queries over the consumer repo's built catalogues:
|
|
4
|
+
*
|
|
5
|
+
* query_catalogue_coverage — row count + internal-FK pass + coverage for one catalogue
|
|
6
|
+
* find_products_by_category — products filtered by category
|
|
7
|
+
* find_orphan_rows — rows whose internal FK target is missing
|
|
8
|
+
* query_edges_for_entity — every edge row referencing a given entity
|
|
9
|
+
*
|
|
10
|
+
* FK semantics follow ADR 0134: external FKs are validated only at
|
|
11
|
+
* aggregation, so per-SDD coverage and orphan checks consider internal
|
|
12
|
+
* FKs only. Reuses the existing schema-loader + csv-reader.
|
|
13
|
+
*/
|
|
14
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
15
|
+
export declare function register(server: McpServer, sddRoot: string): void;
|
|
16
|
+
//# sourceMappingURL=catalogue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogue.d.ts","sourceRoot":"","sources":["../../../../src/lib/mcp/tools/catalogue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAwGzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAwMjE"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalogue tools (sdd-mcp Phase 8, Step 4). Read-only, on-demand
|
|
3
|
+
* queries over the consumer repo's built catalogues:
|
|
4
|
+
*
|
|
5
|
+
* query_catalogue_coverage — row count + internal-FK pass + coverage for one catalogue
|
|
6
|
+
* find_products_by_category — products filtered by category
|
|
7
|
+
* find_orphan_rows — rows whose internal FK target is missing
|
|
8
|
+
* query_edges_for_entity — every edge row referencing a given entity
|
|
9
|
+
*
|
|
10
|
+
* FK semantics follow ADR 0134: external FKs are validated only at
|
|
11
|
+
* aggregation, so per-SDD coverage and orphan checks consider internal
|
|
12
|
+
* FKs only. Reuses the existing schema-loader + csv-reader.
|
|
13
|
+
*/
|
|
14
|
+
import { readdir } from "node:fs/promises";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
import { z } from "zod";
|
|
17
|
+
import { McpEnvelopeError } from "../errors.js";
|
|
18
|
+
import { loadCanonicalSchema, findCatalogue, } from "../../catalogue/schema-loader.js";
|
|
19
|
+
import { readCatalogueCsv, } from "../../catalogue/csv-reader.js";
|
|
20
|
+
async function loadAll(sddRoot) {
|
|
21
|
+
const schema = await loadCanonicalSchema();
|
|
22
|
+
const dir = join(sddRoot, "catalogues");
|
|
23
|
+
const present = new Map();
|
|
24
|
+
let files;
|
|
25
|
+
try {
|
|
26
|
+
files = await readdir(dir);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return { schema, present };
|
|
30
|
+
}
|
|
31
|
+
for (const f of files) {
|
|
32
|
+
if (!f.endsWith(".csv"))
|
|
33
|
+
continue;
|
|
34
|
+
const name = f.slice(0, -".csv".length);
|
|
35
|
+
present.set(name, await readCatalogueCsv(join(dir, f)));
|
|
36
|
+
}
|
|
37
|
+
return { schema, present };
|
|
38
|
+
}
|
|
39
|
+
/** Referenced catalogue + column from an FK `references` string ("cat.col"). */
|
|
40
|
+
function refParts(references) {
|
|
41
|
+
const [catalogue, column] = references.split(".");
|
|
42
|
+
return { catalogue: catalogue ?? "", column: column ?? "id" };
|
|
43
|
+
}
|
|
44
|
+
/** Compute internal-FK orphan rows for one catalogue (or all when name is null). */
|
|
45
|
+
function orphansFor(loaded, only) {
|
|
46
|
+
const out = [];
|
|
47
|
+
// Pre-build PK value sets per present catalogue.
|
|
48
|
+
const pkSets = new Map();
|
|
49
|
+
for (const [name, csv] of loaded.present) {
|
|
50
|
+
let def;
|
|
51
|
+
try {
|
|
52
|
+
def = findCatalogue(loaded.schema, name);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
pkSets.set(name, new Set(csv.rows.map((r) => r[def.primaryKey] ?? "")));
|
|
58
|
+
}
|
|
59
|
+
for (const [name, csv] of loaded.present) {
|
|
60
|
+
if (only !== null && name !== only)
|
|
61
|
+
continue;
|
|
62
|
+
let def;
|
|
63
|
+
try {
|
|
64
|
+
def = findCatalogue(loaded.schema, name);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
for (const fk of def.foreignKeys) {
|
|
70
|
+
if (fk.external)
|
|
71
|
+
continue; // external FKs validated at aggregation only
|
|
72
|
+
const { catalogue: targetCat } = refParts(fk.references);
|
|
73
|
+
const targetPks = pkSets.get(targetCat);
|
|
74
|
+
for (const row of csv.rows) {
|
|
75
|
+
const val = row[fk.column] ?? "";
|
|
76
|
+
if (val === "")
|
|
77
|
+
continue; // empty FK value — nullable or unset
|
|
78
|
+
// Missing target catalogue, or value not found in the target's PKs.
|
|
79
|
+
if (targetPks === undefined || !targetPks.has(val)) {
|
|
80
|
+
out.push({
|
|
81
|
+
catalogue: name,
|
|
82
|
+
row_id: row[def.primaryKey] ?? "",
|
|
83
|
+
broken_fk_column: fk.column,
|
|
84
|
+
references: fk.references,
|
|
85
|
+
missing_target: val,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
function asText(payload) {
|
|
94
|
+
return { content: [{ type: "text", text: JSON.stringify(payload, null, 2) }] };
|
|
95
|
+
}
|
|
96
|
+
export function register(server, sddRoot) {
|
|
97
|
+
// --- query_catalogue_coverage ---
|
|
98
|
+
server.registerTool("query_catalogue_coverage", {
|
|
99
|
+
title: "Query catalogue coverage",
|
|
100
|
+
description: "Row count, internal-FK pass, and coverage metrics for one built catalogue. Read-only on-demand mirror of the catalogue-integrity gate.",
|
|
101
|
+
inputSchema: {
|
|
102
|
+
catalogue: z
|
|
103
|
+
.string()
|
|
104
|
+
.min(1)
|
|
105
|
+
.describe("Catalogue name (e.g. 'products'). See sdd://catalogue."),
|
|
106
|
+
},
|
|
107
|
+
}, async ({ catalogue }) => {
|
|
108
|
+
const loaded = await loadAll(sddRoot);
|
|
109
|
+
try {
|
|
110
|
+
findCatalogue(loaded.schema, catalogue);
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
throw new McpEnvelopeError({
|
|
114
|
+
code: "CATALOGUE_NOT_DECLARED",
|
|
115
|
+
message: `"${catalogue}" is not declared in the canonical schema (version ${loaded.schema.schemaVersion}).`,
|
|
116
|
+
remediation: "Query sdd://catalogue/schema for declared names.",
|
|
117
|
+
context: { catalogue, schema_version: loaded.schema.schemaVersion },
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
const csv = loaded.present.get(catalogue);
|
|
121
|
+
if (csv === undefined) {
|
|
122
|
+
throw new McpEnvelopeError({
|
|
123
|
+
code: "CATALOGUE_NOT_BUILT",
|
|
124
|
+
message: `Catalogue "${catalogue}" is declared but not built under ${sddRoot}/catalogues.`,
|
|
125
|
+
remediation: "Build catalogues (catalogue-integrity-gate skill or `sdd-cli catalogue build`) before querying coverage.",
|
|
126
|
+
context: { catalogue, sdd_root: sddRoot },
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
const orphans = orphansFor(loaded, catalogue);
|
|
130
|
+
return asText({
|
|
131
|
+
catalogue,
|
|
132
|
+
schema_version: loaded.schema.schemaVersion,
|
|
133
|
+
row_count: csv.rows.length,
|
|
134
|
+
fk_pass: orphans.length === 0,
|
|
135
|
+
coverage: {
|
|
136
|
+
internal_fk_orphan_count: orphans.length,
|
|
137
|
+
columns_present: csv.columns.length,
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
// --- find_products_by_category ---
|
|
142
|
+
server.registerTool("find_products_by_category", {
|
|
143
|
+
title: "Find products by category",
|
|
144
|
+
description: "Products in the products catalogue matching a given category, with domain, profile, and category.",
|
|
145
|
+
inputSchema: {
|
|
146
|
+
category: z
|
|
147
|
+
.string()
|
|
148
|
+
.min(1)
|
|
149
|
+
.describe("Product category value (e.g. 'platform-root', 'application-product'). See sdd://catalogue/category-taxonomy."),
|
|
150
|
+
},
|
|
151
|
+
}, async ({ category }) => {
|
|
152
|
+
const loaded = await loadAll(sddRoot);
|
|
153
|
+
const csv = loaded.present.get("products");
|
|
154
|
+
if (csv === undefined) {
|
|
155
|
+
throw new McpEnvelopeError({
|
|
156
|
+
code: "CATALOGUE_NOT_BUILT",
|
|
157
|
+
message: `The products catalogue is not built under ${sddRoot}/catalogues.`,
|
|
158
|
+
remediation: "Build catalogues before querying products.",
|
|
159
|
+
context: { sdd_root: sddRoot },
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
const matches = csv.rows
|
|
163
|
+
.filter((r) => r["category"] === category)
|
|
164
|
+
.map((r) => ({
|
|
165
|
+
id: r["id"] ?? "",
|
|
166
|
+
name: r["name"] ?? "",
|
|
167
|
+
domain_id: r["domain_id"] ?? "",
|
|
168
|
+
profile: r["profile"] ?? "",
|
|
169
|
+
category: r["category"] ?? "",
|
|
170
|
+
}));
|
|
171
|
+
return asText({ category, match_count: matches.length, products: matches });
|
|
172
|
+
});
|
|
173
|
+
// --- find_orphan_rows ---
|
|
174
|
+
server.registerTool("find_orphan_rows", {
|
|
175
|
+
title: "Find orphan rows",
|
|
176
|
+
description: "Rows whose internal foreign-key value has no matching primary key in the referenced catalogue. Triages FK-FAIL without re-running the full builder. Optional catalogue filter.",
|
|
177
|
+
inputSchema: {
|
|
178
|
+
catalogue: z
|
|
179
|
+
.string()
|
|
180
|
+
.optional()
|
|
181
|
+
.describe("Optional: restrict to one catalogue. Omit to scan all."),
|
|
182
|
+
},
|
|
183
|
+
}, async ({ catalogue }) => {
|
|
184
|
+
const loaded = await loadAll(sddRoot);
|
|
185
|
+
if (catalogue !== undefined) {
|
|
186
|
+
try {
|
|
187
|
+
findCatalogue(loaded.schema, catalogue);
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
throw new McpEnvelopeError({
|
|
191
|
+
code: "CATALOGUE_NOT_DECLARED",
|
|
192
|
+
message: `"${catalogue}" is not declared in the canonical schema.`,
|
|
193
|
+
remediation: "Query sdd://catalogue/schema for declared names.",
|
|
194
|
+
context: { catalogue },
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
const orphans = orphansFor(loaded, catalogue ?? null);
|
|
199
|
+
return asText({
|
|
200
|
+
scope: catalogue ?? "all",
|
|
201
|
+
schema_version: loaded.schema.schemaVersion,
|
|
202
|
+
orphan_count: orphans.length,
|
|
203
|
+
orphans,
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
// --- query_edges_for_entity ---
|
|
207
|
+
server.registerTool("query_edges_for_entity", {
|
|
208
|
+
title: "Query edges for entity",
|
|
209
|
+
description: "Every edge row, in any catalogue, whose foreign key references the given entity (incoming + outgoing). Powers impact-analysis and dependency queries.",
|
|
210
|
+
inputSchema: {
|
|
211
|
+
entity_type: z
|
|
212
|
+
.string()
|
|
213
|
+
.min(1)
|
|
214
|
+
.describe("Entity type — the singular of its catalogue (e.g. 'capability', 'service', 'product') or the catalogue name itself."),
|
|
215
|
+
entity_id: z.string().min(1).describe("The entity's id value."),
|
|
216
|
+
},
|
|
217
|
+
}, async ({ entity_type, entity_id }) => {
|
|
218
|
+
const loaded = await loadAll(sddRoot);
|
|
219
|
+
// Resolve entity_type -> base catalogue name.
|
|
220
|
+
const candidates = [
|
|
221
|
+
entity_type,
|
|
222
|
+
`${entity_type}s`,
|
|
223
|
+
entity_type.replace(/y$/, "ies"),
|
|
224
|
+
];
|
|
225
|
+
const base = loaded.schema.catalogues.find((c) => candidates.includes(c.name));
|
|
226
|
+
if (base === undefined) {
|
|
227
|
+
throw new McpEnvelopeError({
|
|
228
|
+
code: "ENTITY_TYPE_UNKNOWN",
|
|
229
|
+
message: `Could not resolve entity_type "${entity_type}" to a catalogue.`,
|
|
230
|
+
remediation: "Use a catalogue's singular (e.g. 'capability') or its name (e.g. 'capabilities'). See sdd://catalogue/schema.",
|
|
231
|
+
context: { entity_type, tried: candidates },
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
const targetRef = `${base.name}.${base.primaryKey}`;
|
|
235
|
+
const edges = [];
|
|
236
|
+
for (const [name, csv] of loaded.present) {
|
|
237
|
+
let def;
|
|
238
|
+
try {
|
|
239
|
+
def = findCatalogue(loaded.schema, name);
|
|
240
|
+
}
|
|
241
|
+
catch {
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
const matchingFks = def.foreignKeys.filter((fk) => fk.references === targetRef);
|
|
245
|
+
if (matchingFks.length === 0)
|
|
246
|
+
continue;
|
|
247
|
+
for (const row of csv.rows) {
|
|
248
|
+
for (const fk of matchingFks) {
|
|
249
|
+
if ((row[fk.column] ?? "") === entity_id) {
|
|
250
|
+
edges.push({
|
|
251
|
+
catalogue: name,
|
|
252
|
+
row_id: row[def.primaryKey] ?? "",
|
|
253
|
+
via_column: fk.column,
|
|
254
|
+
row,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return asText({
|
|
261
|
+
entity_type: base.name,
|
|
262
|
+
entity_id,
|
|
263
|
+
edge_count: edges.length,
|
|
264
|
+
edges,
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=catalogue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogue.js","sourceRoot":"","sources":["../../../../src/lib/mcp/tools/catalogue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,aAAa,GAGd,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,gBAAgB,GAEjB,MAAM,+BAA+B,CAAC;AAQvC,KAAK,UAAU,OAAO,CAAC,OAAe;IACpC,MAAM,MAAM,GAAG,MAAM,mBAAmB,EAAE,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC7C,IAAI,KAAe,CAAC;IACpB,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAA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AC;YACH,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;YACZ,WAAW,EAAE,IAAI,CAAC,IAAI;YACtB,SAAS;YACT,UAAU,EAAE,KAAK,CAAC,MAAM;YACxB,KAAK;SACN,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdd-method/sdd-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Method-layer CLI for SDD repository lifecycle — init, sync, validate, list, plan, generate-briefing, mcp serve, catalogue {build,aggregate,validate,version}, pack {build,validate}. v0.23.1 patches v0.23.0: `sdd-cli pack build` now populates source_commit + source_branch in the rendered BUNDLE_MANIFEST.yaml from `git rev-parse HEAD` / `git rev-parse --abbrev-ref HEAD` against the producer-repo working tree, matching sdd-method's build-method-baseline-bundle.sh provenance behaviour. Non-git producer dirs (CI artefact directories etc.) get the sentinel \"uncommitted\" so consumer-side parseManifest (which rejects empty source_commit) still accepts the bundle. Pre-v0.23.1 packs wrote empty strings and were unsyncable — discovered during the contextua-platform Phase 7 first-adopter pilot (ADR 0151) when operations-console refused the first build of contextua-app-context-pack@v0.1.0. v0.23.0 ships the adopter pack producer + consumer surface per sdd-method ADR 0151 (companion plan adopter-bundle-producer-model.md Phases 3a + 3b + 3c). New `pack` verb with build and validate subcommands lets platform-profile adopters (contextua-platform, CXS Connect) produce additive-layer bundles from a context-pack-seed.yaml declaration. The builder validates the seed against the canonical schema, resolves include: directives across files, expands managed_paths (literal + glob against the producer working tree), runs a producer-side leakage check (disjointness with the declared forward base + disjointness with declared forbidden_paths globs), stages the payload tree, emits SHA-256 checksums per managed file, renders BUNDLE_MANIFEST.yaml mirroring the .hbs template shape, and produces <pack-name>-v<semver>.tar.gz + sidecar .sha256. Consumer-side enforcement extends `sdd-cli sync` for the multi-bundle lock chain: requires_forward_base resolution verifies the consumer's lock carries a compatible forward base; requires_pack resolution enforces vertical-extension dependencies with full semver-range support (caret with pre-1.0 narrow per npm convention, tilde, exact pin, >=); the existing cross-bundle path-ownership check now functions for adopter pack names too (consumer-side leakage assertion); produced_by_adopter / scope / requires_forward_base / requires_pack carry from the manifest into the lock entry as additive optional fields preserving lock_version: 2. New `sdd-cli sync --config <path>` reads a multi-bundle method-baseline.config.yaml (ordered bundles[].source list) and iterates each through the single-bundle sync engine — mutually exclusive with --bundle. `sdd-cli list` surfaces adopter pack provenance: forward-base version in the repo line plus indented `+ <pack-name> <version> from <adopter-repo> [requires <base-pack>]` lines beneath; --verbose adds per-bundle managed_path counts; JSON format adds a per-repo bundles[] array carrying full provenance. Type relaxation: BundleManifest.bundleName and BundleEntry.name widened from the closed BundleName enum to string (adopter pack names are arbitrary per ADR 0151); the closed enum still applies to sdd-method forward bases, validated at parse time only when is_forward_base: true. BundleManifest parser migrated from line-by-line scalar regex to the existing yaml library dependency for nested requires_forward_base / requires_pack object parsing. v0.22.0 bundles three landed scopes. (a) ADR 0141 Phase 5 — `--agent-harness` flag on init/sync now accepts `github-copilot-cli` as the second reference implementation alongside the `claude-code` default; Copilot CLI sync writes `.github/hooks/{pre-tool-use,session-start}.json` with the same sentinel-based ownership pattern as the Claude Code `.claude/settings.json` block. Default changes from \"unset\" to `claude-code`; existing adopters on v0.12.2+ get sentinel-tagged-in-place via the dedupe pre-pass. Unknown harness values fail loudly instead of warning. (b) ADR 0148 Phase 4 — init and sync now emit `agent-instructions.md` at the SDD root (harness-neutral, fully method-managed, unconditional overwrite) plus a thin harness wrapper (`CLAUDE.md` under claude-code, `AGENTS.md` under github-copilot-cli) with `<!-- method-managed: begin/end -->` markers; adopter content around the marker block survives sync via the existing `writeMarkedBlockFile` machinery. The v0.3–v0.21 `generate-claude-md` verb + native rich-content renderer retire; the new `generate-briefing` verb regenerates both files from the on-disk templates for the no-bundle-sync case. Older bundles pre-dating ADR 0148 templates sync gracefully with a \"Skipped\" log line. Existing repos carrying a hand-rolled CLAUDE.md without markers will see the wrapper rewrite refused on first sync; pass --allow-overwrite after rehoming any custom content (covered in the upstream agent-instructions-migration-guide). (c) Catalogue schema 2.9.0 (lockstep with sdd-method v0.10.0 reverse-extension-baseline v0.9.0) carrying the Track 2 cohort-sweep field additions per content/plans/v0-9-0-cohort-sweep-derived-bundle.md: capabilities now carries data_subset (foundational/synthesis-tier keying axis) + slice_scope (multi-app-group capability slicing — same capability_id may appear with distinct slice_scope values, row identity becomes (id, slice_scope)); new per-feature edge catalogue feature_subscription_channels built from reverse-evidence/feature-grounding-evidence.yaml subscription_channels: entries (AppSync WebSocket / Pekko WS / MQTT / SSE channel layer, peer of graphql_operations: per resolved §1, kebab name + transport + evidence + optional payload_ref); new per-SDD edge catalogue product_platform_dependencies built from the product-scoped platform_dependencies: block in the same evidence file; new federated edge catalogue cross_sdd_platform_capability derived by the aggregator joining product_platform_dependencies × capability_service on target_service_id == service_id, emitting one row per resolved (consuming-product, platform-capability) pair with orphan findings for unresolved references. SCHEMA_COMPAT unchanged (still ^2.0.0); additive minor across both new catalogues and capability column additions. v0.21.0 ships catalogue schema 2.8.0 closing the long-tail contract-consumer mapping gap (K-03a). The contracts builder now also walks the platform-profile layout `docs/domains/<dom>/contracts/{openapi,proto,avro}/<file>.<ext>` documented in reverse/workflows/contract.md, in addition to the canonical `contracts/<subdir>/<dom>/<file>.<ext>` layout — backward-compatible additive change for federated SDDs that don't carry per-domain contracts. Adds a new buildServiceContractConsumes builder that parses each service's `repos/<service>/docs/service-architecture.md` External Interfaces table, reads Outbound rows, and emits `service_contract` rows with role=consumes via an adopter-supplied `.sdd/service-contract-aliases.yaml` (case-insensitive interface_aliases + interface_contains substring tier + same_product_inference templates with `{prefix}` substitution). Schema 2.8.0 marks service_contract.contract_id as external:true so federated SDDs can emit consumes rows pointing to platform-root contracts; aggregator validates the merged catalogue. Resolution failures become convention findings, not FK-invalid rows. Pattern documented in sdd-method ADR 0147. SCHEMA_COMPAT unchanged (still ^2.0.0). v0.19.0 ships catalogue schema 2.6.0 (lockstep with sdd-method): adds optional `sub_integrations:` array on integration-manifest.yaml per ADR 0144. Multi-provider integration monoliths (modernisation-in-flight or intentional permanent gateways brokering N providers) can declare each provider; the integrations.ts builder emits one integrations.csv row per sub_integration with parent_product_id = umbrella SDD's integrationId. Uses the existing parent_product_id column — no new schema columns. Backward compatible (optional field); SDDs without sub_integrations emit identical output to pre-2.6.0. Originating motivation: connect's sdd-camera-platform-legacy covering Surfsight v2 + VisionTrack v1/v2 + SureCam in one Spring-Boot codebase. SCHEMA_COMPAT unchanged (still ^2.0.0). v0.18.0 ships catalogue schema 2.5.0 (lockstep with sdd-method): adds feature-grounding source per ADR 0143. Canonical builder walks `docs/domains/<dom>/design/<capability>/feature-grounding.md` (platform-profile) and `docs/design/integration/feature-grounding.md` (integration-product), parses the markdown table form, and emits features.csv rows (source: feature-grounding, capability-owned) plus capability_feature / feature_repo / feature_service edges derived from the table columns. Optional per-SDD `.sdd/feature-grounding-aliases.yaml` translates display names (class names, file basenames) to canonical service / repo ids. SCHEMA_COMPAT unchanged (still ^2.0.0). v0.17.0 enables multi-level federation: organisation-level SDDs can now aggregate from organisation-level children (e.g. CXS aggregating sdd-mining, sdd-latam) via optional level: organisation field on siblings, skipping manifest requirements for pure orchestration repos. v0.16.0 adds organisation-profile support for system-of-systems aggregators (e.g. CXS aggregating sdd-connect, sdd-mining, sdd-latam), closing the gap for organisation-level SDD manifests. v0.15.0 ships catalogue schema 2.4.0 (lockstep with sdd-method): adds feature_contract derived edge (forward: capability_feature ⋈ capability_contract; reverse: feature_service ⋈ service_contract) closing the Capability → Feature → Contract chain pre-implementation, plus the new DomainModel entity per ADR 0142 with domain_models / capability_domain_model / feature_domain_model catalogues sourced from a new traceability.domain_model manifest field (forward) or docs/domains/*/architecture/data-model.mermaid.md file-system scan (reverse). Platform-profile only for domain_models; the metamodel now also documents non-catalogued method artefacts (work orders, discovery stories, execution stories, traceability manifests) so it's a complete reference for the forward SDD method's artefact set. SCHEMA_COMPAT unchanged (still ^2.0.0). v0.14.1 patches v0.14.0's domains-builder fix: products-builder now also clears domain_id for non-platform-profile rows even when manifest.domainId is declared. v0.14.0 stopped emitting umbrella domain rows but products.domain_id (and the applications.csv filtered view) still pointed at them, dangling at FK validation. Per ADR 0136 + schema description for products.domain_id, app/integration/support products do not have a primary domain — the builder now honours that statement regardless of manifest declaration, and emits an inferred finding when a manifest-declared value is overridden. v0.14.0 ships two post-v0.9.0-release fixes surfaced by the connect-cohort sync: (1) sync now enforces minimum_sdd_cli_version declared by bundle manifests — previously the orchestration check existed only in the shell sync script and was a no-op when adopters used `sdd-cli sync`, leaving the safety net for stale-CLI scenarios silently absent; (2) per ADR 0136 (App and Integration Products Do Not Belong to a Primary Domain), the domains.ts catalogue builder now skips row emission for non-platform-profile SDDs — application-product and integration-product SDDs that have a docs/domains/<umbrella>/ subdirectory as a structural-organisation convention no longer emit a member-declaration row that collides on PK at aggregation against the canonical platform-profile contribution. v0.13.2 fixed the aggregator's sibling-vendored-schema cross-check to use semver range satisfaction against SCHEMA_COMPAT.catalogue_schema (^2.0.0) instead of strict equality — siblings vendored at lower minor versions inside the same major are now accepted, unblocking aggregation across federated cohorts where the canonical schema is ahead of the bundled schema. v0.13.0 ships the feature-tree.md bullet parser per sdd-method schema 2.2.0 + plan extract-feature-tree-bullets.md: application-product builders now emit features.csv rows with source: \"feature-tree\" from per-app feature-tree.md bullets, populating the previously-empty edge catalogues (persona_feature, journey_feature) for portfolio monoliths whose feature inventory lives in the bullet form. Adds the optional runway column on features.csv with adopter-owned controlled-vocabulary validation via feature-runway-vocabulary.yaml at the SDD root. v0.12.2 dedupes equivalent unmarked adopter PreToolUse entries on settings.json upsert. v0.12.0 extends the integration profileType enum to 11 values (per sdd-method ADR 0137) and fixes the init→sync conflict. v0.11.0 shipped the canonical catalogue surface per ADR 0134 + schema 2.1.0.",
|
|
3
|
+
"version": "0.25.0",
|
|
4
|
+
"description": "Method-layer CLI for SDD repository lifecycle — init, sync, validate, list, plan, generate-briefing, mcp serve, catalogue {build,aggregate,validate,version}, pack {build,validate}. v0.25.0 ships catalogue schema 2.10.0 (lockstep with sdd-method ADR 0155 — Align C4 Catalogue Capture with Strict C4 Abstractions), bringing the catalogue's C4 layer into line with c4model.com/abstractions. New node catalogue c4_external_systems (C4 L1 external software systems extracted from System_Ext(...) / Container_Ext(...) on L1+L2 mermaid; id = ext-{slug}); new edges persona_c4system (the C4 Person-uses-System relationship, mapping Person(...) actors to personas rows — the C4 Person abstraction reuses Persona) and system_external_dependency (system integrates-with external, from Rel(...) lines, collapsed to system level per ADR 0155 §4.2). New advisory enum c4_container_type = {Application, Data Store}: the c4-containers builder now types ContainerQueue as Data Store (was the non-canonical \"Infrastructure\") and no longer emits Container_Ext as an internal container row (external containers are catalogued as c4_external_systems); the legacy types Infrastructure / External System remain recognised-but-WARNed during the 2.x line and are removed at the 3.0.0 major bump (the enum is intentionally not bound in column_enums until then). The aggregator dedups c4_external_systems by id across SDDs rather than failing the duplicate-PK check — the one narrowly-scoped exception per ADR 0134, since the same external system (e.g. ext-google-maps) is legitimately declared by multiple SDDs; attribute conflicts on a shared id surface as a convention finding. SCHEMA_COMPAT unchanged (still ^2.0.0); additive minor. v0.24.0 ships sdd-mcp Phase 8 — catalogue resources + tools on the read-only MCP server (sdd-method ADR 0128 + ADR 0150). New resources: sdd://catalogue/schema (vendored canonical schema as JSON), sdd://catalogue/metamodel, sdd://catalogue/category-taxonomy, sdd://catalogue (list of built catalogues), and sdd://catalogue/{name} (rows from catalogues/{name}.csv, validated against the schema, distinguishing not-declared from not-built). New tools: query_catalogue_coverage (row count + internal-FK pass), find_products_by_category, find_orphan_rows (broken internal FK targets), and query_edges_for_entity (every edge row referencing an entity). All reuse the existing src/lib/catalogue schema-loader + csv-reader rather than re-parsing; FK checks consider internal FKs only per ADR 0134 (external FKs are validated at aggregation). Markdown resources try the post-IA path (guides/, standards/) then fall back, returning a structured 'run sdd-cli sync' error when absent. v0.23.1 patches v0.23.0: `sdd-cli pack build` now populates source_commit + source_branch in the rendered BUNDLE_MANIFEST.yaml from `git rev-parse HEAD` / `git rev-parse --abbrev-ref HEAD` against the producer-repo working tree, matching sdd-method's build-method-baseline-bundle.sh provenance behaviour. Non-git producer dirs (CI artefact directories etc.) get the sentinel \"uncommitted\" so consumer-side parseManifest (which rejects empty source_commit) still accepts the bundle. Pre-v0.23.1 packs wrote empty strings and were unsyncable — discovered during the contextua-platform Phase 7 first-adopter pilot (ADR 0151) when operations-console refused the first build of contextua-app-context-pack@v0.1.0. v0.23.0 ships the adopter pack producer + consumer surface per sdd-method ADR 0151 (companion plan adopter-bundle-producer-model.md Phases 3a + 3b + 3c). New `pack` verb with build and validate subcommands lets platform-profile adopters (contextua-platform, CXS Connect) produce additive-layer bundles from a context-pack-seed.yaml declaration. The builder validates the seed against the canonical schema, resolves include: directives across files, expands managed_paths (literal + glob against the producer working tree), runs a producer-side leakage check (disjointness with the declared forward base + disjointness with declared forbidden_paths globs), stages the payload tree, emits SHA-256 checksums per managed file, renders BUNDLE_MANIFEST.yaml mirroring the .hbs template shape, and produces <pack-name>-v<semver>.tar.gz + sidecar .sha256. Consumer-side enforcement extends `sdd-cli sync` for the multi-bundle lock chain: requires_forward_base resolution verifies the consumer's lock carries a compatible forward base; requires_pack resolution enforces vertical-extension dependencies with full semver-range support (caret with pre-1.0 narrow per npm convention, tilde, exact pin, >=); the existing cross-bundle path-ownership check now functions for adopter pack names too (consumer-side leakage assertion); produced_by_adopter / scope / requires_forward_base / requires_pack carry from the manifest into the lock entry as additive optional fields preserving lock_version: 2. New `sdd-cli sync --config <path>` reads a multi-bundle method-baseline.config.yaml (ordered bundles[].source list) and iterates each through the single-bundle sync engine — mutually exclusive with --bundle. `sdd-cli list` surfaces adopter pack provenance: forward-base version in the repo line plus indented `+ <pack-name> <version> from <adopter-repo> [requires <base-pack>]` lines beneath; --verbose adds per-bundle managed_path counts; JSON format adds a per-repo bundles[] array carrying full provenance. Type relaxation: BundleManifest.bundleName and BundleEntry.name widened from the closed BundleName enum to string (adopter pack names are arbitrary per ADR 0151); the closed enum still applies to sdd-method forward bases, validated at parse time only when is_forward_base: true. BundleManifest parser migrated from line-by-line scalar regex to the existing yaml library dependency for nested requires_forward_base / requires_pack object parsing. v0.22.0 bundles three landed scopes. (a) ADR 0141 Phase 5 — `--agent-harness` flag on init/sync now accepts `github-copilot-cli` as the second reference implementation alongside the `claude-code` default; Copilot CLI sync writes `.github/hooks/{pre-tool-use,session-start}.json` with the same sentinel-based ownership pattern as the Claude Code `.claude/settings.json` block. Default changes from \"unset\" to `claude-code`; existing adopters on v0.12.2+ get sentinel-tagged-in-place via the dedupe pre-pass. Unknown harness values fail loudly instead of warning. (b) ADR 0148 Phase 4 — init and sync now emit `agent-instructions.md` at the SDD root (harness-neutral, fully method-managed, unconditional overwrite) plus a thin harness wrapper (`CLAUDE.md` under claude-code, `AGENTS.md` under github-copilot-cli) with `<!-- method-managed: begin/end -->` markers; adopter content around the marker block survives sync via the existing `writeMarkedBlockFile` machinery. The v0.3–v0.21 `generate-claude-md` verb + native rich-content renderer retire; the new `generate-briefing` verb regenerates both files from the on-disk templates for the no-bundle-sync case. Older bundles pre-dating ADR 0148 templates sync gracefully with a \"Skipped\" log line. Existing repos carrying a hand-rolled CLAUDE.md without markers will see the wrapper rewrite refused on first sync; pass --allow-overwrite after rehoming any custom content (covered in the upstream agent-instructions-migration-guide). (c) Catalogue schema 2.9.0 (lockstep with sdd-method v0.10.0 reverse-extension-baseline v0.9.0) carrying the Track 2 cohort-sweep field additions per content/plans/v0-9-0-cohort-sweep-derived-bundle.md: capabilities now carries data_subset (foundational/synthesis-tier keying axis) + slice_scope (multi-app-group capability slicing — same capability_id may appear with distinct slice_scope values, row identity becomes (id, slice_scope)); new per-feature edge catalogue feature_subscription_channels built from reverse-evidence/feature-grounding-evidence.yaml subscription_channels: entries (AppSync WebSocket / Pekko WS / MQTT / SSE channel layer, peer of graphql_operations: per resolved §1, kebab name + transport + evidence + optional payload_ref); new per-SDD edge catalogue product_platform_dependencies built from the product-scoped platform_dependencies: block in the same evidence file; new federated edge catalogue cross_sdd_platform_capability derived by the aggregator joining product_platform_dependencies × capability_service on target_service_id == service_id, emitting one row per resolved (consuming-product, platform-capability) pair with orphan findings for unresolved references. SCHEMA_COMPAT unchanged (still ^2.0.0); additive minor across both new catalogues and capability column additions. v0.21.0 ships catalogue schema 2.8.0 closing the long-tail contract-consumer mapping gap (K-03a). The contracts builder now also walks the platform-profile layout `docs/domains/<dom>/contracts/{openapi,proto,avro}/<file>.<ext>` documented in reverse/workflows/contract.md, in addition to the canonical `contracts/<subdir>/<dom>/<file>.<ext>` layout — backward-compatible additive change for federated SDDs that don't carry per-domain contracts. Adds a new buildServiceContractConsumes builder that parses each service's `repos/<service>/docs/service-architecture.md` External Interfaces table, reads Outbound rows, and emits `service_contract` rows with role=consumes via an adopter-supplied `.sdd/service-contract-aliases.yaml` (case-insensitive interface_aliases + interface_contains substring tier + same_product_inference templates with `{prefix}` substitution). Schema 2.8.0 marks service_contract.contract_id as external:true so federated SDDs can emit consumes rows pointing to platform-root contracts; aggregator validates the merged catalogue. Resolution failures become convention findings, not FK-invalid rows. Pattern documented in sdd-method ADR 0147. SCHEMA_COMPAT unchanged (still ^2.0.0). v0.19.0 ships catalogue schema 2.6.0 (lockstep with sdd-method): adds optional `sub_integrations:` array on integration-manifest.yaml per ADR 0144. Multi-provider integration monoliths (modernisation-in-flight or intentional permanent gateways brokering N providers) can declare each provider; the integrations.ts builder emits one integrations.csv row per sub_integration with parent_product_id = umbrella SDD's integrationId. Uses the existing parent_product_id column — no new schema columns. Backward compatible (optional field); SDDs without sub_integrations emit identical output to pre-2.6.0. Originating motivation: connect's sdd-camera-platform-legacy covering Surfsight v2 + VisionTrack v1/v2 + SureCam in one Spring-Boot codebase. SCHEMA_COMPAT unchanged (still ^2.0.0). v0.18.0 ships catalogue schema 2.5.0 (lockstep with sdd-method): adds feature-grounding source per ADR 0143. Canonical builder walks `docs/domains/<dom>/design/<capability>/feature-grounding.md` (platform-profile) and `docs/design/integration/feature-grounding.md` (integration-product), parses the markdown table form, and emits features.csv rows (source: feature-grounding, capability-owned) plus capability_feature / feature_repo / feature_service edges derived from the table columns. Optional per-SDD `.sdd/feature-grounding-aliases.yaml` translates display names (class names, file basenames) to canonical service / repo ids. SCHEMA_COMPAT unchanged (still ^2.0.0). v0.17.0 enables multi-level federation: organisation-level SDDs can now aggregate from organisation-level children (e.g. CXS aggregating sdd-mining, sdd-latam) via optional level: organisation field on siblings, skipping manifest requirements for pure orchestration repos. v0.16.0 adds organisation-profile support for system-of-systems aggregators (e.g. CXS aggregating sdd-connect, sdd-mining, sdd-latam), closing the gap for organisation-level SDD manifests. v0.15.0 ships catalogue schema 2.4.0 (lockstep with sdd-method): adds feature_contract derived edge (forward: capability_feature ⋈ capability_contract; reverse: feature_service ⋈ service_contract) closing the Capability → Feature → Contract chain pre-implementation, plus the new DomainModel entity per ADR 0142 with domain_models / capability_domain_model / feature_domain_model catalogues sourced from a new traceability.domain_model manifest field (forward) or docs/domains/*/architecture/data-model.mermaid.md file-system scan (reverse). Platform-profile only for domain_models; the metamodel now also documents non-catalogued method artefacts (work orders, discovery stories, execution stories, traceability manifests) so it's a complete reference for the forward SDD method's artefact set. SCHEMA_COMPAT unchanged (still ^2.0.0). v0.14.1 patches v0.14.0's domains-builder fix: products-builder now also clears domain_id for non-platform-profile rows even when manifest.domainId is declared. v0.14.0 stopped emitting umbrella domain rows but products.domain_id (and the applications.csv filtered view) still pointed at them, dangling at FK validation. Per ADR 0136 + schema description for products.domain_id, app/integration/support products do not have a primary domain — the builder now honours that statement regardless of manifest declaration, and emits an inferred finding when a manifest-declared value is overridden. v0.14.0 ships two post-v0.9.0-release fixes surfaced by the connect-cohort sync: (1) sync now enforces minimum_sdd_cli_version declared by bundle manifests — previously the orchestration check existed only in the shell sync script and was a no-op when adopters used `sdd-cli sync`, leaving the safety net for stale-CLI scenarios silently absent; (2) per ADR 0136 (App and Integration Products Do Not Belong to a Primary Domain), the domains.ts catalogue builder now skips row emission for non-platform-profile SDDs — application-product and integration-product SDDs that have a docs/domains/<umbrella>/ subdirectory as a structural-organisation convention no longer emit a member-declaration row that collides on PK at aggregation against the canonical platform-profile contribution. v0.13.2 fixed the aggregator's sibling-vendored-schema cross-check to use semver range satisfaction against SCHEMA_COMPAT.catalogue_schema (^2.0.0) instead of strict equality — siblings vendored at lower minor versions inside the same major are now accepted, unblocking aggregation across federated cohorts where the canonical schema is ahead of the bundled schema. v0.13.0 ships the feature-tree.md bullet parser per sdd-method schema 2.2.0 + plan extract-feature-tree-bullets.md: application-product builders now emit features.csv rows with source: \"feature-tree\" from per-app feature-tree.md bullets, populating the previously-empty edge catalogues (persona_feature, journey_feature) for portfolio monoliths whose feature inventory lives in the bullet form. Adds the optional runway column on features.csv with adopter-owned controlled-vocabulary validation via feature-runway-vocabulary.yaml at the SDD root. v0.12.2 dedupes equivalent unmarked adopter PreToolUse entries on settings.json upsert. v0.12.0 extends the integration profileType enum to 11 values (per sdd-method ADR 0137) and fixes the init→sync conflict. v0.11.0 shipped the canonical catalogue surface per ADR 0134 + schema 2.1.0.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sdd-method",
|
|
7
7
|
"sdd",
|