refactor: derive 1954 rank from legacyRank; add generator unit tests #448
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!448
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/63-rank-derivation"
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?
Foundation-review follow-up (PR #447, top recommendation) — do the rank-model hardening before the full 1954 dataset and
Rubrics1954Precedence(#67) depend on the grade↔class pairing.Problem
A 1954 block authored both
legacyRank(grade token) andrank(numeric class) as independent, independently-cited facts. A typo (duplex-ii-classis+rank: 1) would pass every gate — the schema validates each separately and the provenance gate only checks each is cited, not that they agree.Fix
Make the numeric
ranka single derived fact:transformSanctoraleEditionderivesrankfromlegacyRankviaDEFAULT_RANK_BY_LEGACY, cited to the grade's own source.rankOverridehandles the divergent cases. The default table is a coarse sort key; the fine grade lives inlegacyRankand is whatRubrics1954Precedence(#67) will order on.dominica-*/feria-maiorin a sanctoral block) or arankOverridemissing its cite errors the build.Behaviour-preserving
The 8 authored 1954 blocks drop their now-redundant explicit
rank. The regenerated corpus is byte-identical (git status data/corpusis empty after rebuild) — the derivation reproduces the exact same records. The golden fixture and the entire 1962 corpus are untouched.Tests (the generator had none)
New Node harness —
npm test(node --test), wired into thecorpus-verifyCI job.tools/generator/test/transform.test.mjscovers the derivation across all seven sanctoral grades,rankOverrideprecedence + its required citation, the unmapped-grade and missing-grade fail-closed paths, and edition-absence skipping.Closes review follow-up (1); the edition-diff report (2) and enum-scoping (4) remain tracked for the dataset-burndown / #61.
Part of Epic #63.