@sdd-method/sdd-cli 1.45.0 → 2.0.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.
Files changed (90) hide show
  1. package/README.md +0 -4
  2. package/dist/author-program.d.ts.map +1 -1
  3. package/dist/author-program.js +3 -0
  4. package/dist/author-program.js.map +1 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/lib/catalogue/build.d.ts.map +1 -1
  9. package/dist/lib/catalogue/build.js +13 -0
  10. package/dist/lib/catalogue/build.js.map +1 -1
  11. package/dist/lib/catalogue/builders/c4-entity-rollups.js +1 -1
  12. package/dist/lib/catalogue/builders/c4-entity-rollups.js.map +1 -1
  13. package/dist/lib/catalogue/builders/capabilities.d.ts.map +1 -1
  14. package/dist/lib/catalogue/builders/capabilities.js +4 -1
  15. package/dist/lib/catalogue/builders/capabilities.js.map +1 -1
  16. package/dist/lib/catalogue/builders/contracts.js +1 -1
  17. package/dist/lib/catalogue/builders/contracts.js.map +1 -1
  18. package/dist/lib/catalogue/builders/event-edges.js +1 -1
  19. package/dist/lib/catalogue/builders/event-edges.js.map +1 -1
  20. package/dist/lib/catalogue/builders/product-edges.d.ts.map +1 -1
  21. package/dist/lib/catalogue/builders/product-edges.js +3 -1
  22. package/dist/lib/catalogue/builders/product-edges.js.map +1 -1
  23. package/dist/lib/catalogue/builders/product-platform-dependencies.d.ts.map +1 -1
  24. package/dist/lib/catalogue/builders/product-platform-dependencies.js +16 -1
  25. package/dist/lib/catalogue/builders/product-platform-dependencies.js.map +1 -1
  26. package/dist/lib/catalogue/builders/requirements.d.ts +25 -0
  27. package/dist/lib/catalogue/builders/requirements.d.ts.map +1 -0
  28. package/dist/lib/catalogue/builders/requirements.js +240 -0
  29. package/dist/lib/catalogue/builders/requirements.js.map +1 -0
  30. package/dist/lib/catalogue/canonical-schema.yaml +160 -7
  31. package/dist/lib/catalogue/rubric-coverage-map.yaml +36 -0
  32. package/dist/lib/catalogue/schema-compat.d.ts +1 -1
  33. package/dist/lib/catalogue/schema-compat.js +1 -1
  34. package/dist/lib/ci-binding/index.d.ts.map +1 -1
  35. package/dist/lib/ci-binding/index.js +2 -0
  36. package/dist/lib/ci-binding/index.js.map +1 -1
  37. package/dist/lib/ci-binding/module.d.ts.map +1 -1
  38. package/dist/lib/ci-binding/module.js +17 -7
  39. package/dist/lib/ci-binding/module.js.map +1 -1
  40. package/dist/lib/init/app.js +3 -3
  41. package/dist/lib/init/app.js.map +1 -1
  42. package/dist/lib/init/ci-workflow.js +2 -0
  43. package/dist/lib/init/ci-workflow.js.map +1 -1
  44. package/dist/lib/init/platform.js +2 -2
  45. package/dist/lib/init/platform.js.map +1 -1
  46. package/dist/lib/sdd-index/repo-config.d.ts.map +1 -1
  47. package/dist/lib/sdd-index/repo-config.js +7 -2
  48. package/dist/lib/sdd-index/repo-config.js.map +1 -1
  49. package/dist/lib/sdd-index/types.d.ts +1 -1
  50. package/dist/lib/sync/config.d.ts +3 -1
  51. package/dist/lib/sync/config.d.ts.map +1 -1
  52. package/dist/lib/sync/config.js +8 -1
  53. package/dist/lib/sync/config.js.map +1 -1
  54. package/dist/lib/validate/behaviour-store.d.ts +31 -0
  55. package/dist/lib/validate/behaviour-store.d.ts.map +1 -0
  56. package/dist/lib/validate/behaviour-store.js +351 -0
  57. package/dist/lib/validate/behaviour-store.js.map +1 -0
  58. package/dist/lib/validate/dispatch.d.ts.map +1 -1
  59. package/dist/lib/validate/dispatch.js +18 -0
  60. package/dist/lib/validate/dispatch.js.map +1 -1
  61. package/dist/lib/validate/plan.d.ts.map +1 -1
  62. package/dist/lib/validate/plan.js +2 -0
  63. package/dist/lib/validate/plan.js.map +1 -1
  64. package/dist/lib/vocabulary/migrate.d.ts +23 -0
  65. package/dist/lib/vocabulary/migrate.d.ts.map +1 -0
  66. package/dist/lib/vocabulary/migrate.js +237 -0
  67. package/dist/lib/vocabulary/migrate.js.map +1 -0
  68. package/dist/lib/vocabulary/renames.d.ts +20 -0
  69. package/dist/lib/vocabulary/renames.d.ts.map +1 -0
  70. package/dist/lib/vocabulary/renames.js +40 -0
  71. package/dist/lib/vocabulary/renames.js.map +1 -0
  72. package/dist/lib/vocabulary/vocabulary-renames.yaml +76 -0
  73. package/dist/maintain-version.json +2 -2
  74. package/dist/verbs/migrate.d.ts +9 -0
  75. package/dist/verbs/migrate.d.ts.map +1 -0
  76. package/dist/verbs/migrate.js +32 -0
  77. package/dist/verbs/migrate.js.map +1 -0
  78. package/dist/verify-version.json +2 -2
  79. package/package.json +3 -5
  80. package/scripts/author-acceptance.mjs +3 -1
  81. package/scripts/author-version.json +2 -2
  82. package/scripts/build-persona-package.mjs +1 -2
  83. package/scripts/dagger-parity.sh +1 -1
  84. package/scripts/maintain-version.json +2 -2
  85. package/scripts/sync-vendored-script.sh +4 -1
  86. package/scripts/validate-app-dependencies.sh +30 -22
  87. package/scripts/validate-integration-docs.sh +1 -1
  88. package/scripts/verify-version.json +2 -2
  89. package/LICENSE +0 -201
  90. package/NOTICE +0 -17
