@sdd-method/author-cli 0.13.0 → 0.14.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 (33) hide show
  1. package/README.md +1 -1
  2. package/dist/author-program.js +10 -2
  3. package/dist/lib/catalogue/build.js +58 -12
  4. package/dist/lib/catalogue/builders/adr-governs.js +1 -1
  5. package/dist/lib/catalogue/builders/adrs.js +2 -2
  6. package/dist/lib/catalogue/builders/contract-revisions.js +45 -7
  7. package/dist/lib/catalogue/builders/data-model.js +1 -1
  8. package/dist/lib/catalogue/builders/entity-archetype.js +121 -0
  9. package/dist/lib/catalogue/builders/quality-scores.js +1 -1
  10. package/dist/lib/catalogue/builders/requirements.js +1 -1
  11. package/dist/lib/catalogue/canonical-schema.yaml +41 -21
  12. package/dist/lib/catalogue/retired-catalogues.js +1 -1
  13. package/dist/lib/catalogue/rubric-coverage-map.yaml +7 -3
  14. package/dist/lib/catalogue/staleness-verdicts.js +3 -3
  15. package/dist/lib/structure/apply.js +71 -0
  16. package/dist/lib/structure/archive.js +330 -0
  17. package/dist/lib/structure/catalogue.js +31 -10
  18. package/dist/lib/structure/compose.js +1 -1
  19. package/dist/lib/structure/effects.js +1 -1
  20. package/dist/lib/structure/extract.js +123 -0
  21. package/dist/lib/structure/intended.js +194 -0
  22. package/dist/lib/structure/model.js +1 -1
  23. package/dist/lib/structure/render.js +1 -1
  24. package/dist/lib/structure/view.js +8 -3
  25. package/dist/lib/validate/agreement-evidence.js +2 -2
  26. package/dist/lib/validate/behaviour-store.js +49 -12
  27. package/dist/lib/validate/dispatch.js +1 -1
  28. package/dist/lib/validate/structural-model.js +48 -35
  29. package/dist/maintain-version.json +2 -2
  30. package/dist/verbs/change.js +15 -0
  31. package/dist/verbs/migrate-structure.js +36 -0
  32. package/dist/verify-version.json +2 -2
  33. package/package.json +2 -2
@@ -0,0 +1,36 @@
1
+ import { extractStructure, writeExtraction } from "../lib/structure/extract.js";
2
+ // `migrate structure [--dry-run]`: extract an SDD's first structural model from its sources, with its report
3
+ // (M-ADR 0230 §6 step 1). Refuses an SDD that has a model; writes no source file.
4
+ export async function runMigrateStructure(sddPath, options, write) {
5
+ const x = await extractStructure(sddPath);
6
+ if (x.refused !== null) {
7
+ write(`[FAIL] migrate structure: ${x.refused}\n`);
8
+ return 1;
9
+ }
10
+ const total = [...x.counts.values()].reduce((a, b) => a + b, 0);
11
+ 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`);
12
+ if (options.dryRun) {
13
+ write(x.report);
14
+ return 0;
15
+ }
16
+ for (const p of await writeExtraction(sddPath, x))
17
+ write(`wrote ${p}\n`);
18
+ 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");
19
+ return 0;
20
+ }
21
+ // Authored content, so the author's and sdd-cli's (M-ADR 0230 §6, at its acceptance). Attaches to the
22
+ // `migrate` command its program already registers.
23
+ export function registerMigrateStructure(program) {
24
+ const migrate = program.commands.find((c) => c.name() === "migrate");
25
+ if (!migrate)
26
+ throw new Error("registerMigrateStructure: register `migrate` first");
27
+ migrate
28
+ .command("structure")
29
+ .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)")
30
+ .option("--sdd-path <path>", "the SDD (default: the current directory)", ".")
31
+ .option("--dry-run", "write nothing; print the report", false)
32
+ .action(async (opts) => {
33
+ process.exitCode = await runMigrateStructure(opts.sddPath, { dryRun: opts.dryRun }, (s) => process.stdout.write(s));
34
+ });
35
+ }
36
+ //# sourceMappingURL=migrate-structure.js.map
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "5.0.0",
3
- "built_against_sdd_cli": "5.0.0"
2
+ "version": "5.1.0",
3
+ "built_against_sdd_cli": "5.1.0"
4
4
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sdd-method/author-cli",
3
- "version": "0.13.0",
4
- "sddCliVersion": "5.0.0",
3
+ "version": "0.14.0",
4
+ "sddCliVersion": "5.1.0",
5
5
  "description": "Re-author one SDD's content — scaffold, plan, contracts, conformance, api-surface, snapshots, briefings, catalogue check — plus every read-only verify verb. Ships only the code those verbs reach; it cannot sync the baseline or rebuild the catalogues. Maintenance is in @sdd-method/maintain-cli, administration in @sdd-method/sdd-cli.",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",