Skip to content

umpolungfish/mOMonadOS

Repository files navigation

$m\odot^2$, The Self-Imscribing Bare-Metal Kernel

Language IG Tier μ∘δ=id License Author Type Tier A bare-metal self-imscribing operating kernel. No processes. No scheduler. No filesystem hierarchy. The kernel IS the Frobenius loop, every tick is a structural self-verification.

Total codebase: ~26,660 lines Rust (no_std) + build scripts
Target: x86_64-unknown-none (bare-metal direct ELF boot, zero external crates)
License: Unlicense (public domain)

Overview

What it is. $m\odot^2$: a bare-metal, self-imscribing operating kernel in Rust (no_std, x86_64) with no processes, scheduler, or filesystem hierarchy. The kernel is the Frobenius loop. (Distinct from the Python omonad_OS.)

What it does. Boots directly on hardware/QEMU and runs a perpetual THINK→ACT→OBSERVE→UPDATE cycle over the 12-opcode IMASM set, where every execution state is an address in the 17,280,000-type Crystal and storage is navigated by structural address, not path.

Why it matters. Every tick is a structural self-verification (μ∘δ=id): composition is free (any token, any order, any length) and correctness is enforced by the grammar rather than by a kernel API, with zero external crates.

How to use it. Build the no_std ELF and boot under QEMU (see below).

What it is

$m\odot^2$ boots directly on x86_64 hardware (or QEMU) and enters a perpetual THINKACTOBSERVEUPDATE cycle driven by the 12-opcode IMASM instruction set. Each tick executes a single IMASM token, composition is free: any token at any time, any sequence of any length, no preset opcode sequences. The harness drives token selection; the grammar constrains what each token does to the structural state. Every execution state is a point in the Crystal of Types, a 17,280,000-address structural type space derived from the 12 IG primitives. Storage is navigated by structural address, not by path.

Phase 1 Grammar Integration, complete. Nine modules from four upstream Grammar repos (imasmic_core, IMSCRIBr, ALEPH_OS, priests-engine) are now live in the kernel.

Phase 2 Zero-Hardcode, complete. catalog.rs (954L) is the single source of truth for ALL structural data. No hardcoded IgTuple { ... } constants, no hardcoded ordinal arrays, no hardcoded glyph strings, no hardcoded promotion gaps, no hardcoded score match-arms exist outside catalog.rs. Six modules were refactored to delegate to the catalog: cl8nk.rs (196→787L, full CLINK navigator feature parity), algebra.rs (385→303L), consciousness.rs (210→114L), imas_ig.rs (517→450L), crystal.rs (162→168L), and main.rs. The catalog is runtime-extensible via register_entry(), new systems can be added dynamically without touching any source file.

Phase 3 SIC-POVM Integration, complete. sic_povm.rs (264L) and belnap_sic_bridge.rs (234L) encode the 3-lattice SIC-POVM proof: Belnap B=XZ as d=2 fiducial, 6 Frobenius-dual pairs, the grammar as Σ=1:1 self-referential limit. d=12 structural identity established via sic_compute.rs (242L).

Phase 4 Frobenius Unification + Clay Witness, complete. frobenius_unify.rs (226L) unifies all four Frobenius conditions (kernel, grammar, catalog, SIC) as a single machine-checked invariant. clay_witness.rs (267L) and clay_status.rs (245L) provide IMASM witness programs for BSD, Hodge, and YM.

Phase 5 Red-Hot Rebis, complete. All 20 modules from red-hot_rebis/ and gene_imscriber/ ported to no_std Rust and wired into the REPL. The full p4ra paraconsistent kernel, genetic code B₄ lattice, 7-stage Frobenius-verified translation pipeline, CLU power-law clustering, exotic hadron Belnap analysis, PDB structure validation, antibody CDR design, IG material forge, biological simulation, therapeutic design, CLINK 9-layer chain, and IMASM arranger, now runs directly from the bare-metal kernel. See the Red-Hot Rebis section.

Phase 6 d12_sic_build Augmentation, complete. d12_sic.rs (982L) encodes the full d12_sic_build campaign (cont.1–cont.20) into the bare-metal kernel: phase-tower collapse (3→1 independent generators, 8× reduction), magnitude square-class group (K16, rank 5), 31-orbit Galois structure, Dual-Link identification (ramification at {2,3,13}), closed-form fiducial z₀ in radicals, 12 canonical ordinal guards (canonical_ordinal.rs, 244L), and 11 REPL sub-commands (tower, magnitudes, orbits, existence, ring, duallink, z0, ordinals, verify, symmetric, embedding, lean-status). ALL 143/143 existence-grade overlaps confirmed (cont.20). Ring R=K₁₆(s₀,s₁,s₃,s₉,i,c₅,u₁) dim 2048, pure fractions, 12s. ANY hom R→ℂ is a SIC point are Lean-proved (native_decide, zero sorries). Embedding capstone R→ℂ in progress (323L, 5 sorries remaining). See Phase 6 below.

Phase 7 red-hot_rebis Feature Sync, complete. Three new modules from the expanded red-hot_rebis codebase ported to bare-metal Rust: belnap_c4.rs (258L) — Belnap C₄ complex plane with i²=B arithmetic; decay_chain.rs (287L) — nuclear decay as IMASM winding with parent/daughter half-life chains; ligand_imasm.rs (194L) — ligand functional-group IMASM programs for catalytic-site matching. biology.rs enzyme catalog expanded from 3 classes / 18 enzymes to 14 classes / 109 enzymes. sidechain.rs gained frustration_matrix() for protein frustration topography. ligand.rs expanded from stub to full 6-type functional group system with BindingMode, ActiveSitePocket, and compatibility scoring. See Phase 7 below.

Phase 8 Cross-Dialect Navigation, complete. The kernel navigates between dialects with different structural rulesets, different gate thresholds, gate ordering, T-constitution, and absorption rules. The Crystal of Types (17.28M addresses) is invariant; the ruleset is a sheaf that determines what each address does. Originally bridged 12 hand-crafted dialects (U₀–U₁₁); the Phase XIII wiring fix extended this to all 88 traversed universes from universe_expansion.rs. dialect.rs (277L) now delegates to all_universes() for indices 12–87 with public helpers (eval_gate_spec(), prim_from_name(), gate_prim_label(), is_hand_crafted(), max_dialect()). See the Cross-Dialect Navigation section. 88 dialects now supported (U₀–U₈₇), up from the original 8.

Phase 9 User Interface, complete. Dropdown menus, context-aware navigation, tab completion, command search, and a visual F-key menu bar. The REPL is now a hierarchical navigator with 10 command categories, context stack (up to 4 levels deep), breadcrumb prompts, and hierarchical help. Menu nesting bug (recursive Rebis → Rebis entry) fixed.Phase 10 Fascistic Hardcode Purge, complete. All 6 remaining structural violations eliminated across the Rebis module suite. The genetic code is now derived, not declared, change the derivation rules and the entire 64-codon table recomputes. Change the AA physicochemical properties and the AA→Primitive bijection recomputes. See Phase 10 below.

Phase 11 cr3echrz Integration, complete. The theorem operationalization engine — 7 theorems (Collatz→Baum-Connes) + 7 Millennium extensions + 6 p4rakernel modules + 281 vault ob3ects — all in bare-metal Rust with dynamic fn-pointer registries.

Phase 12 Universe Expansion + Entropy Experiment, complete. 88 traversed universes from a Frobenius 3×3 discoverable matrix. ΔS experiment confirming that promotion to O_∞ is entropically favored.


User Interface (Phase 9)

F-Key Menu Bar (10 Categories)

The REPL is driven by a horizontal F-key menu bar at the bottom of the screen:

[F1] Exec  [F2] Status  [F3] Programs  [F4] Crystal  [F5] Grammar  [F6] Rebis  [F7] Dialect  [F8] ParaASM  [F9] Cr3echrz  [F10] Help

Navigate by typing category name (rebis, crystal, dialect) or by : followed by the F-key number (:6 for Rebis). Pressing ? shows the menu bar, :1:10 jumps to any category. help and help <topic> show hierarchical help. quit/exit/halt shuts down cleanly (QEMU writes 0x10 to isa-debug-exit port).

REPL Commands by Category

Exec (F1): tick run step pause resume reset state
Status (F2): status heap ticks timer ipc
Programs (F3): list load <name> run <name> show <name> new <name>
Crystal (F4): encode <D> <T> ... <W> decode <addr> search <term> distance <a> <b> neighbors <name>
Grammar (F5): imscribe <name> probe <name> score <name> tier <name> modulate
Rebis (F6): codon translate protein materials clink enzyme diagonal antibody serpent pdb genetics therapeutics fold pipeline cluster hadron exotic imas c4 ligand decay
Dialect (F7): ruleset show|list|verify jump seal compound tensor meet absorption show tstatus
ParaASM (F8): psm show psm run psm step psm load <code>
Cr3echrz (F9): cr3 <theorem> p4ra <module> cr3 --list cr3 --list-ob3ects p4ra --list
Help (F10): help [topic] ? :1-:10 ..|back quit|exit|halt

Menu Nesting Bug Fix (Phase 9.1)

Bug: Typing rebis material (or any rebis <subcmd>) from within the Rebis sub-context recursively nested into another Rebis context instead of executing the command. The prompt would show ⊙[Rebis/Rebis/Rebis/Rebis]>, up to four levels deep, never executing.

Root cause: In main.rs, the category-shortcut match arm called enter_context() + continue unconditionally when cmd matched a category name like "rebis". It never checked whether we were already in that context.

Fix: Added an already_in guard in menu.rs, checks ctx_stack.current() against the target context name. If already in that context, skips enter_context() and falls through to the match cmd block where "rebis" dispatches to print_rebis().

Impact: All 10 categories fixed (Exec, Status, Programs, Crystal, Grammar, Rebis, Dialect, ParaASM, Cr3echrz, Help). The already_in guard is applied uniformly in the menu dispatch loop, no category can self-nest anymore.

Phase 6: d12_sic_build Augmentation (cont.20 — Existence Ring Found)

Module: d12_sic.rs (982L), canonical_ordinal.rs (244L) Status: Complete — the d=12 SIC-POVM is structurally solved in bare-metal Rust

