Skip to content

feat(op-canon): canonical_concept_name reverse map re-export#62

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/beautiful-gates-dJo0u
Jul 1, 2026
Merged

feat(op-canon): canonical_concept_name reverse map re-export#62
AdaWorldAPI merged 1 commit into
mainfrom
claude/beautiful-gates-dJo0u

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

Re-export ogar_vocab::canonical_concept_name (OGAR PR #98) on op_canon::app — the reverse codebook map (shared concept id → canonical name). With #61's app_of/concept_of, the app module now round-trips in both directions:

name --class_id_of--> concept id --canonical_concept_name--> name
concept --render_classid--> 0x0001_DDCC --app_of / concept_of--> (prefix, concept)

Why

Same one-source-of-truth discipline as the forward resolvers and #61: the canonical layer (ogar-vocab) owns the map, op-canon re-exports — no local table to drift. It returns the shared canonical name, so both WorkPackage and Redmine's Issue reverse to project_work_item (not the OpenProject surface name).

Tests

  • 1 doctest: round-trip via class_id_of + None for unknown ids.
  • 2 unit tests: reverses class_id_of on the headline concepts; agrees with the Snapshot's own canonical_concept for 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-dJo0u was restarted from the new main (c8a59e6, which contains #61) and this single follow-up commit stacked on top — fast-forward push, fresh PR, no overlap with the walled odoo-rs-transcode branch.

🤖 Generated with Claude Code


Generated by Claude Code

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 AdaWorldAPI merged commit bd3463f into main Jul 1, 2026
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.
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