VALIDATION-PLANES-11: Frontmatter enum, format, and bounds
What it demonstrates
Section titled “What it demonstrates”Zod enum/date/min refinements over frontmatter surface as positioned frontmatter-plane findings.
Builds on: VALIDATION-PLANES-10: Cross into content: a one-field frontmatter schema
How it’s done
Section titled “How it’s done”A TypeScript program against the library API; inline comments show the resulting values and behavior.
const c = contract({ frontmatter: z.strictObject({ id: z.string().min(1), status: z.enum(["open", "closed"]), created: z.string().date(), }),});// status: "bogus" -> frontmatter/enum at the status line// an unexpected key -> frontmatter/unknown-key (strictObject)Surfaces exercised
Section titled “Surfaces exercised”z.enum() / z.string().date() / .min() over frontmatterz.strictObject() -> frontmatter/unknown-key (src/core/content.ts matchFrontmatter)frontmatter/enum (src/core/content.ts frontmatterIdFor)