Skip to content

Commit f8e9d48

Browse files
committed
feat(ar_shape): OGIT canonical vocabulary + per-extractor codebooks (Rails + Odoo) fold curator vocab into ogit:includes/isMemberOf/contains/isPartOf
Operator clarification 2026-06-19: "if we have one canonical, it just needs a codebook for import. and OGAR can use canonical." OGIT TTL at /home/user/OGIT/SGO/sgo/verbs/{includes,isMemberOf,contains, isPartOf}.ttl defines the canonical relation predicate vocabulary. Each is owl:ObjectProperty subPropertyOf ogit:Verb. The workspace already calls lance-graph-ontology "the OGIT-canonical ontology spine" (per .claude/knowledge/ontology-registry.md). OGAR is the compiler that USES OGIT canonical predicates; the IRIs stay ogit:-prefixed. What landed: 1. New pub mod ogit_relations with the 4 canonical relation IRIs: - ogit:includes (one-to-many parent → children; has_many, One2many) - ogit:isMemberOf (many-to-one child → parent; belongs_to, Many2one) - ogit:contains (composition; habtm, Many2many from composing side) - ogit:isPartOf (inverse of contains) Plus is_relation_predicate() direction-blind check. 2. translate_rails_to_ogit(triples) — joins declares_association + association_kind and emits the directional OGIT predicate: | Rails kind | OGIT predicate | |---------------------------|--------------------| | belongs_to | ogit:isMemberOf | | has_many | has_one | ogit:includes | | has_and_belongs_to_many | ogit:contains | Missing kind triple defaults to belongs_to (conservative). 3. translate_odoo_to_ogit(triples, ns) — maps target → ogit:isMemberOf (the Many2one-dominant default for today's Odoo extractor which doesn't surface field_kind). Subject rewritten from <class>.<field> → <class>; object underscored to match workspace IRI convention (account.tax → odoo:account_tax). Future Odoo-extractor extension emitting field_kind sibling triple → dispatch to includes/contains. 4. classes_matching_commercial_line_item_shape_canonical — single detector walks ogit_relations canonical predicates direction-blind. Replaces the per-vocabulary dispatch with one canonical pass. 5. 4 new tests, all green: - ogit_relation_predicates_have_stable_canonical_iris - rails_codebook_translates_has_many_to_includes_and_belongs_to_to_is_member_of - odoo_codebook_translates_target_to_is_member_of_with_underscored_comodel - ogit_canonical_detector_finds_line_item_classes_on_both_corpora (loads OSB fixture + workspace Odoo; codebook-translates both; asserts InvoiceLineItem and account_move_line both surface via the canonical detector) Plus all 10 prior tests still green → 14/14 total. What this collapses: - E-OGAR-AR-SHAPE-SMOKE-2 finding "two extractor predicate vocabularies" → SOLVED. Each extractor stays free to emit its native shape; OGAR consumes OGIT canonical after a per-extractor codebook pass. - Doctrine §2 correction 4 "the ontology shapes everything agnostically through the contract" → contract carries OGIT-canonical Triples; ontology holds the codebook; consumers don't know which extractor produced what. - §11.1 Inc 4 (curator promotion probe) → F4 is now falsifiable today on the existing corpus pair via the codebook layer; the upstream-alignment path (E-AR-PROJECTION-CORRECTION-1 Phase 1 Option A) can ship later, moving the codebook one layer up without changing OGAR's consumer surface. Adding a new extractor (Spree, future SAP) means adding ONE codebook function; the detector stays unchanged. OGIT vs OGAR (operator-confirmed): OGIT = canonical predicate vocabulary source (TTL prefix ogit:, http://www.purl.org/ogit/). OGAR = the compiler/Core that consumes OGIT canonical (per docs/OGAR_AR_SHAPE_ENDGAME.md). No ogar: predicate prefix; the pub mod ogit_relations is correctly named. EPIPHANIES E-OGAR-AR-SHAPE-SMOKE-3 prepended. Cross-refs: - OGIT/SGO/sgo/verbs/{includes,isMemberOf,contains,isPartOf}.ttl (canonical predicate definitions) - crates/lance-graph-ontology/src/ar_shape.rs (codebooks + canonical detector + 4 new tests; 14/14 green) - E-OGAR-AR-SHAPE-SMOKE-2 (the predicate-vocab divergence this closes) - E-OGAR-AR-SHAPE-SMOKE-1 (hand-fixture predecessor) - .claude/knowledge/ontology-registry.md (OGIT-canonical spine framing) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xzyc27Nx3f8WC5KzwfWfjx
1 parent 93074fa commit f8e9d48

2 files changed

Lines changed: 353 additions & 0 deletions

File tree

.claude/board/EPIPHANIES.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,32 @@ The local-scan `memberof` (#this-branch) is the **in-mailbox special case** of "
302302
**Three threads are ONE structure:** basin-tree (1→4→16…) = Morton tile pyramid (quadtree subdivision) = `perturbation-sim` L1-L4 cascade levels = the field perturbation-learning runs over. Distance = hop count = pyramid level = cascade round — **one number, three readings**.
303303

304304
**Wiring (gated on the 5+3 council for the SoA-ownership commitment):** add `row_for_member_index` to the contract (basin-node → member row); wire the EdgeBlock out-family slot → sibling basin-node via ClassView (Options 1+2); reclassify **CHAODA as a unary `node_anomaly`** (point↔manifold LFD), NOT a pairwise `DistanceMeans` — it never belonged in the hop-distance dispatch. The `node_distance(PrefixDepth)` tree-hop is already the basin-tree distance; no new means needed for the structural tier. Cross-refs: `E-PANCAKES-IS-RADIX-IS-HHTL` (radix subtree = basin), `E-COARSE-QUANTIZER-IS-SCALE-FREE-ROUTER` (basin-node = IVF coarse centroid = parent SoA), `E-CLAM-IS-THE-MANIFOLD-ENGINE` (CHAODA = unary anomaly), `E-WHT-META-AWARENESS-AND-KRONECKER-LOOKUP` (pyramid energy = the field summary), `E-GUID-IS-THE-GRAPH`, canon node 512 B, `perturbation-sim::{sketch::walsh_pyramid_energy, chaoda}`, OGAR "256×256 centroid tile" + "perturbation = (exponent, location, phase, magnitude)".
305+
## 2026-06-19 — E-OGAR-AR-SHAPE-SMOKE-3 — OGIT is the canonical predicate vocabulary; OGAR consumes canonical via per-extractor codebooks; `translate_rails_to_ogit` + `translate_odoo_to_ogit` fold curator vocabularies into `ogit:includes/isMemberOf/contains/isPartOf`
306+
307+
**Status:** FINDING (operator-directed clarification, 2026-06-19; 14/14 ar_shape tests green including 4 new OGIT-canonical ones). **Closes the predicate-vocabulary divergence from `E-OGAR-AR-SHAPE-SMOKE-2`** by naming what the convergence target IS, not just describing the divergence.
308+
309+
**The click (operator-stated):** *"if we have one canonical, it just needs a codebook for import. and OGAR can use canonical."*
310+
311+
**What this entry locks:**
312+
313+
1. **OGIT defines the canonical predicate vocabulary.** Verified by reading `OGIT/SGO/sgo/verbs/{includes,isMemberOf,contains,isPartOf}.ttl` locally at `/home/user/OGIT/`. Each is a `owl:ObjectProperty` `subPropertyOf ogit:Verb`, defined by the AdaWorldAPI/OGIT canonical TTL: `ogit:includes` ("Indicates if an entity includes something else"), `ogit:isMemberOf` ("An entity can be a member of another entity"), `ogit:contains` ("This relationship indicates that something is part of something else"), `ogit:isPartOf` ("Indicates if an entity is part of another entity"). 176 OGIT verbs total in `SGO/sgo/verbs/`. Workspace usage already aligns: `lance-graph-ontology` is documented as *"the OGIT-canonical ontology spine"* (per `.claude/knowledge/ontology-registry.md`), and policy evaluation runs against *"canonical OGIT entity type"* (per the sprint-6 conformance test).
314+
315+
2. **OGIT vs OGAR distinction (operator-confirmed):** OGIT = the canonical predicate vocabulary (source of `ogit:` IRIs in TTL). OGAR = the AR-shaped THINK/DO compiler that USES OGIT canonical (per `docs/OGAR_AR_SHAPE_ENDGAME.md`). Predicates stay `ogit:`-prefixed because OGIT TTL is their source; OGAR consumes them. There is no `ogar:` predicate prefix, only an OGAR consumer of `ogit:` predicates. `pub mod ogit_relations` in `ar_shape.rs` is correctly named.
316+
317+
3. **Per-extractor codebooks fold curator vocab → OGIT canonical.** New `pub fn translate_rails_to_ogit(triples) -> Vec<Triple>`: joins `declares_association` + `association_kind` and emits the directional OGIT predicate (`belongs_to → ogit:isMemberOf`, `has_many|has_one → ogit:includes`, `habtm → ogit:contains`). New `pub fn translate_odoo_to_ogit(triples, ns) -> Vec<Triple>`: maps `target` → `ogit:isMemberOf` (conservative Many2one default; future Odoo-extractor extension can emit a sibling `field_kind` triple to dispatch on M2O / O2M / M2M). The codebook pattern dissolves `E-OGAR-AR-SHAPE-SMOKE-2`'s vocabulary-divergence finding: each extractor stays free to emit its native shape; OGAR consumes the canonical after a small per-extractor translation.
318+
319+
4. **`classes_matching_commercial_line_item_shape_canonical` runs on OGIT-canonical triples directly.** Direction-blind: both `ogit:isMemberOf` (child→parent) and `ogit:includes` (parent→children) count as "relation present" for the doc-parent + tax-binding intersection. One detector, one canonical vocabulary, both curators surface their expected class on the real corpora: `InvoiceLineItem` on OSB (translated from `declares_association` + `association_kind`), `account_move_line` on Odoo (translated from `target`).
320+
321+
**The collapse from the SMOKE-2 finding.** Before: two extractor jargons (`declares_association` for Rails, `target` for Odoo), one detector that had to dispatch on which predicate appeared. After: one OGIT-canonical vocabulary, one detector. Adding a new extractor (Spree, future SAP) means adding ONE codebook function; the detector stays unchanged.
322+
323+
**What this means for the broader plan.** §11.1 Inc 4 (curator promotion probe): the codebook layer is the in-repo workaround that makes F4 falsifiable today on the existing corpus pair, NOT contingent on `E-AR-PROJECTION-CORRECTION-1` Phase 1 Option A (upstream alignment of nexgen's projection to emit unified Rails vocab). Both paths converge — upstream alignment can ship later as it's just moving the codebook one layer up. The doctrine §2 correction 4 (*"the ontology shapes everything agnostically through the contract"*) now has a concrete cash-out: the contract `Triple` carries OGIT-canonical predicates; the ontology (lance-graph-ontology) holds the codebook; consumers (OGAR detectors, future adapter codegen) read OGIT canonical and don't know which extractor produced it.
324+
325+
**Out of scope (operator discipline acceptance #4-7):** still only one `CanonicalConcept` (`CommercialLineItem`). The OGIT-canonical detector is a TRANSPARENT replacement of the per-vocabulary one for that single concept; adding TaxPolicy / CommercialDocument / etc. is sibling functions, each gated by its own ≥2-curator harvest evidence.
326+
327+
**Cross-refs:** `crates/lance-graph-ontology/src/ar_shape.rs` (`pub mod ogit_relations` + `translate_rails_to_ogit` + `translate_odoo_to_ogit` + `classes_matching_commercial_line_item_shape_canonical` + 4 new tests); `OGIT/SGO/sgo/verbs/{includes,isMemberOf,contains,isPartOf}.ttl` (the canonical predicate definitions); `E-OGAR-AR-SHAPE-SMOKE-2` (the predicate-vocabulary divergence finding this closes); `E-OGAR-AR-SHAPE-SMOKE-1` (the hand-fixture predecessor, retained); `.claude/knowledge/ontology-registry.md` (the "OGIT-canonical ontology spine" framing this entry implements).
328+
329+
---
330+
305331
## 2026-06-19 — E-OGAR-AR-SHAPE-SMOKE-2 — operator pivot: ruff_ruby_spo replaces hand-fixtures, surfaces extractor-vocabulary divergence (Rails `declares_association` ≠ Odoo `target`); detector now vocabulary-aware on real 1195+ triple OSB + 2.8 MB Odoo corpora
306332

307333
**Status:** FINDING (operator-directed pivot, 2026-06-19; 10/10 ar_shape tests green including 4 new harvest-driven ones). **The findings:**

0 commit comments

Comments
 (0)