---
title: Tightened the frontmatter contract across 142 pages
description: Deleted `domain`, required `wing` + `genre`, renamed `growthStage` to `stability` and gated it to the genres where it means something. 142 files migrated by codemod in one pass.
section: meta
tags: [meta, changelog, schema, frontmatter, refactor, fumadocs, types, codemod]
genre: index
lastUpdated: 2026-04-23
url: https://fardiniqbal.com/docs/changelog/2026-04-23-schema-purity-pass
---


The frontmatter contract had drifted. `domain` was redundant with `wing` on every page. `growthStage` used title-case values and applied to genres where "stability" made no sense — what does it mean for an index page to be "Developing"? `visibility: private-draft` was conflating two states: private (I don't want this public) and pending-review (this is a draft awaiting promotion). `highlight` was a changelog-only field hiding in the global schema. The whole thing was held together by convention rather than types.

I did the Hejlsberg pass. Deleted `domain` and the DOMAINS constant. Required `wing` + a new `genre` on every MDX — `index | reference | log | essay | story | journal | changelog`. Renamed `growthStage` to `stability`, lowercased the values, and gated it to `genre: reference | log` via a discriminated union at the source layer so the compiler refuses to let you mark an index page "stable." Split `private-draft` into a clean `private` on the public schema and moved pending-review state onto `DraftSchema` where it belongs. Renamed `highlight` to `featured` and required `changelogCategory` on every changelog entry. Extracted `changelogDocSchema` so Fumadocs wires the union at the source layer instead of at runtime.

142 MDX files migrated by `scripts/codemod-schema-purity.ts` in one pass. Biome, tsc, and `next build` all green. Also merged `introduction.mdx` into `index.mdx` — the role-lane IA had been living in two places and the introduction page was the one nobody visited. The contract is now strict enough that the next time I add a genre, the type system will tell me every place I forgot to handle it.
