Commit 5795a22
committed
feat(ar_shape): ERP AST test at EDGE level — OSB(Rails) + Odoo emit the same canonical concept-GRAPH
Operator "you were in the odoo vs rails based ERP AST test" (2026-06-19).
The synergy work so far proved NAME-level convergence (class IRI →
CanonicalConcept). This lands the deeper test: EDGE-level convergence —
the concept GRAPH converges across a Rails-based ERP and Odoo, which is
what makes it an AST not a label table.
New surface in ar_shape.rs:
- concept_of_token(token) -> Option<CanonicalConcept> — resolves a
single relation token (Odoo comodel class name OR Rails relation
leaf) to its concept by the same lexical hints the 11 class
detectors use. Priority-ordered: *line*/tax/stock_move resolve
before the bare document arms so ambiguous substrings classify
correctly. Returns None for real-but-unpromoted targets
(estimate, uom, analytic_account) — honest, not fabricated.
- ConceptEdge type alias (CanonicalConcept, CanonicalConcept).
- ConceptDetector type alias (clears the synergy_registry_one_shot
type_complexity clippy warning).
- concept_edges(triples, ns, is_rails) -> BTreeSet<ConceptEdge> —
runs the per-curator OGIT codebook (translate_rails_to_ogit /
translate_odoo_to_ogit), resolves BOTH endpoints of each canonical
relation to concepts, returns the edge set (self-edges dropped).
Convergence proven on real corpora (3 tests):
- CommercialLineItem → CommercialDocument
OSB: InvoiceLineItem.invoice (Rails declares_association, leaf
"invoice"). Odoo: account_move_line.move_id → account.move (Odoo
target). Different field name, different predicate, SAME edge.
- CommercialLineItem → TaxPolicy
OSB: InvoiceLineItem.{tax1,tax2} (two named FKs). Odoo:
account_move_line.tax_ids → account.tax (one M2M). Different
cardinality, SAME edge.
- CommercialDocument → BillingParty
OSB: Invoice belongs_to :client. Odoo: account_move → partner_id →
res.partner. Convergence isn't limited to the line-item node.
Tests:
- concept_of_token_resolves_both_curator_vocabularies
- osb_rails_and_odoo_commercial_line_item_share_concept_edges
- osb_rails_and_odoo_commercial_document_both_link_billing_party
Plus all 28 prior tests still green → 31/31 total. ar_shape
clippy-clean (the pre-existing synergy detector-table type_complexity
warning is resolved via the ConceptDetector alias).
Why this is THE AST test: node-level convergence (SMOKE-1..4) shows
two curators NAME the same concepts. Edge-level shows two curators
STRUCTURE them identically — line item is a member of a document,
document belongs to a party, line carries a tax. Strip Rails/Odoo
syntax and the same business AST remains. This is doctrine §2
"labels are leaf detail; the SHAPE is what overlaps" proven at the
relation level — the strongest cash-out yet of OGAR-is-the-compiler
(the concept-graph IS the compiled output; the curators are
interchangeable front-ends).
EPIPHANIES E-OGAR-AR-SHAPE-SMOKE-5 prepended.
Cross-refs:
- E-OGAR-AR-SHAPE-SMOKE-3 (the OGIT canonical codebooks this builds on)
- E-OGAR-AR-SHAPE-SMOKE-4 (the node-level sibling concepts)
- docs/OGAR_AR_SHAPE_ENDGAME.md §2 correction 4 (labels-are-leaf-detail,
now proven at edge level)
- AdaWorldAPI/OGAR CODEBOOK (the concept-edges ARE the family-edge
structure OGAR's canonical classes encode)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xzyc27Nx3f8WC5KzwfWfjx1 parent bd274ea commit 5795a22
2 files changed
Lines changed: 441 additions & 142 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
285 | 301 | | |
286 | 302 | | |
287 | 303 | | |
| |||
0 commit comments