feat(odoo-spo): regenerate corpus with inherits_from + validation_kind (#526 follow-up)#527
Conversation
#526 follow-up) PR #526 shipped the inherits_from (ruff#19) + validation_kind (ruff#21) enrichment passes as code, but left the corpus regen pending — that session lacked the Odoo source tree. This session has /home/user/odoo/addons, so the two passes now land their triples in the shipped corpus. Regenerated via the merged spo_enrich (additive, (s,p,o)-idempotent): P1/P0 0 new (already present; #525 inherit[0] + multi-emitter baked in) inherits_from 166 new validation_kind 247 new 24166 -> 24579 odoo_ontology.rs: count 24_166 -> 24_579; histogram gains inherits_from=166 + validation_kind=247; module doc updated; 2 new regression tests (enrichment_emits_inherits_from_to_declared_base, enrichment_emits_validation_kind_on_constrains_method). cargo test -p lance-graph --lib odoo_ontology 13/13 green; fmt clean; python3 -m unittest tests.test_spo_enrich 41/41 (no python change). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CcpLeEC3XK8Eye53GKBVvi
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAppends 413 SPO NDJSON triples to the Odoo ontology corpus introducing ChangesOdoo SPO Corpus Enrichment and Test Alignment
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…d Core, harvest is subordinate
Repurposes the P3 selection_value work after the operator caught a real
architectural inversion: the wishlist's structural asks (target /
inverse_name / inherits_from / selection_value) are CORE facts, not
behavioural harvest, and belong in the typed `OdooEntity` Core
(`lance-graph-ontology::odoo_blueprint`) — not bolted onto the flat SPO
ndjson by `spo_enrich.py`.
Source-verified: `OdooField.target` ALREADY exists in the Core, so the
`target` harvest pass was re-deriving a fact the Core already held;
`inherits_from` + `selection_value` were genuine Core gaps filled on the
harvest side — the "Core gap → extend the Core deliberately, never hack
the adapter" anti-pattern.
# Why a side-table, not a struct field
`OdooField` has 3 554 literal sites, `OdooEntity` 404, no constructor.
Adding a field to the mega-structs breaks every literal. The
doctrine-correct "extend the Core deliberately" for a literal sea that
size is a TYPED SIDE-TABLE — still Core, still authoritative, beside the
mega-structs instead of inside them.
# What lands
New `odoo_blueprint/structural.rs`:
- `OdooInherits { model, bases }` — the _inherit/_inherits mixin chain
(OdooEntityKind records the ORM base class, not the mixin list)
- `OdooFieldSelection { model, field, values }` — Selection value domain
(OdooFieldKind::Selection flags it; OdooField never stored the values)
- Curated `account.move` consts, GROUNDED: INHERITS matches the #527
corpus (mail_activity_mixin + sequence_mixin); FIELD_SELECTIONS uses
canonical standard Odoo state/move_type value sets.
- `project_inherits_from` / `project_selection_value` — Core → SPO
projection (direction of truth: Core out to SPO, never the reverse).
- 5 tests incl. a consistency check against the #527 corpus.
# Reframing (anti-self-fulfilling-drift)
So a future session does NOT read the prior work as "add another
spo_enrich predicate":
- `spo_enrich.py` module-doc gains an ARCHITECTURE NOTE: the structural
predicates' authoritative home is the typed Core; this file is the
Extracted-leg BREADTH feeder for the ~322 ObjectTypes the curated
Core hasn't reached; Curated Core wins on convergence. Behavioural
predicates (deep reads_field, emitted_by, validation_kind) ARE
genuine harvest and correctly stay.
- `EPIPHANIES.md` prepends E-ODOO-CORE-FIRST-STRUCTURAL, which
explicitly BOUNDS THE FRAMING of the four prior E-ODOO-SPO-* entries
so the predicate-bolt-on cadence isn't read as the intended
architecture. Names `virtually_overrides` as a ClassView/Core
capability — NOT harvest predicate #6.
# Not changed
The selection_value AST reader in spo_enrich.py stays (it's the Extracted
leg's mechanism for breadth) — now correctly subordinate to the Core.
Behavioural harvest is untouched.
# Tests
cargo test -p lance-graph-ontology --lib structural : 5/5
python3 -m unittest tests.test_spo_enrich : 53/53
cargo test -p lance-graph --lib odoo_ontology : 13/13 (unchanged)
Summary
Executes the one explicit pending step from #526: "Corpus regenerated against live
/home/user/odoo/addons— pending next session with Odoo source." #526 shipped theinherits_from(ruff#19) +validation_kind(ruff#21) enrichment passes as code, but the shipped corpus carried none of their triples because that session lacked the Odoo source tree. This session has/home/user/odoo/addons, so the two passes now land their data in the shipped corpus.What changed
Regenerated the corpus through the merged four-pass
spo_enrich. The pass is additive and(s,p,o)-idempotent, so re-running over the already-enriched corpus added only the genuinely new predicates:target/inverse_namereads_fieldinherits_from(ruff#19)validation_kind(ruff#21)24 166 → 24 579. The P1/P0 zero-delta confirms #525's
inherit[0]fix and the multi-emitter deep-read lifts are already baked into the corpus (no drift).validation_kinddistribution:presence108 /range80 /lookup31 /uniqueness18 /format10.Rust (
crates/lance-graph/src/graph/spo/odoo_ontology.rs)24_166→24_579inherits_from= 166 andvalidation_kind= 247enrichment_emits_inherits_from_to_declared_base—account_account inherits_from mail_thread; asserts everyinherits_frombase is a corpus-declaredogit:ObjectTypeand no edge is a self-loop (the Odoo extend-in-place idiom is dropped at scan time).enrichment_emits_validation_kind_on_constrains_method—_check_account_codeclassifiedformat; asserts every object ∈ {presence, uniqueness, range, format, lookup}.Tests
cargo test -p lance-graph --lib odoo_ontology— 13/13 greencargo fmt -p lance-graph --check— cleanpython3 -m unittest tests.test_spo_enrich— 41/41 (no Python change this round; the mergedspo_enrichalready carries fix(odoo-spo): #523 review follow-up — multi-emitter deep-reads + _inherit-only models #525's fix + feat(odoo-spo): inherits_from (P1b/ruff#19) + validation_kind (P2/ruff#21) #526's passes)Consumer follow-up (separate, on
AdaWorldAPI/odoo-rs)od_ontology::RecomputeDagand a futureClassViewMRO walk now see the 166 inheritance edges. The odoo-rsUPSTREAM_WISHLISTP1 (_inherit/_inherits) + P2 (validation_kind) become upstream-resolved once a consumer PR picks them up. No odoo-rs change here (one-way pull).🤖 Generated with Claude Code
https://claude.ai/code/session_01CcpLeEC3XK8Eye53GKBVvi
Generated by Claude Code
Summary by CodeRabbit
New Features
inherits_fromandvalidation_kind) to enhance inheritance and validation tracking within the corpus.Tests
Documentation