@@ -22,6 +22,8 @@ const TITLES = {
22
22
  "yaml-parse": "Validate that tracked YAML parses",
23
23
  "gate-readiness": "Validate gate readiness",
24
24
  "bundle-coherence": "Report bundle coherence",
25
+ "behaviour-store": "Validate the behaviour store: agreement records, the pre-apply gate, stale requirements, verdicts",
26
+ "behaviour-store-openspec": "Validate the behaviour store with OpenSpec (strict)",
25
27
  // CI has no platform checkout, so this step runs the app-only checks; the met gate needs the platform beside it.
26
28
  "app-dependencies": "Validate app dependencies (app-only checks; no platform checkout in CI)",
27
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../src/lib/validate/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAerD,wEAAwE;AACxE,MAAM,MAAM,GAAqC;IAC/C,eAAe,EAAE,uBA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,cAAc;QACpB,IAAI,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,CAAC;QAC1D,QAAQ,EAAE,CAAC,MAAM;KAClB,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,WAAW,CAAC,IAAc;IACxC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface VocabularyRewrite {
2
+ readonly file: string;
3
+ readonly line: number;
4
+ readonly from: string;
5
+ readonly to: string;
6
+ readonly rule: string;
7
+ }
8
+ export interface VocabularyReport {
9
+ readonly file: string;
10
+ readonly line: number;
11
+ readonly text: string;
12
+ readonly reason: string;
13
+ }
14
+ export interface MigrateResult {
15
+ readonly rewrites: readonly VocabularyRewrite[];
16
+ readonly reported: readonly VocabularyReport[];
17
+ readonly filesScanned: number;
18
+ readonly filesChanged: number;
19
+ }
20
+ export declare function migrateVocabulary(sddPath: string, opts?: {
21
+ dryRun?: boolean;
22
+ }): Promise<MigrateResult>;
23
+ //# sourceMappingURL=migrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/lib/vocabulary/migrate.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC/C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAqKD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAwChH"}
@@ -0,0 +1,237 @@
1
+ /**
2
+ * `migrate vocabulary` (M-ADR 0222 §4.1; docs/method/foundations/vocabulary-renames.yaml): rewrite an SDD's
3
+ * OWN files from the former tool-read values to the new ones. Authored content, so the verb is the author's
4
+ * and the full CLI's, never maintain's (M-ADR 0218), and it is deterministic: a second run changes nothing.
5
+ *
6
+ * Scope: tracked files only, minus every lock-managed path (method and pack payload, which sync and pack
7
+ * cycles own), `.sdd/` and `catalogues/` (rebuilt by catalogue build). A value is rewritten only in a known
8
+ * position, never as a free-text word:
9
+ * - a spec `**Status:**` header (bold or the `> … Status:` prose form) detailed-pre-lock -> detailed
10
+ * - the spec-lifecycle ratchet baseline's `<status> :: <path>` keys detailed-pre-lock -> detailed
11
+ * - a YAML value of `required_stability`, `stability`, `template-stability`,
12
+ * `traceability.contracts.status`, and the same keys in Markdown examples locked -> stable
13
+ * - an agreement tag anywhere (`release-vMAJOR.MINOR-locked`) -> release-vMAJOR.MINOR-agreed
14
+ * - the key `lock_in_tag` -> agreement_tag
15
+ * - gate-registry `next_gate: lock-in` and the key `remediation_before_lock_in` -> agreement, remediation_before_agreement
16
+ * Reported, never rewritten: an adopter-named `x-<adopter>-stability` extension (the adopter's to rename, M-ADR 0222 §4.1),
17
+ * and `detailed-pre-lock` in a manifest's `capability.status` (a spec-authoring stage on the wrong axis, which
18
+ * the traceability check already reports; it is not translated, because the true lifecycle value is not a
19
+ * translation of the word).
20
+ */
21
+ import { execFile } from "node:child_process";
22
+ import { readFile, stat, writeFile } from "node:fs/promises";
23
+ import { join } from "node:path";
24
+ import { promisify } from "node:util";
25
+ import { isPair, isScalar, parseDocument, visit } from "yaml";
26
+ import { rename } from "./renames.js";
27
+ const execFileAsync = promisify(execFile);
28
+ const MAX_BYTES = 4 * 1024 * 1024;
29
+ const STABILITY_KEYS = new Set(["required_stability", "stability", "template-stability"]);
30
+ // MAJOR.MINOR as the method writes it, and any dotted version an adopter wrote (release-v1.0.1-locked).
31
+ const TAG_RE = /\brelease-v(?:\d+|X|MAJOR)(?:\.(?:\d+|X|MINOR|PATCH))+-locked\b/g;
32
+ function lineOf(text, offset) {
33
+ let n = 1;
34
+ for (let i = 0; i < offset && i < text.length; i++)
35
+ if (text.charCodeAt(i) === 10)
36
+ n++;
37
+ return n;
38
+ }
39
+ async function trackedFiles(sddPath) {
40
+ const { stdout } = await execFileAsync("git", ["-C", sddPath, "ls-files", "-z"], { maxBuffer: 64 * 1024 * 1024 });
41
+ return stdout.split("\0").filter((p) => p !== "");
42
+ }
43
+ async function managedPaths(sddPath) {
44
+ const out = new Set();
45
+ let text;
46
+ try {
47
+ text = await readFile(join(sddPath, "method-baseline.lock"), "utf8");
48
+ }
49
+ catch {
50
+ return out;
51
+ }
52
+ for (const line of text.split("\n")) {
53
+ const m = /^\s+-\s+[0-9a-f]{64}\s+(.+)$/.exec(line);
54
+ if (m)
55
+ out.add(m[1].trim());
56
+ }
57
+ return out;
58
+ }
59
+ /** Edits for text forms that are values wherever they appear: the agreement tag and the lock_in_tag key. */
60
+ function tokenEdits(text) {
61
+ const edits = [];
62
+ const tag = rename("agreement-tag");
63
+ for (const m of text.matchAll(TAG_RE)) {
64
+ const to = m[0].replace(/-locked$/, "-agreed");
65
+ edits.push({ start: m.index, end: m.index + m[0].length, text: to, rewrite: { from: m[0], to, rule: tag.id } });
66
+ }
67
+ const key = rename("agreement-tag-key");
68
+ for (const m of text.matchAll(new RegExp(`\\b${key.old}\\b`, "g"))) {
69
+ edits.push({ start: m.index, end: m.index + key.old.length, text: key.new, rewrite: { from: key.old, to: key.new, rule: key.id } });
70
+ }
71
+ return edits;
72
+ }
73
+ function markdownEdits(text) {
74
+ const edits = tokenEdits(text);
75
+ const status = rename("authoring-status-detailed");
76
+ const stab = rename("stability-stable");
77
+ const lines = text.split("\n");
78
+ let offset = 0;
79
+ for (const line of lines) {
80
+ const header = /^(\s*(?:[-*]\s+)?\*\*Status:\*\*\s*)(\S+)/.exec(line) ?? /^(>.*\bStatus:\s*)([^\s|]+)/.exec(line);
81
+ if (header && header[2] === status.old) {
82
+ const start = offset + header[1].length;
83
+ edits.push({ start, end: start + status.old.length, text: status.new, rewrite: { from: status.old, to: status.new, rule: status.id } });
84
+ }
85
+ // Stability values in Markdown examples (YAML blocks or prose quoting a key: value pair).
86
+ // Not after a hyphen or word character: `x-<adopter>-stability: locked` is the adopter's (M-ADR 0222 §4.1).
87
+ const stabRe = /(?<![\w-])(required_stability|stability|template-stability)(\s*:\s*["']?)locked\b/g;
88
+ for (const m of line.matchAll(stabRe)) {
89
+ const start = offset + m.index + m[1].length + m[2].length;
90
+ edits.push({ start, end: start + stab.old.length, text: stab.new, rewrite: { from: stab.old, to: stab.new, rule: stab.id } });
91
+ }
92
+ offset += line.length + 1;
93
+ }
94
+ return edits;
95
+ }
96
+ function baselineEdits(text) {
97
+ const status = rename("authoring-status-detailed");
98
+ const edits = [];
99
+ let offset = 0;
100
+ for (const line of text.split("\n")) {
101
+ if (line.startsWith(`${status.old} :: `)) {
102
+ edits.push({ start: offset, end: offset + status.old.length, text: status.new, rewrite: { from: status.old, to: status.new, rule: status.id } });
103
+ }
104
+ offset += line.length + 1;
105
+ }
106
+ return edits;
107
+ }
108
+ function pathKeys(path) {
109
+ const keys = [];
110
+ for (const n of path)
111
+ if (isPair(n) && isScalar(n.key))
112
+ keys.push(String(n.key.value));
113
+ return keys;
114
+ }
115
+ /** The scalar's own source text, so a quoted value keeps its quotes. */
116
+ function scalarEdit(text, node, from, to, rule) {
117
+ const r = node.range;
118
+ if (!r)
119
+ return undefined;
120
+ const src = text.slice(r[0], r[1]);
121
+ const at = src.indexOf(from);
122
+ if (at < 0)
123
+ return undefined;
124
+ return { start: r[0] + at, end: r[0] + at + from.length, text: to, rewrite: { from, to, rule } };
125
+ }
126
+ function yamlEdits(text, file, reported) {
127
+ const edits = tokenEdits(text);
128
+ let doc;
129
+ try {
130
+ doc = parseDocument(text);
131
+ }
132
+ catch {
133
+ return edits;
134
+ }
135
+ if (doc.errors.length > 0)
136
+ return edits;
137
+ const stab = rename("stability-stable");
138
+ const gate = rename("gate-registry-next-gate");
139
+ const remed = rename("gate-registry-remediation-key");
140
+ const status = rename("authoring-status-detailed");
141
+ visit(doc, {
142
+ Pair(_, pair, path) {
143
+ if (!isScalar(pair.key))
144
+ return;
145
+ const key = String(pair.key.value);
146
+ const val = isScalar(pair.value) ? pair.value : undefined;
147
+ const v = val ? String(val.value) : undefined;
148
+ const ancestors = pathKeys(path);
149
+ if (/^x-.+-stability$/.test(key)) {
150
+ reported.push({ file, line: lineOf(text, pair.key.range?.[0] ?? 0), text: `${key}: ${v ?? "…"}`, reason: "an adopter-named extension: the adopter's to rename; the method's value is `stable`" });
151
+ return;
152
+ }
153
+ if (val && v === stab.old && (STABILITY_KEYS.has(key) || (key === "status" && ancestors.slice(-2).join(".") === "traceability.contracts"))) {
154
+ const e = scalarEdit(text, val, stab.old, stab.new, stab.id);
155
+ if (e)
156
+ edits.push(e);
157
+ }
158
+ if (val && key === "next_gate" && v === gate.old) {
159
+ const e = scalarEdit(text, val, gate.old, gate.new, gate.id);
160
+ if (e)
161
+ edits.push(e);
162
+ }
163
+ if (key === remed.old) {
164
+ const e = scalarEdit(text, pair.key, remed.old, remed.new, remed.id);
165
+ if (e)
166
+ edits.push(e);
167
+ }
168
+ if (val && key === "status" && v === status.old && ancestors.slice(-1)[0] === "capability") {
169
+ reported.push({ file, line: lineOf(text, val.range?.[0] ?? 0), text: `capability.status: ${v}`, reason: "a spec-authoring stage on the lifecycle axis: re-author to the capability's true lifecycle phase; not translated" });
170
+ }
171
+ return undefined;
172
+ },
173
+ });
174
+ return edits;
175
+ }
176
+ function applyEdits(text, edits) {
177
+ const sorted = [...edits].sort((a, b) => b.start - a.start);
178
+ let out = text;
179
+ let lastStart = Number.POSITIVE_INFINITY;
180
+ for (const e of sorted) {
181
+ if (e.end > lastStart)
182
+ continue; // overlapping edits: keep the later one only
183
+ out = out.slice(0, e.start) + e.text + out.slice(e.end);
184
+ lastStart = e.start;
185
+ }
186
+ return out;
187
+ }
188
+ export async function migrateVocabulary(sddPath, opts = {}) {
189
+ const managed = await managedPaths(sddPath);
190
+ const files = (await trackedFiles(sddPath)).filter((f) => !managed.has(f) && !f.startsWith(".sdd/") && !f.startsWith("catalogues/") && !f.includes("node_modules/"));
191
+ const rewrites = [];
192
+ const reported = [];
193
+ let changed = 0;
194
+ for (const rel of files) {
195
+ const abs = join(sddPath, rel);
196
+ let st;
197
+ try {
198
+ st = await stat(abs);
199
+ }
200
+ catch {
201
+ continue;
202
+ }
203
+ if (!st.isFile() || st.size > MAX_BYTES)
204
+ continue;
205
+ const buf = await readFile(abs);
206
+ if (buf.includes(0))
207
+ continue;
208
+ const text = buf.toString("utf8");
209
+ let edits;
210
+ if (/\.ya?ml$/.test(rel))
211
+ edits = yamlEdits(text, rel, reported);
212
+ else if (rel.endsWith("spec-lifecycle-baseline.txt"))
213
+ edits = baselineEdits(text);
214
+ else if (/\.(md|hbs)$/.test(rel))
215
+ edits = markdownEdits(text);
216
+ else
217
+ edits = tokenEdits(text);
218
+ if (edits.length === 0)
219
+ continue;
220
+ const seen = new Set();
221
+ for (const e of edits.sort((a, b) => a.start - b.start)) {
222
+ const k = `${e.start}:${e.end}`;
223
+ if (seen.has(k))
224
+ continue;
225
+ seen.add(k);
226
+ rewrites.push({ file: rel, line: lineOf(text, e.start), ...e.rewrite });
227
+ }
228
+ const next = applyEdits(text, edits);
229
+ if (next !== text) {
230
+ changed++;
231
+ if (!opts.dryRun)
232
+ await writeFile(abs, next);
233
+ }
234
+ }
235
+ return { rewrites, reported, filesScanned: files.length, filesChanged: changed };
236
+ }
237
+ //# sourceMappingURL=migrate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../src/lib/vocabulary/migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAA0B,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AA+B1C,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAClC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,oBAAoB,EAAE,WAAW,EAAE,oBAAoB,CAAC,CAAC,CAAC;AAC1F,wGAAwG;AACxG,MAAM,MAAM,GAAG,kEAAkE,CAAC;AAElF,SAAS,MAAM,CAAC,IAAY,EAAE,MAAc;IAC1C,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,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AAI,CAAC,CAAC,GAAG,EAAE,CAAC;YAChC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;gBAAE,SAAS;YAC1B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACZ,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACrC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,IAAI,CAAC,IAAI,CAAC,MAAM;gBAAE,MAAM,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AACnF,CAAC"}
@@ -0,0 +1,20 @@
1
+ export interface VocabularyRename {
2
+ readonly id: string;
3
+ readonly old: string;
4
+ readonly new: string;
5
+ }
6
+ interface RenamesFile {
7
+ readonly introduced_in: string;
8
+ readonly removed_in: string;
9
+ readonly renames: readonly VocabularyRename[];
10
+ }
11
+ export declare const VENDORED_RENAMES_PATH: string;
12
+ export declare function vocabularyRenames(): RenamesFile;
13
+ /** The rename with this id; throws on an id the file does not hold, so a reader cannot silently lose its alias. */
14
+ export declare function rename(id: string): VocabularyRename;
15
+ /** The value as a reader should treat it: the new name for the former one, anything else unchanged. */
16
+ export declare function canonicalValue(id: string, value: string): string;
17
+ /** Whether a value is the former name under this rename (for the reader's finding). */
18
+ export declare function isFormerValue(id: string, value: string): boolean;
19
+ export {};
20
+ //# sourceMappingURL=renames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renames.d.ts","sourceRoot":"","sources":["../../../src/lib/vocabulary/renames.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,WAAW;IACnB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC/C;AAGD,eAAO,MAAM,qBAAqB,QAA6C,CAAC;AAIhF,wBAAgB,iBAAiB,IAAI,WAAW,CAM/C;AAED,mHAAmH;AACnH,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,CAInD;AAED,uGAAuG;AACvG,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED,uFAAuF;AACvF,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAEhE"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The method's vocabulary renames (M-ADR 0222 §4.1), loaded from the vendored copy of
3
+ * sdd-method's docs/method/foundations/vocabulary-renames.yaml (one-way, sdd-method ->
4
+ * vendored; scripts/sync-vendored-script.sh, drift-tested in tests/parity).
5
+ *
6
+ * For one major release every reader accepts a former value and reads it as the new one;
7
+ * from `removed_in` the former value is an error. Readers ask this module rather than
8
+ * keeping their own copy, so a rename has one definition here as it has one in the bundles.
9
+ */
10
+ import { readFileSync } from "node:fs";
11
+ import { dirname, join } from "node:path";
12
+ import { fileURLToPath } from "node:url";
13
+ import { parse } from "yaml";
14
+ const __dirname = dirname(fileURLToPath(import.meta.url));
15
+ export const VENDORED_RENAMES_PATH = join(__dirname, "vocabulary-renames.yaml");
16
+ let cached;
17
+ export function vocabularyRenames() {
18
+ if (cached === undefined) {
19
+ const doc = parse(readFileSync(VENDORED_RENAMES_PATH, "utf8"));
20
+ cached = { introduced_in: String(doc.introduced_in), removed_in: String(doc.removed_in), renames: doc.renames };
21
+ }
22
+ return cached;
23
+ }
24
+ /** The rename with this id; throws on an id the file does not hold, so a reader cannot silently lose its alias. */
25
+ export function rename(id) {
26
+ const r = vocabularyRenames().renames.find((x) => x.id === id);
27
+ if (r === undefined)
28
+ throw new Error(`vocabulary-renames.yaml has no rename "${id}"`);
29
+ return r;
30
+ }
31
+ /** The value as a reader should treat it: the new name for the former one, anything else unchanged. */
32
+ export function canonicalValue(id, value) {
33
+ const r = rename(id);
34
+ return value === r.old ? r.new : value;
35
+ }
36
+ /** Whether a value is the former name under this rename (for the reader's finding). */
37
+ export function isFormerValue(id, value) {
38
+ return value === rename(id).old;
39
+ }
40
+ //# sourceMappingURL=renames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renames.js","sourceRoot":"","sources":["../../../src/lib/vocabulary/renames.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAc7B,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;AAEhF,IAAI,MAA+B,CAAC;AAEpC,MAAM,UAAU,iBAAiB;IAC/B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAgB,CAAC;QAC9E,MAAM,GAAG,EAAE,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;IAClH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,mHAAmH;AACnH,MAAM,UAAU,MAAM,CAAC,EAAU;IAC/B,MAAM,CAAC,GAAG,iBAAiB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/D,IAAI,CAAC,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,EAAE,GAAG,CAAC,CAAC;IACtF,OAAO,CAAC,CAAC;AACX,CAAC;AAED,uGAAuG;AACvG,MAAM,UAAU,cAAc,CAAC,EAAU,EAAE,KAAa;IACtD,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IACrB,OAAO,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;AACzC,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,aAAa,CAAC,EAAU,EAAE,KAAa;IACrD,OAAO,KAAK,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC;AAClC,CAAC"}
@@ -0,0 +1,76 @@
1
+ # Vocabulary renames (M-ADR 0222 §4.1)
2
+ #
3
+ # The tool-read values the method renamed when "lock" left its vocabulary, as data:
4
+ # every reader that accepts a former value, and the migrate verb, follows this file.
5
+ # For one major release a reader accepts the former value, treats it as the new one
6
+ # and reports it; from removed_in the former value is an error.
7
+ #
8
+ # Each reader that aliases a former value marks the place with a comment line
9
+ # vocabulary-alias: <old> -> <new>
10
+ # and the correspondence registry holds the readers and this file to each other in
11
+ # both directions (orchestration/correspondence-registry.yaml, vocabulary-renames).
12
+ #
13
+ # Consumed by:
14
+ # - validate-spec-lifecycle.sh, validate-traceability.sh, validate-app-dependencies.sh,
15
+ # dispatch-release.sh (the bundled readers)
16
+ # - sdd-cli's catalogue build and repo-config reader
17
+ # - `sdd-cli migrate vocabulary` (rewrites an SDD's own files)
18
+ #
19
+ # Distribution: ships in every method baseline via the seed-file lists.
20
+
21
+ schema_version: "1.0.0"
22
+ introduced_in: "2.0.0" # the sdd-cli major that reads both names
23
+ removed_in: "3.0.0" # the sdd-cli major that rejects the former names
24
+
25
+ renames:
26
+ - id: authoring-status-detailed
27
+ old: detailed-pre-lock
28
+ new: detailed
29
+ positions:
30
+ - "spec `**Status:**` header (M-ADR 0201's authoring ladder)"
31
+ - "work-order status"
32
+ - "capability manifest `capability.status` (a spec-authoring stage on the wrong axis; reported, never translated)"
33
+
34
+ - id: stability-stable
35
+ old: locked
36
+ new: stable
37
+ positions:
38
+ - "`required_stability` (app and integration platform dependencies)"
39
+ - "`traceability.contracts.status` (the contract-set maturity ladder)"
40
+ - "repository config `stability` (a stability class)"
41
+ - "runtime-artefact `stability` and `template-stability`"
42
+ note: "Only where `locked` is a stability CLASS. A pinned version is a different thing (M-ADR 0222 §4.1)."
43
+
44
+ - id: agreement-tag
45
+ old: release-vMAJOR.MINOR-locked
46
+ new: release-vMAJOR.MINOR-agreed
47
+ positions:
48
+ - "the agreement tag on a release branch (M-ADRs 0072-0074)"
49
+
50
+ - id: agreement-tag-key
51
+ old: lock_in_tag
52
+ new: agreement_tag
53
+ positions:
54
+ - "a platform BASELINE.md record key (M-ADR 0073)"
55
+
56
+ - id: gate-registry-next-gate
57
+ old: lock-in
58
+ new: agreement
59
+ positions:
60
+ - "gate registry `next_gate` value (domain-architecture rubric)"
61
+
62
+ - id: gate-registry-remediation-key
63
+ old: remediation_before_lock_in
64
+ new: remediation_before_agreement
65
+ positions:
66
+ - "gate registry key (domain-architecture rubric)"
67
+
68
+ - id: journey-status-accepted
69
+ old: accepted-pre-lock
70
+ new: accepted
71
+ positions:
72
+ - "user-journey status (templates only; no reader)"
73
+
74
+ # An extension an adopter names itself (an `x-<adopter>-stability` contract extension,
75
+ # say) is the adopter's to rename; its values follow the method's (M-ADR 0222 §4.1). The migrate verb
76
+ # reports such extensions and never rewrites them.
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "0.4.0",
3
- "built_against_sdd_cli": "1.45.0"
2
+ "version": "0.6.0",
3
+ "built_against_sdd_cli": "2.0.0"
4
4
  }
@@ -0,0 +1,9 @@
1
+ import type { Command } from "commander";
2
+ /**
3
+ * `migrate vocabulary` (M-ADR 0222 §4.1): rewrite the SDD's own files from the former tool-read values to the
4
+ * new ones, in known positions only, and report what it must not rewrite. Authored content, so the verb is the
5
+ * author's and the full CLI's (M-ADR 0218). Exit 0 when nothing is left to migrate, 1 when it rewrote values
6
+ * (or, with --dry-run, found values it would rewrite), so a wave can gate on "migrated".
7
+ */
8
+ export declare function registerMigrate(program: Command): void;
9
+ //# sourceMappingURL=migrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/verbs/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASzC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuBtD"}
@@ -0,0 +1,32 @@
1
+ import { resolve } from "node:path";
2
+ import { migrateVocabulary } from "../lib/vocabulary/migrate.js";
3
+ /**
4
+ * `migrate vocabulary` (M-ADR 0222 §4.1): rewrite the SDD's own files from the former tool-read values to the
5
+ * new ones, in known positions only, and report what it must not rewrite. Authored content, so the verb is the
6
+ * author's and the full CLI's (M-ADR 0218). Exit 0 when nothing is left to migrate, 1 when it rewrote values
7
+ * (or, with --dry-run, found values it would rewrite), so a wave can gate on "migrated".
8
+ */
9
+ export function registerMigrate(program) {
10
+ const migrate = program.command("migrate").description("Migrate an SDD's own files to the method's current vocabulary");
11
+ migrate
12
+ .command("vocabulary")
13
+ .description("Rewrite the SDD's own files from the former tool-read values (detailed-pre-lock, stability locked, release-vX.X-locked, lock_in_tag, next_gate lock-in, remediation_before_lock_in) to the new ones, in known positions only; method- and pack-managed files, .sdd/ and catalogues/ are untouched (exit 1 when anything was or would be rewritten)")
14
+ .option("--sdd-path <path>", "Path to the SDD repo root (defaults to cwd)")
15
+ .option("--dry-run", "List what would be rewritten; write nothing")
16
+ .action(async (opts) => {
17
+ const root = resolve(opts.sddPath ?? process.cwd());
18
+ const r = await migrateVocabulary(root, { dryRun: opts.dryRun === true });
19
+ const w = (s) => process.stdout.write(s);
20
+ for (const x of r.rewrites)
21
+ w(` ${opts.dryRun ? "would rewrite" : "rewrote"} ${x.file}:${x.line} ${x.from} -> ${x.to} (${x.rule})\n`);
22
+ for (const x of r.reported)
23
+ w(` reported ${x.file}:${x.line} ${x.text} — ${x.reason}\n`);
24
+ const verb = opts.dryRun ? "would rewrite" : "rewrote";
25
+ w(r.rewrites.length === 0
26
+ ? `[PASS] migrate vocabulary: nothing to migrate in ${r.filesScanned} file(s) the SDD owns${r.reported.length ? `; ${r.reported.length} reported for the adopter` : ""}\n`
27
+ : `[INFO] migrate vocabulary: ${verb} ${r.rewrites.length} value(s) in ${r.filesChanged} file(s) of ${r.filesScanned}${r.reported.length ? `; ${r.reported.length} reported for the adopter` : ""}\n`);
28
+ if (r.rewrites.length > 0)
29
+ process.exit(1);
30
+ });
31
+ }
32
+ //# sourceMappingURL=migrate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/verbs/migrate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAOjE;;;;;GAKG;AACH,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QACvD,CAAC,CACC,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;YACrB,CAAC,CAAC,oDAAoD,CAAC,CAAC,YAAY,wBAAwB,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,2BAA2B,CAAC,CAAC,CAAC,EAAE,IAAI;YAC1K,CAAC,CAAC,8BAA8B,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,gBAAgB,CAAC,CAAC,YAAY,eAAe,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,2BAA2B,CAAC,CAAC,CAAC,EAAE,IAAI,CACxM,CAAC;QACF,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "1.4.0",
3
- "built_against_sdd_cli": "1.45.0"
2
+ "version": "2.0.0",
3
+ "built_against_sdd_cli": "2.0.0"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdd-method/sdd-cli",
3
- "version": "1.45.0",
3
+ "version": "2.0.0",
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",
@@ -8,7 +8,7 @@
8
8
  "spec-driven-development",
9
9
  "cli"
10
10
  ],
