feat(ontology): odoo hydrator + DOLCE classifier (four-way alignment seam)#412
Conversation
…seam)
First concrete increment of the odoo → lance-graph-ontology integration.
Adds the Layer-1 odoo OWL hydrator and the Layer-2 alignment seed so
woa-rs odoo-extracted business models resolve into the existing financial
ontology, per woa-rs/.claude/reference/four_way_alignment_seam.md.
- modules/odoo/manifest.yaml + build.rs: new OGIT slot ODOO_V1=(50,1),
inherits_from fibofnd, 17 entity types (u16=4300..4316, no collision).
- data/ontologies/odoo/odoo-core.ttl: 17 core odoo classes as owl:Class.
- data/ontologies/odoo/alignment/{odoo-to-fibo,odoo-to-skr}.ttl:
owl:equivalentClass/equivalentProperty axioms (Seam decision 1 / Option B
— odoo inherits FIBO/SKR slots, no new CAM family). Includes the
account.move dual-nature projection (Open-question 5).
- hydrators/odoo.rs: hydrate_odoo + hydrate_odoo_from, inherits_from
FIBOFND, edge whitelist {rdfs:subClassOf, owl:equivalentClass, ...}.
- hydrators/dolce_odoo.rs: classify_odoo + DolceCategory enum (own module
per Open-question 3); suffix heuristics + product.template Endurant
special-case + default Endurant.
- tests: 21-row seam classifier matrix + hydrate smoke (seed + canonical).
cargo test -p lance-graph-ontology: 127 passed / 0 failed.
cargo test -p lance-graph-contract: 449 passed / 0 failed.
https://claude.ai/code/session_016NwUSxRobQRH26KUJXvEYn
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces comprehensive Odoo ERP integration to the lance-graph-ontology crate, adding business model definitions in Turtle, alignment axioms to FIBO and SKR chart-of-accounts, a suffix-based DOLCE classifier, ontology hydration with inheritance and edge whitelisting, and full test coverage. ChangesOdoo Integration Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df7c234f9d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # false it is a natural person. Mirrors seam Step 2. | ||
|
|
||
| odoo:res.partner.Company | ||
| owl:equivalentClass fibo-be-le:LegalEntity . |
There was a problem hiding this comment.
Align company partners to the canonical LegalEntity IRI
When res.partner.Company is routed through owl:equivalentClass, this target does not match the FIBO entities hydrated elsewhere in this repo: crates/lance-graph-ontology/tests/fibo_be_hydrator_smoke.rs documents and asserts that LegalEntity resolves as https://www.omg.org/spec/Commons/Organizations/LegalEntity, not under BE/LegalEntities/LegalPersons/. In a registry with FIBO-BE/FND loaded, the cascade will therefore land on an Odoo-local interned IRI from this overlay rather than the canonical FIBO node, so company partners will not actually resolve into the financial ontology.
Useful? React with 👍 / 👎.
| owl:equivalentClass ubl:Invoice . | ||
|
|
||
| odoo:account.move.line | ||
| owl:equivalentClass fibo-fnd-acc-aeq:JournalEntry . |
There was a problem hiding this comment.
Preserve the journal-entry-line pivot for move lines
For account.move.line, this maps the Odoo line item to the whole JournalEntry class even though the adjacent seed-table alignment in crates/lance-graph-callcenter/src/odoo_alignment.rs uses the JournalEntryLine pivot and labels it as ogit.SMBAccounting:JournalEntryLine. With this overlay loaded, line-item rows collapse onto the parent journal-entry concept, so downstream accounting resolution can no longer distinguish the move header from its individual lines.
Useful? React with 👍 / 👎.
…tion + E-CODEBOOK-INHERITS-FROM-OGIT Per the 2026-05-28 user-given doctrine (distilled across four messages): "every data is now LE-byte contract SoA in each mailbox / bitpacked is also only a desperation bucket / normally LE SoA should have codebook for everything including semantic ontology graph / inherited from OGIT because the SoA doesn't guess." Adds the canonical identity layer that supersedes the bitpacked RoleKey form shipped in feaa587: **New: crates/lance-graph-contract/src/callcenter/ogit_uris.rs (8 tests)** - SAVANT_OGIT_BASE = "https://ogit.adaworldapi.com/callcenter/savants#" - SAVANT_OGIT_URIS: LazyLock<[String; 25]> — one URI per savant, roster order - savant_ogit_uri(id) / savant_ogit_uri_by_name(name) — lookup helpers - 8 unit tests: uris_match_savant_count, uris_use_canonical_namespace, id_1_resolves_to_fiscal_position_resolver, id_16_is_absent, id_26_resolves_to_backorder_judge, id_lookup_matches_name_lookup, nonexistent_name_returns_none, every_savant_in_roster_has_a_uri Resolves through `lance-graph-ontology::registry::OntologyRegistry` (infrastructure already shipped — PR #407/#408 hydrators, PR #412 DOLCE classifier, PR #416 FIBU/FIBO alignment, the canonical lingua-franca path). The OntologyRegistry resolves the URI to a stable u32 codebook code; the LE-byte mailbox SoA columns store the code. The Baton (u16, CausalEdge64) carries the code across mailbox boundaries. **Updated: contract::callcenter::role_keys (doc-only update)** Module-level documentation now explicitly flags the bitpacked RoleKey slices as the desperation-bucket fallback per the new doctrine; canonical savant identity is via the OGIT URI in ogit_uris. Code unchanged (still compiled, 7 tests still pass) — usable for ephemeral in-mailbox Hamming compare where codebook lookup is unavailable. **Updated: contract::callcenter::mod.rs** Re-exports the new ogit_uris module + adds the two-identity-layer rationale in the module doc (canonical OGIT URI + desperation-bucket RoleKey). **Prepended: .claude/board/EPIPHANIES.md — E-CODEBOOK-INHERITS-FROM-OGIT** Captures the full doctrine across all four 2026-05-28 messages: Vsa16kF32 deprecated, LE-byte SoA per mailbox, codebook for everything, inheritance from OGIT, Kontenerkennung-style multi-dim rich codebook (parent chain + NARS confidence per link + business × transaction × form × regulation × law × entity × product), audit query layer (episodic + AriGraph SPO-G + regulation-ontology + NARS confidence threshold). **Queued (separate D-ids, captured in the EPIPHANIES entry):** - (a) data/ontologies/ogit/callcenter/savants.ttl + OntologyRegistry hydration for the 25 savants - (b) Kontenerkennung-style inheritance struct with NARS confidence per parent link - (c) regulation-ontology codebook (HGB / GoB / AO / UStG / IFRS / GoBD) - (d) audit-threshold dispatch in cognitive-shader-driver (NARS confidence vs audit_floor → CausalEdge64 emission or escalation Baton) Tests: 15 callcenter tests total (8 new ogit_uris + 7 existing role_keys); 454 prior contract lib tests unaffected. https://claude.ai/code/session_017gZ6sPRXYPj5n7uJ7NBtRv
…tion + E-CODEBOOK-INHERITS-FROM-OGIT Per the 2026-05-28 user-given doctrine (distilled across four messages): "every data is now LE-byte contract SoA in each mailbox / bitpacked is also only a desperation bucket / normally LE SoA should have codebook for everything including semantic ontology graph / inherited from OGIT because the SoA doesn't guess." Adds the canonical identity layer that supersedes the bitpacked RoleKey form shipped in feaa587: **New: crates/lance-graph-contract/src/callcenter/ogit_uris.rs (8 tests)** - SAVANT_OGIT_BASE = "https://ogit.adaworldapi.com/callcenter/savants#" - SAVANT_OGIT_URIS: LazyLock<[String; 25]> — one URI per savant, roster order - savant_ogit_uri(id) / savant_ogit_uri_by_name(name) — lookup helpers - 8 unit tests: uris_match_savant_count, uris_use_canonical_namespace, id_1_resolves_to_fiscal_position_resolver, id_16_is_absent, id_26_resolves_to_backorder_judge, id_lookup_matches_name_lookup, nonexistent_name_returns_none, every_savant_in_roster_has_a_uri Resolves through `lance-graph-ontology::registry::OntologyRegistry` (infrastructure already shipped — PR #407/#408 hydrators, PR #412 DOLCE classifier, PR #416 FIBU/FIBO alignment, the canonical lingua-franca path). The OntologyRegistry resolves the URI to a stable u32 codebook code; the LE-byte mailbox SoA columns store the code. The Baton (u16, CausalEdge64) carries the code across mailbox boundaries. **Updated: contract::callcenter::role_keys (doc-only update)** Module-level documentation now explicitly flags the bitpacked RoleKey slices as the desperation-bucket fallback per the new doctrine; canonical savant identity is via the OGIT URI in ogit_uris. Code unchanged (still compiled, 7 tests still pass) — usable for ephemeral in-mailbox Hamming compare where codebook lookup is unavailable. **Updated: contract::callcenter::mod.rs** Re-exports the new ogit_uris module + adds the two-identity-layer rationale in the module doc (canonical OGIT URI + desperation-bucket RoleKey). **Prepended: .claude/board/EPIPHANIES.md — E-CODEBOOK-INHERITS-FROM-OGIT** Captures the full doctrine across all four 2026-05-28 messages: Vsa16kF32 deprecated, LE-byte SoA per mailbox, codebook for everything, inheritance from OGIT, Kontenerkennung-style multi-dim rich codebook (parent chain + NARS confidence per link + business × transaction × form × regulation × law × entity × product), audit query layer (episodic + AriGraph SPO-G + regulation-ontology + NARS confidence threshold). **Queued (separate D-ids, captured in the EPIPHANIES entry):** - (a) data/ontologies/ogit/callcenter/savants.ttl + OntologyRegistry hydration for the 25 savants - (b) Kontenerkennung-style inheritance struct with NARS confidence per parent link - (c) regulation-ontology codebook (HGB / GoB / AO / UStG / IFRS / GoBD) - (d) audit-threshold dispatch in cognitive-shader-driver (NARS confidence vs audit_floor → CausalEdge64 emission or escalation Baton) Tests: 15 callcenter tests total (8 new ogit_uris + 7 existing role_keys); 454 prior contract lib tests unaffected. https://claude.ai/code/session_017gZ6sPRXYPj5n7uJ7NBtRv
…tion + E-CODEBOOK-INHERITS-FROM-OGIT Per the 2026-05-28 user-given doctrine (distilled across four messages): "every data is now LE-byte contract SoA in each mailbox / bitpacked is also only a desperation bucket / normally LE SoA should have codebook for everything including semantic ontology graph / inherited from OGIT because the SoA doesn't guess." Adds the canonical identity layer that supersedes the bitpacked RoleKey form shipped in feaa587: **New: crates/lance-graph-contract/src/callcenter/ogit_uris.rs (8 tests)** - SAVANT_OGIT_BASE = "https://ogit.adaworldapi.com/callcenter/savants#" - SAVANT_OGIT_URIS: LazyLock<[String; 25]> — one URI per savant, roster order - savant_ogit_uri(id) / savant_ogit_uri_by_name(name) — lookup helpers - 8 unit tests: uris_match_savant_count, uris_use_canonical_namespace, id_1_resolves_to_fiscal_position_resolver, id_16_is_absent, id_26_resolves_to_backorder_judge, id_lookup_matches_name_lookup, nonexistent_name_returns_none, every_savant_in_roster_has_a_uri Resolves through `lance-graph-ontology::registry::OntologyRegistry` (infrastructure already shipped — PR #407/#408 hydrators, PR #412 DOLCE classifier, PR #416 FIBU/FIBO alignment, the canonical lingua-franca path). The OntologyRegistry resolves the URI to a stable u32 codebook code; the LE-byte mailbox SoA columns store the code. The Baton (u16, CausalEdge64) carries the code across mailbox boundaries. **Updated: contract::callcenter::role_keys (doc-only update)** Module-level documentation now explicitly flags the bitpacked RoleKey slices as the desperation-bucket fallback per the new doctrine; canonical savant identity is via the OGIT URI in ogit_uris. Code unchanged (still compiled, 7 tests still pass) — usable for ephemeral in-mailbox Hamming compare where codebook lookup is unavailable. **Updated: contract::callcenter::mod.rs** Re-exports the new ogit_uris module + adds the two-identity-layer rationale in the module doc (canonical OGIT URI + desperation-bucket RoleKey). **Prepended: .claude/board/EPIPHANIES.md — E-CODEBOOK-INHERITS-FROM-OGIT** Captures the full doctrine across all four 2026-05-28 messages: Vsa16kF32 deprecated, LE-byte SoA per mailbox, codebook for everything, inheritance from OGIT, Kontenerkennung-style multi-dim rich codebook (parent chain + NARS confidence per link + business × transaction × form × regulation × law × entity × product), audit query layer (episodic + AriGraph SPO-G + regulation-ontology + NARS confidence threshold). **Queued (separate D-ids, captured in the EPIPHANIES entry):** - (a) data/ontologies/ogit/callcenter/savants.ttl + OntologyRegistry hydration for the 25 savants - (b) Kontenerkennung-style inheritance struct with NARS confidence per parent link - (c) regulation-ontology codebook (HGB / GoB / AO / UStG / IFRS / GoBD) - (d) audit-threshold dispatch in cognitive-shader-driver (NARS confidence vs audit_floor → CausalEdge64 emission or escalation Baton) Tests: 15 callcenter tests total (8 new ogit_uris + 7 existing role_keys); 454 prior contract lib tests unaffected. https://claude.ai/code/session_017gZ6sPRXYPj5n7uJ7NBtRv
…tion + E-CODEBOOK-INHERITS-FROM-OGIT Per the 2026-05-28 user-given doctrine (distilled across four messages): "every data is now LE-byte contract SoA in each mailbox / bitpacked is also only a desperation bucket / normally LE SoA should have codebook for everything including semantic ontology graph / inherited from OGIT because the SoA doesn't guess." Adds the canonical identity layer that supersedes the bitpacked RoleKey form shipped in feaa587: **New: crates/lance-graph-contract/src/callcenter/ogit_uris.rs (8 tests)** - SAVANT_OGIT_BASE = "https://ogit.adaworldapi.com/callcenter/savants#" - SAVANT_OGIT_URIS: LazyLock<[String; 25]> — one URI per savant, roster order - savant_ogit_uri(id) / savant_ogit_uri_by_name(name) — lookup helpers - 8 unit tests: uris_match_savant_count, uris_use_canonical_namespace, id_1_resolves_to_fiscal_position_resolver, id_16_is_absent, id_26_resolves_to_backorder_judge, id_lookup_matches_name_lookup, nonexistent_name_returns_none, every_savant_in_roster_has_a_uri Resolves through `lance-graph-ontology::registry::OntologyRegistry` (infrastructure already shipped — PR #407/#408 hydrators, PR #412 DOLCE classifier, PR #416 FIBU/FIBO alignment, the canonical lingua-franca path). The OntologyRegistry resolves the URI to a stable u32 codebook code; the LE-byte mailbox SoA columns store the code. The Baton (u16, CausalEdge64) carries the code across mailbox boundaries. **Updated: contract::callcenter::role_keys (doc-only update)** Module-level documentation now explicitly flags the bitpacked RoleKey slices as the desperation-bucket fallback per the new doctrine; canonical savant identity is via the OGIT URI in ogit_uris. Code unchanged (still compiled, 7 tests still pass) — usable for ephemeral in-mailbox Hamming compare where codebook lookup is unavailable. **Updated: contract::callcenter::mod.rs** Re-exports the new ogit_uris module + adds the two-identity-layer rationale in the module doc (canonical OGIT URI + desperation-bucket RoleKey). **Prepended: .claude/board/EPIPHANIES.md — E-CODEBOOK-INHERITS-FROM-OGIT** Captures the full doctrine across all four 2026-05-28 messages: Vsa16kF32 deprecated, LE-byte SoA per mailbox, codebook for everything, inheritance from OGIT, Kontenerkennung-style multi-dim rich codebook (parent chain + NARS confidence per link + business × transaction × form × regulation × law × entity × product), audit query layer (episodic + AriGraph SPO-G + regulation-ontology + NARS confidence threshold). **Queued (separate D-ids, captured in the EPIPHANIES entry):** - (a) data/ontologies/ogit/callcenter/savants.ttl + OntologyRegistry hydration for the 25 savants - (b) Kontenerkennung-style inheritance struct with NARS confidence per parent link - (c) regulation-ontology codebook (HGB / GoB / AO / UStG / IFRS / GoBD) - (d) audit-threshold dispatch in cognitive-shader-driver (NARS confidence vs audit_floor → CausalEdge64 emission or escalation Baton) Tests: 15 callcenter tests total (8 new ogit_uris + 7 existing role_keys); 454 prior contract lib tests unaffected. https://claude.ai/code/session_017gZ6sPRXYPj5n7uJ7NBtRv
…ate-Jd2iZ feat(ontology): odoo hydrator + DOLCE classifier (four-way alignment seam)
…tion + E-CODEBOOK-INHERITS-FROM-OGIT Per the 2026-05-28 user-given doctrine (distilled across four messages): "every data is now LE-byte contract SoA in each mailbox / bitpacked is also only a desperation bucket / normally LE SoA should have codebook for everything including semantic ontology graph / inherited from OGIT because the SoA doesn't guess." Adds the canonical identity layer that supersedes the bitpacked RoleKey form shipped in feaa587: **New: crates/lance-graph-contract/src/callcenter/ogit_uris.rs (8 tests)** - SAVANT_OGIT_BASE = "https://ogit.adaworldapi.com/callcenter/savants#" - SAVANT_OGIT_URIS: LazyLock<[String; 25]> — one URI per savant, roster order - savant_ogit_uri(id) / savant_ogit_uri_by_name(name) — lookup helpers - 8 unit tests: uris_match_savant_count, uris_use_canonical_namespace, id_1_resolves_to_fiscal_position_resolver, id_16_is_absent, id_26_resolves_to_backorder_judge, id_lookup_matches_name_lookup, nonexistent_name_returns_none, every_savant_in_roster_has_a_uri Resolves through `lance-graph-ontology::registry::OntologyRegistry` (infrastructure already shipped — PR #407/#408 hydrators, PR #412 DOLCE classifier, PR #416 FIBU/FIBO alignment, the canonical lingua-franca path). The OntologyRegistry resolves the URI to a stable u32 codebook code; the LE-byte mailbox SoA columns store the code. The Baton (u16, CausalEdge64) carries the code across mailbox boundaries. **Updated: contract::callcenter::role_keys (doc-only update)** Module-level documentation now explicitly flags the bitpacked RoleKey slices as the desperation-bucket fallback per the new doctrine; canonical savant identity is via the OGIT URI in ogit_uris. Code unchanged (still compiled, 7 tests still pass) — usable for ephemeral in-mailbox Hamming compare where codebook lookup is unavailable. **Updated: contract::callcenter::mod.rs** Re-exports the new ogit_uris module + adds the two-identity-layer rationale in the module doc (canonical OGIT URI + desperation-bucket RoleKey). **Prepended: .claude/board/EPIPHANIES.md — E-CODEBOOK-INHERITS-FROM-OGIT** Captures the full doctrine across all four 2026-05-28 messages: Vsa16kF32 deprecated, LE-byte SoA per mailbox, codebook for everything, inheritance from OGIT, Kontenerkennung-style multi-dim rich codebook (parent chain + NARS confidence per link + business × transaction × form × regulation × law × entity × product), audit query layer (episodic + AriGraph SPO-G + regulation-ontology + NARS confidence threshold). **Queued (separate D-ids, captured in the EPIPHANIES entry):** - (a) data/ontologies/ogit/callcenter/savants.ttl + OntologyRegistry hydration for the 25 savants - (b) Kontenerkennung-style inheritance struct with NARS confidence per parent link - (c) regulation-ontology codebook (HGB / GoB / AO / UStG / IFRS / GoBD) - (d) audit-threshold dispatch in cognitive-shader-driver (NARS confidence vs audit_floor → CausalEdge64 emission or escalation Baton) Tests: 15 callcenter tests total (8 new ogit_uris + 7 existing role_keys); 454 prior contract lib tests unaffected. https://claude.ai/code/session_017gZ6sPRXYPj5n7uJ7NBtRv
Summary
First concrete increment of the odoo → lance-graph-ontology integration, so woa-rs odoo-extracted business models resolve into the existing financial ontology (per
woa-rs/.claude/reference/four_way_alignment_seam.md).ODOO_V1 = (50, 1),inherits_from: fibofnd— via newmodules/odoo/manifest.yaml+ one additive line inlance-graph-contract/build.rs(slot 50, above the prior max of 42; entity codes 4300–4316, no collision).data/ontologies/odoo/odoo-core.ttl— 17 core odoo classes asowl:Class.odoo/alignment/{odoo-to-fibo,odoo-to-skr}.ttl—owl:equivalentClass/equivalentPropertyaxioms. Seam decision 1 / Option B: odoo inherits existing FIBO/SKR slots and does not get its own CAM codebook family. Includes theaccount.movedual-nature projection (Open-question 5).hydrators/odoo.rs—hydrate_odoo/hydrate_odoo_from, edge whitelist incl.rdfs:subClassOf+owl:equivalentClass.hydrators/dolce_odoo.rs—classify_odoo(iri) -> DolceCategory, its own module (Open-question 3); suffix heuristics +product.templateEndurant special-case.Test plan
cargo test -p lance-graph-ontology— green (incl. the 21-row seam classifier matrix + hydrate smoke:hydrate_odoo_fromreturns Ok with non-zero entities, alignment TTLs parse)cargo test -p lance-graph-contract— green (build.rs regeneratesODOO_V1)main(which now carries the Cognitive substrate: locked 33-TSV atom layer + 34-tactic recipes + escalation loop #411 cognitive substrate) — 0 failures, 0 compile errorsNotes
account.move.linewould fall through to Endurant (the snippet only listed.move), contradicting the seam matrix (→ Perdurant). Fixed with an explicit.move.linesuffix.lance-graph-callcenter::odoo_alignmentalready ships a paralleldolce_odoo()+DolceMarker+ODOO_SEED(CAM seed-table layer). Doctrinally consistent with this ontology-side (TTL-hydration) classifier but not unified — cross-crate dedup is a candidate follow-up, deliberately deferred to keep this increment build-safe.https://claude.ai/code/session_016NwUSxRobQRH26KUJXvEYn
Generated by Claude Code
Summary by CodeRabbit
New Features
Tests
Documentation