T-WWNY-mc-wire-hydrate-frontmatter-readback
Status: planning/backlog · Impact: medium · Complexity: medium
The Zod-v4 migration introduced hydrateFrontmatter<T>
(plugin/lib/model/entity.ts:436, with its HydrateResult<T> type at
plugin/lib/model/entity.ts:432) to return typed entity frontmatter, but it has
no production consumer — only tests call it. Meanwhile loadCorpus
(plugin/lib/model/corpus/loader.ts:75) and the docs projections still hand
consumers Record<string, unknown> frontmatter. Route those consumers through
hydrateFrontmatter<T> so they get typed entity frontmatter, realizing the
typed-entity win the migration already set up. This is pickable now — it needs no
markdown-contract library change.
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
loadCorpus(and theCorpusEntryfrontmatter it exposes) routes frontmatter throughhydrateFrontmatter<T>, so corpus consumers receive typed entity frontmatter instead ofRecord<string, unknown>. - AC-2: The docs projections that read entity frontmatter consume it via
hydrateFrontmatter<T>rather than untypedRecord<string, unknown>. - AC-3:
hydrateFrontmatter/HydrateResultnow have a real production caller (the previously-dead export is reachable from non-test code), and theentity+corpus+docstest suites stay green.
Out of scope
Section titled “Out of scope”- Cell- and row-level typing of table content — that is W1 (T-2YLD-mc-structured-cells-upstream), W2 (T-2LBP-mc-typed-cell-rewire-touchpoints), and W3 (T-G93C-mc-migrate-scan-placeholders).