refactor(redmine-canon): re-export ogar_vocab::class_ids — one source of truth#5
Merged
Merged
Conversation
… of truth Follow-on to AdaWorldAPI/OGAR#76 (class_ids landed in ogar-vocab itself). The local class_ids block was byte-identical to op-canon::class_ids; both now re-export from ogar_vocab::class_ids so the constants cannot drift across ports. The codebook is minted once in OGAR; the typed constants come from there. Changes: - Cargo.toml: add ogar-vocab git dep (branch=main). - src/class_ids.rs: replaced 200 lines of constants + 4 drift tests with one `pub use ogar_vocab::class_ids::*` + one slim port-local guard. The retained port-local test (snapshot_concepts_match_re_exported_constants) is the one that's still meaningful here: it verifies the vendored snapshot agrees with OGAR's published codebook for every concept. A regen that produces an id disagreeing with the codebook contract (ids never re-move) fails CI before any consumer breaks. OGAR carries the upstream forward+reverse guards (constants ↔ CODEBOOK). cargo test 13 unit + 1 doctest, all green. clippy -D warnings + fmt clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-on to AdaWorldAPI/OGAR#76 (class_ids landed in
ogar-vocabitself).The local
class_idsblock was byte-identical toop-canon::class_ids. Both now re-export fromogar_vocab::class_idsso the constants cannot drift across ports. The codebook is minted once in OGAR; the typed constants come from there.Diff
ALL+ 4 drift testspub use ogar_vocab::class_ids::*;+ one slim port-local guardThe retained port-local test (
snapshot_concepts_match_re_exported_constants) is the one still meaningful here: every concept the vendored snapshot promotes must agree with OGAR's published codebook at the same id. A regen that drifts from the codebook contract (ids never re-move) fails CI before any consumer breaks.OGAR carries the upstream forward+reverse guards (constants ↔
CODEBOOK), so they're not duplicated here.Why
The two
-rsports stop carrying the same byte-identical numbers in two places. A future OGAR codebook promotion needs to update one source, not three. The trade-off — losing strict self-containment (gains anogar-vocabgit dep) — is the architectural choice you steered toward (de-dup over self-contained-seed).Tests
cargo test13 unit + 1 doctest, all green. clippy (-D warnings) + fmt clean.Pair
Symmetric PR on the OP side: openproject-nexgen-rs#? (same shape).