feat: define the generated corpus file schema and layout #363

Merged
manlycucumber merged 2 commits from feature/39-corpus-schema into develop 2026-07-02 06:05:39 +00:00
manlycucumber commented 2026-07-02 06:04:35 +00:00 (Migrated from github.com)

Summary

Ships issue #39: the executable schema for the generated CC0 calendar corpus that the engine will load in place of hand-written seed data.

  • 9 JSON Schemas (draft 2020-12) under data/corpus/schema/ — source registry; sanctoral + temporal identity; temporal skeleton; per-edition attributes + placement; precedence tiers + rules.
  • Sample fixtures under tests/fixtures/corpus/{valid,invalid}/, grounded in the seed feasts.
  • SchemaValidationTest.php (via opis/json-schema, new dev dep) asserts every valid record conforms and every malformed record is rejected — a too-loose or too-strict rule fails CI.

Contract properties (beyond happy-path validity)

  • Identity records forbid rank/colour/date (additionalProperties:false) — the 3-layer model, enforced.
  • Every asserted string carries a cite/cites provenance marker; cites keys are constrained to the citable field vocabulary.
  • The observanceId pattern mirrors ObservanceId::parse() (first temporal segment must be an anchor family; the easter-offset form is never an identifier).
  • colour.base excludes rose (rose is a roseAllowed flag on a violet base).
  • aliases.secondaryFacet is a list of ObservanceId slugs, not prose.

Verification

Local gate green: lint (PSR-12), analyse (PHPStan L6), test574 tests, 30,612 assertions. A 4-dimension adversarial review workflow (design fidelity · schema semantics · VO consistency · liturgical fidelity) surfaced 7 defects, all fixed here and locked with negative fixtures — including correcting Gaudete Sunday from class I to class II per the 1960 rubrics.

Closes #39.

## Summary Ships issue #39: the executable schema for the generated CC0 calendar corpus that the engine will load in place of hand-written seed data. - **9 JSON Schemas** (draft 2020-12) under `data/corpus/schema/` — source registry; sanctoral + temporal identity; temporal skeleton; per-edition attributes + placement; precedence tiers + rules. - **Sample fixtures** under `tests/fixtures/corpus/{valid,invalid}/`, grounded in the seed feasts. - **`SchemaValidationTest.php`** (via `opis/json-schema`, new dev dep) asserts every valid record conforms and every malformed record is rejected — a too-loose or too-strict rule fails CI. ## Contract properties (beyond happy-path validity) - Identity records **forbid** rank/colour/date (`additionalProperties:false`) — the 3-layer model, enforced. - Every asserted string carries a `cite`/`cites` provenance marker; `cites` keys are constrained to the citable field vocabulary. - The `observanceId` pattern mirrors `ObservanceId::parse()` (first temporal segment must be an anchor family; the easter-offset form is never an identifier). - `colour.base` excludes `rose` (rose is a `roseAllowed` flag on a violet base). - `aliases.secondaryFacet` is a list of ObservanceId slugs, not prose. ## Verification Local gate green: `lint` (PSR-12), `analyse` (PHPStan L6), `test` — **574 tests, 30,612 assertions**. A 4-dimension adversarial review workflow (design fidelity · schema semantics · VO consistency · liturgical fidelity) surfaced 7 defects, all fixed here and locked with negative fixtures — including correcting Gaudete Sunday from class I to **class II** per the 1960 rubrics. Closes #39.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Directorium/Core!363
No description provided.