@sdd-method/sdd-cli 3.0.0 → 4.0.1
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/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/catalogue/aggregate.d.ts.map +1 -1
- package/dist/lib/catalogue/aggregate.js +2 -0
- package/dist/lib/catalogue/aggregate.js.map +1 -1
- package/dist/lib/catalogue/build.d.ts +3 -1
- package/dist/lib/catalogue/build.d.ts.map +1 -1
- package/dist/lib/catalogue/build.js +33 -2
- package/dist/lib/catalogue/build.js.map +1 -1
- package/dist/lib/catalogue/builders/adr-governs.d.ts +4 -0
- package/dist/lib/catalogue/builders/adr-governs.d.ts.map +1 -0
- package/dist/lib/catalogue/builders/adr-governs.js +39 -0
- package/dist/lib/catalogue/builders/adr-governs.js.map +1 -0
- package/dist/lib/catalogue/builders/adrs.d.ts +2 -0
- package/dist/lib/catalogue/builders/adrs.d.ts.map +1 -1
- package/dist/lib/catalogue/builders/adrs.js +11 -0
- package/dist/lib/catalogue/builders/adrs.js.map +1 -1
- package/dist/lib/catalogue/builders/contract-revisions.d.ts +12 -0
- package/dist/lib/catalogue/builders/contract-revisions.d.ts.map +1 -0
- package/dist/lib/catalogue/builders/contract-revisions.js +126 -0
- package/dist/lib/catalogue/builders/contract-revisions.js.map +1 -0
- package/dist/lib/catalogue/builders/data-model.d.ts +73 -0
- package/dist/lib/catalogue/builders/data-model.d.ts.map +1 -0
- package/dist/lib/catalogue/builders/data-model.js +316 -0
- package/dist/lib/catalogue/builders/data-model.js.map +1 -0
- package/dist/lib/catalogue/builders/entities-mermaid.d.ts.map +1 -1
- package/dist/lib/catalogue/builders/entities-mermaid.js +18 -85
- package/dist/lib/catalogue/builders/entities-mermaid.js.map +1 -1
- package/dist/lib/catalogue/builders/integration-components.js +49 -5
- package/dist/lib/catalogue/builders/integration-components.js.map +1 -1
- package/dist/lib/catalogue/builders/quality-scores.d.ts.map +1 -1
- package/dist/lib/catalogue/builders/quality-scores.js +17 -0
- package/dist/lib/catalogue/builders/quality-scores.js.map +1 -1
- package/dist/lib/catalogue/builders/requirements.d.ts +7 -1
- package/dist/lib/catalogue/builders/requirements.d.ts.map +1 -1
- package/dist/lib/catalogue/builders/requirements.js +132 -23
- package/dist/lib/catalogue/builders/requirements.js.map +1 -1
- package/dist/lib/catalogue/builders/user-journeys.d.ts.map +1 -1
- package/dist/lib/catalogue/builders/user-journeys.js +8 -13
- package/dist/lib/catalogue/builders/user-journeys.js.map +1 -1
- package/dist/lib/catalogue/canonical-schema.yaml +767 -17
- package/dist/lib/catalogue/retired-catalogues.d.ts +6 -0
- package/dist/lib/catalogue/retired-catalogues.d.ts.map +1 -0
- package/dist/lib/catalogue/retired-catalogues.js +25 -0
- package/dist/lib/catalogue/retired-catalogues.js.map +1 -0
- package/dist/lib/catalogue/rubric-coverage-map.yaml +90 -2
- package/dist/lib/catalogue/schema-compat.d.ts +1 -1
- package/dist/lib/catalogue/schema-compat.js +1 -1
- package/dist/lib/catalogue/schema-loader.d.ts +6 -0
- package/dist/lib/catalogue/schema-loader.d.ts.map +1 -1
- package/dist/lib/catalogue/schema-loader.js +3 -0
- package/dist/lib/catalogue/schema-loader.js.map +1 -1
- package/dist/lib/catalogue/staleness-verdicts.d.ts.map +1 -1
- package/dist/lib/catalogue/staleness-verdicts.js +75 -6
- package/dist/lib/catalogue/staleness-verdicts.js.map +1 -1
- package/dist/lib/metamodel/roundtrip-gate.d.ts.map +1 -1
- package/dist/lib/metamodel/roundtrip-gate.js +3 -0
- package/dist/lib/metamodel/roundtrip-gate.js.map +1 -1
- package/dist/lib/metamodel/schema-projection.d.ts +6 -0
- package/dist/lib/metamodel/schema-projection.d.ts.map +1 -1
- package/dist/lib/metamodel/schema-projection.js +27 -1
- package/dist/lib/metamodel/schema-projection.js.map +1 -1
- package/dist/lib/structure/apply.d.ts +8 -0
- package/dist/lib/structure/apply.d.ts.map +1 -0
- package/dist/lib/structure/apply.js +71 -0
- package/dist/lib/structure/apply.js.map +1 -0
- package/dist/lib/structure/archive.d.ts +21 -0
- package/dist/lib/structure/archive.d.ts.map +1 -0
- package/dist/lib/structure/archive.js +318 -0
- package/dist/lib/structure/archive.js.map +1 -0
- package/dist/lib/structure/catalogue.d.ts +33 -0
- package/dist/lib/structure/catalogue.d.ts.map +1 -0
- package/dist/lib/structure/catalogue.js +183 -0
- package/dist/lib/structure/catalogue.js.map +1 -0
- package/dist/lib/structure/compose.d.ts +30 -0
- package/dist/lib/structure/compose.d.ts.map +1 -0
- package/dist/lib/structure/compose.js +174 -0
- package/dist/lib/structure/compose.js.map +1 -0
- package/dist/lib/structure/effects.d.ts +16 -0
- package/dist/lib/structure/effects.d.ts.map +1 -0
- package/dist/lib/structure/effects.js +36 -0
- package/dist/lib/structure/effects.js.map +1 -0
- package/dist/lib/structure/extract.d.ts +19 -0
- package/dist/lib/structure/extract.d.ts.map +1 -0
- package/dist/lib/structure/extract.js +123 -0
- package/dist/lib/structure/extract.js.map +1 -0
- package/dist/lib/structure/model.d.ts +57 -0
- package/dist/lib/structure/model.d.ts.map +1 -0
- package/dist/lib/structure/model.js +212 -0
- package/dist/lib/structure/model.js.map +1 -0
- package/dist/lib/structure/render.d.ts +11 -0
- package/dist/lib/structure/render.d.ts.map +1 -0
- package/dist/lib/structure/render.js +242 -0
- package/dist/lib/structure/render.js.map +1 -0
- package/dist/lib/structure/view.d.ts +36 -0
- package/dist/lib/structure/view.d.ts.map +1 -0
- package/dist/lib/structure/view.js +301 -0
- package/dist/lib/structure/view.js.map +1 -0
- package/dist/lib/validate/agreement-evidence.d.ts +8 -2
- package/dist/lib/validate/agreement-evidence.d.ts.map +1 -1
- package/dist/lib/validate/agreement-evidence.js +20 -8
- package/dist/lib/validate/agreement-evidence.js.map +1 -1
- package/dist/lib/validate/behaviour-store.d.ts +5 -0
- package/dist/lib/validate/behaviour-store.d.ts.map +1 -1
- package/dist/lib/validate/behaviour-store.js +54 -13
- package/dist/lib/validate/behaviour-store.js.map +1 -1
- package/dist/lib/validate/dispatch.d.ts.map +1 -1
- package/dist/lib/validate/dispatch.js +7 -0
- package/dist/lib/validate/dispatch.js.map +1 -1
- package/dist/lib/validate/journey-impact.d.ts +2 -0
- package/dist/lib/validate/journey-impact.d.ts.map +1 -1
- package/dist/lib/validate/journey-impact.js +17 -2
- package/dist/lib/validate/journey-impact.js.map +1 -1
- package/dist/lib/validate/structural-model.d.ts +11 -0
- package/dist/lib/validate/structural-model.d.ts.map +1 -0
- package/dist/lib/validate/structural-model.js +265 -0
- package/dist/lib/validate/structural-model.js.map +1 -0
- package/dist/maintain-version.json +2 -2
- package/dist/verbs/change.d.ts +3 -0
- package/dist/verbs/change.d.ts.map +1 -0
- package/dist/verbs/change.js +15 -0
- package/dist/verbs/change.js.map +1 -0
- package/dist/verbs/structure.d.ts +10 -0
- package/dist/verbs/structure.d.ts.map +1 -0
- package/dist/verbs/structure.js +124 -0
- package/dist/verbs/structure.js.map +1 -0
- package/dist/verify-version.json +2 -2
- package/package.json +1 -1
- package/scripts/author-version.json +2 -2
- package/scripts/build-persona-package.mjs +5 -0
- package/scripts/maintain-version.json +2 -2
- package/scripts/verify-version.json +2 -2
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
// structural-model: the structural model and each open change's structural artifact (M-ADR 0230 §4.3, §4.4, Proposed;
|
|
2
|
+
// docs/method/methods/guides/structural-model-format.md).
|
|
3
|
+
//
|
|
4
|
+
// The model (openspec/structure/<partition>.yaml), as the current view:
|
|
5
|
+
// files valid YAML, schema_version, a partition matching its file name and naming one this SDD has
|
|
6
|
+
// (a platform SDD: its domains and `platform`; an application or integration SDD: its sdd_id)
|
|
7
|
+
// elements a `structure` catalogue, its `structure` columns only, an id held once, required columns,
|
|
8
|
+
// value types and vocabularies (the catalogue metamodel's)
|
|
9
|
+
// references resolved in the view; into a catalogue of another class, against that catalogue as built
|
|
10
|
+
// hierarchies no cycle through a self-reference; natural keys unique; domain invariants naming their entity's own
|
|
11
|
+
// attributes and relationships
|
|
12
|
+
// views each generated view under docs/structure/ missing, stale (rendered from an earlier model) or edited by
|
|
13
|
+
// hand (its body no longer matches the digest in its header)
|
|
14
|
+
// Each open change (openspec/changes/<change>/structure/):
|
|
15
|
+
// artifact where the model exists, a change has partition deltas or none.yaml, never both
|
|
16
|
+
// deltas well formed; ADDED ids new; MODIFIED and REMOVED ids held by the delta's partition; a base
|
|
17
|
+
// revision for every element modified, removed or read, still the current one; a reference into an
|
|
18
|
+
// element another open change adds names that change in depends_on
|
|
19
|
+
// no-op contradicted by a behaviour delta for a feature the model does not hold; a structural delta
|
|
20
|
+
// must add that feature
|
|
21
|
+
// Composition (§4.5; lib/structure/compose.ts), with a change agreed when its agreement record says so:
|
|
22
|
+
// overlap two agreed changes writing one element or adding one id; a change overlapping an agreed one
|
|
23
|
+
// composed each change's view (with its dependency closure) and the intended view (every agreed change)
|
|
24
|
+
// validated on their own; what fails there and not in current is reported against the changes
|
|
25
|
+
// that write the elements it names
|
|
26
|
+
// reads a dependency withdrawn (record withdrawn or superseded, or neither open nor archived), an agreed
|
|
27
|
+
// change depending on one not agreed, a cycle of dependencies
|
|
28
|
+
// Archived changes (§4.6):
|
|
29
|
+
// archived a change archived with structural deltas and no effect record (a raw `openspec archive`): its
|
|
30
|
+
// structure is not applied, so its transition is not shipped
|
|
31
|
+
//
|
|
32
|
+
// Report only while M-ADR 0230 is Proposed (ENFORCED): every finding is a [WARN] and the check exits 0. Without
|
|
33
|
+
// openspec/structure/ and with no change carrying a structure/ directory it reports [N/A].
|
|
34
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
35
|
+
import { join } from "node:path";
|
|
36
|
+
import { parseDocument } from "yaml";
|
|
37
|
+
import { parseCatalogueCsv } from "../catalogue/csv-reader.js";
|
|
38
|
+
import { loadCanonicalSchema } from "../catalogue/schema-loader.js";
|
|
39
|
+
import { APPLIED_FILE, elementKey, loadChangeStructure, loadModel, STRUCTURE_DIR } from "../structure/model.js";
|
|
40
|
+
import { agreedOrder, attribute, checkDependencies, checkOverlap, intended, viewAt } from "../structure/compose.js";
|
|
41
|
+
import { describeState, renderViews, VIEW_PATHS, viewState } from "../structure/render.js";
|
|
42
|
+
import { validateDeltas, validateView, viewOf } from "../structure/view.js";
|
|
43
|
+
const VIEW_COUNT = Object.keys(VIEW_PATHS).length;
|
|
44
|
+
/** Flipped when M-ADR 0230 is accepted: findings then FAIL. */
|
|
45
|
+
export const ENFORCED = false;
|
|
46
|
+
const CHANGES_DIR = join("openspec", "changes");
|
|
47
|
+
async function readText(p) {
|
|
48
|
+
try {
|
|
49
|
+
return await readFile(p, "utf8");
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function subdirs(p) {
|
|
56
|
+
try {
|
|
57
|
+
return (await readdir(p, { withFileTypes: true })).filter((e) => e.isDirectory()).map((e) => e.name).sort();
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** The change's agreement record status (docs/agreements/<change>.yaml), or `unrecorded`. */
|
|
64
|
+
async function agreementStatus(repo, change) {
|
|
65
|
+
const text = await readText(join(repo, "docs", "agreements", `${change}.yaml`));
|
|
66
|
+
if (text === null)
|
|
67
|
+
return "unrecorded";
|
|
68
|
+
try {
|
|
69
|
+
const status = String(parseDocument(text).toJS()?.agreement_record?.status ?? "");
|
|
70
|
+
return ["proposed", "agreed", "withdrawn", "superseded"].find((s) => s === status) ?? "unrecorded";
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return "unrecorded";
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/** Names of archived changes: openspec/changes/archive/<YYYY-MM-DD>-<name>. */
|
|
77
|
+
async function archivedNames(repo) {
|
|
78
|
+
return new Set((await subdirs(join(repo, CHANGES_DIR, "archive"))).map((d) => d.replace(/^\d{4}-\d{2}-\d{2}-/, "")));
|
|
79
|
+
}
|
|
80
|
+
function builtLookup(repo) {
|
|
81
|
+
const cache = new Map();
|
|
82
|
+
const fn = ((catalogue, column) => {
|
|
83
|
+
const rows = cache.get(catalogue);
|
|
84
|
+
if (rows === undefined || rows === null)
|
|
85
|
+
return null;
|
|
86
|
+
return new Set(rows.map((r) => r[column] ?? ""));
|
|
87
|
+
});
|
|
88
|
+
fn.load = async (catalogue) => {
|
|
89
|
+
if (cache.has(catalogue))
|
|
90
|
+
return;
|
|
91
|
+
const text = await readText(join(repo, "catalogues", `${catalogue}.csv`));
|
|
92
|
+
cache.set(catalogue, text === null ? null : parseCatalogueCsv(text).rows);
|
|
93
|
+
};
|
|
94
|
+
return fn;
|
|
95
|
+
}
|
|
96
|
+
export async function checkStructuralModel(repo, options = {}) {
|
|
97
|
+
const enforced = options.enforced ?? ENFORCED;
|
|
98
|
+
const problems = [];
|
|
99
|
+
const lines = [];
|
|
100
|
+
const files = await loadModel(repo, problems);
|
|
101
|
+
const changes = (await subdirs(join(repo, CHANGES_DIR))).filter((c) => c !== "archive");
|
|
102
|
+
const structures = [];
|
|
103
|
+
for (const c of changes)
|
|
104
|
+
structures.push(await loadChangeStructure(repo, c, problems));
|
|
105
|
+
if (files === null && !structures.some((s) => s.present)) {
|
|
106
|
+
return { exitCode: 0, stdout: `[N/A] structural-model: no structural model (${STRUCTURE_DIR}/) and no change with structural deltas in this repository\n` };
|
|
107
|
+
}
|
|
108
|
+
const schema = options.schema ?? (await loadCanonicalSchema());
|
|
109
|
+
// Partitions this SDD has.
|
|
110
|
+
const manifest = (await readText(join(repo, ".sdd", "sdd-manifest.yaml"))) ?? "";
|
|
111
|
+
let profile = "";
|
|
112
|
+
let sddId = "";
|
|
113
|
+
try {
|
|
114
|
+
const m = parseDocument(manifest).toJS();
|
|
115
|
+
profile = String(m?.profile ?? "");
|
|
116
|
+
sddId = String(m?.sdd_id ?? "");
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
// the manifest check reports an unparseable manifest
|
|
120
|
+
}
|
|
121
|
+
const view = viewOf(files ?? [], problems);
|
|
122
|
+
const built = builtLookup(repo);
|
|
123
|
+
for (const c of schema.catalogues)
|
|
124
|
+
if (c.sourceOfTruth !== "structure")
|
|
125
|
+
await built.load(c.name);
|
|
126
|
+
let allowed = null;
|
|
127
|
+
if (profile === "platform-profile") {
|
|
128
|
+
allowed = new Set(["platform", ...(view.get("domains")?.keys() ?? []), ...(built("domains", "id") ?? [])]);
|
|
129
|
+
}
|
|
130
|
+
else if (sddId !== "") {
|
|
131
|
+
allowed = new Set([sddId]);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
lines.push("partitions: not checked (no profile or sdd_id in .sdd/sdd-manifest.yaml)");
|
|
135
|
+
}
|
|
136
|
+
const checkPartition = (partition, file) => {
|
|
137
|
+
if (allowed !== null && !allowed.has(partition)) {
|
|
138
|
+
problems.push(`${file}: partition ${partition} is not one this SDD has (${profile === "platform-profile" ? "a domain id, or platform" : `its sdd_id, ${sddId}`})`);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
for (const f of files ?? [])
|
|
142
|
+
checkPartition(f.partition, f.file);
|
|
143
|
+
// The current view.
|
|
144
|
+
const unresolved = new Set();
|
|
145
|
+
const currentProblems = [];
|
|
146
|
+
validateView(schema, view, built, currentProblems, unresolved);
|
|
147
|
+
problems.push(...currentProblems);
|
|
148
|
+
const elementCount = [...view.values()].reduce((n, m) => n + m.size, 0);
|
|
149
|
+
lines.push(files === null ? `model: none (${STRUCTURE_DIR}/ absent)` : `model: ${files.length} partition file(s), ${elementCount} element(s) in ${view.size} catalogue(s)`);
|
|
150
|
+
if (unresolved.size > 0)
|
|
151
|
+
lines.push(`references into ${[...unresolved].sort().join(", ")}: unresolved (no built catalogue)`);
|
|
152
|
+
// The generated views, against a render of the current view. An SDD that has not rendered them yet (no
|
|
153
|
+
// docs/structure/) is adopting the model, which keeps its originals until the review is complete (§6 step 1).
|
|
154
|
+
if (files !== null && (await subdirs(join(repo, "docs"))).includes("structure")) {
|
|
155
|
+
let current = 0;
|
|
156
|
+
for (const [path, rendered] of renderViews(view)) {
|
|
157
|
+
const state = viewState(rendered, await readText(join(repo, path)));
|
|
158
|
+
if (state === "current")
|
|
159
|
+
current++;
|
|
160
|
+
else
|
|
161
|
+
problems.push(describeState(path, state));
|
|
162
|
+
}
|
|
163
|
+
lines.push(`generated views: ${current} of ${VIEW_COUNT} current`);
|
|
164
|
+
}
|
|
165
|
+
else if (files !== null) {
|
|
166
|
+
lines.push("generated views: not rendered (no docs/structure/); `sdd-cli structure render` writes them");
|
|
167
|
+
}
|
|
168
|
+
// Open changes.
|
|
169
|
+
const addedBy = new Map();
|
|
170
|
+
for (const s of structures)
|
|
171
|
+
for (const d of s.deltas)
|
|
172
|
+
for (const e of d.added)
|
|
173
|
+
addedBy.set(elementKey(e.catalogue, e.id), s.change);
|
|
174
|
+
const features = new Set(view.get("features")?.keys() ?? []);
|
|
175
|
+
let withDeltas = 0;
|
|
176
|
+
let noOps = 0;
|
|
177
|
+
let without = 0;
|
|
178
|
+
for (const s of structures) {
|
|
179
|
+
const dir = join(CHANGES_DIR, s.change);
|
|
180
|
+
for (const d of s.deltas)
|
|
181
|
+
checkPartition(d.partition, d.file);
|
|
182
|
+
if (s.deltas.length > 0)
|
|
183
|
+
withDeltas++;
|
|
184
|
+
if (s.noOp)
|
|
185
|
+
noOps++;
|
|
186
|
+
if (!s.present || (s.deltas.length === 0 && !s.noOp)) {
|
|
187
|
+
without++;
|
|
188
|
+
if (files !== null)
|
|
189
|
+
problems.push(`${dir}: no structural artifact; the model exists, so a change states its structural deltas or claims none (structure/none.yaml)`);
|
|
190
|
+
}
|
|
191
|
+
if (s.noOp && s.deltas.length > 0)
|
|
192
|
+
problems.push(`${s.noOp.file}: a no-op claim beside ${s.deltas.length} partition delta(s); state one or the other`);
|
|
193
|
+
const elsewhere = new Map([...addedBy].filter(([, c]) => c !== s.change));
|
|
194
|
+
validateDeltas(schema, view, s.deltas, elsewhere, problems);
|
|
195
|
+
// A behaviour delta for a feature the model does not hold needs that feature added here.
|
|
196
|
+
const adds = new Set(s.deltas.flatMap((d) => d.added.filter((e) => e.catalogue === "features").map((e) => e.id)));
|
|
197
|
+
for (const feature of await subdirs(join(repo, dir, "specs"))) {
|
|
198
|
+
if (features.has(feature) || adds.has(feature))
|
|
199
|
+
continue;
|
|
200
|
+
if (files === null && features.size === 0 && !s.present)
|
|
201
|
+
continue;
|
|
202
|
+
if (s.noOp)
|
|
203
|
+
problems.push(`${s.noOp.file}: claims no structural effect, and the change's behaviour deltas create a living spec for ${feature}, a feature the model does not hold`);
|
|
204
|
+
else
|
|
205
|
+
problems.push(`${dir}: a behaviour delta for ${feature}, a feature the model does not hold, and no structural delta adds features/${feature}`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
lines.push(`changes: ${changes.length} open, ${withDeltas} with structural deltas, ${noOps} claiming none, ${without} without the artifact`);
|
|
209
|
+
// Composition (M-ADR 0230 §4.5): the three views and the three checks.
|
|
210
|
+
const open = new Map();
|
|
211
|
+
for (const s of structures)
|
|
212
|
+
open.set(s.change, { structure: s, status: await agreementStatus(repo, s.change) });
|
|
213
|
+
const archived = await archivedNames(repo);
|
|
214
|
+
checkOverlap(open, problems);
|
|
215
|
+
checkDependencies(open, archived, problems);
|
|
216
|
+
const known = new Set(currentProblems);
|
|
217
|
+
const atAgreed = new Set();
|
|
218
|
+
for (const [name, oc] of open) {
|
|
219
|
+
if (oc.structure.deltas.length === 0)
|
|
220
|
+
continue;
|
|
221
|
+
const at = [];
|
|
222
|
+
validateView(schema, viewAt(view, name, open), built, at, new Set());
|
|
223
|
+
for (const p of at) {
|
|
224
|
+
if (known.has(p))
|
|
225
|
+
continue;
|
|
226
|
+
problems.push(`at ${name}: ${p}`);
|
|
227
|
+
if (oc.status === "agreed")
|
|
228
|
+
atAgreed.add(p);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
const agreed = agreedOrder(open);
|
|
232
|
+
if (agreed.length > 0) {
|
|
233
|
+
const inIntended = [];
|
|
234
|
+
validateView(schema, intended(view, open), built, inIntended, new Set());
|
|
235
|
+
for (const p of inIntended) {
|
|
236
|
+
if (known.has(p) || atAgreed.has(p))
|
|
237
|
+
continue;
|
|
238
|
+
const by = attribute(p, open, agreed);
|
|
239
|
+
problems.push(`in the intended view, from ${by.length > 0 ? by.join(" with ") : "the agreed changes together"}: ${p}`);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// An archived change with structural deltas and no effect record: archived by a raw `openspec archive`, so its
|
|
243
|
+
// behaviour moved and its structure did not. Its structural transition is not shipped (§4.6).
|
|
244
|
+
let raw = 0;
|
|
245
|
+
for (const dir of await subdirs(join(repo, CHANGES_DIR, "archive"))) {
|
|
246
|
+
const ap = [];
|
|
247
|
+
const s = await loadChangeStructure(repo, join("archive", dir), ap);
|
|
248
|
+
if (s.deltas.length === 0)
|
|
249
|
+
continue;
|
|
250
|
+
if ((await readText(join(repo, CHANGES_DIR, "archive", dir, "structure", APPLIED_FILE))) !== null)
|
|
251
|
+
continue;
|
|
252
|
+
raw++;
|
|
253
|
+
problems.push(`${join(CHANGES_DIR, "archive", dir)}: archived with structural deltas and no effect record (structure/${APPLIED_FILE}), as a raw \`openspec archive\` leaves it; its structure is not applied, so the transition is not shipped. Run \`sdd-cli change archive ${dir.replace(/^\d{4}-\d{2}-\d{2}-/, "")}\` to apply it, guarded by its base revisions`);
|
|
254
|
+
}
|
|
255
|
+
if (raw > 0)
|
|
256
|
+
lines.push(`archived changes whose structure is not applied: ${raw}`);
|
|
257
|
+
lines.push(`views: current; at each of ${[...open.values()].filter((o) => o.structure.deltas.length > 0).length} change(s) with deltas; intended from ${agreed.length} agreed change(s)`);
|
|
258
|
+
const body = lines.map((l) => `${l}\n`).join("");
|
|
259
|
+
if (problems.length === 0)
|
|
260
|
+
return { exitCode: 0, stdout: `structural-model:\n${body}[PASS] structural-model: ok\n` };
|
|
261
|
+
const tag = enforced ? "FAIL" : "WARN";
|
|
262
|
+
const tail = enforced ? `[FAIL] structural-model: ${problems.length} finding(s)\n` : `[WARN] structural-model: ${problems.length} finding(s), report only (M-ADR 0230, Proposed)\n`;
|
|
263
|
+
return { exitCode: enforced ? 1 : 0, stdout: `structural-model:\n${body}${problems.map((p) => `[${tag}] ${p}\n`).join("")}${tail}` };
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=structural-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structural-model.js","sourceRoot":"","sources":["../../../src/lib/validate/structural-model.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,0DAA0D;AAC1D,EAAE;AACF,wEAAwE;AACxE,2GAA2G;AAC3G,4GAA4G;AAC5G,0GAA0G;AAC1G,yEAAyE;AACzE,yGAAyG;AACzG,oHAAoH;AACpH,6CAA6C;AAC7C,uHAAuH;AACvH,2EAA2E;AAC3E,2DAA2D;AAC3D,+FAA+F;AAC/F,2GAA2G;AAC3G,iHAAiH;AACjH,iFAAiF;AACjF,4GAA4G;AAC5G,sCAAsC;AACtC,wGAAwG;AACxG,4GAA4G;AAC5G,6GAA6G;AAC7G,4GAA4G;AAC5G,iDAAiD;AACjD,iHAAiH;AACjH,4EAA4E;AAC5E,2BAA2B;AAC3B,8GAA8G;AAC9G,2EAA2E;AAC3E,EAAE;AACF,gHAAgH;AAChH,2FAA2F;AAC3F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAwB,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,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M,EAAE,sBAAsB,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC;AACvI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../../src/verbs/change.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CASrD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { archiveChange } from "../lib/structure/archive.js";
|
|
2
|
+
// `change archive <change>`: the method's archive operation (M-ADR 0230 §4.6, Proposed). Behaviour and structure are
|
|
3
|
+
// prepared in a scratch worktree, validated as a whole, and published as one commit only if the store has not moved.
|
|
4
|
+
// Run it again after an interruption: it verifies an archive that already landed, and recovers a raw `openspec archive`.
|
|
5
|
+
export function registerChange(program) {
|
|
6
|
+
const change = program.command("change").description("Operate on a change in the behaviour store (M-ADR 0223, M-ADR 0230)");
|
|
7
|
+
change
|
|
8
|
+
.command("archive <change>")
|
|
9
|
+
.description("Archive a judged change: its behaviour and structure published as one guarded commit (M-ADR 0230 §4.6, Proposed)")
|
|
10
|
+
.option("--sdd-path <path>", "the SDD whose openspec/ is the store (default: the current directory)", ".")
|
|
11
|
+
.action(async (name, opts) => {
|
|
12
|
+
process.exitCode = await archiveChange({ sddPath: opts.sddPath, change: name, write: (s) => process.stdout.write(s) });
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=change.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change.js","sourceRoot":"","sources":["../../src/verbs/change.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,qHAAqH;AACrH,qHAAqH;AACrH,yHAAyH;AACzH,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,qEAAqE,CAAC,CAAC;IAC5H,MAAM;SACH,OAAO,CAAC,kBAAkB,CAAC;SAC3B,WAAW,CAAC,kHAAkH,CAAC;SAC/H,MAAM,CAAC,mBAAmB,EAAE,uEAAuE,EAAE,GAAG,CAAC;SACzG,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,IAAyB,EAAE,EAAE;QACxD,OAAO,CAAC,QAAQ,GAAG,MAAM,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACzH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
export declare function runStructureShow(sddPath: string, ref: string, write: (s: string) => void): Promise<number>;
|
|
3
|
+
export declare function runStructureRender(sddPath: string, options: {
|
|
4
|
+
check: boolean;
|
|
5
|
+
}, write: (s: string) => void): Promise<number>;
|
|
6
|
+
export declare function runMigrateStructure(sddPath: string, options: {
|
|
7
|
+
dryRun: boolean;
|
|
8
|
+
}, write: (s: string) => void): Promise<number>;
|
|
9
|
+
export declare function registerStructure(program: Command): void;
|
|
10
|
+
//# sourceMappingURL=structure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../src/verbs/structure.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASzC,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,MAAM,CAAC,CAwBjB;AAID,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,EAC3B,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,MAAM,CAAC,CAkCjB;AAID,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAepI;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4BxD"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { stringify } from "yaml";
|
|
4
|
+
import { extractStructure, writeExtraction } from "../lib/structure/extract.js";
|
|
5
|
+
import { elementKey, loadModel, STRUCTURE_DIR } from "../lib/structure/model.js";
|
|
6
|
+
import { describeState, renderViews, viewState } from "../lib/structure/render.js";
|
|
7
|
+
import { revisionOf, viewOf } from "../lib/structure/view.js";
|
|
8
|
+
// `structure show <catalogue>/<id>`: one element of the structural model and its revision, the value a change's
|
|
9
|
+
// `base:` records for it (M-ADR 0230 §4.4, Proposed). Read only.
|
|
10
|
+
export async function runStructureShow(sddPath, ref, write) {
|
|
11
|
+
const slash = ref.indexOf("/");
|
|
12
|
+
if (slash <= 0 || slash === ref.length - 1) {
|
|
13
|
+
write(`[FAIL] structure show: name an element as <catalogue>/<id>, not ${JSON.stringify(ref)}\n`);
|
|
14
|
+
return 2;
|
|
15
|
+
}
|
|
16
|
+
const catalogue = ref.slice(0, slash);
|
|
17
|
+
const id = ref.slice(slash + 1);
|
|
18
|
+
const problems = [];
|
|
19
|
+
const files = await loadModel(sddPath, problems);
|
|
20
|
+
if (files === null) {
|
|
21
|
+
write(`[FAIL] structure show: no structural model (${STRUCTURE_DIR}/) in ${sddPath}\n`);
|
|
22
|
+
return 1;
|
|
23
|
+
}
|
|
24
|
+
const e = viewOf(files, problems).get(catalogue)?.get(id);
|
|
25
|
+
if (!e) {
|
|
26
|
+
write(`[FAIL] structure show: the model holds no ${elementKey(catalogue, id)}\n`);
|
|
27
|
+
for (const p of problems)
|
|
28
|
+
write(` ${p}\n`);
|
|
29
|
+
return 1;
|
|
30
|
+
}
|
|
31
|
+
write(`# ${elementKey(catalogue, id)} in ${e.file} (partition ${e.partition})\n`);
|
|
32
|
+
write(`revision: ${revisionOf(e)}\n`);
|
|
33
|
+
write(stringify({ id: e.id, ...e.columns }));
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
// `structure render [--check]`: write the generated views of the current view (M-ADR 0230 §4.3, Proposed), or, with
|
|
37
|
+
// --check, write nothing and report each view that is missing, stale or edited by hand (exit 1 if any is).
|
|
38
|
+
export async function runStructureRender(sddPath, options, write) {
|
|
39
|
+
const problems = [];
|
|
40
|
+
const files = await loadModel(sddPath, problems);
|
|
41
|
+
if (files === null) {
|
|
42
|
+
write(`[FAIL] structure render: no structural model (${STRUCTURE_DIR}/) in ${sddPath}\n`);
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
45
|
+
const view = viewOf(files, problems);
|
|
46
|
+
if (problems.length > 0) {
|
|
47
|
+
write(`[FAIL] structure render: the model does not load cleanly; run \`sdd-cli validate --validator structural-model\`\n`);
|
|
48
|
+
for (const p of problems)
|
|
49
|
+
write(` ${p}\n`);
|
|
50
|
+
return 1;
|
|
51
|
+
}
|
|
52
|
+
let off = 0;
|
|
53
|
+
for (const [path, rendered] of renderViews(view)) {
|
|
54
|
+
const abs = join(sddPath, path);
|
|
55
|
+
const text = await readFile(abs, "utf8").catch(() => null);
|
|
56
|
+
const state = viewState(rendered, text);
|
|
57
|
+
if (options.check) {
|
|
58
|
+
if (state !== "current") {
|
|
59
|
+
off++;
|
|
60
|
+
write(`[WARN] ${describeState(path, state)}\n`);
|
|
61
|
+
}
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (state === "hand-edited")
|
|
65
|
+
write(`[WARN] ${describeState(path, state)}; the edit is overwritten\n`);
|
|
66
|
+
if (state !== "current") {
|
|
67
|
+
await mkdir(dirname(abs), { recursive: true });
|
|
68
|
+
await writeFile(abs, rendered, "utf8");
|
|
69
|
+
}
|
|
70
|
+
write(`${state === "current" ? "unchanged" : "wrote"} ${path}\n`);
|
|
71
|
+
}
|
|
72
|
+
if (options.check)
|
|
73
|
+
write(off === 0 ? "[PASS] structure render --check: every view is current\n" : `[FAIL] structure render --check: ${off} view(s) not current\n`);
|
|
74
|
+
return options.check && off > 0 ? 1 : 0;
|
|
75
|
+
}
|
|
76
|
+
// `migrate structure [--dry-run]`: extract an SDD's first structural model from its sources, with its report
|
|
77
|
+
// (M-ADR 0230 §6 step 1, Proposed). Refuses an SDD that has a model; writes no source file.
|
|
78
|
+
export async function runMigrateStructure(sddPath, options, write) {
|
|
79
|
+
const x = await extractStructure(sddPath);
|
|
80
|
+
if (x.refused !== null) {
|
|
81
|
+
write(`[FAIL] migrate structure: ${x.refused}\n`);
|
|
82
|
+
return 1;
|
|
83
|
+
}
|
|
84
|
+
const total = [...x.counts.values()].reduce((a, b) => a + b, 0);
|
|
85
|
+
write(`${options.dryRun ? "would extract" : "extracted"} ${total} element(s) in ${x.counts.size} catalogue(s), ${x.files.size} partition(s); ${x.loss.length + x.extraction.length} fact(s) the model could not carry\n`);
|
|
86
|
+
if (options.dryRun) {
|
|
87
|
+
write(x.report);
|
|
88
|
+
return 0;
|
|
89
|
+
}
|
|
90
|
+
for (const p of await writeExtraction(sddPath, x))
|
|
91
|
+
write(`wrote ${p}\n`);
|
|
92
|
+
write("[INFO] migrate structure: the model is now the record of structure, and the catalogue is built from it. Keep the original sources until it is reviewed against the code; removing openspec/structure/ withdraws it\n");
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
95
|
+
export function registerStructure(program) {
|
|
96
|
+
const migrate = program.commands.find((c) => c.name() === "migrate");
|
|
97
|
+
if (migrate) {
|
|
98
|
+
migrate
|
|
99
|
+
.command("structure")
|
|
100
|
+
.description("Extract the SDD's first structural model from its sources into openspec/structure/, with an extraction report; source files are untouched (M-ADR 0230, Proposed)")
|
|
101
|
+
.option("--sdd-path <path>", "the SDD (default: the current directory)", ".")
|
|
102
|
+
.option("--dry-run", "write nothing; print the report", false)
|
|
103
|
+
.action(async (opts) => {
|
|
104
|
+
process.exitCode = await runMigrateStructure(opts.sddPath, { dryRun: opts.dryRun }, (s) => process.stdout.write(s));
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
const structure = program.command("structure").description("Read the structural model, and write its generated views (M-ADR 0230, Proposed)");
|
|
108
|
+
structure
|
|
109
|
+
.command("show <element>")
|
|
110
|
+
.description("Print one element of the structural model, <catalogue>/<id>, with its revision")
|
|
111
|
+
.option("--sdd-path <path>", "the SDD (default: the current directory)", ".")
|
|
112
|
+
.action(async (element, opts) => {
|
|
113
|
+
process.exitCode = await runStructureShow(opts.sddPath, element, (s) => process.stdout.write(s));
|
|
114
|
+
});
|
|
115
|
+
structure
|
|
116
|
+
.command("render")
|
|
117
|
+
.description("Write the generated views of the structural model under docs/structure/; --check reports instead")
|
|
118
|
+
.option("--sdd-path <path>", "the SDD (default: the current directory)", ".")
|
|
119
|
+
.option("--check", "write nothing; report each view that is missing, stale or edited by hand", false)
|
|
120
|
+
.action(async (opts) => {
|
|
121
|
+
process.exitCode = await runStructureRender(opts.sddPath, { check: opts.check }, (s) => process.stdout.write(s));
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=structure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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C,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACnG,CAAC,CAAC,CAAC;IACL,SAAS;SACN,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,kGAAkG,CAAC;SAC/G,MAAM,CAAC,mBAAmB,EAAE,0CAA0C,EAAE,GAAG,CAAC;SAC5E,MAAM,CAAC,SAAS,EAAE,0EAA0E,EAAE,KAAK,CAAC;SACpG,MAAM,CAAC,KAAK,EAAE,IAAyC,EAAE,EAAE;QAC1D,OAAO,CAAC,QAAQ,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACnH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/verify-version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdd-method/sdd-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "The full SDD method CLI (sdd-cli): init, sync, validate, catalogue build and aggregate, scaffold, plan, pack build and every other method verb for spec-driven-development repositories. The verify-only, author and maintain personas ship as @sdd-method/verify-cli, @sdd-method/author-cli and @sdd-method/maintain-cli.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sdd-method",
|
|
@@ -44,6 +44,11 @@ const ADMIN_CANARIES = [
|
|
|
44
44
|
"verbs/metamodel.js",
|
|
45
45
|
"verbs/catalogue.js",
|
|
46
46
|
"lib/catalogue/migration-map.js",
|
|
47
|
+
// The archive operation and extraction (M-ADR 0230 §4.6, §6, Proposed) are sdd-cli's while the record is Proposed: no persona carries them.
|
|
48
|
+
"verbs/change.js",
|
|
49
|
+
"lib/structure/archive.js",
|
|
50
|
+
"lib/structure/apply.js",
|
|
51
|
+
"lib/structure/extract.js",
|
|
47
52
|
];
|
|
48
53
|
const AUTHOR_ONLY_MODULES = [
|
|
49
54
|
"verbs/conformance.js",
|