T-E2B1-site-data-model-page-generated
Status: closed/done · Impact: medium · Complexity: medium
Kill the drift class in the site’s hand-written Data model page: its
entity count and tables derive from the PREFIXES registry and the
entity schemas, per D-0009-reference-entity-and-docs-appendix §5.
The page opens with “nine entity types” today — already false at ten,
falser at eleven.
| Location | Role today |
|---|---|
site/src/content/docs/architecture/data-model.md | Hand-written; hardcoded count, hand-maintained identity and roster tables |
plugin/lib/model/identifier.ts | PREFIXES — authoritative prefix/numbering registry |
plugin/lib/model/entities/ | Per-type schema.json descriptions + properties; _common.json shared fields |
plugin/lib/services/docs/site.ts | The generator pass the page joins |
Proposed
Section titled “Proposed”data-model.md is generated in docs generate site: static narrative
blocks (schema layout, identity rationale, relationships diagram,
task-status walk) + identity table from PREFIXES + roster table
(Type / Role / Key fields beyond _common) from the schemas + a
derived type count; AUTO-GENERATED banner; writeIfChanged
idempotency.
Approach
Section titled “Approach”regenDataModelPageinsite.ts: walkplugin/lib/model/entities/*/schema.json, derive each type’s role (description first sentence) and its properties minus_common.json’s; identity table rows fromPREFIXES(Type / Prefix / Numbering / Wikilink shape); count computed.- Static narrative preserved from the current page where still true; the relationships diagram stays a static block (design intent no schema carries).
- Content-parity check against the hand-written page before replacing it.
- Tests: one roster row per shipped type, derived count, idempotency.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/lib/services/docs/site.ts | modify | regenDataModelPage + dry-run inventory row |
site/src/content/docs/architecture/data-model.md | modify | Becomes generated output (banner, derived tables) |
plugin/lib/services/docs/tests/generate_site.test.ts | modify | Data-model coverage |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: The generated page carries the AUTO-GENERATED banner and a derived type count that
matches
plugin/lib/model/entities/*/schema.json(eleven onceT-UE7Tships). - AC-2: A hand-edit to the page is reverted by
sdlc docs generate site(writeIfChanged). - AC-3: Roster and identity tables list every shipped type with its prefix and key fields; tests pin this.
- AC-4:
npm --prefix site run buildis green.
Out of scope
Section titled “Out of scope”- Generating the other hand-written architecture pages — they stay
under
/dev-update-docssemantic review.
Dependencies
Section titled “Dependencies”T-UE7T— the RF row must exist so the first generated roster is complete (no churn one phase later).
Discovery context
Section titled “Discovery context”- User-added scope during D-0009 planning; extracted from D-0009-reference-entity-and-docs-appendix Migration Phase 4.
Depends on
Section titled “Depends on”T-UE7T