feat(op-canon): canonical_concept_name reverse map re-export#62
Merged
Conversation
Re-export `ogar_vocab::canonical_concept_name` (OGAR PR #98) on `op_canon::app` — the reverse codebook map (shared concept id -> canonical name), completing the round-trip against class_id_of: name --class_id_of--> concept id --canonical_concept_name--> name Same one-source-of-truth discipline as the forward resolvers and #61's app_of/concept_of: the canonical layer owns the map, op-canon re-exports. Returns the SHARED canonical name (WorkPackage and Redmine's Issue both reverse to project_work_item), not the OpenProject surface name. - 1 doctest (round-trip via class_id_of + None for unknown ids). - 2 unit tests: reverses class_id_of on headline concepts; agrees with the snapshot's canonical_concept for every id it resolves (>=20 covered). cargo +1.95 fmt / clippy -D warnings / test -p op-canon: 23 unit + 8 doctests green.
AdaWorldAPI
pushed a commit
that referenced
this pull request
Jul 1, 2026
Add `Snapshot::concept_by_class_id(id: u16) -> Option<&Concept>` — the reverse lookup returning the full snapshot record for a codebook id, complementing #62's `canonical_concept_name` (which returns only the name via the OGAR map). Where the name-only map suffices for display, this yields the whole Concept — curator classes + class_id_le wire bytes — that corpus-evidence consumers need. Snapshot-backed (covers the OpenProject promoted concepts); the name it carries agrees with the OGAR reverse map, pinned by canonical_concept_name_agrees_with_the_snapshot. - 1 unit test: 0x0102 -> project_work_item record (WorkPackage among the curator classes); every concept round-trips by its own id; unknown -> None. cargo +1.95 fmt / clippy -D warnings / test -p op-canon: 24 unit + 8 doctests green.
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
Re-export
ogar_vocab::canonical_concept_name(OGAR PR #98) onop_canon::app— the reverse codebook map (shared concept id → canonical name). With #61'sapp_of/concept_of, theappmodule now round-trips in both directions:Why
Same one-source-of-truth discipline as the forward resolvers and #61: the canonical layer (
ogar-vocab) owns the map,op-canonre-exports — no local table to drift. It returns the shared canonical name, so bothWorkPackageand Redmine'sIssuereverse toproject_work_item(not the OpenProject surface name).Tests
class_id_of+Nonefor unknown ids.class_id_ofon the headline concepts; agrees with theSnapshot's owncanonical_conceptfor every id it resolves (≥20 covered — the checked-mirror discipline, not a vacuous pass).cargo +1.95 fmt --check/clippy --all-targets -D warnings/test -p op-canon: 23 unit + 8 doctests green.Branch note
Follows the merged #61. Per the merged-branch rule,
beautiful-gates-dJo0uwas restarted from the newmain(c8a59e6, which contains #61) and this single follow-up commit stacked on top — fast-forward push, fresh PR, no overlap with the walledodoo-rs-transcodebranch.🤖 Generated with Claude Code
Generated by Claude Code