@sdd-method/author-cli 0.7.0 → 0.8.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 (94) hide show
  1. package/dist/author-program.js +1 -1
  2. package/dist/lib/agent-harness.js +2 -2
  3. package/dist/lib/briefing/index.js +1 -1
  4. package/dist/lib/briefing/render.js +1 -1
  5. package/dist/lib/briefing/variables.js +1 -1
  6. package/dist/lib/catalogue/application-archetype/vocabulary.js +2 -2
  7. package/dist/lib/catalogue/archetype/maps/android.yaml +2 -2
  8. package/dist/lib/catalogue/archetype/maps/swiftui.yaml +2 -2
  9. package/dist/lib/catalogue/archetype/maps/uikit.yaml +2 -2
  10. package/dist/lib/catalogue/archetype/maps/web-generic.yaml +2 -2
  11. package/dist/lib/catalogue/archetype/openui-archetype-vocabulary.yaml +3 -3
  12. package/dist/lib/catalogue/archetype/resolver.js +4 -4
  13. package/dist/lib/catalogue/archetype/wireframe.js +1 -1
  14. package/dist/lib/catalogue/build.js +33 -33
  15. package/dist/lib/catalogue/builders/adr-supersedes.js +3 -3
  16. package/dist/lib/catalogue/builders/adrs.js +3 -3
  17. package/dist/lib/catalogue/builders/c4-containers.js +2 -2
  18. package/dist/lib/catalogue/builders/c4-entity-rollups.js +1 -1
  19. package/dist/lib/catalogue/builders/c4-external-systems.js +2 -2
  20. package/dist/lib/catalogue/builders/c4-systems.js +1 -1
  21. package/dist/lib/catalogue/builders/capabilities.js +1 -1
  22. package/dist/lib/catalogue/builders/capability-domain-model.js +1 -1
  23. package/dist/lib/catalogue/builders/capability-spec-walker.js +2 -2
  24. package/dist/lib/catalogue/builders/capability-spec.js +4 -4
  25. package/dist/lib/catalogue/builders/contracts.js +3 -3
  26. package/dist/lib/catalogue/builders/data-store-mapping.js +2 -2
  27. package/dist/lib/catalogue/builders/domain-models.js +2 -2
  28. package/dist/lib/catalogue/builders/domains.js +3 -3
  29. package/dist/lib/catalogue/builders/entities-manifest.js +8 -8
  30. package/dist/lib/catalogue/builders/entities-mermaid.js +4 -4
  31. package/dist/lib/catalogue/builders/entity-persistence.js +1 -1
  32. package/dist/lib/catalogue/builders/entity-slug.js +3 -3
  33. package/dist/lib/catalogue/builders/event-catalog-walker.js +6 -6
  34. package/dist/lib/catalogue/builders/event-edges.js +6 -6
  35. package/dist/lib/catalogue/builders/events.js +3 -3
  36. package/dist/lib/catalogue/builders/evidence-class.js +1 -1
  37. package/dist/lib/catalogue/builders/feature-domain-model.js +1 -1
  38. package/dist/lib/catalogue/builders/feature-grounding-walker.js +2 -2
  39. package/dist/lib/catalogue/builders/feature-grounding.js +5 -5
  40. package/dist/lib/catalogue/builders/feature-subscription-channels.js +3 -3
  41. package/dist/lib/catalogue/builders/features.js +1 -1
  42. package/dist/lib/catalogue/builders/glossary-xref.js +4 -4
  43. package/dist/lib/catalogue/builders/integrations.js +4 -4
  44. package/dist/lib/catalogue/builders/persona-c4system.js +1 -1
  45. package/dist/lib/catalogue/builders/product-edges.js +1 -1
  46. package/dist/lib/catalogue/builders/product-platform-dependencies.js +2 -2
  47. package/dist/lib/catalogue/builders/products.js +5 -5
  48. package/dist/lib/catalogue/builders/repo-edges.js +12 -12
  49. package/dist/lib/catalogue/builders/repositories.js +11 -7
  50. package/dist/lib/catalogue/builders/screen-tree.js +6 -6
  51. package/dist/lib/catalogue/builders/screens.js +18 -18
  52. package/dist/lib/catalogue/builders/service-contract-consumes.js +1 -1
  53. package/dist/lib/catalogue/builders/service-entity-tables.js +3 -3
  54. package/dist/lib/catalogue/builders/services.js +5 -5
  55. package/dist/lib/catalogue/builders/system-external-dependency.js +2 -2
  56. package/dist/lib/catalogue/coverage-render.js +15 -15
  57. package/dist/lib/catalogue/csv-writer.js +1 -1
  58. package/dist/lib/catalogue/feature-grounding-aliases-loader.js +1 -1
  59. package/dist/lib/catalogue/findings.js +1 -1
  60. package/dist/lib/catalogue/fk-validator.js +2 -2
  61. package/dist/lib/catalogue/manifest-loader.js +3 -3
  62. package/dist/lib/catalogue/schema-compat.js +2 -2
  63. package/dist/lib/catalogue/schema-loader.js +1 -1
  64. package/dist/lib/catalogue/screen-validation-loader.js +2 -2
  65. package/dist/lib/catalogue/service-architecture-parser.js +1 -1
  66. package/dist/lib/catalogue/traceability-loader.js +6 -4
  67. package/dist/lib/conformance/finding.js +1 -1
  68. package/dist/lib/conformance/index.js +5 -5
  69. package/dist/lib/generate-briefing/index.js +2 -2
  70. package/dist/lib/metamodel/tql-subset-parser.js +280 -0
  71. package/dist/lib/pack/schema.js +2 -2
  72. package/dist/lib/pack/seed.js +2 -2
  73. package/dist/lib/pack/validate.js +1 -1
  74. package/dist/lib/plan/read-sdd.js +1 -1
  75. package/dist/lib/repo-kind.js +3 -3
  76. package/dist/lib/scaffold/archetype-behaviour.js +171 -0
  77. package/dist/lib/scaffold/domain.js +24 -6
  78. package/dist/lib/scaffold/registry.js +1 -1
  79. package/dist/lib/sync/briefing-merge.js +2 -2
  80. package/dist/lib/sync/bundle-cache.js +4 -4
  81. package/dist/lib/sync/yaml-block-merge.js +1 -1
  82. package/dist/lib/validate/archetype-citations.js +134 -0
  83. package/dist/lib/validate/behaviour-store.js +25 -1
  84. package/dist/lib/validate/dispatch.js +8 -1
  85. package/dist/maintain-version.json +2 -2
  86. package/dist/verbs/conformance.js +3 -3
  87. package/dist/verbs/list.js +1 -1
  88. package/dist/verbs/render.js +1 -1
  89. package/dist/verbs/scaffold.js +7 -4
  90. package/dist/verify-program.js +2 -2
  91. package/dist/verify-version.json +2 -2
  92. package/package.json +2 -2
  93. package/scripts/validate-app-dependencies.sh +1 -1
  94. package/scripts/validate-integration-docs.sh +1 -1