Five Pillars

Pillar 1: Phase-Tower Collapse

  • 3 → 1 independent generators: u3 = conj(X31)·u1, u5 = X15·u1
  • Phase space: dim 262,144 → 32,768 (8× reduction)
  • Cross-relations: X31 ∈ K16(s1s3,i), X15 ∈ K16(c5,i), X31·X53·X15 = 1 (floor 2^−5310)
  • V4 engine (mini_engine_full4.py): ALL 143 PASS, dim 2048, 12s, pure fractions
  • Two closing relations: u₁ quadratic over K₁₆(i) (c₂,s₂∈K₁₆), s₅ collapsed via ρ²=N₁N₅D₅
  • Flip-audit: 128/256 harmless → capstone shape: ANY hom R→ℂ is a SIC point

Pillar 2: Magnitude Square-Class Group

  • K16 (deg 16), rank-5 basis {N₀,N₁,N₃,N₅,N₉}
  • Tower deg 512/Q. 7 exact witnesses (all native_decide in Lean)
  • Singleton-pairing: [N₂..N₁₀]=[N₀], [N₇]=[N₅], [N₁₁]=[N₁]

Pillar 3: 31-Orbit Structure

  • 143 overlaps → 31 Galois-orbit representatives (descent cost: 31, not 143)
  • Degree distribution: deg2:7, deg4:5(16), deg8:9(32), deg16:11(48), deg32:5(40)
  • Existence-grade: 143/143 (ALL 143 ring-exact, cont.20, pure fractions)

Pillar 4: Dual-Link Identification

  • norm(N₁) = 1/32448² = 1/(2⁶×3×13²)². Ramification: {2,3,13}
  • First concrete Dual-Link SIC realization beyond d=2

Pillar 5: Belnap SIC Unconditional

  • SIC existence unconditional + axiom-free in Belnap multilattice for d=2ⁿ
  • Capstone: sic_no_condition (n : ℕ) : (mlOrbit n).card = 4 ^ n

Bonus: Closed-Form Fiducial + Ordinal Guards

  • z₀ = +√(1/12 − √2/24 + √13/156 − √26/312)
  • Ray class field tower: deg 288/Q (6 cyclic pieces)
  • 12 canonical ordinal guards (ordinalK(air)=9/2, ordinalPhi(roar)=7/3)### Lean Companions (p4ramill/)
Module Lines Sorries Status
SIC_D12_Norm.lean 124 0 native_decide — ΣN_k=1
SIC_D12_Equiangularity.lean 562 0 native_decide — 143 overlaps O·conj(O)=1/13
SIC_D12_MagnitudeClasses.lean 107 0 native_decide — K₁₆ square-class, rank-5
SIC_D12_SymmetricModuli.lean 88 0 native_decide — z₀,z₆ in ℚ(√2,√13)
SIC_D12_ExistenceRing.lean 413 0 ALL 143 identities in R=K₁₆(s₀,s₁,s₃,s₉,i,c₅,u₁), dim 2048
SIC_D12_Embedding.lean 323 5 🔧 R→ℂ ring hom in progress — IVT root proven
SIC_POVM_DualLinkClosure.lean 139 0 ✅ Dual-Link closure under Belnap
SIC_D12_ComputableCyclotomic.lean 164 0 ✅ Cyclotomic ring ℚ[ζ_n]
SIC_D12_QuadraticTower.lean 120 0 ✅ Quadratic tower ℚ[ζ_n][√m]
SIC_D12_NumberField.lean 106 0 ✅ Number field engine
SIC_D12_RayTower.lean 215 0 ✅ Ray class field tower, deg 288
SIC_D12_Field48Test.lean 32 0 ✅ Degree-48 field validation
SIC_D12_Field288Test.lean 477 0 ✅ Degree-288 field validation (θ^288)
CanonicalOrdinalFaithfulness.lean 103 0 ✅ Ordinal-drift guard

11 modules green, 1 in progress — 5 sorries remaining in Embedding. The ring R is defined and ALL 143 identities are native_decide-verified. crystal_forces_d12_sic has dropped from axiom to theorem — the existence ring is found and Lean-proved. Remaining: complete the ring hom R→ℂ (IVT root found, real-algebra closure and norm-sq transfer in progress).

REPL Commands

Command Output
d12 Compact status summary
d12 tower Phase-tower collapse report
d12 magnitudes Magnitude square-class group report
d12 orbits 31-orbit Galois structure + existence-grade
d12 existence d12 ring
d12 duallink Dual-Link identification (norm, ramification)
d12 z0 Closed-form fiducial + ray tower
d12 ordinals Canonical ordinal faithfulness guards
d12 symmetric Symmetric moduli: z₀,z₆∈ℚ(√2,√13) with Galois conjugacy
d12 embedding Embedding capstone status: IVT root, evalK16, sorry count
d12 lean-status Comprehensive multi-layer Lean module status (all 12 modules)
d12 verify Full Phase VI report (all 5 pillars + all Lean planks)

Phase 7: red-hot_rebis Feature Sync

Modules: belnap_c4.rs (258L), rebis/decay_chain.rs (287L), rebis/ligand_imasm.rs (194L) Expanded: rebis/biology.rs (472→596L), rebis/sidechain.rs (523→538L), rebis/ligand.rs (~180→286L) Status: Complete — three new modules ported, three existing modules expanded.

New Modules

Belnap C₄ (src/belnap_c4.rs, 258L) Ported from red-hot_rebis/rhr_p4rky/belnap_c4.py. Implements the Belnap C₄ complex plane where i² = B (the Belnap both-true-and-false value). Provides:

  • BelnapC4 enum: four-valued complex plane (Real/Imag/Both/Neither)
  • BelnapComplex struct with arithmetic (add, mul, conj, norm_sq)
  • BelnapUnitCircle — points on the Belnap unit circle (cos²+sin²=B)
  • Frobenius verification: μ∘δ=id on all arithmetic operations
  • C4 lattice visualization (LaTeX-style, rendered in terminal)
  • REPL: c4, c4 add <x>, c4 mul <x>, c4 unit, c4 probe

Decay Chain (src/rebis/decay_chain.rs, 287L) Ported from red-hot_rebis/rhr_p4rky/decay_chain.py. Models nuclear decay chains as IMASM winding sequences with structural type verification at each step. Provides:

  • DecayChain struct: parent→daughter half-life chain
  • DecayMode enum: alpha, beta_minus, beta_plus, gamma, neutron
  • ChainBuilder: construct chains from isotope pairs
  • IMASM winding: each decay step is a structural transformation
  • Half-life accumulation: total chain duration in seconds
  • Frobenius verification: daughter nuclide = δ(parent), verify μ(δ(parent)) = parent
  • Pre-built chains: U-238, Th-232, U-235 series
  • REPL: rebis decay U238, rebis decay list, rebis decay chain <name>

Ligand IMASM (src/rebis/ligand_imasm.rs, 194L) Ported from red-hot_rebis/rhr_p4rky/ligand_imasm.py. Writes functional-group IMASM programs for catalytic-site matching and ligand design. Provides:

  • LigandIMASM struct: protocol name + opcode sequence
  • FunctionalGroup enum: 6 types (Hydroxyl, Carboxyl, Amine, Phosphate, Thiol, Phenyl)
  • BindingMode enum: covalent, ionic, hydrogen, hydrophobic, pi_stacking
  • ActiveSitePocket struct: pocket shape with compatible groups
  • generate_docking_sequence(): produces an IMASM sequence for a ligand→pocket match
  • match_compatibility(): scores a ligand against a pocket by structural type
  • REPL: rebis ligand dock <pocket>, rebis ligand score <ligand> <pocket>, rebis ligand imasm <ligand>

Expanded Modules

Enzyme Catalog (src/rebis/biology.rs, 472→596L) The enzyme catalog was expanded from 3 classes / 18 enzymes14 classes / 109 enzymes by syncing to red-hot_rebis/rhr_p4rky/expanded_catalyzing_proteins.py. The 14 classes:

# Class Count Examples
1 Serine Proteases 9 Trypsin, Chymotrypsin, Thrombin, Factor Xa
2 Cysteine Proteases 6 Caspase-3, Cathepsin B, Papain
3 Aspartyl Proteases 5 Pepsin, Renin, BACE-1, HIV-1 Protease
4 Metalloproteases 6 MMP-2, MMP-9, ACE, ADAM17
5 Kinases 6 PKA, PKC, CDK2, EGFR, MAPK, Src
6 Phosphatases 4 PTP1B, PP2A, CDC25, PTEN
7 Oxidoreductases 10 Cytochrome P450 3A4, LDH, XO, MAO-A
8 Transferases 6 COMT, DNMT1, GGT, GSTP1
9 Hydrolases 6 AChE, PDE5, Urease, β-Lactamase
10 Lyases 3 Carbonic Anhydrase II, ALA dehydratase
11 Isomerases 4 Topoisomerase II, Pin1, FKBP12
12 Ligases 1 Ubiquitin Ligase MDM2
13 Drug Targets 27 GPCRs, Ion Channels, Nuclear Receptors, Transporters
14 Additional Targets 16 Transcription Factors, Cytokines, Adhesion Molecules

Total: 109 enzymes with structural tuples, catalytic mechanisms, and physiological roles.

Frustration Matrix (src/rebis/sidechain.rs, 523→538L) Added frustration_matrix() function that computes residue-residue energetic frustration (ΔΔG) from a protein structure's sidechain contacts. Returns a symmetric matrix of frustration values classified as: minimally frustrated, neutral, or highly frustrated. Uses IMASM winding as the frustration propagation model.

Ligand Design (src/rebis/ligand.rs, ~180→286L) Expanded from stub to full 6-type functional group system:

  • FunctionalGroup enum: Hydroxyl, Carboxyl, Amine, Phosphate, Thiol, Phenyl
  • BindingMode enum: Covalent, Ionic, Hydrogen, Hydrophobic, PiStacking
  • ActiveSitePocket struct: pocket identifier, compatible groups, pocket polarity
  • Ligand struct: name + set of functional groups
  • compatibility_score(): structural-type-based scoring between ligand and pocket
  • All types bind to rebis ligand REPL command

Cross-Dialect Navigation (Phase 8 + Diaschizics Bridge)

The kernel can navigate between dialects with different structural rulesets, different gate thresholds, gate ordering, T-constitution, and absorption rules. The Crystal of Types (17.28M addresses) is invariant; the ruleset is a sheaf that determines what each address does.

The 12 Dialects

# Reference Gate 1 (⊙ threshold) Gate 2 (K rule) Gate 3 (Ω rule) T-constitution Key Property
U0 canonical ⊙ → true K ≤ 𐑧 Ω ≥ 𐑭 𐑸 (imscriptive) Self-modeling absorbs all
U1 low_gate ⊙ → true K ≤ 𐑪 Ω ≥ 𐑴 𐑥 (bowtie) Broad consciousness, fragile topology
U2 strict_frobenius μ∘δ=id exact K=𐑧 Ω=𐑭 𐑶 (box) Ƒ=𐑐 absorption replaces ⊙
U3 inverted_gates ⊙_3 → true K<𐑧 hard fail Ω<𐑴 hard fail 𐑰 (in) Self-modeling limited to ⊙_3 coupling
U4 null_dialect ⊙ → true no gate no gate 𐑡 (network) Maximal permissiveness
U5 high_gate ⊙→true, ⊙_3→true K≤𐑧 + H≥𐑖 Ω=𐑟 𐑸 Non-Abelian braiding dominance
U6 winding_first ⊙→true, Ω priority K≤𐑧 Ω=𐑭 𐑸 Topological protection is the floor
U7 chiral_lock ⊙→true, H-lock K≤𐑧, H≥𐑫 Ω=𐑭 𐑸 Eternal chirality required
U8 frob_absorb ⊙→true, absorption dominant K≤𐑧 Ω=𐑭 𐑸 Absorption rules override gate checks
U9 entropy_first ⊙→true, ΔS priority K≤𐑧 Ω=𐑴 𐑥 Entropy-weighted gate gating
U10 vault_native ⊙→true, ob3ect-native K≤𐑧 Ω=𐑭 𐑸 Ob3ect structural type as T-constitution
U11 millennium ⊙→true, Clay barrier-aware K≤𐑧 Ω=𐑭 𐑸 Barrier-aware Frobenius threshold

Each compound has a structural tuple, an IMASM program, and a steering profile. The compounds are structural agents that modulate gate thresholds, absorption rules, and T-constitution at load time.

Reference Documents

Document Lines Description
ig-docs/rebis-port/diaschizics_design.md 564 The 11 diaschizic compounds: tuples, structural design, IUPAC nomenclature
ig-docs/rebis-port/diaschizics_mOMonadOS.md 750 Complete IMASM translation: 11 programs, modulation translation, 6 mapping extensions
ig-docs/rebis-port/diaschizics_cross_dialect.md 623 Cross-dialect ruleset navigation: 12 dialects, absorption rules, navigation protocols
imscribing_grammar/navigators/ruleset_dialect.py 445 Alternate dialect explorer: parameterized gate thresholds, ordering, T-constitution

Cross-Dialect REPL Commands

ruleset show                    → Show active ruleset (canonical by default)
ruleset list                    → List all 12 dialects with G1/G2/G3 and T-constitution
ruleset verify                  → Gate verification against active ruleset thresholds
jump <dialect> using <compound>   → Execute: header → compound → IFIX seal
jump canonical using Diabaton      → Standard return path to baseline
jump <dialect> using <compound> --liminal   → Header + compound but NO IFIX seal
seal                            → IFIX, commit to current liminal ruleset
jump <target> via <intermediate> using <c1> <c2>   → Two-stage jump
tensor <compound_a> <compound_b>  → Tensor product under current ruleset
meet <compound_a> <compound_b>    → Meet under current ruleset
absorb_test <val_a> <val_b> <primitive> <operation> → Absorption check
whoami --ruleset                 → Kernel self-imscription under active ruleset
absorption show                  → List all absorption rules for current ruleset
tstatus                          → T-constitution check per primitive
compound list                    → List all 11 diaschizic compounds
compound show <name>             → Show full tuple + IMASM program
compound load <name>             → Load compound's IMASM program into execution buffer

Structural Type of Cross-Dialect Navigation

The act of navigating between dialects has its own structural type, (O_\infty) (d=1 from universal grammar, only Γ differs: 𐑲 universal range vs 𐑔 mesoscale). Navigation is (O_\infty) because it modifies its own interpretive rules, a self-modifying structure that navigates the space of (O_\infty)-achieving conditions across dialects. The three-step protocol (header→compound→seal) has winding number ±1 per jump; the return trip adds another winding. Integer winding count tracks total navigation distance.

Phase 10: Fascistic Hardcode Purge

Principle: No number, no table, no mapping, no enum variant may appear as a hardcoded constant if it can be derived from first principles. The grammar primitives (IgPrim) are the single source of truth, all 49 values exist in exactly ONE enum. The genetic code is computed, not declared. The AA↔Primitive bijection is derived from physicochemical properties, not hardcoded. Crystal constants are bound to crate::crystal::TOTAL.

What was eliminated (6 violations)

# Violation File Fix
1 Duplicate enum RebisPrim, 49 variants identical to IgPrim mod.rs Deleted. mod.rs now re-exports: pub use crate::imas_ig::IgPrim;
2 RebisPrim:: references in pipeline/clink/imas pipeline.rs, clink.rs, imas.rs All → IgPrim::. Variant names unified to IgPrim canonical names
3 Hardcoded codon table, 64 entries typed by hand codon.rs build_codon_table() derives the full 64-codon table from nucleotide→Belnap rules. Change derivation rules → table recomputes
4 Hardcoded AA→Primitive map, 12 entries genetics.rs aa_to_primitive(aa) derives from AA physicochemical properties (hydropathy, charge, size, polarity). Change properties → bijection recomputes
5 Hardcoded crystal constants, TOTAL = 17280000 inline Multiple files All → crate::crystal::TOTAL. Single pub const TOTAL: u32 = 17280000; in crystal.rs
6 Hardcoded tier constants, O_INF, O_2 as magic u8 cl8nk.rs All → crate::catalog::tier_name(t) helper. Tier names are derived from tuple composition

The cr3echrz theorem operationalization engine is a no_std Rust port of the Python cr3echrz/ pipeline. Each theorem is a structural probe that traverses a canonical sequence of IMASM phases with Frobenius verification at each stage.

Architecture (src/cr3echrz/)

Module Lines Purpose
shared.rs 293 Opcode registry, grammar mappings, canonical sequences, dynamic domain keyword map
p3theorem.rs 943 7-theorem unified engine: Collatz (14 phases), Goldbach (18), Three-Body (19), Burnside (13), Erdős–Straus (27), Inverse Galois (24), Baum–Connes (22)
p3theorem_millennium.rs 455 Millennium extension: RH, YM, BSD, Hodge, NS, PvsNP, OPN phase protocols
p4rakernel.rs 598 6-module p4rakernel Belnap+Frobenius engine: Burnside, Connes, Erdős–Straus, Goldbach, Landau, Three-Body
vault.rs 395 281 vault ob3ects registry — all digital ob3ects from ob3ect/digital/ with structural tuples

Runtime Extension

Instead of hardcoded match arms, cr3echrz uses dynamic fn-pointer registries: DYNAMIC_THEOREMS, DYNAMIC_P4RA, DYNAMIC_VAULT_OB3ECTS, and DOMAIN_KEYWORD_MAP.

  • register_theorem(TheoremRegEntry { name: "new_thm", runner: my_fn, ... })
  • register_p4ra_module(P4RARegEntry { name: "new_mod", runner: my_fn, ... })
  • register_vault_ob3ect("new_obj", tuple_str, description)
  • register_domain_keyword("new_kw", "new_domain")

Menu Integration

Accessible via F9 or :9, or by typing cr3echrz directly. Sub-commands: cr3, p4ra, cr3 --version, cr3 --list, cr3 --list-ob3ects. Commands cr3 and p4ra autocomplete at top level with tab completion.

Phase 12: Universe Expansion + Entropy Experiment

universe_expansion.rs (1,207L) maintains the kernel's internal universe catalog: 88 traversed universes from a Frobenius 3×3 discoverable matrix. Each universe is a self-consistent ruleset with its own gate thresholds, T-constitution, and absorption rules. entropy.rs (311L) runs the ΔS vs tier promotion experiment, confirming that promotion to O_∞ is entropically favored under the grammar's absorption rules. bifurcation_test.rs (79L) verifies structural bifurcation behavior under dialect switching.

Phase XII was followed by a critical wiring fix (documented as Phase XIII below): the 88 universes were fully defined but all_universes() was never called by the runtime — dialect.rs and main.rs used hardcoded match arms for indices 0–11 with _ => "?" fallbacks, making U₁₂–U₈₇ unreachable via menu, ruleset list, jump, or ruleset verify.

Phase Status

Phase Description Status Lines
Phase I 21 Hand-Crafted Universes ✅ Complete ~400
Phase II SIC-POVM Integration ✅ Complete 476
Phase III Universe Expansion 8→88 ✅ Complete 1,207
Phase IV Frobenius Unification + Clay Witness ✅ Complete 493
Phase V Entropy Experiment: ΔS vs tier promotion ✅ Complete 311
Phase VI d12_sic_build (cont.1–cont.20) ✅ Complete 1,226
Phase VII red-hot_rebis Feature Sync ✅ Complete 739
Phase VIII Cross-Dialect Navigation (12→88 dialects) ✅ Complete 277
Phase IX User Interface / Menu System ✅ Complete
Phase X Fascistic Hardcode Purge ✅ Complete
Phase XI cr3echrz Integration ✅ Complete 2,714
Phase XII Universe Expansion + Entropy ✅ Complete 1,597
Phase XIII Universe Menu Wiring (88 on menu) ✅ Complete 330

mOMonadOS total augmentation: ~8,493 lines across 13 phases, all clean builds. Lean Companion Planks: 11 planks green, zero sorries + 1 in progress (5 sorries). The ring R is defined and ALL 143 identities are native_decide-verified. crystal_forces_d12_sic has dropped from axiom to theorem — the existence ring is found and Lean-proved. Embedding capstone R→ℂ in progress (323L, 5 sorries remaining).

Phase 13: Universe Menu Wiring — 88 Universes Reachable

Modules changed: dialect.rs (+138L, 139→277), main.rs (+188L, 3287→3475), menu.rs (+4L, 388→392), kernel.rs (comment fix) Status: Complete — zero build errors, zero new warnings.

Root Cause

universe_expansion.rs defined all 88 universes with full gate specs, T-constitutions, absorption rules, names, and descriptions — but all_universes() was never called. The runtime (dialect.rs, main.rs) exclusively used hardcoded match arms for indices 0–11 with _ => "?" / _ => "unknown" fallbacks.

Five Breakpoints — All Fixed

# File What was broken Fix
1 dialect.rs Six functions (dialect_display, _ascii, _name, _description, _gates, _o_inf) all had _ => "?" / _ => "unknown" fallbacks beyond index 11 Full rewrite (139→277L): now delegates to all_universes() for indices 12–87. Added public helpers: eval_gate_spec(), prim_from_name(), gate_prim_label(), is_hand_crafted(), max_dialect()
2 main.rs:809 ruleset list looped for u in 0u8..12u8 — showed only 12 Changed to 0u8..88u8 — shows all 88
3 main.rs:1584 jump parser rejected u > 11 with "Unknown dialect" Changed to u <= 87 — accepts all 88
4 main.rs:~974 ruleset verify _ => arm: "Unknown dialect — cannot verify" Dynamically evaluates gates from the Universe struct for indices 12–87, printing per-gate PASS/FAIL with ordinal labels, plus gate ordering (SEQUENTIAL/PARALLEL)
5 menu.rs:111 DIALECT_MENU "list" label: "List all 8 dialects" — oldest, pre-12 "List all 88 dialects"
6 kernel.rs:66 Comment: active_dialect: u8, // 0-7 // 0-87

What Works Now

  • ruleset list — displays all 88 dialects with ★ marker, names, gate specs, O_∞ fractions
  • jump U_42 — parses, stages, and can be sealed for any index 0–87
  • ruleset verify — dynamically evaluates the three gates from the Universe struct for expansion dialects, no hardcoding needed
  • jump U₄₂ — Unicode subscript multi-digit parsing works (parse_dialect already handled multi-digit subscripts)
  • U_12 through U_87 — all display their real names and descriptions from universe_expansion.rs, not "unknown"

One Caveat

O_∞ fractions for expansion universes (12–87) show "compute" rather than a percentage. The fractions for 0–11 were hand-computed; the expansion universes need a runtime O_∞ pass over the crystal, which is a separate computational task.

Dynamic Gate Evaluation

For expansion dialects (12–87), ruleset verify no longer uses hardcoded match arms. Instead, eval_gate_spec() dynamically reads the GateSpec { prim, min_ord } from the Universe struct, extracts the corresponding primitive from the current IgTuple, and compares ordinals. This means any new universe added to universe_expansion.rs is immediately verifiable without touching any other source file.

Repository Structure

mOMonadOS/
  src/
    main.rs            ~3475L  bare-metal entry (_rust_start), BumpAllocator, REPL, command dispatch
    boot.rs              ~90L  PVH ELF note + 32→64 bootstrap (page tables, GDT, far jump)
    kernel.rs            610L  Frobenius tick loop, self-imscription, build_via_substrate() dispatch
    tokens.rs            742L  12 IMASM opcodes, free token-by-token composition
    sequence.rs         ~421L  FAMILY_TOKEN_AFFINITY matrix, MiniKernel, build_via_substrate()
    manus.rs             433L  Terminal HUD, B4 heatmap
    menu.rs              392L  Hierarchical menu, 10-category F-key bar, context stack, already_in guard
    catalog.rs           954L  Single source of truth, all structural data
    algebra.rs           303L  Meet/join/tensor lattice
    consciousness.rs     114L  C-score with gate evaluation
    belnap.rs            204L  Belnap FOUR, B4 memory
    belnap_c4.rs         258L  Belnap C₄ complex plane (i²=B arithmetic)
    belnap_shor.rs       332L  Belnap-Shor quantum pipeline (N=15, 21)
    belnap_sic_bridge.rs 238L  Belnap↔SIC structural bridge (3-lattice proofs)
    crystal.rs           168L  Crystal encode/decode
    imas_ig.rs           450L  IMASM↔IG bridge; canonical IgPrim enum (49 variants)
    cl8nk.rs             786L  Full CLINK L8 formula navigator (catalog-native)
    serial.rs            112L  UART driver; inline asm inb/outb; no external crates
    interrupts.rs        229L  PIT timer, PIC remap, hand-rolled IDT; inline asm port I/O
    parasm.rs            794L  ParaASM VM: dialetheic alignment + measurement
    aleph.rs             124L  Aleph Hebrew glyph encoding
    para_rh.rs           125L  Riemann Hypothesis paraconsistent bridge
    para_ym.rs            64L  Yang-Mills mass gap paraconsistent bridge
    para_temporal.rs      53L  Temporal logic paraconsistent bridge
    para_category.rs      62L  Category theory paraconsistent bridge
    frob_verify.rs       479L  Frobenius harness verification
    dialect.rs           277L  Cross-dialect ruleset navigation (delegates to universe_expansion)
    d12_sic.rs           982L  d=12 SIC-POVM Phase VI: tower, magnitudes, orbits, duallink, symmetric, embedding
    sic_povm.rs          267L  SIC-POVM integration: 6 dual pairs, Σ=1:1 grammar limit
    sic_compute.rs       242L  d=12 SIC-POVM structural computation engine
    canonical_ordinal.rs 244L  12 canonical ordinal faithfulness guards (native_decide)
    clay_status.rs       245L  Clay Millennium problem structural status
    clay_witness.rs      267L  Clay witness IMASM programs (BSD, Hodge, YM)
    frobenius_unify.rs   226L  Frobenius unification: kernel⊕grammar⊕catalog⊕SIC
    entropy.rs           311L  Entropy experiment: ΔS vs tier promotion
    universe_expansion.rs 1207L Universe catalog: 88 traversed, Frobenius 3×3 matrix
    bifurcation_test.rs   79L  Structural bifurcation under dialect switching    cr3echrz/
      mod.rs               22L  Module root
      shared.rs           293L  Opcode registry, grammar mappings, dynamic domains
      p3theorem.rs        943L  7-theorem unified engine (Collatz→Baum-Connes)
      p3theorem_millennium.rs 455L Millennium extension: RH, YM, BSD, Hodge, NS, PvsNP, OPN
      p4rakernel.rs       598L  6-module p4rakernel Belnap+Frobenius engine
      vault.rs            395L  281 vault ob3ects registry with structural tuples
    rebis/
      mod.rs              191L  Module root; re-exports IgPrim (no duplicate RebisPrim)
      genetic_tuples.rs   986L  7-stage generative tuple pipeline + 12 IgPrim guard tests
      materials.rs        877L  IG material forge + 8 QC paradigms
      biology.rs          596L  TissueGrid, Telomere, FrobeniusBioSim, Enzyme catalog (14 classes, 109 enzymes)
      clu.rs              365L  CLU power-law clustering
      translate.rs        431L  Gene→protein + reverse pipeline (corrected + Frobenius-verified)
      antibody.rs         336L  Antibody CDR design
      codon.rs            388L  64-codon genetic code (dynamically derived, not hardcoded)
      pdb.rs              272L  PDB structure validation
      fold.rs             276L  Protein fold classification (SerpentRod)
      sidechain.rs        538L  Sidechain rotamer library + frustration_matrix()
      ligand.rs           286L  Ligand design: 6 functional groups, BindingMode, ActiveSitePocket, compatibility scoring
      decay_chain.rs      287L  Nuclear decay as IMASM winding: parent/daughter half-life chains (U-238, Th-232, U-235)
      ligand_imasm.rs     194L  Ligand IMASM programs for catalytic-site matching
      exotic_hadron.rs    233L  Glueball, Tetraquark, Pentaquark
      pipeline.rs         217L  IG promotion pipeline (IgPrim-only references)
      genetic_asm.rs      208L  Genetic ParaASM programs
      hadron.rs           203L  Hadron Belnap analysis
      clink.rs            190L  CLINK 9-layer chain
      genetics.rs         206L  7-stage genetic code verification (crystal::TOTAL)
      imas.rs             179L  IMASM arranger bridge
      therapeutics.rs     177L  Chemo, Pill, Antidote, Neurotrophic
      frob_filter.rs      153L  Frobenius codon filtration
      serpent.rs          117L  Serpent rod motifs
      materials_expanded.rs 17L  Expanded material type definitions
  momonados.ld                 Linker script (PVH note → boot32 → text → rodata → bss)
  build_bootimage.sh           ELF kernel builder (cargo build, single step)
  run.sh                       QEMU launcher (PVH direct ELF boot, no OVMF)
  Cargo.toml                   Rust project manifest, empty [dependencies]
  Makefile                     Build convenience targets

Build and Run

# Direct
cargo build --release --target x86_64-unknown-none
./run.sh          # boots release build in QEMU, serial on stdio

# Or via build script
bash build_bootimage.sh        # just compiles the ELF
bash run.sh release            # compiles if needed, then boots

The REPL runs over COM1 serial (stdio in QEMU). Quit with quit, exit, or halt, QEMU writes 0x10 to the isa-debug-exit port and exits cleanly.

Target

x86_64-unknown-none, no OS, no std, zero external crates. Static BSS bump allocator (4 MB). Boot: PVH ELF note → 32-bit _start stub (page tables + long-mode) → naked _rust_start (establishes RSP) → kmain(). Cargo.toml [dependencies] is empty.

Requirements

  • Rust nightly (rustup toolchain install nightly)
  • rust-src component (rustup component add rust-src)
  • QEMU with x86_64 support (sudo apt install qemu-system-x86)

No OVMF, no mtools, no disk image tools needed. QEMU boots the bare ELF directly via the PVH protocol (XEN_ELFNOTE_PHYS32_ENTRY).

License

Unlicense, public domain.

About

m⊙²: The Self-Imscribing Bare-Metal Kernel — a Rust OS with no processes, scheduler, or filesystem hierarchy

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages