Skip to content

docs(od-ontology): pull SPO schema from lance-graph + name the compiler-AST frame#13

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/odoo-pull-ontology-schema-from-lance-graph
Jun 22, 2026
Merged

docs(od-ontology): pull SPO schema from lance-graph + name the compiler-AST frame#13
AdaWorldAPI merged 1 commit into
mainfrom
claude/odoo-pull-ontology-schema-from-lance-graph

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

Phase-1 of the repatriation (per REPATRIATION-FRAME.md shipped in #12).
Pulled the rich SPO predicate-schema documentation from
lance_graph::graph::spo::odoo_ontology (wrong-altitude: generic graph spine
carrying a per-app vocabulary) into triple.rs — the consumer that USES the
vocabulary now owns its docs. Additive only; lance-graph's copy stays in place
to be subtracted in a later phase.

The compiler-AST frame (operator-named)

"lance-graph on OGAR is acting like a compiler, so the AST needs to think
like that."

Made explicit at the head of triple.rs:

Odoo source ─[ruff + odoo-blueprint-extractor]→ AST (this corpus)
                            │
                            │ frontend:  parse_ndjson (this module)
                            ▼
                       Vec<Triple>  (the typed AST)
                            │
                            │ lowering passes:
                            │   schema_to_classes  → ogar_vocab::Class    (structure)
                            │   corpus_to_actions  → ogar_vocab::ActionDef (behaviour)
                            ▼
                        OGAR IR
                            │
                            │ codegen:
                            │   ogar-adapter-surrealql → DEFINE TABLE / FIELD
                            ▼
                        Target
  • odoo-rs = the Odoo language frontend of the OGAR compiler.
  • OGAR Class/ActionDef = the IR.
  • lance-graph + adapters = the middle / back end.
  • The 13 predicates = the AST node-type set. A 14th is a language change,
    not a doc update.
  • The 4 truth bands = provenance on every AST node.
  • Slices reference externs resolved by the symbol table (OGAR ClassView),
    not by the slice.

What landed in triple.rs

  • Full 13-predicate × subject-shape × object-shape × provenance-band schema
    table.
  • The four truth-value provenance bands (corrected from lance-graph's
    incomplete 3-band claim — the corpus carries (1.0, 1.0) declaration AND
    (1.0, 0.95) membership; the new test caught the omission).
  • The "a + b → c through d?" Foundry query pattern — what the corpus is FOR.
  • Two enrichment layers (target / inverse_name; deep reads_field) +
    _inherit-only / multi-emitter corrections.

What landed in tests/corpus_schema_pin.rs

10 invariant pins, all green against both shipped corpora (slice-1 and
slice-2). Catches:

  • undocumented predicate appearing in the corpus;
  • truth band outside the four documented;
  • structural band leaking into a non-structural predicate;
  • inherits_from / reads_field self-loops;
  • target carrying an odoo: prefix;
  • validation_kind drift outside the recognised five;
  • raises outside the exc: namespace;
  • the canonical convergence-pin deep read (_compute_amount cross-model).

Three pins shifted in scope from lance-graph's originals (the AST-view
made them demand things the slice corpora can't deliver):

lance-graph claim corrected slice-aware claim
every inherits_from base is a declared ObjectType in this corpus well-formed odoo:<name> IRI (slice externs are AST-valid; resolved via the symbol table)
target object always contains a dot no odoo: prefix (single-word comodels like website are valid)
structural band = rdf:type + has_function (one band) declaration band (1.0, 1.0, rdf:type only) + membership band (1.0, 0.95, has_function only)

Full-corpus integrity claims belong on the full corpus, not on slices.

Tests

39 lib + 7 bin + 10 corpus-pin + all integration green; clippy 0;
fmt-clean. Builds on merged #12 (the frame).

…the compiler-AST frame

Phase-1 repatriation per REPATRIATION-FRAME.md: pulled the rich predicate
schema documentation from `lance_graph::graph::spo::odoo_ontology` (where it
was wrong-altitude — generic graph spine carrying a per-app vocabulary) into
`triple.rs` where the consumer that USES the vocabulary owns its docs.

And operator-named the deeper frame this pull surfaces:

  "lance-graph on OGAR is acting like a compiler, so the AST needs to think
   like that"

Made explicit in triple.rs head: SPO corpus = AST (typed nodes = 13
predicates, provenance = 4 truth bands); odoo-rs = language frontend; OGAR
Class/ActionDef = IR; lance-graph + adapters = middle/back end. Adding a 14th
predicate is a language change, not a doc update. Slices reference externs
resolved by the symbol table (OGAR ClassView), not in-slice.

Pulled into the module doc:
- 13-predicate × 3-S/O-shape × provenance-band schema table
- The 4 truth-value provenance bands (corrected from lance-graph's incomplete
  3-band claim — the corpus actually carries (1.0, 1.0) declaration AND
  (1.0, 0.95) membership; the new test caught it)
- The "a + b → c through d?" Foundry query pattern (what the corpus is FOR)
- Two enrichment layers (target/inverse_name; deep reads_field) + the
  _inherit-only / multi-emitter corrections

New `tests/corpus_schema_pin.rs` — 10 invariant pins, all green against
slice-1 (account_move) and slice-2 corpora. Catches: undocumented predicate
appearing, truth band outside the four, structural band leaking into a
non-structural predicate, inherits_from / reads_field self-loops, target
carrying odoo: prefix, validation_kind drift, raises in wrong namespace,
+ the canonical convergence-pin deep read (_compute_amount cross-model).

Three pins SHIFTED in scope from the lance-graph original (the AST-view
made the demands the slice corpora can't meet): inherits_from base is "well-
formed extern" not "declared in slice"; target object is "raw, no odoo:
prefix" not "must be dotted" (single-word comodels like `website` exist).
Full-corpus integrity claims belong on the full corpus, not slices.

Additive — lance-graph's odoo_ontology.rs untouched (it's the duplicate now,
to be subtracted in a later phase). 39 lib + 7 bin + 10 corpus-pin + all
integration green; clippy 0; fmt-clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@AdaWorldAPI AdaWorldAPI merged commit 440c9a6 into main Jun 22, 2026
AdaWorldAPI pushed a commit that referenced this pull request Jul 7, 2026
…2 to the recipe

OGAR (#174/#175/#176) + lance-graph (#658) migrated to generic plug-and-play
capability handling, retiring the COUNT_FUSE dual-store. Checked odoo-rs
against the migrated mains:

- Restarted branch from merged main (PR #24 = 0bd6809); floated deps to
  OGAR dee1fc5 (hot-plug) + ruff 55bbf60 (which now INCLUDES the merged DTO
  arm, ruff #51). cargo test -p od-ontology --features cli,fieldmask = 17/17
  green. ZERO breakage: COUNT_FUSE was internal to the OGAR<->lance-graph
  bridge; the additive capability_registry/ocr_actions surfaces don't touch
  the Class/ActionDef/compile_graph_python surface odoo-rs consumes.
- Handover §2b documents the socket/authority/bridge/consumer model +
  sibling-path-dep NO-PIN rule + the 5 drift arms.
- W2 revised: the lance-graph V3 sink is no longer 'invent a sink' — it is
  the hotplug-consumer-migration recipe (declare odoo_actions authority
  table + HOT_PLUG const + activation test + executor), mirroring the
  tesseract-rs #13/#14 template. odoo-rs needs no HOT_PLUG until W2.

Ref: E-HOTPLUG-GENERIC-1, E-HOTPLUG-MIGRATION-1,
OGAR .claude/knowledge/hotplug-consumer-migration.md.
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