@@ -95,7 +95,7 @@ export function buildAuthorProgram() {
95
95
  registerGenerateBriefing(program);
96
96
  registerContext(program);
97
97
  const catalogue = program.commands.find((c) => c.name() === "catalogue");
98
- catalogue.description("Validate and query per-SDD catalogues (ADR 0134), and check them for staleness — never rebuilds");
98
+ catalogue.description("Validate and query per-SDD catalogues (M-ADR 0134), and check them for staleness — never rebuilds");
99
99
  registerCatalogueCheck(catalogue);
100
100
  return program;
101
101
  }
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * Agent-harness identifiers — the value space of `--agent-harness` on
3
- * `sdd-cli init`, `sdd-cli sync` and `context pull` per ADR 0141 §4.6.
3
+ * `sdd-cli init`, `sdd-cli sync` and `context pull` per M-ADR 0141 §4.6.
4
4
  *
5
5
  * Claude Code is the one supported harness (M-ADR 0220 §4.6) and the default. The GitHub Copilot
6
6
  * CLI value is retired: passing it fails, naming that record. Every SDD and code repository also
7
7
  * gets an AGENTS.md pointer to agent-instructions.md, with no flag; it is a pointer, not support
8
8
  * for another harness. Adopters binding any other harness implement the portable contracts
9
- * themselves (ADR 0141 §4.5).
9
+ * themselves (M-ADR 0141 §4.5).
10
10
  */
11
11
  export const AGENT_HARNESSES = ["claude-code"];
12
12
  export const DEFAULT_AGENT_HARNESS = "claude-code";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Public facade for the briefing layer (ADR 0148).
2
+ * Public facade for the briefing layer (M-ADR 0148).
3
3
  *
4
4
  * `agent-instructions.md` is the harness-neutral canonical briefing
5
5
  * (fully method-managed; sync overwrites unconditionally). Harness
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Renderer for the briefing-layer templates per ADR 0148.
2
+ * Renderer for the briefing-layer templates per M-ADR 0148.
3
3
  *
4
4
  * Templates ship via the method baseline bundle and land at
5
5
  * `<target>/orchestration/templates/briefing/...` after sync's
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Variable resolution for the briefing layer per ADR 0148 §4.1.
2
+ * Variable resolution for the briefing layer per M-ADR 0148 §4.1.
3
3
  *
4
4
  * The four variables are sourced from target-repo state:
5
5
  *
@@ -5,7 +5,7 @@
5
5
  * tiered vocabulary. This module resolves a declared value against the union
6
6
  * of:
7
7
  * - the **method tier** — `unclassified` only, built into sdd-cli (mirrors
8
- * how the ADR 0173/0176 method-tier scaffold archetypes are built in);
8
+ * how the M-ADR 0173/0176 method-tier scaffold archetypes are built in);
9
9
  * - the **reference-architecture / adopter bundle tiers** — seedless
10
10
  * vocabulary files (`application-archetypes.yaml`) shipped in consumed
11
11
  * bundles and extracted to the local bundle cache
@@ -13,7 +13,7 @@
13
13
  * - an optional **adopter-local** extension file at
14
14
  * `.sdd/application-archetypes.yaml` in the SDD repo.
15
15
  *
16
- * This deliberately does NOT reuse the ADR 0176 scaffold registry resolver
16
+ * This deliberately does NOT reuse the M-ADR 0176 scaffold registry resolver
17
17
  * (`scaffold/registry.ts`): that resolver is seed-oriented and drops any
18
18
  * entry with no `seeds[]`, whereas a classification archetype is seedless by
19
19
  * design. It DOES share the same bundle-cache distribution substrate — this
@@ -1,8 +1,8 @@
1
- # Default archetype map — android (ADR 0169 §4.2). Method-owned.
1
+ # Default archetype map — android (M-ADR 0169 §4.2). Method-owned.
2
2
  #
3
3
  # Android View + Material toolkit. These names are industry-standard (Google/AndroidX/Material)
4
4
  # and identical across every Android app — never an adopter's bespoke vocabulary.
5
- # Resolution order (ADR 0169 §4.3): adopter overlay override -> by_token -> by_suffix_heuristic -> default.
5
+ # Resolution order (M-ADR 0169 §4.3): adopter overlay override -> by_token -> by_suffix_heuristic -> default.
6
6
  # Selected per screen by `platform: android` frontmatter.
7
7
 
8
8
  map_version: "1.0.0"
@@ -1,8 +1,8 @@
1
- # Default archetype map — swiftui (ADR 0169 §4.2). Method-owned.
1
+ # Default archetype map — swiftui (M-ADR 0169 §4.2). Method-owned.
2
2
  #
3
3
  # Apple SwiftUI toolkit. Industry-standard Apple names, identical across every SwiftUI app —
4
4
  # never an adopter's bespoke vocabulary.
5
- # Resolution order (ADR 0169 §4.3): adopter overlay override -> by_token -> by_suffix_heuristic -> default.
5
+ # Resolution order (M-ADR 0169 §4.3): adopter overlay override -> by_token -> by_suffix_heuristic -> default.
6
6
  # Selected per screen by `platform: swiftui` frontmatter.
7
7
 
8
8
  map_version: "1.0.0"
@@ -1,8 +1,8 @@
1
- # Default archetype map — uikit (ADR 0169 §4.2). Method-owned.
1
+ # Default archetype map — uikit (M-ADR 0169 §4.2). Method-owned.
2
2
  #
3
3
  # Apple UIKit toolkit. Industry-standard Apple names (UI- prefixed), identical across every
4
4
  # UIKit app — never an adopter's bespoke vocabulary.
5
- # Resolution order (ADR 0169 §4.3): adopter overlay override -> by_token -> by_suffix_heuristic -> default.
5
+ # Resolution order (M-ADR 0169 §4.3): adopter overlay override -> by_token -> by_suffix_heuristic -> default.
6
6
  # Selected per screen by `platform: uikit` frontmatter.
7
7
 
8
8
  map_version: "1.0.0"
@@ -1,8 +1,8 @@
1
- # Default archetype map — web-generic (ADR 0169 §4.2). Method-owned.
1
+ # Default archetype map — web-generic (M-ADR 0169 §4.2). Method-owned.
2
2
  #
3
3
  # Keys off component NAMES (which the builder already parses), not design-system source.
4
4
  # Vendor-standard / common-DS tokens ONLY — never an adopter's bespoke vocabulary.
5
- # Resolution order (ADR 0169 §4.3): adopter overlay override -> by_token -> by_suffix_heuristic -> default.
5
+ # Resolution order (M-ADR 0169 §4.3): adopter overlay override -> by_token -> by_suffix_heuristic -> default.
6
6
  # Selected per screen by `platform: web-generic` (or web) frontmatter.
7
7
 
8
8
  map_version: "1.0.0"
@@ -1,12 +1,12 @@
1
- # OpenUI Archetype Vocabulary — method-owned (ADR 0169 §4.1)
1
+ # OpenUI Archetype Vocabulary — method-owned (M-ADR 0169 §4.1)
2
2
  #
3
3
  # A closed, platform-tagged superset of visual archetypes. An archetype assigns a
4
4
  # component a VISUAL SHAPE + slots/orientation — never geometry or styling (stays inside
5
- # the compose-only boundary, ADR 0166 §3). Default archetype maps
5
+ # the compose-only boundary, M-ADR 0166 §3). Default archetype maps
6
6
  # (archetype-maps/*.yaml) resolve adopter component NAMES to entries here; the
7
7
  # render-screen-wireframe skill lowers a resolved tree to SVG using `render`.
8
8
  #
9
- # `is_container` feeds ADR 0168 §4.1 isContainer when a resolved map is present.
9
+ # `is_container` feeds M-ADR 0168 §4.1 isContainer when a resolved map is present.
10
10
 
11
11
  vocabulary_version: "1.0.0"
12
12
 
@@ -1,12 +1,12 @@
1
- // OpenUI archetype resolver (per ADR 0169).
1
+ // OpenUI archetype resolver (per M-ADR 0169).
2
2
  //
3
3
  // Binds an adopter component NAME to a visual ARCHETYPE via a method-shipped
4
4
  // platform default map plus an optional adopter overlay. The binding is what
5
5
  // makes a shape-blind openui-lang block renderable as a wireframe, and it
6
- // supplies the container/leaf classification the ADR 0168 `screen-root-is-leaf`
6
+ // supplies the container/leaf classification the M-ADR 0168 `screen-root-is-leaf`
7
7
  // check consumes (isContainerArchetype).
8
8
  //
9
- // Resolution order (ADR 0169 §4.3): adopter override -> default by_token (after
9
+ // Resolution order (M-ADR 0169 §4.3): adopter override -> default by_token (after
10
10
  // stripping a vendor prefix) -> by_suffix_heuristic -> default (panel).
11
11
  //
12
12
  // The vocabulary + the four default maps are method-owned reference data,
@@ -74,7 +74,7 @@ export function resolveArchetype(name, platform, overlay) {
74
74
  }
75
75
  /**
76
76
  * Whether a component classifies as a container archetype for a platform.
77
- * Used by ADR 0168 §4.1 isContainer to refine the appears-with-children
77
+ * Used by M-ADR 0168 §4.1 isContainer to refine the appears-with-children
78
78
  * heuristic. Returns undefined when the platform has no map (caller falls back
79
79
  * to the heuristic) so an absent map never mis-classifies a known container.
80
80
  */
@@ -1,4 +1,4 @@
1
- // Deterministic structural-wireframe renderer (ADR 0169 §4.4).
1
+ // Deterministic structural-wireframe renderer (M-ADR 0169 §4.4).
2
2
  //
3
3
  // Lowers a screen's openui-lang block to an SVG wireframe: parse the block into
4
4
  // a composition tree, resolve each node to a visual archetype, and lay it out
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Per-SDD catalogue builder — `sdd-cli catalogue build` orchestrator.
3
3
  *
4
- * Per ADR 0134 §4.6, the canonical builder reads method-defined declarative
4
+ * Per M-ADR 0134 §4.6, the canonical builder reads method-defined declarative
5
5
  * inputs and emits `catalogues/*.csv` matching the canonical schema.
6
6
  *
7
7
  * The orchestrator provides:
@@ -119,7 +119,7 @@ export async function runCatalogueBuild(inputs, write) {
119
119
  }
120
120
  // 5. Internal FK validation (external FKs logged as findings). Pass the
121
121
  // SDD profile so profile-external FKs (schema 2.23.0, e.g. an app/integration
122
- // capability's platform-resident domain_id per ADR 0136) resolve at
122
+ // capability's platform-resident domain_id per M-ADR 0136) resolve at
123
123
  // aggregation instead of failing this local build.
124
124
  const { fk, enums } = await validateWithEngineToLog(schema, rowsByCatalogue, findings, { profile: manifest.profile });
125
125
  // 5b. Bound-enum validation (M-ADR 0203 §4.1): every column_enums-bound
@@ -172,7 +172,7 @@ export async function runCatalogueBuild(inputs, write) {
172
172
  // declared primary-key uniqueness — always a hard failure, like a dangling
173
173
  // internal FK. (The silent-union path is not a failure: it is the expected
174
174
  // outcome of two sources asserting the same fact.)
175
- // Error-severity findings (e.g. the ADR 0168 screen-spec status gate) fail the
175
+ // Error-severity findings (e.g. the M-ADR 0168 screen-spec status gate) fail the
176
176
  // build by default, independent of --strict.
177
177
  const exitCode = !fk.internalPass || dedupe.conflicts.length > 0 || findings.errorCount() > 0 || strictFail
178
178
  ? 1
@@ -312,7 +312,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
312
312
  })));
313
313
  }
314
314
  // 5. Services derived 1:1 from runtime-typed repositories.
315
- // Forward `description` source (ADR 0163 P1): repo-config `description:`,
315
+ // Forward `description` source (M-ADR 0163 P1): repo-config `description:`,
316
316
  // parsed but previously dropped by the repositories builder.
317
317
  const repoDescriptions = new Map();
318
318
  const declaredServicesByRepo = new Map();
@@ -503,18 +503,18 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
503
503
  contractIdByPath: mergedContractIdByPath,
504
504
  }));
505
505
  // 10. Repo edges — repo_capability, repo_contract (feature_repo empty
506
- // here; populated by feature-grounding extractor below per ADR 0143).
506
+ // here; populated by feature-grounding extractor below per M-ADR 0143).
507
507
  const capabilityIdByPath = new Map();
508
508
  for (const cap of capabilities) {
509
509
  const sp = String(cap["spec_path"] ?? "");
510
510
  if (sp !== "")
511
511
  capabilityIdByPath.set(sp, String(cap["id"]));
512
512
  }
513
- // Per ADR 0157, repo-edges has both forward-declared (additional_context,
513
+ // Per M-ADR 0157, repo-edges has both forward-declared (additional_context,
514
514
  // repo-config.contracts) and reverse-derived (capability_service ⋈
515
515
  // services.primary_repo_id, contracts.source_repo_id denorm) paths. Note
516
516
  // that the capability_feature ⋈ feature_repo path (Y) needs feature_repo
517
- // populated, which the ADR 0143 extractor below (10a) does — but repo-edges
517
+ // populated, which the M-ADR 0143 extractor below (10a) does — but repo-edges
518
518
  // runs first. So Path Y picks up zero rows here; the second pass after
519
519
  // grounding extracts (below) appends the missing edges.
520
520
  const knownRepoIds = new Set(repos.map((r) => String(r["id"])));
@@ -558,7 +558,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
558
558
  knownServiceIds: knownServiceIdsForExemption,
559
559
  allowedReasons: serviceExemptionReasons,
560
560
  }));
561
- // 10a. Feature-grounding extractor per ADR 0143 (schema 2.5.0).
561
+ // 10a. Feature-grounding extractor per M-ADR 0143 (schema 2.5.0).
562
562
  // Walks docs/domains/*/design/*/feature-grounding.md (platform-profile)
563
563
  // or docs/design/integration/feature-grounding.md (integration-product)
564
564
  // and emits feature rows (source: feature-grounding) plus capability_feature,
@@ -588,7 +588,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
588
588
  ]);
589
589
  }
590
590
  // feature_repo + feature_service edges are stored unconditionally —
591
- // per ADR 0143 §2 they're grounding's unique contribution and must
591
+ // per M-ADR 0143 §2 they're grounding's unique contribution and must
592
592
  // emit even when every grounding row collides on feature id with an
593
593
  // earlier source (`feature-tree` / `feature-spec`). Pre-0.30.2 the
594
594
  // conditional above gated feature_repo on the row emission, dropping
@@ -599,13 +599,13 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
599
599
  ]);
600
600
  // feature_service starts here — earlier passes don't populate it.
601
601
  out.set("feature_service", grounding.featureServiceRows);
602
- // 10b. Capability-spec extractor per ADR 0145 (schema 2.7.0).
602
+ // 10b. Capability-spec extractor per M-ADR 0145 (schema 2.7.0).
603
603
  // Walks docs/domains/*/product/*.md (platform-profile only) and emits
604
604
  // feature rows (source: capability-spec) plus capability_feature,
605
605
  // feature_repo, feature_service edges from the
606
606
  // `## Feature Grounding (code-path trace)` table. Runs after the
607
607
  // feature-grounding extractor so precedence (feature-grounding wins
608
- // on id collision) is enforced. Reuses ADR 0143's alias map for
608
+ // on id collision) is enforced. Reuses M-ADR 0143's alias map for
609
609
  // service / repo resolution.
610
610
  const existingFeatureIdsAfterGrounding = new Set((out.get("features") ?? []).map((r) => String(r["id"])));
611
611
  const capabilitySpec = await buildCapabilitySpec({
@@ -629,7 +629,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
629
629
  ]);
630
630
  }
631
631
  // feature_repo + feature_service edges are stored unconditionally —
632
- // per ADR 0145 they're capability-spec's unique contribution and must
632
+ // per M-ADR 0145 they're capability-spec's unique contribution and must
633
633
  // emit even when every capability-spec row collides on feature id with an
634
634
  // earlier source. Pre-fix the conditional above gated these edges on the
635
635
  // row emission, dropping them in the all-collide case (same two-level bug
@@ -714,7 +714,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
714
714
  out.set("feature_repo", [...existingFeatureRepo, ...derived]);
715
715
  }
716
716
  }
717
- // 10b-bis. Second pass on repo_capability Path Y (per ADR 0157 §4.3) —
717
+ // 10b-bis. Second pass on repo_capability Path Y (per M-ADR 0157 §4.3) —
718
718
  // capability_feature ⋈ feature_repo. The initial repo-edges pass (step 10)
719
719
  // ran before the feature-grounding extractor populated feature_repo, so
720
720
  // Path Y picked up zero rows there. Now that feature_repo is fully built,
@@ -821,7 +821,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
821
821
  }
822
822
  }
823
823
  // 11. Events + service_event + capability_event.
824
- // Per ADR 0156 (schema 2.12.0), events ingest from both the forward-method
824
+ // Per M-ADR 0156 (schema 2.12.0), events ingest from both the forward-method
825
825
  // avsc path and the reverse-method `event-catalog.yaml` path. YAML wins on
826
826
  // name/domain/publisher/transport; avsc augments schema_path/version.
827
827
  // service_event edges populate from both repo-config events.produces/consumes
@@ -863,7 +863,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
863
863
  // repos/<service>/docs/service-architecture.md External Interfaces table.
864
864
  // The consumes-emission path is gated on an adopter-supplied
865
865
  // .sdd/service-contract-aliases.yaml mapping interface display text to
866
- // canonical contract names. Pattern documented in ADR 0147.
866
+ // canonical contract names. Pattern documented in M-ADR 0147.
867
867
  const exposesRows = buildServiceContract({
868
868
  findings,
869
869
  configs: reposResult.configs,
@@ -900,7 +900,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
900
900
  }
901
901
  }
902
902
  }
903
- // 12-bis. Second pass on repo_contract Path X (per ADR 0157 §4.2 amendment) —
903
+ // 12-bis. Second pass on repo_contract Path X (per M-ADR 0157 §4.2 amendment) —
904
904
  // service_contract ⋈ services.primary_repo_id. The initial repo-edges pass
905
905
  // (step 10) ran before service_contract was built, so Path X picked up zero
906
906
  // rows there. Now that service_contract is fully populated, derive the
@@ -947,9 +947,9 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
947
947
  featureServiceRows: out.get("feature_service") ?? [],
948
948
  serviceContractRows: out.get("service_contract") ?? [],
949
949
  }));
950
- // 12a-bis. feature_event — derived edge per schema 2.15.0 / ADR 0161.
950
+ // 12a-bis. feature_event — derived edge per schema 2.15.0 / M-ADR 0161.
951
951
  // Pure join of feature_service ⋈ service_event; no authored shape. Mirrors
952
- // ADR 0160's capability_event derived path one rung lower in the hierarchy.
952
+ // M-ADR 0160's capability_event derived path one rung lower in the hierarchy.
953
953
  out.set("feature_event", buildFeatureEvent({
954
954
  knownFeatureIds: featureIdsAfterAllSources,
955
955
  knownEventIds,
@@ -957,7 +957,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
957
957
  serviceEventRows: out.get("service_event") ?? [],
958
958
  }));
959
959
  // 12b. domain_models + capability_domain_model + feature_domain_model
960
- // per schema 2.4.0 / ADR 0142. Platform-profile only — non-platform
960
+ // per schema 2.4.0 / M-ADR 0142. Platform-profile only — non-platform
961
961
  // builds emit headers-only. domain_models runs first; the edges depend
962
962
  // on its known-id set.
963
963
  const domainModels = await buildDomainModels({
@@ -984,8 +984,8 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
984
984
  capabilityDomainModelRows: out.get("capability_domain_model") ?? [],
985
985
  }));
986
986
  // 13. App-product profile builders (personas, journeys, persona/journey
987
- // edges, product-edges). Per ADR 0134, app-product SDDs emit these
988
- // catalogues; other profiles emit zero rows. Per ADR 0136, product_*
987
+ // edges, product-edges). Per M-ADR 0134, app-product SDDs emit these
988
+ // catalogues; other profiles emit zero rows. Per M-ADR 0136, product_*
989
989
  // edges' capability_id and service_id are external FKs validated by
990
990
  // the aggregator, not here.
991
991
  const featureIdByPath = featuresResult.idByPath;
@@ -1024,12 +1024,12 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
1024
1024
  featureIdByPath,
1025
1025
  featureIdBySlug,
1026
1026
  }));
1027
- // UI screens family (per ADR 0166). Application-product profile; the walker
1027
+ // UI screens family (per M-ADR 0166). Application-product profile; the walker
1028
1028
  // reads `screens/*.md` screen-spec artefacts (frontmatter + ```openui-lang
1029
1029
  // block) and emits the six catalogues. Other profiles have no screens/ dir →
1030
1030
  // empty. FK resolution uses the feature + persona id maps already built.
1031
- // Optional adopter-tunable screen-validation parameters (ADR 0168 §4.5 /
1032
- // ADR 0169 §4.3); absent → method defaults (the vocabulary-free checks run).
1031
+ // Optional adopter-tunable screen-validation parameters (M-ADR 0168 §4.5 /
1032
+ // M-ADR 0169 §4.3); absent → method defaults (the vocabulary-free checks run).
1033
1033
  const screenValidation = await loadScreenValidationConfig(sddPath);
1034
1034
  const screensResult = await buildScreens({
1035
1035
  sddPath,
@@ -1091,7 +1091,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
1091
1091
  });
1092
1092
  out.set("scaffolds", scaffoldsResult.scaffolds);
1093
1093
  out.set("scaffold_items", scaffoldsResult.scaffoldItems);
1094
- // Screen↔capability context cross-check (ADR 0170 §4.6, schema 2.21.0):
1094
+ // Screen↔capability context cross-check (M-ADR 0170 §4.6, schema 2.21.0):
1095
1095
  // a screen's `context:` should equal the context of the capability it
1096
1096
  // realises (screen → screen_feature → feature.capability_id →
1097
1097
  // capability.context). Convention finding, never an FK failure — the
@@ -1203,7 +1203,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
1203
1203
  c4ContainerRows: c4Containers,
1204
1204
  });
1205
1205
  out.set("c4_components", c4Components);
1206
- // 15b. C4 L1 context elements (ADR 0155): external systems + the
1206
+ // 15b. C4 L1 context elements (M-ADR 0155): external systems + the
1207
1207
  // persona→system and system→external edges, extracted from System_Ext /
1208
1208
  // Person / Rel macros on the L1/L2 diagrams. (The rows were computed at
1209
1209
  // step 7, where capability_service consults them — see above.)
@@ -1274,7 +1274,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
1274
1274
  });
1275
1275
  out.set("glossary_items", glossaryResult.rows);
1276
1276
  const knownGlossaryIds = new Set(glossaryResult.rows.map((r) => String(r["id"])));
1277
- // Per ADR 0158 (schema 2.12.0), the glossary-xref builder ingests from
1277
+ // Per M-ADR 0158 (schema 2.12.0), the glossary-xref builder ingests from
1278
1278
  // five walkers and emits two catalogues: glossary_xref (term-to-term
1279
1279
  // relations) and entity_glossary (new sibling — data-model entity to
1280
1280
  // canonical term mappings).
@@ -1291,7 +1291,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
1291
1291
  // Backfill canonical_term_id + aliases onto glossary_items from the xref
1292
1292
  // edges (same alignment manifest, resolved downstream).
1293
1293
  out.set("glossary_items", backfillGlossaryRelations(glossaryResult.rows, xref.glossaryXref));
1294
- // 17. Data-model entities + service_entity + C4 roll-ups per ADR 0159
1294
+ // 17. Data-model entities + service_entity + C4 roll-ups per M-ADR 0159
1295
1295
  // (schema 2.13.0). Four new catalogues, five walkers:
1296
1296
  //
1297
1297
  // - entities-manifest: forward path, reads models[].entities[] from
@@ -1322,7 +1322,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
1322
1322
  knownGlossaryIds,
1323
1323
  });
1324
1324
  // Forward wins on attribute conflicts (matches per-adopter authoring intent
1325
- // per ADR 0159 §4.4). Reverse rows seed the map; forward overwrites.
1325
+ // per M-ADR 0159 §4.4). Reverse rows seed the map; forward overwrites.
1326
1326
  const entitiesById = new Map();
1327
1327
  for (const r of entitiesFromMermaid)
1328
1328
  entitiesById.set(String(r["id"]), r);
@@ -1330,9 +1330,9 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
1330
1330
  entitiesById.set(String(r["id"]), r);
1331
1331
  const entityRows = [...entitiesById.values()];
1332
1332
  out.set("entities", entityRows);
1333
- // Per ADR 0159 §4.9: now that entities.csv exists, append entity_glossary
1333
+ // Per M-ADR 0159 §4.9: now that entities.csv exists, append entity_glossary
1334
1334
  // rows for the reverse-method side. The forward-method emission via
1335
- // glossary-xref's models[].entities[] walker (ADR 0158) is already in
1335
+ // glossary-xref's models[].entities[] walker (M-ADR 0158) is already in
1336
1336
  // xref.entityGlossary; here we extend with rows derived from
1337
1337
  // entities-mermaid's slug-matched glossary_term FKs.
1338
1338
  const existingEntityGlossaryPks = new Set(xref.entityGlossary.map((r) => String(r["id"])));
@@ -1370,7 +1370,7 @@ async function collectRows(schema, manifest, findings, sddPath, snapshotStore) {
1370
1370
  if (!entityIdBySlug.has(slug))
1371
1371
  entityIdBySlug.set(slug, id);
1372
1372
  }
1373
- // ADR 0164: backfill entities.persistence_kind from the Data Store Mapping
1373
+ // M-ADR 0164: backfill entities.persistence_kind from the Data Store Mapping
1374
1374
  // Store column (reverse-only; forward store-less tables leave it empty).
1375
1375
  const enrichedEntityRows = await enrichEntityPersistenceKind({
1376
1376
  sddPath,
@@ -1466,7 +1466,7 @@ function checkScreenCapabilityContext(args) {
1466
1466
  if (sCtx !== cCtx) {
1467
1467
  args.findings.add("convention", `screen-capability context mismatch: screen "${screenId}" ` +
1468
1468
  `(context=${sCtx}) realises capability "${capId}" ` +
1469
- `(context=${cCtx}) — a seam screen or a mistag (ADR 0170 §4.6)`);
1469
+ `(context=${cCtx}) — a seam screen or a mistag (M-ADR 0170 §4.6)`);
1470
1470
  }
1471
1471
  }
1472
1472
  }
@@ -2,11 +2,11 @@
2
2
  // ADR pair where either side declares the relationship:
3
3
  // - the superseding ADR's `Supersedes:` text references a known ADR id, or
4
4
  // - the superseded ADR's `Superseded By:` text references a known ADR id
5
- // (the ADR 0174 §4.5 lazy-migration case: distributed reference ADRs are
5
+ // (the M-ADR 0174 §4.5 lazy-migration case: distributed reference ADRs are
6
6
  // adopter-agnostic and cannot name adopter ADR numbers, so only the
7
7
  // superseded local copy carries the link — including the cross-repo
8
8
  // `<repo>#9000` form, whose number resolves locally once the bundle that
9
- // ships ADR 9000 is pinned).
9
+ // ships RA-ADR 9000 is pinned).
10
10
  //
11
11
  // Only rows where BOTH endpoints resolve to known ADR ids are emitted —
12
12
  // the canonical schema's FKs on this edge are required+internal.
@@ -14,7 +14,7 @@
14
14
  // Also computes the inverse (`superseded_by_id`) backfill values that the
15
15
  // orchestrator stitches into adrs.csv after this builder runs.
16
16
  const ADR_REF_RE = /\bADR[\s\-_]?(\d{3,4})\b/gi;
17
- // `Superseded By:` additionally accepts the ADR 0140 cross-repo reference
17
+ // `Superseded By:` additionally accepts the M-ADR 0140 cross-repo reference
18
18
  // form `<repo>#9000` — the lazy-migration case, where the superseding
19
19
  // record lives in a distributed bundle. Procedural citations of the
20
20
  // migration rule itself ("per sdd-method#0174 §4.5") are stripped first
@@ -8,7 +8,7 @@
8
8
  // platform-foundational 0001-0099 band per M-ADR 0140)
9
9
  // - docs/domains/<domain>/architecture/adr/ADR XXXX: Title.md
10
10
  //
11
- // Per ADR 0136 the method-scope ADRs are owned by the platform-root in
11
+ // Per M-ADR 0136 the method-scope ADRs are owned by the platform-root in
12
12
  // the federation chain (the highest-up SDD that holds them via the seed-
13
13
  // file distribution). App and integration profile SDDs skip emission of
14
14
  // method-scope ADRs so the aggregated catalogue carries each method ADR
@@ -64,7 +64,7 @@ export async function buildAdrs(inputs) {
64
64
  const relPath = relative(inputs.sddPath, file);
65
65
  const { domainId, scope } = scopeFromPath(relPath);
66
66
  if ((scope === "method" || scope === "platform") && !ownsMethodScope) {
67
- // Per ADR 0136: method- and platform-scope ADRs are emitted only by
67
+ // Per M-ADR 0136: method- and platform-scope ADRs are emitted only by
68
68
  // the SDD that owns the platform scope (platform-profile in
69
69
  // adopting ecosystems). App and integration SDDs hold seed-file
70
70
  // copies on disk but do not contribute them to the federated
@@ -100,7 +100,7 @@ export async function buildAdrs(inputs) {
100
100
  });
101
101
  }
102
102
  if (methodScopeSkipCount > 0) {
103
- inputs.findings.add("coverage", `${methodScopeSkipCount} method/platform-scope ADR(s) skipped — emitted by ecosystem root only per ADR 0136`);
103
+ inputs.findings.add("coverage", `${methodScopeSkipCount} method/platform-scope ADR(s) skipped — emitted by ecosystem root only per M-ADR 0136`);
104
104
  }
