T-UAIV-site-projection-framework
Status: closed/done · Impact: high · Complexity: large
Generalize the D-0009 P6 pattern into a framework: any planning entity type renders a roster page plus per-entity child pages with zero wiring, through Eta templates; types needing domain columns register overrides. Glossary and References re-platform as the first two overrides — the proof the framework subsumes the existing specials. D-0010-deterministic-site-assembly §4, §6.
| Location | Role today |
|---|---|
plugin/lib/services/docs/site.ts | Glossary/references rosters + child pages hand-built per type; renders through site_render.ts + site_*.eta templates since T-QWFA (PR #344), but the per-type assembly logic is still bespoke |
plugin/lib/services/docs/site_render.ts | Eta render seam for site pages (T-QWFA) |
plugin/lib/services/docs/site_glossary_template.eta, site_references_template.eta, site_child_page_template.eta | Per-type templates with duplicated roster shape |
plugin/lib/model/entities/<type>/ | No site-projection modules |
Proposed
Section titled “Proposed”Per D-0010 §4/§6: projections.ts — a generic projection (roster at
/planning/<plural>/ with Id/Title/Summary columns, bucketFor
bucketing, <a id> row anchors; child pages at
/planning/<plural>/<slug>/ from the full body; wikilinks resolve to
sibling child routes, else code-format) plus an explicit override
registry. Overrides live in the entity package as
site_projection.ts (report-kind precedent). Rendering goes through
the existing T-QWFA seam: generic site_roster_template.eta /
site_child_page_template.eta replace the per-type
glossary/references templates, whose column variations become
override data, not template forks. Term and reference become
overrides keeping their /glossary/ and /references/ routes
byte-identical.
Approach
Section titled “Approach”- Projection types + generic implementation; route/nav registration through P1/P2 seams.
- Generalize the T-QWFA templates: one roster family, one child-page family; column variations carried in projection data.
- Override registry; port term + reference projections to
site_projection.tsmodules; retiresite_glossary_template.eta/site_references_template.eta. - Golden tests: re-platformed glossary/references output
byte-identical to the post-#344 baseline; generic projection
fixtures under
tests/fixtures/mini/.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/lib/services/docs/site/projections.ts | new | Generic + registry |
plugin/lib/services/docs/site_roster_template.eta | new | Roster family (subsumes glossary/references rosters) |
plugin/lib/services/docs/site_child_page_template.eta | modify | Generalized child-page family |
plugin/lib/services/docs/site_glossary_template.eta | delete | Subsumed |
plugin/lib/services/docs/site_references_template.eta | delete | Subsumed |
plugin/lib/model/entities/term/site_projection.ts | new | Override |
plugin/lib/model/entities/reference/site_projection.ts | new | Override |
plugin/lib/services/docs/site.ts | modify | Bespoke glossary/references assembly retires |
plugin/lib/services/docs/tests/ | modify | Golden + fixture suites |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: A fixture entity type with no override renders roster + child pages through the generic projection.
- AC-2: Re-platformed
/glossary/and/references/pages are byte-identical to the post-#344 baseline. - AC-3: No per-type roster/child-page template forks remain — column variations live in projection data.
- AC-4: Two-pass idempotency holds across the framework’s output.
Out of scope
Section titled “Out of scope”- Rolling out to the planning corpus — T-I6WC-site-corpus-curated-types / T-EC4B-site-corpus-high-volume-types.
- Reference pages (skills/entities/ops) — plugin-surface, not entity projections; they keep their emitters (Eta-ported here only if trivial).
Dependencies
Section titled “Dependencies”- T-G5ND-site-generated-sidebar — nav anchor seam the projections register into (and P1 routes transitively).
Discovery context
Section titled “Discovery context”Extracted from D-0010-deterministic-site-assembly Migration Phase 4.