Context
See ROADMAP.md section 'Grammar Hardening'.
Problem
The content renderer currently uses Object.entries(item)[0] to discriminate content types. This pattern:
- Relies on JS object insertion order (not guaranteed)
- Prevents TypeScript discriminated unions
- Produces poor error messages
Solution
Migrate to an explicit type field on every content item. This is a breaking change that:
- Enables proper discriminated union narrowing
- Produces clearer validation errors
- Requires updates to all YAML files, tests, and content types
Acceptance Criteria
- Update Zod schemas to use z.object({ type: z.literal('...'), ... }) pattern
- Update content renderer to use item.type switch
- Update all content type TypeScript discriminated unions
- Migrate all YAML content files to use explicit type field
- Update unit tests
- Update E2E tests
- Regenerate JSON schemas
- Update AGENTS.md tables
Timeline
This is a breaking change - coordinate with next major version bump.
Context
See ROADMAP.md section 'Grammar Hardening'.
Problem
The content renderer currently uses Object.entries(item)[0] to discriminate content types. This pattern:
Solution
Migrate to an explicit type field on every content item. This is a breaking change that:
Acceptance Criteria
Timeline
This is a breaking change - coordinate with next major version bump.