Skip to content

feat(op-canon): Snapshot::concept_by_class_id reverse record lookup#63

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

feat(op-canon): Snapshot::concept_by_class_id reverse record lookup#63
AdaWorldAPI merged 1 commit into
mainfrom
claude/beautiful-gates-dJo0u

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

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).

Why

The name-only map is enough for display, but corpus-evidence work needs the whole Concept — its curator classes and class_id_le wire bytes — that an Option<&'static str> can't carry. This is the id-keyed sibling of the existing concept(name) and concept_of_class(curator_class) lookups. Snapshot-backed (covers the OpenProject promoted concepts); the name it carries agrees with the OGAR reverse map, already pinned by canonical_concept_name_agrees_with_the_snapshot.

Tests

  • 1 unit test: 0x0102 → the project_work_item record (with WorkPackage among its curator classes); every concept round-trips by its own id; unknown id → None.
  • cargo +1.95 fmt --check / clippy --all-targets -D warnings / test -p op-canon: 24 unit + 8 doctests green.

Branch note

Follows the merged #62. Per the merged-branch rule, beautiful-gates-dJo0u was restarted from the new main (bd3463f, containing #62) 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

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