11
- "license": "Apache-2.0",
11
+ "license": "UNLICENSED",
12
12
  "author": "Tom Foster",
13
13
  "type": "module",
14
14
  "bin": {
@@ -22,9 +22,7 @@
22
22
  "files": [
23
23
  "dist",
24
24
  "scripts",
25
- "README.md",
26
- "LICENSE",
27
- "NOTICE"
25
+ "README.md"
28
26
  ],
29
27
  "scripts": {
30
28
  "build": "tsc && node scripts/copy-yaml-assets.mjs",
@@ -139,6 +139,8 @@ for (const repo of REPOS) {
139
139
  check(`contracts attest @${name}`, repo, () => ["contracts", "attest", "--target-repo", ".", "--refresh"]);
140
140
  check(`conformance @${name}`, repo, (_c, ws) => ["conformance", "--target-repo", ".", "--emit-finding", join(ws, "findings")]);
141
141
  check(`api-surface @${name}`, repo, (_c, ws) => ["api-surface", "--source", ".", "--out", join(ws, "surface.yaml")]);
142
+ // Rewrites the SDD's own files to the current vocabulary: must never touch a maintain-only path (the lock, managed payload).
143
+ check(`migrate vocabulary @${name}`, repo, () => ["migrate", "vocabulary", "--sdd-path", "."]);
142
144
  const screens = join(repo, "screens");
143
145
  if (existsSync(screens)) {
144
146
  const spec = readdirSync(screens).find((f) => f.endsWith(".md"));
@@ -161,7 +163,7 @@ for (const repo of REPOS) {
161
163
  void kind;
162
164
  }
163
165
 
164
- const SURFACE = ["catalogue check", "generate-briefing", "scaffold domain", "plan", "contracts attest", "conformance", "api-surface", "render screen", "context pull",
166
+ const SURFACE = ["catalogue check", "generate-briefing", "scaffold domain", "plan", "contracts attest", "conformance", "api-surface", "render screen", "context pull", "migrate vocabulary",
165
167
  "snapshot fold", "snapshot land", "snapshot verify", "snapshot diff", "snapshot targets", "snapshot advance"];
166
168
  const missing = SURFACE.filter((v) => !exercised.has(v));
167
169
  process.stdout.write(`COVERAGE exercised: ${[...exercised].join(", ")}\n`);
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "0.3.0",
3
- "built_against_sdd_cli": "1.45.0"
2
+ "version": "0.5.0",
3
+ "built_against_sdd_cli": "2.0.0"
4
4
  }
@@ -278,7 +278,6 @@ for (const p of bundled) {
278
278
  await mkdir(join(OUT, "scripts"), { recursive: true });
279
279
  await cp(p, join(OUT, "scripts", relative(join(ROOT, "scripts"), p)));
280
280
  }
281
- for (const f of ["LICENSE", "NOTICE"]) await cp(join(ROOT, f), join(OUT, f));
282
281
 
283
282
  if (main.publishConfig?.access !== "public") die(`sdd-cli's package.json has no publishConfig.access=public — ${P.name} would publish private`);
284
283
 
@@ -296,7 +295,7 @@ const pkg = {
296
295
  // Inherited, not assumed: a scoped package publishes PRIVATE by default, and
297
296
  // the first publish of verify-cli failed with E402 because this was missing.
298
297
  publishConfig: main.publishConfig,
299
- files: ["dist", "scripts", "README.md", "LICENSE", "NOTICE"],
298
+ files: ["dist", "scripts", "README.md"],
300
299
  };
301
300
  await writeFile(join(OUT, "package.json"), `${JSON.stringify(pkg, null, 2)}\n`);
302
301
  await writeFile(join(OUT, "README.md"), P.readme);
@@ -41,7 +41,7 @@ for repo in "$@"; do
41
41
  --source="$W/$name" --verify-version=$VV --maintain-version=$MV \
42
42
  --verify-tarball="$PKGS/sdd-method-verify-cli-$VV.tgz" --maintain-tarball="$PKGS/sdd-method-maintain-cli-$MV.tgz" ) > "$OUT/$name.dagger.log" 2>&1
43
43
  drc=$?; secs=$(( $(date +%s) - start ))
44
- sed "s/\x1b\[[0-9;]*m//g" "$OUT/$name.dagger.log" | grep -oE "^ *(PASS|FAIL|ADVISORY) +exit [0-9]+ [a-z0-9-]+" | sed "s/^ *//" | awk '{print $4, $3}' | sort > "$OUT/$name.dagger.steps"
44
+ sed "s/\x1b\[[0-9;]*m//g" "$OUT/$name.dagger.log" | grep -oE "^ *(PASS|FAIL|ADVISORY|N/A) +exit [0-9]+ [a-z0-9-]+" | sed "s/^ *//" | awk '{print $4, $3}' | sort > "$OUT/$name.dagger.steps"
45
45
  # 2. The same plan, directly on the host (a second clone, so neither run sees the other)
46
46
  git clone -q --no-hardlinks "$repo" "$W/direct"
47
47
  ( cd "$W/direct" && $VERIFY validate --list ) > "$OUT/$name.plan.json"
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "0.4.0",
3
- "built_against_sdd_cli": "1.45.0"
2
+ "version": "0.6.0",
3
+ "built_against_sdd_cli": "2.0.0"
4
4
  }