Skip to content

transpile-chain LEG 2 + LEG 3: Odoo _inherit→mixins, and ClassView×FieldMask→struct+ActionDef methods#149

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

transpile-chain LEG 2 + LEG 3: Odoo _inherit→mixins, and ClassView×FieldMask→struct+ActionDef methods#149
AdaWorldAPI merged 3 commits into
mainfrom
claude/medcare-bridge-lance-graph-wmx76z

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Builds the middle and render ends of the operator's transpile chain:

ruff *_spo harvest → ogar-from-ruff lift → CompiledClass → ClassView × FieldMask → askama render
       LEG 1 (ruff #40, merged)   LEG 2 (this PR)              LEG 3 (this PR)

Both legs ride this one branch (F8: one branch = one PR).


LEG 2 — ogar-from-ruff lifts Odoo _inherit onto Class.mixins

ruff #40 (merged) shipped the is_a input end: a frontend-agnostic
ruff_spo_triplet::Model.inherits, populated by the Odoo frontend from
_inherit (self-reopen self-edge excluded upstream). The lift previously
consumed only sti.inherits_from → Class.parent (Rails STI) and dropped
Model.inherits. Now lift_model_with_language does
class.mixins.extend(model.inherits).

The multi-parent question was answered by the vocab — no parent widening.
Class::mixins doc names _inherit = 'mixin.thread'; Class::inheritance
states "Mixins / concerns are a SEPARATE axis … never folded in here." So
_inheritmixins (the multi-parent Vec), not the STI single-parent
spine. Frontend-agnostic (no-op for Rails sti / C++ bases).

Ledger: D-OGAR-ODOO-INHERIT-MIXINS.


LEG 3 — ogar-render-askama: ClassView × FieldMask → struct + ActionDef methods

New render_class_with_methods(class, mask, actions) — a compile-time
(askama = the ERB/XSLT analog) transpiler that emits a Rust struct where:

  • FIELDS are the ClassView × FieldMask projection. The FieldMask
    bitmask indexes the ObjectView N3 order (attributes then family edges — the
    basis OgarClassView::render_rows uses); bit n set ⇒ n-th field emits.
  • METHODS are the OGAR ActionDef DO-arm, assembled as a
    struct-of-methods constructorimpl { new(..) ctor + one fn per ActionDef }.

Operator rulings baked in:

  • Behaviour is Rust methods, never SurrealQL DDL. The deprecated
    SurrealQL-AST adapter (DEFINE EVENT … WHEN … THEN … carrying lifecycle) is
    not a target — consistent with SURREAL-AST-AS-ADAPTER.md §0. Tests assert
    no DEFINE EVENT / DEFINE TABLE in the output.
  • on_enter (the Rubicon state mutation) → method takes &mut self; read
    actions take &self.

New dep: lance-graph-contract (for FieldMask, branch=main).

Ledger: D-OGAR-RENDER-CLASSVIEW-FIELDMASK-METHODS.

End-to-end verification

A masked account.move (mask = {0, 2}) renders:

pub struct AccountMove {
    pub name: String,   // field 0 kept
    pub state: String,  // field 2 kept — field 1 `amount_total` masked out
}
impl AccountMove {
    pub const CLASS_ID: u16 = 0x0202;
    pub fn new(name: String, state: String) -> Self { Self { name, state } }
    /// OGAR action `action_post` (DO-arm).
    pub fn action_post(&mut self) { /* TODO: port from ogit-erp/account.move */ }
}

Testing

  • LEG 2: +2 tests in ogar-from-ruff (48 green).
  • LEG 3: +6 tests in ogar-render-askama (50 green): mask gates fields,
    ActionDef→methods, no SurrealQL DDL, dotted-predicate + PascalCase
    sanitisers.
  • Workspace cargo check clean; cargo clippy -p ogar-from-ruff and
    -p ogar-render-askama -- -D warnings clean. (Also fixes a pre-existing
    clippy::cloned_ref_to_slice_refs surfaced by the 1.95 toolchain in the
    list_view test.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP

claude added 3 commits June 24, 2026 05:46
…lassids

Resolves docs/MARS-TRANSCODING.md §1's deferred classid mint via the 5+3
codebook-hardening pass. One domain 0x0C spanning the MARS structural CMDB
(A→R→S→M dependsOn backbone) AND the Automation DO-arm actuators — the Auth
precedent (heterogeneous shapes, one cross-app concern; render prefix is the
hi-u16 skin, the domain byte is the lo-u16 shared-concept half).

9 concepts (load-bearing only; the speculative rest reserved):
  0x0C01 mars_application   0x0C02 mars_resource
  0x0C03 mars_software      0x0C04 mars_machine
  0x0C05 knowledge_item     0x0C06 mars_node_template
  0x0C07 action_handler     0x0C08 action_applicability
  0x0C09 automation_trigger

Atomic lockstep (per runtime-archaeologist's 11-site checklist) across:
- ogar-vocab: CODEBOOK + ConceptDomain enum + canonical_concept_domain arm
  + domain-byte doc block + class_ids consts + class_ids::ALL + 9 builder fns
  + all_promoted_classes() + count/routing tests.
- ogar-class-view: import list + all_canonical_classes() (the drift-gate that
  broke CI for the Anatomy mint — every_codebook_id_appears_in_class_ids_all).

Opportunistically fixed pre-existing doc drift the doctrine-keeper flagged:
DIV-1 (Anatomy missing from APP-CLASS-CODEBOOK-LAYOUT domain map) + DIV-2
(stale 0x0A/0x0B in the lib.rs doc block; missing 0x0B Auth line).

5+3 hardening: theorem-checker (PASS) / doctrine-keeper / integration-lead /
runtime-archaeologist savants + cargo fmt/test/clippy gates. ogar-vocab 94 +
ogar-class-view 11 tests green, clippy-clean on new code.

Docs: MARS-TRANSCODING §1 re-graded provisional→minted; D-MARS-CLASSID ledger
row; EPIPHANIES E-MARS-AUTOMATION-MINT; APP-CLASS-CODEBOOK-LAYOUT domain map.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
…ns — transpile-chain LEG 2

ruff PR #40 (merged) shipped the is_a input end: a frontend-agnostic
`ruff_spo_triplet::Model.inherits: Vec<String>` populated by the Odoo
frontend from `_inherit` (self-reopen self-edge excluded upstream). The
lift previously consumed only `sti.inherits_from -> Class.parent` (Rails
STI) and dropped Model.inherits, so the Odoo is_a linkage never reached
the Core.

Route it to Class.mixins (extend), the multi-parent Vec shelf the vocab
already designates for it: Class::mixins doc names `_inherit = 'mixin.thread'`,
and Class::inheritance excludes mixins ("a SEPARATE axis ... never folded
in here"). So NOT parent/inheritance (STI single-parent spine) — no parent
widening, no information loss, no vocab-axis violation. Multi-parent handled
natively by the Vec. Frontend-agnostic: only the Odoo frontend populates
Model.inherits, so it is a no-op for Rails (sti) / C++ (bases).

Consequence for LEG 3 (render, D-VCW-3): the FieldMask compose must union
parent U mixins for Odoo inherited fields; render_rows stays concept-local.

Tests: +2 (odoo_inherit_lands_on_mixins_not_parent, empty_inherits_adds_no_mixins);
48 green in ogar-from-ruff, workspace check + clippy clean.
Ledger: docs/DISCOVERY-MAP.md D-OGAR-ODOO-INHERIT-MIXINS.
The remote branch tip ca60c38 (ConceptDomain::Automation mint) predates the
#148 merged arc, which independently landed the same Automation content on
main in post-canon-flip form. Verified fully subsumed before this merge:
 - concept surface: main has 91 concept fns ⊇ ca60c38's 81 (empty set-diff)
 - docs/MARS-TRANSCODING.md: identical (md5 8ba1cde…) on both
 - EPIPHANIES E-MARS-AUTOMATION-MINT + E-HIRO-IS-OGAR-DO-ARM: both on main

'-s ours' keeps the main+LEG2 tree (the verified superset) while recording
ca60c38 as a parent so no history is discarded (non-destructive; force-push
guard respected). Brings the branch to latest main + transpile-chain LEG 2.

@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: e8679f5a7c

ℹ️ 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".

// deduped, and excluded the bare-`_inherit` reopen self-edge. Only the
// Odoo frontend populates `Model::inherits`, so this is a no-op for the
// Rails (`sti`) and C++ (`bases`) producers — hence unconditional.
class.mixins.extend(model.inherits.iter().cloned());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pin ruff before reading Model::inherits

This access assumes the ruff PR #40 shape where ruff_spo_triplet::Model has an inherits field, but crates/ogar-from-ruff/Cargo.toml still depends on ruff_spo_triplet via the floating branch = "main" and this repo commits no Cargo.lock. On a clean build that resolves main to a revision before/without that field, ogar-from-ruff no longer compiles at this line; the commit message says the dependency is bumped to 61ce2b49, so this should be pinned to that rev (or otherwise locked) with the source change.

Useful? React with 👍 / 👎.

@AdaWorldAPI AdaWorldAPI merged commit ffacf21 into main Jul 4, 2026
2 checks passed
@AdaWorldAPI AdaWorldAPI changed the title ogar-from-ruff: lift Odoo _inherit onto Class.mixins (transpile-chain LEG 2) transpile-chain LEG 2 + LEG 3: Odoo _inherit→mixins, and ClassView×FieldMask→struct+ActionDef methods Jul 4, 2026
AdaWorldAPI pushed a commit that referenced this pull request Jul 4, 2026
ogar-from-ruff reads ruff_spo_triplet::Model::inherits (added in ruff #40).
With no committed Cargo.lock, the floating `branch = "main"` pin could
resolve to a ruff rev WITHOUT that field on a clean build and fail to
compile — and the prior commit's '61ce2b49' claim didn't travel. Pin all
three ruff refs (ruff_spo_triplet + ruff_spo_address in ogar-from-ruff,
ruff_ruby_spo in ogar-from-rails) to the exact rev 61ce2b49 (ruff main at
the #40 merge). Same rev across both crates: they share ruff_spo_triplet
internally, so a mismatch would double-check-out ruff.

Verified: ruff re-locks to 61ce2b49; ogar-from-ruff 48 tests + ogar-from-rails
green; workspace check + clippy -D warnings clean.
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