Skip to content

refactor(redmine-canon): re-export ogar_vocab::class_ids — one source of truth#5

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/redmine-canon-class-ids-from-ogar
Jun 19, 2026
Merged

refactor(redmine-canon): re-export ogar_vocab::class_ids — one source of truth#5
AdaWorldAPI merged 1 commit into
mainfrom
claude/redmine-canon-class-ids-from-ogar

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

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.

Diff

Before After
~190 lines of constants + ALL + 4 drift tests one pub use ogar_vocab::class_ids::*; + one slim port-local guard
crates/redmine-canon/Cargo.toml       |   4 +
crates/redmine-canon/src/class_ids.rs | 189 ++++++----------------------------
3 files changed, 44 insertions(+), 155 deletions(-)

The 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 -rs ports 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 an ogar-vocab git dep) — is the architectural choice you steered toward (de-dup over self-contained-seed).

Tests

cargo test 13 unit + 1 doctest, all green. clippy (-D warnings) + fmt clean.

Pair

Symmetric PR on the OP side: openproject-nexgen-rs#? (same shape).

… 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.
@AdaWorldAPI AdaWorldAPI merged commit e6acc12 into main Jun 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants