knowledge(ast-address): the three-layer "why" — rails-shaped semantic AST → importable OGIT ERP primitives#617
Conversation
Follow-up to #616. The merged doc stated the *what* (AST as the (part_of:is_a) GUID address); this adds the *why*, grounded in shipped contract code verified this session: - Layer 1 — rails-shaped semantic AST at assembler cost: the four facet.rs SIMD lanes ARE the LSP ops (definition=vpcmpeqd, typeHierarchy=vpxor+tzcnt, ...). Declarative shape is the precondition. - Layer 2 — static OGAR / dynamic ClassView / askama: the class_view.rs XML/XSD/ClassView/XSLT ladder + C2 (presence-never-semantics) and N3 (append-only positions) = how a row view evolves 17 years (Redmine) without breaking persisted rows. View AND conditional classaction are the two projections of ONE ClassView over the N×6×(part_of:is_a) SoA. - Layer 3 — OGAR as importable ERP-primitive stdlib + lance as compiler: ogar_codebook canonical_concept_id (import) + render_classid_for_concept (customize); cost collapses to O(consumer deltas). DO arm is ALSO wireable: ActionDef/ActionInvocation/KausalSpec (OGAR-AST-CONTRACT) is the behavioral IR; the arago/HIRO ActionHandler model (OGIT = almato/arago ontology) transcodes into it. Behavior is conditionalized at the cost of one ClassView classaction dispatch. Three honest boundaries kept explicit: (1) mechanism shipped, stdlib mostly empty; (2) DO wireable but KausalSpec-membrane-governed, and an ActionDef's internal compute is still its content; (3) cheapness requires pull-don't-reconstruct (the consumer-preflight iron rule). Status stays CONJECTURE. Verified this session: facet_mint 8/8 tests green in the zero-dep contract crate; facet.rs/class_view.rs/ ogar_codebook.rs surfaces cited exist on main. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
📝 WalkthroughWalkthroughAdds a new conceptual section to the AST-as- ChangesAST-as-
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25a63ce6c1
ℹ️ 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".
|
|
||
| | economic step | shipped surface | | ||
| | --- | --- | | ||
| | **import** a primitive | `canonical_concept_id("account.move") → u16` → `classid` → `ClassView` | |
There was a problem hiding this comment.
Replace Odoo aliases with canonical codebook keys
When a consumer follows this table literally, canonical_concept_id("account.move") returns None in the shipped contract code: ogar_codebook.rs only accepts canonical-shaped keys such as commercial_document, and its docs explicitly say curator/source aliases must be normalized through OGAR first. This makes the advertised zero-dep import path fail for Odoo concepts and can push consumers toward hardcoded fallback ids instead of the shared codebook.
Useful? React with 👍 / 👎.
…on pointer Extends the #617 thesis with the operator's economic framing, grounded: - Layer 3 sharpened: the importable primitives are LAWS/REGULATIONS as static universal reusable patterns (ObjectView = required fields; ActionDef/KausalSpec = regulatory rules), not CRUD shapes. Content stays with the consumer (I-VSA-IDENTITIES); only the pattern is shared. Grounded: OGIT NTO/{Audit,Compliance,Legal} regulation-as-pattern. - OWL↔OGIT bijective-lossless class conversion cited as the enabling result (operator-proven, attributed not re-run); mechanism is structural — OGIT {entities,verbs,attributes} IS the (part_of:is_a) shape, so OWL regulatory ontologies (e.g. FIBO) import losslessly. - Boundary #1 revised: stdlib source is NOT empty — complete OGIT is imported into OGAR at vocab/imports/ogit (~1,940 TTL incl. Audit/Compliance/Legal/Security + SDF Automation = HIRO DO-arm source). The remaining step is mint-to-codebook (facet_mint -> ogar_codebook), not harvest. - DO-in-the-consumer reduces to a classaction POINTER: lossless ontology => class identity preserved bijectively across consumers => behavior is pointed-at, not re-implemented. classid -> ActionDef, dispatched via an ActionInvocation DTO; consumer holds pointer + KausalSpec guard + content; the body lives once at the target. = the OGAR consumer doctrine (classid is pure address; magic at the resolution target). - Magnitude anchored: OpenProject ~500K LOC; marginal consumer cost collapses to import + pointers + deltas, one-time mint amortized across all consumers. Flagged as the CONJECTURE's payoff the brick-3 probe must turn into a measurement. Correction logged: the local `owl` repo is camel-ai's multi-agent framework (arXiv:2505.23885), NOT W3C OWL — not cited as the converter. Status stays CONJECTURE. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
OpenProject + Odoo as ~2 MB of GUID-encoded (part_of:is_a) vs ~20 MB / ~250K LOC (~10x). Dimensional check: 16 B/FacetCascade => 2 MB ~= 131K class/member/field nodes, enough for both ERPs' structural skeleton. Honest caveat recorded: the 2 MB is THINK-arm structure + classaction pointers — DO-arm ActionDef bodies are minted once in OGAR and shared, so it's the per-consumer marginal footprint over a shared library, not the whole system in 2 MB. The 10x ratio is the hypothesis the brick-3 MedCare probe gives the first datapoint for. Status stays CONJECTURE. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
…ayoff Integrate the now-merged AST-as-(part_of:is_a)-address arc (#616 "what" + V3 alignment, #617 "why") and the facet_mint rank-minter brick into the V3 value-tenant migration plan (soa-value-tenant-migration-v2.md), as first-class roadmap rather than a side thread. §0–§6 stay operator-locked and untouched. New §7 records the *application* the two-phase sequencing exists to serve: - The why beneath §0's what: once identity is V3 (Phase 1) and the value tenants are the V3-shaped contained facet (Phase 2), a transcode source's structural AST IS its address — so minting an ERP in any consumer collapses to importing pre-minted OGIT class primitives + wiring classaction pointers; the low-code platform self-programs at assembler cost instead of re-transcoding ~500K LOC per consumer. - The arc IS this plan's (part_of:is_a) structure axis made literal — the shipped FacetCascade read as hi_chain=part_of / lo_chain=is_a is the "shadow the V3 key casts" §1 already names; downstream of BOTH phases. - The brick chain mapped onto the phases + gates: brick 1 (slot allocation) LOCKED by the shipped FacetCascade; brick 2 (facet_mint rank-minter) BUILT (360fc72); brick 3 (MedCare ruff_csharp_spo -> mint -> SoA -> typeHierarchy probe, MedCareV2 oracle) PENDING = the single CONJECTURE->FINDING gate. - Canon:Custom is ONE lock shared with §2.2: the minter's facet_classid is a parameter, so resolving canon(hi):custom(lo) settles both the Phase-1 classid entries and the minter's row-0 ordering in one decision. Arc stays [S]->[H] CONJECTURE; gate F-code via brick 3. Header pointer added; cross-refs extended (ast doc, facet_mint, ruff #29). Board: LATEST_STATE note prepended (2026-06-26). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TANd15SECEb1Gm4cpaRVD9
Session handover for the next session: what shipped (#616 merged, #617 merged, ruff #29 open), the three-layer thesis, the V3 state (OSINT/FMA/ CPIC all wired as of #618 — none by this session), the built-but-unmerged minter (facet_mint @ serene-mayer 360fc72, 8 tests green), and the brick-3 MedCare probe as the single CONJECTURE→FINDING gate. Includes the burn/owl corrections and the sync-first discipline. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
Cross-links the parallel V3-identity/genome session (614/615/618, q2/cpic NARS prototype, CYP2D6 falsifier) as the companion half of the arc. Three corrections their handover surfaced: - mint OGIT->codebook is a CROSS-REPO arc (ogar-vocab + contract CODEBOOK + lance-graph-ogar parity together), per ISS-OGAR-GENETICS-MIRROR-PENDING / E-CODEBOOK-MINT-IS-A-CROSS-REPO-ARC — not a local wire. - Canon:Custom flip must be atomic over the COMPLETE V3 set (OSINT+FMA+ CPIC), now unblocked by #618 (I-LEGACY-API-FEATURE-GATED). - Board-hygiene debt logged: #616/#617 shipped without same-commit EPIPHANIES/PR_ARC/LATEST_STATE updates; fold into the next PR alongside the companion's outstanding 614/615/618 rows. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
What
Follow-up to #616. The merged doc stated the what (store the AST as the
(part_of:is_a)GUID address); this adds the why — the full economic thesis, co-developed this session and grounded in shipped contract code + the OGIT import in OGAR. Documentation only; no code or contract surface touched. Status stays CONJECTURE.4 commits: three-layer thesis → laws-as-patterns / OGIT-imported / DO-as-classaction-pointer → 2 MB headline target.
The three layers (each citing a shipped surface)
facet.rsSIMD lanes are the LSP ops (definition=vpcmpeqd,typeHierarchy=vpxor+tzcnt,documentSymbol=hi_chain, ancestry=GFNI Morton). A graph traversal collapses to a register XOR +tzcnt. The declarative (rails) shape is the precondition — only the THINK arm flattens to fixed-width tiles.class_view.rs's own XML/XSD/ClassView/XSLT ladder + C2 (presence-never-semantics) and N3 (append-only positions) = a row view that evolves like Redmine's 17 years without invalidating a stored row. View and conditionalclassactionare the two projections of one ClassView over theN × 6×(part_of:is_a)SoA.ogar_codebook::canonical_concept_id(import) +render_classid_for_concept(customize: lo=canon concept, hi=custom render); transcode cost collapses from O(whole app) to O(consumer deltas).The economic thesis (operator-developed)
ObjectView= required fields;ActionDef/KausalSpec= rules). Content stays with the consumer (I-VSA-IDENTITIES); only the pattern is shared. Grounded: OGITNTO/{Audit, Compliance, Legal}.{entities, verbs, attributes}is the(part_of:is_a)shape — so OWL regulatory ontologies (e.g. FIBO) import losslessly.ActionDef/ActionInvocation/KausalSpec(OGAR-AST-CONTRACT.md) is the behavioral IR; the arago/HIRO ActionHandler model transcodes into it (OGIT = almato/arago's, TTL creatorchris.boos@almato.com). In the consumer, DO reduces to a classaction pointer —classid → ActionDef, dispatched via anActionInvocationDTO; the consumer holds the pointer +KausalSpecguard + content, the body lives once at the target. That is the OGAR consumer doctrine (classid is pure address; magic at the resolution target).(part_of:is_a)vs ~20 MB / ~250K LOC (~10×). Dimensionally credible: 16 B/FacetCascade⇒ 2 MB ≈ 131K nodes.Three honest boundaries kept explicit
vocab/imports/ogit— not empty. The remaining step is mint-to-codebook (facet_mint→ogar_codebook), not harvest.KausalSpec-membrane-governed. Conditionalization is classaction-cheap; anActionDef's internal compute is still its content, minted once + shared (so the 2 MB is the per-consumer marginal footprint over a shared library, not the whole system).ogar-consumer-preflightiron rule; re-harvesting locally pays twice (the SURREAL-AST / do-it-twice trap this design rejects).Verification this session
facet_mint(brick 2) — 8/8 tests green, run in the zero-deplance-graph-contractcrate (the earlier "blocked by ndarray'sburnsubmodule" caveat was wrong —burnis an excluded workspace member with zero code coupling; corrected in-thread).facet.rs/class_view.rs/ogar_codebook.rscited surfaces exist onmain(feat(contract): 6×(8:8) FacetCascade + V3 (part_of:is_a) fold + OSINT-V3 (custom:canon split) #613/refactor(contract): reusablefacetmodule — content-blind 8:8 substrate + zero-cost reinterpret #614/feat(contract): NodeGuid::mint_for tail-variant carrier (Phase 1 identity→V3) #615);facet_mintis onclaude/serene-mayer-1a09he(360fc720), not yet merged.owlrepo is camel-ai's multi-agent framework, not W3C OWL — not cited as the converter).The whole arc converts from CONJECTURE → FINDING via one empirical step: the MedCare probe (
ruff_csharp_spo→facet_mint→ SoA → LSP query, MedCareV2 oracle). Its only gates are wiring, not research: merge the minter branch, mint imported OGIT → codebook, reserve one ASTfacet_classid.🤖 Generated with Claude Code