feat(ogar-vocab): canonical_concept_name — the id → concept-name reverse map#98
Merged
Merged
Conversation
…rse map The inverse of `canonical_concept_id`: `canonical_concept_name(u16) -> Option<&'static str>`, a linear scan over the existing CODEBOOK. Ids are unique in the codebook (now asserted by a round-trip test over all 39 entries), so the mapping is 1:1 and round-trips both ways. This is the capability odoo-rs filed as PROBE-OGAR-ID-TO-CONCEPT-NAME (its specs/UPSTREAM_WISHLIST.md): a consumer that resolved a classid via a port alias (name → id) needs id → concept-name to (a) stamp a readable `COMMENT 'commercial_document (classid:0x00020202)'` into emitted DDL and (b) populate `Class::canonical_concept` from an id — WITHOUT copying the codebook locally (which the Core-First doctrine forbids). The forward step plus this reverse step also resolves the lexical asymmetry: both `sale.order` and `account.move` resolve to 0x0202 → `commercial_document`, where neither name lexically IS the concept. Additive, zero behaviour change. 2 new tests (round-trip over CODEBOOK + known-ids/None); full ogar-vocab suite 85 passing, clippy clean on the new code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Adds the inverse of
canonical_concept_id:A linear scan over the existing
CODEBOOK(the(name, id)source of truth).Ids are unique in the codebook — now asserted by a round-trip test over all 39
entries — so the mapping is 1:1 and round-trips both ways:
canonical_concept_id(canonical_concept_name(id)?) == Some(id).0x0202commercial_document0x0103billable_work_entry0x0204billing_party0xFFFF/0x0000NoneWhy
This is the capability odoo-rs filed as
PROBE-OGAR-ID-TO-CONCEPT-NAME(its
specs/UPSTREAM_WISHLIST.md). A consumer that resolved a classid via aport alias (
name → id) needs theid → concept-namedirection to:COMMENT 'commercial_document (classid:0x00020202)'into emitted SurrealQL DDL (today it can only stamp the hex), and
Class::canonical_conceptfrom an id soschema_classidscollapses into a derived view over
Class::canonical_id()—without copying the codebook locally, which the Core-First doctrine forbids
(the consumer must pull from the Core, not mint a parallel registry). The
forward+reverse pair also resolves the lexical asymmetry the consumer can't:
both
sale.orderandaccount.moveresolve to0x0202 → commercial_document,where neither name lexically is the concept.
Verified
canonical_concept_name_round_trips(all 39 CODEBOOK entries,both directions — doubles as the id-uniqueness guard) +
canonical_concept_name_known_ids_and_none_for_unknown.ogar-vocabsuite 85 passing, 0 failed.Additive, zero behaviour change, no symbol removed. Unblocks the odoo-rs
name-enrichment +
canonical_conceptfusion (follow-on PR once this lands).