105
105
  const rows = parsed.map((a) => ({
106
106
  id: a.id,
@@ -24,7 +24,7 @@ import { join, sep } from "node:path";
24
24
  const L2_BASENAME = "c4-l2-container.mermaid.md";
25
25
  // Boundary opener: `System_Boundary(id, "name") {` or `Container_Boundary(...)`.
26
26
  const BOUNDARY_OPEN_RE = /^(System_Boundary|Container_Boundary)\s*\(\s*\w+/;
27
- // C4-PlantUML container entries inside boundaries. Per ADR 0155 the
27
+ // C4-PlantUML container entries inside boundaries. Per M-ADR 0155 the
28
28
  // canonical c4_container_type is Application | Data Store only:
29
29
  // Container(id, "name", "tech", "desc") → Application
30
30
  // ContainerDb(id, "name", "tech", "desc") → Data Store
@@ -159,7 +159,7 @@ async function collectL2Files(sddPath) {
159
159
  // Lives at the SDD docs/ root; the system is the SDD itself (one
160
160
  // c4_systems row per SDD), so the boundary in the L2 is the product
161
161
  // boundary. domain_id is left empty — federated app/integration
162
- // products do not have a primary domain per ADR 0136.
162
+ // products do not have a primary domain per M-ADR 0136.
163
163
  const productRel = join("docs", L2_BASENAME);
164
164
  const productAbs = join(sddPath, productRel);
165
165
  if (await isFile(productAbs)) {
@@ -1,4 +1,4 @@
1
- // Phase 3 C4-to-entity roll-up walkers per ADR 0159 §4.8.
1
+ // Phase 3 C4-to-entity roll-up walkers per M-ADR 0159 §4.8.
2
2
  // Both are pure transitive joins over already-FK-enforced inputs.
3
3
  //
4
4
  // buildC4ContainerEntity:
@@ -1,5 +1,5 @@
1
1
  // C4 external software systems discoverer — emits `c4_external_systems.csv`
2
- // rows (per ADR 0155). External systems are C4 L1 peers the ecosystem
2
+ // rows (per M-ADR 0155). External systems are C4 L1 peers the ecosystem
3
3
  // integrates with but does not own; they are rendered `System_Ext(...)` on
4
4
  // L1/L2 diagrams (and occasionally `Container_Ext(...)` for an external
5
5
  // system's container). They are NOT c4_containers (not inside your system)
@@ -12,7 +12,7 @@
12
12
  // (schema 3.0.0, M-ADR 0203 §4.2) — so identity is the author's declared
13
13
  // assertion, the same identity the aggregator adjudicates (M-ADR 0189
14
14
  // §4.2). The same declared identity across SDDs collapses to one row at
15
- // aggregation (the dedup-by-PK exception to ADR 0134). Two entries whose
15
+ // aggregation (the dedup-by-PK exception to M-ADR 0134). Two entries whose
16
16
  // DISPLAY NAMES agree but whose entry ids differ are two rows — the
17
17
  // same-entity-two-labels case made visible instead of silently merged;
18
18
  // the 2.x name-slug ids map to these via the ext-id migration map.
@@ -1,6 +1,6 @@
1
1
  // C4 L1 systems discoverer — emits at most one `c4_systems.csv` row.
2
2
  //
3
- // Per ADR 0134's federation model, each SDD emits its OWN c4_systems
3
+ // Per M-ADR 0134's federation model, each SDD emits its OWN c4_systems
4
4
  // row when its manifest category is architectural. Categories map to
5
5
  // the c4_system_kind enum (canonical-schema.yaml):
6
6
  // platform-root → platform
@@ -2,7 +2,7 @@
2
2
  // traceability YAMLs (authoritative) plus capability spec files
3
3
  // (fallback for specs not covered by a traceability).
4
4
  //
5
- // Per ADR 0134 and the catalogue-builder-specification §"Inputs":
5
+ // Per M-ADR 0134 and the catalogue-builder-specification §"Inputs":
6
6
  // - Authoritative source: docs/domains/<domain>/product/<cap>.traceability.yaml
7
7
  // declares capability.id (canonical), domain, capability_spec, runway.
8
8
  // - Fallback: capability spec markdown files at
@@ -14,7 +14,7 @@
14
14
  // Domain model ids follow the `{domain_id}-data-model` convention from
15
15
  // the domain-models builder.
16
16
  //
17
- // Added in schema 2.4.0 per ADR 0142.
17
+ // Added in schema 2.4.0 per M-ADR 0142.
18
18
  export function buildCapabilityDomainModel(inputs) {
19
19
  if (inputs.manifest.profile !== "platform-profile") {
20
20
  return [];
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Walker for capability spec markdown files per ADR 0145 (schema 2.7.0).
2
+ * Walker for capability spec markdown files per M-ADR 0145 (schema 2.7.0).
3
3
  *
4
4
  * Reads `## Feature Grounding (code-path trace)` markdown tables of the
5
5
  * canonical shape:
@@ -8,7 +8,7 @@
8
8
  * |---|---|---|
9
9
  * | `banners-module` | `banners` store module + `src/components/banners` | docs/.../feature-grounding.md |
10
10
  *
11
- * Path convention (per ADR 0145 §4.3):
11
+ * Path convention (per M-ADR 0145 §4.3):
12
12
  * - platform-profile: `docs/domains/<dom>/product/<capability>.md`
13
13
  *
14
14
  * Capability id resolves from the filename stem. Tolerant of column
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Capability-spec feature extractor per ADR 0145 (schema 2.7.0).
2
+ * Capability-spec feature extractor per M-ADR 0145 (schema 2.7.0).
3
3
  *
4
4
  * Walks `docs/domains/<dom>/product/<capability>.md` (platform-profile),
5
5
  * parses the `## Feature Grounding (code-path trace)` markdown table,
@@ -12,7 +12,7 @@
12
12
  * - `feature_service.csv` rows derived from class names / file
13
13
  * basenames / route fragments in the Implementation column,
14
14
  * resolved via `services.csv` + the optional per-SDD alias map
15
- * introduced by ADR 0143.
15
+ * introduced by M-ADR 0143.
16
16
  *
17
17
  * Resolution is best-effort and never breaks FK validation — only
18
18
  * confidently-resolved rows are emitted. Unresolved CAPABILITY ids emit
@@ -25,7 +25,7 @@
25
25
  * coverage finding per row plus one summary line (M-ADR 0143 §4.4 as
26
26
  * amended); it measures resolution coverage, never correctness.
27
27
  *
28
- * Precedence per ADR 0145 §4.7: feature-tree, feature-spec, and
28
+ * Precedence per M-ADR 0145 §4.7: feature-tree, feature-spec, and
29
29
  * feature-grounding rows win on id collision (they are more specific
30
30
  * sources); capability-spec rows are skipped with a divergence finding
31
31
  * when their id is already taken.
@@ -105,7 +105,7 @@ export async function buildCapabilitySpec(inputs) {
105
105
  // When the earlier source DID also emit the edge, the ids are identical
106
106
  // (`${cap}__${feature}` in every emitter) and keyed-table dedup unions
107
107
  // them — dedup rows, keep edges. feature_repo / feature_service remain
108
- // this source's unique contribution (ADR 0145) as before.
108
+ // this source's unique contribution (M-ADR 0145) as before.
109
109
  if (seenFeatures.has(featureId)) {
110
110
  // Same one-check-two-meanings split as feature-grounding.ts: a hit on
111
111
  // an id seeded from an EARLIER SOURCE is the documented precedence rule
@@ -8,7 +8,7 @@
8
8
  // - openapi/*.yaml → rest
9
9
  // - proto/*.proto → rpc
10
10
  // - avro/*.avsc → event
11
- // - service_id and source_repo_id are nullable; per ADR 0110 the real
11
+ // - service_id and source_repo_id are nullable; per M-ADR 0110 the real
12
12
  // contract sources may live in sibling contracts-* repos. The
13
13
  // canonical builder leaves these empty by default; an OpenAPI
14
14
  // `x-source-repo` extension is honoured as a hint when present
@@ -64,7 +64,7 @@ export async function buildContracts(inputs) {
64
64
  const idByPath = new Map();
65
65
  const seen = new Set();
66
66
  // Contract deprecation source (schema 2.22.0): BASELINE.md deprecation-
67
- // runway entries per ADR 0073 §4.8 — the same source
67
+ // runway entries per M-ADR 0073 §4.8 — the same source
68
68
  // validate-deprecation-runway.sh enforces. Absent file = no deprecations.
69
69
  const deprecatedPaths = await readBaselineDeprecations(inputs.sddPath, inputs.findings);
70
70
  const discovered = [];
@@ -173,7 +173,7 @@ export async function buildContracts(inputs) {
173
173
  /**
174
174
  * Read deprecated contract paths from BASELINE.md at the SDD root.
175
175
  *
176
- * Shape per ADR 0073 §4.8 (the deprecation-runway gate's source):
176
+ * Shape per M-ADR 0073 §4.8 (the deprecation-runway gate's source):
177
177
  * contracts:
178
178
  * openapi: [ { path, status, sunset_date? }, ... ]
179
179
  * proto: [ ... ]