Skip to content

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.

  • AC-1: loadCorpus (and the CorpusEntry frontmatter it exposes) routes frontmatter through hydrateFrontmatter<T>, so corpus consumers receive typed entity frontmatter instead of Record<string, unknown>.
  • AC-2: The docs projections that read entity frontmatter consume it via hydrateFrontmatter<T> rather than untyped Record<string, unknown>.
  • AC-3: hydrateFrontmatter / HydrateResult now have a real production caller (the previously-dead export is reachable from non-test code), and the entity + corpus + docs test suites stay green.

← Back to Tasks