transpile-chain LEG 2 + LEG 3: Odoo _inherit→mixins, and ClassView×FieldMask→struct+ActionDef methods#149
Conversation
…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.
There was a problem hiding this comment.
💡 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()); |
There was a problem hiding this comment.
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 👍 / 👎.
_inherit onto Class.mixins (transpile-chain LEG 2)_inherit→mixins, and ClassView×FieldMask→struct+ActionDef methods
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.
Builds the middle and render ends of the operator's transpile chain:
Both legs ride this one branch (F8: one branch = one PR).
LEG 2 —
ogar-from-rufflifts Odoo_inheritontoClass.mixinsruff #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 previouslyconsumed only
sti.inherits_from → Class.parent(Rails STI) and droppedModel.inherits. Nowlift_model_with_languagedoesclass.mixins.extend(model.inherits).The multi-parent question was answered by the vocab — no
parentwidening.Class::mixinsdoc names_inherit = 'mixin.thread';Class::inheritancestates "Mixins / concerns are a SEPARATE axis … never folded in here." So
_inherit→mixins(the multi-parentVec), not the STI single-parentspine. Frontend-agnostic (no-op for Rails
sti/ C++bases).Ledger:
D-OGAR-ODOO-INHERIT-MIXINS.LEG 3 —
ogar-render-askama: ClassView × FieldMask → struct + ActionDef methodsNew
render_class_with_methods(class, mask, actions)— a compile-time(askama = the ERB/XSLT analog) transpiler that emits a Rust struct where:
ClassView × FieldMaskprojection. TheFieldMaskbitmask indexes the ObjectView N3 order (attributes then family edges — the
basis
OgarClassView::render_rowsuses); bitnset ⇒ n-th field emits.ActionDefDO-arm, assembled as astruct-of-methods constructor —
impl { new(..) ctor + one fn per ActionDef }.Operator rulings baked in:
SurrealQL-AST adapter (
DEFINE EVENT … WHEN … THEN …carrying lifecycle) isnot a target — consistent with
SURREAL-AST-AS-ADAPTER.md§0. Tests assertno
DEFINE EVENT/DEFINE TABLEin the output.on_enter(the Rubicon state mutation) → method takes&mut self; readactions take
&self.New dep:
lance-graph-contract(forFieldMask, branch=main).Ledger:
D-OGAR-RENDER-CLASSVIEW-FIELDMASK-METHODS.End-to-end verification
A masked
account.move(mask = {0, 2}) renders:Testing
ogar-from-ruff(48 green).ogar-render-askama(50 green): mask gates fields,ActionDef→methods, no SurrealQL DDL, dotted-predicate + PascalCase
sanitisers.
cargo checkclean;cargo clippy -p ogar-from-ruffand-p ogar-render-askama -- -D warningsclean. (Also fixes a pre-existingclippy::cloned_ref_to_slice_refssurfaced by the 1.95 toolchain in thelist_view test.)
🤖 Generated with Claude Code
https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP