Skip to content

knowledge(ast-address): the three-layer "why" — rails-shaped semantic AST → importable OGIT ERP primitives#617

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/medcare-bridge-lance-graph-wmx76z
Jun 26, 2026
Merged

knowledge(ast-address): the three-layer "why" — rails-shaped semantic AST → importable OGIT ERP primitives#617
AdaWorldAPI merged 3 commits into
mainfrom
claude/medcare-bridge-lance-graph-wmx76z

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jun 26, 2026

Copy link
Copy Markdown
Owner

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)

  1. Rails-shaped semantic AST at assembler cost. The four facet.rs SIMD 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.
  2. Static OGAR · dynamic ClassView · askama row-view. 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 conditional classaction are the two projections of one ClassView over the N × 6×(part_of:is_a) SoA.
  3. OGAR as importable ERP-primitive stdlib · lance as compiler. 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)

  • The primitives are laws/regulations, not CRUD. An ERP's hard value is compliance; regulation is universal + reusable, so it's minted once as a static pattern (ObjectView = required fields; ActionDef/KausalSpec = rules). Content stays with the consumer (I-VSA-IDENTITIES); only the pattern is shared. Grounded: OGIT NTO/{Audit, Compliance, Legal}.
  • OWL↔OGIT bijective-lossless class conversion (operator-proven, attributed not re-run) is the enabling result; mechanism is structural — OGIT {entities, verbs, attributes} is the (part_of:is_a) shape — so OWL regulatory ontologies (e.g. FIBO) import losslessly.
  • DO is also wireable. ActionDef/ActionInvocation/KausalSpec (OGAR-AST-CONTRACT.md) is the behavioral IR; the arago/HIRO ActionHandler model transcodes into it (OGIT = almato/arago's, TTL creator chris.boos@almato.com). In the consumer, DO reduces to a classaction pointerclassid → ActionDef, dispatched via an ActionInvocation DTO; the consumer holds the pointer + KausalSpec guard + content, the body lives once at the target. That is the OGAR consumer doctrine (classid is pure address; magic at the resolution target).
  • Magnitude. OpenProject + Odoo as ~2 MB of GUID-encoded (part_of:is_a) vs ~20 MB / ~250K LOC (~10×). Dimensionally credible: 16 B/FacetCascade ⇒ 2 MB ≈ 131K nodes.

Three honest boundaries kept explicit

  1. Mechanism shipped; source imported; mint remains. Complete OGIT (~1,940 TTL incl. regulatory + SDF automation) is imported into OGAR vocab/imports/ogitnot empty. The remaining step is mint-to-codebook (facet_mintogar_codebook), not harvest.
  2. DO wireable but KausalSpec-membrane-governed. Conditionalization is classaction-cheap; an ActionDef'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).
  3. Cheapness requires pull-don't-reconstruct — the ogar-consumer-preflight iron rule; re-harvesting locally pays twice (the SURREAL-AST / do-it-twice trap this design rejects).

Verification this session

The whole arc converts from CONJECTURE → FINDING via one empirical step: the MedCare probe (ruff_csharp_spofacet_mint → SoA → LSP query, MedCareV2 oracle). Its only gates are wiring, not research: merge the minter branch, mint imported OGIT → codebook, reserve one AST facet_classid.

🤖 Generated with Claude Code

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
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new conceptual section to the AST-as-(part_of:is_a) note, expanding the three-layer thesis and adding a boundary section that separates shipped mechanisms from unwired scope.

Changes

AST-as-(part_of:is_a) thesis expansion

Layer / File(s) Summary
Structural AST execution
.claude/knowledge/ast-as-partof-isa-address.md
Adds the first thesis layer mapping structural AST queries to facet::FacetCascade operations over (part_of:is_a) addresses.
ClassView projections
.claude/knowledge/ast-as-partof-isa-address.md
Adds the second thesis layer describing static OGAR shape, dynamic ClassView row views, askama templates, and guard-gated behavior projections.
OGAR stdlib import
.claude/knowledge/ast-as-partof-isa-address.md
Adds the third thesis layer describing import, customize, and compile surfaces for reusable OGAR primitives.
Shipped boundaries
.claude/knowledge/ast-as-partof-isa-address.md
Adds the closing section describing what is present, what remains unwired, and how the reuse cost model is bounded.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

Hop, hop—three layers bloom in the night,
With facet::FacetCascade sparkling bright.
ClassView and OGAR share a gentle tune,
While boundary carrots glow under the moon.
🐇✨ A tidy nibble, and the thesis is in sight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the documentation update and captures the three-layer rationale for AST-as-address.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

claude added 2 commits June 26, 2026 06:54
…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
@AdaWorldAPI AdaWorldAPI changed the title knowledge(ast-address): the three-layer "why" + DO-arm wireability knowledge(ast-address): the three-layer "why" — rails-shaped semantic AST → importable OGIT ERP primitives Jun 26, 2026
@AdaWorldAPI AdaWorldAPI merged commit e62f1c1 into main Jun 26, 2026
1 check passed
AdaWorldAPI pushed a commit that referenced this pull request Jun 26, 2026
…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
AdaWorldAPI pushed a commit that referenced this pull request Jun 26, 2026
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
AdaWorldAPI pushed a commit that referenced this pull request Jun 26, 2026
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
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