feat: make the precedence table data-driven (#43) #420
No reviewers
Labels
No labels
area: build
area: ci
area: compare
area: data
area: engine
area: model
area: provenance
area: rite
area: validation
backport
blocked
breaking
confirmed
dependencies
duplicate
epic
github_actions
invalid
needs-info
needs-triage
php
priority: high
priority: low
priority: medium
regression
type: bug
type: chore
type: correction
type: docs
type: enhancement
type: feature
type: fix
type: perf
type: refactor
type: security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Directorium/Core!420
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/43-precedence-dataset"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Completes #43 — the last data-for-code refactor in Epic #38, and with it the whole corpus-generator epic.
What moves to data
Rubrics1962Precedenceheld the entire 1962 precedence rule set as private constants. Those move into cited corpus data behind aPrecedenceTableread seam:greatest=1 …fourth=28, gaps preserved),kind=sundayyet aren't first-class Sundays),The engine keeps the branching logic (which selector a day maps to); the data holds the facts (which ordinal a selector is, which ids are great feasts, how many commemorations a class admits). The resolver is now genuinely rubric-generic — the seam #59 will reuse for the 1954/1955 and Novus Ordo tables.
Shape (matches the frozen #39 schemas)
facts/precedence.yaml→editions/roman-rubricae-1960/precedence-tiers.ndjson(precedence-tier) +editions/roman-rubricae-1960/precedence-rules.ndjson(precedence-rules— aoneOfof membership sets and commemoration limits). Per edition, since the precedence table is the rubric family.rg-1960); the born-cited provenance gate resolves each cite.Design notes
PrecedenceTablelives in the Precedence layer and depends only onCorpus(no Calendar types) — so the layer stays acyclic. Cache is keyed by the corpus root dir, so a fixture tree never collides with the shipped one.DayContractstill computes its commemoration limit through the codedCommemorationLimithelper; that helper is left untouched and pinned equal to the data by test, so the two can't drift.Safety
resolveYear()output is byte-identical across the swap (1584–2200), proving the precedence refactor inert. Pre-existing corpus outputs and hashes untouched; the change is purely additive (2 new NDJSON files + manifest entries).PrecedenceTableTestproves the AC directly: reordering the tier data (first-sunday→ ordinal 99 in a fixture corpus) makes the same engine resolve a first-class Sunday to 99 with no code edit, and binds the commemoration limits to the coded baseline.composer test→ 615 tests, 31 586 assertions green ·composer lintclean ·composer analyse[OK]·npm run verify→ 12 files, reproducible + matching committed.Closes #43.