interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

branch main Branches Tags History

aien-architecture-mv / docs / plans / CURRENT_CODE_TO_R0_R16_MIGRATION.md

208 lines · 22747 bytes Raw Blame History Source

Current Code → R0–R16 Migration Map

NOT A MASTER PLAN. This is a finite workstream plan for ADR 0016, the resident reaction architecture. CURRENT_EXECUTION_PLAN.md still owns cross-project sequencing, and doctrine/ROADMAP.md still owns milestone status. The R-gates below are ADR 0016 gates, not M-milestones.

Written: 2026-09-27. The code facts come from reading origin/main of each repository on that date:

RepositoryCommit
omega1feb832
physicsa477aee
aienosaien-dev/aienux main, last commit 2026-09-25
aien-sovereign-coremain, 2026-09-27
aegis-runtime2bbce76
aien-protocolsmain, 2026-09-23

The rules are those in ADR 0016 §60: code plus reproducible evidence decides what is true today, ADR 0016 decides the destination, and nothing is deleted before rollback is proven.


1. What exists today, in one paragraph

Nothing in any repository is reactive. The following were not found anywhere:

Every runtime path today is shaped as orchestration:

Nothing in code drives AIEN → Omega → AEGIS. The word "omega" does not appear in aienos, sovereign-core, or aegis-runtime.

The pieces worth keeping are primitives, not runtimes:

PrimitiveLocation
Generation-checked kernel capabilitiesaienos caps.rs
Atomic OLD-or-NEW store commitsaienos Store v1
Content-addressed evidence DAGsovereign-core aien-proof
Pointer-free coherent shared-world ABIphysics/omega branch m20-shared-world, not merged
Canonical semantic identityOmega M4
Realization selectionOmega M12/M14
Native GPU submissionM16–M19

2. Gate status (evidence-backed only)

GateStatusEvidence
R0 R0_REACTION_ARCHITECTURE_LOCKEDPASS on merge of ADR 0016docs/adr/0016-resident-reaction-architecture.md
R1 R1_SHARED_WORLD_PASSNOT CLAIMEDHost reference pool exists (omega/src/runtime/rx_world.*). The canonical pool must unify with OMEGA_SHARED_WORLD_V1.
R2 R2_CROSS_ENGINE_ABI_PASSNOT CLAIMEDThe ABI exists on unmerged branch m20-shared-world (58/58 host checks). There is no silicon run.
R3 R3_REACTION_CORE_PASSPASS (host reference, CPU only)omega tests/runtime/rx_heartbeat_test.c (make test-r3). Receipt omega/evidence/R3/ef3e5565b9deda5226b58caf00c3e05f467cf03f6ae91984c10898d98e28c321.json: candidate 9dd9594, clean tree, 15/15 tests, 8,948 checks, 0 failures.
R4 R4_CAUSAL_TRACE_PASSPASS (host reference, CPU only)Same receipt. Every reaction crumb in every test is audited for trigger, inputs, authority, outputs, and ancestry: 1,727 audited, 7,016 digests re-verified.
R5 R5_RESOURCE_ARBITRATIONPASShost reference, not silicon (#36-#38)
R6 R6_REACTION_STABILITYPASShost reference, not silicon (#36-#38)
R7 R7_NATIVE_AUTHORITYPASShost, against the native C authority (#41, #43)
R8 R8_CONSTITUTIONAL_AEGISPASShost (#48, fe4924a)
R9 R9_GENERATION_BARRIERPASShost (#42, 00be7ae)
R10 R10_CONTINUOUS_OMEGAPASSDGX Spark CPU (#46, 0a787ee)
R11 R11_CONTINUOUS_COGNITIONPASSDGX Spark CPU (#47, 628daf5)
R12 resident GPU seatPASSGB10 silicon (#44, 05b0692; hardening #45, 4331bf3)
R13 faculties as one causal systemPASS (causal verification PASS, AIEN goal MET)GB10 silicon (#49, fcb5793)
R14 living recoveryPASSGB10 silicon (#50, f70ae10)
R15 quantitative performanceHISTORICAL PASS (16/16 at 3e9e53b); requal FAIL 14/16 at 3108fc2 (omega evidence/REQUAL-3108fc2/); NOT requalified on CAND-0DGX Spark (#67, bba3bd3, 16/16 gates)
R16 orchestrator retirementHISTORICAL PASS at 850fc54; receipt INVALID as a current claim; requal FAIL at 3108fc2; NOT requalified on CAND-0DGX Spark (aien-spark/omega#112 merged, 3dd5eaa, receipt evidence/R16/22d7a79a985514ac38139d39c71c9638d9b6b0a6e05425b6810bdb4833d1ea64.json)

The R3/R4 claims are scoped to the host reference runtime. They say nothing about GPU execution (R12) or about the native Aienux capability root (R7).


3. Module map

Legend:

Parallelization groups (§4) are marked G0–G6.

3.1 Omega (aien-spark/omega, C11)

Current moduleCurrent responsibilityTarget responsibilityDecisionDepends onRiskTestsMilestoneGroup
tools/omegatool.c (3,962 lines)CLI that hand-sequences every gate suite and demoLegacy orchestrated runtime = reference oracle; later one launcher that seeds stimuli and observesOracle until R16everythingLow while untouched--run-*-gates (M4–M14: 111/111 rerun 2026-09-27)R15 compare, R16 retire—
src/runtime/rx_world.{c,h} (new)Host reference reaction runtime: object pool (id, generation, per-field versions, persistence class, content digest), dependency index by field mask, ready set by priority class, explicit lifecycle, versioned snapshot + atomic publication, causal crumbs (SHA-256 DAG)Seed of runtime/{object,reaction,dependency,publication,causal}; the object pool moves onto the shared-world region at R1/R2Keep → Adaptsha256.c, rx_caprootOne world mutex (deliberately simple, ADR 0016 §56); not a performance claimmake test-r3: 15 tests, 8,129 checks, 0 fail; 4/4 engine and 4/4 root deliberate-break (mutation) checks detectedR3, R4 (done host); R1, R5, R6, R15 nextG1
src/runtime/rx_caproot.{c,h} (new)Host capability root: separate non-dumpable mint process; table in a sealed memfd, read-only to the runtime; mint / attenuate-only delegation / revoke (cascading via chain walk) / reclaim (generation++) / lease clock / epochLinux-host stand-in for the Aienux kernel root; semantics must equal aienos caps.rs plus epoch/leaseKeep (host); native root is aienosLinux memfd seals (kernel ≥ 5.1; verified on 7.0)Who may request a fresh mint is not yet authenticated (R7/R8)Attack tests: forged, stale-generation replay, revoked, wrong subject, wrong resource, insufficient rights, lease expiry, epoch change, amplification, resource widening, non-delegable, cascading revoke, revoke mid-run, mprotect / mmap-write / pwrite / ftruncate / /proc reopen / direct-store SIGSEGVR7 (host part)G1
src/omega_accelerator_world.{c,h} (M19, 1,369 lines)Synchronous GPU world: buffer/code registries with OmegaHandle{epoch,id,gen,type,permissions}; submit/ring/drain; exactly-once completion (M19R); rolling digestGPU realization backend under R2/R12. OmegaHandle.permissions becomes a cached view; the right comes from a capability reference validated against the root (I3)Adaptphysics nvrm, m16M19R Lanes A/B are editing this file nowM19 gates (GPU); M19R lifecycle gatesR2, R12G2 (after M19R Gate 2)
src/omega_world_gates.cM19 qualification gatesUnchanged; becomes the regression oracle for R12KeepM19 worldShared with M19R Lanes A/B--run-m19-gates (GPU)R12, R14—
src/omega_evidence.{c,h}Run-scoped, non-clobbering evidence paths; run commit / dirty tree; observed hardware identityReceipt plumbing for every R-gateKeep (already reused by the R3 receipt)—run_commit is HEAD, so every R receipt must also bind OMEGA_CANDIDATE_COMMITused by all suitesall—
omega_types.h, omega_core, omega_canonical, omega_codec, omega_validate (M4)Canonical OMG0 encoding, SEMANTIC_ID content identityIdentity rule and canonical encoding in the per-type object contract (ADR 0016 §26); SemanticId alongside ObjectId/GenerationKeep—Do not change bytes: historical IDs depend on themM4 gates 12/12R1G2
omega_machine (G_M), omega_realize*, omega_realize_synth (M13/M14)Machine graph; G_S × G_M → G_R synthesisOmega realization faculty invoked by reactions, not by callersAdapt (wrap as reactions)R5, R6omega_machine.c:96 is_physics_authorized is a frozen fingerprint field; never treat it as authorityM13/M14 gates 20/20R10G5
omega_matvec (M12 "living matvec")Measures regimes, selects a realization adaptivelyPrototype of "hot operation → cost evidence crosses threshold → optimization reaction"AdaptR10—M12 gates 10/10R10G5
omega_verify (M7, V0–V2)Verification ladderVerification reactions gate realization promotion; the ladder is also applied to the runtime itself (§55)Keep——M7 gates 10/10R10, R13G5
omega_synthesis, omega_library, omega_discovery (M9–M11)Synthesis, library, abstraction discoveryUnchanged inside; triggered by reactionsKeep frozen (M19R rule: Lane E must not edit)—M9–M11 gates depend on exact filesM9–M11 gates 30/30R10G5
omega_blackwell_* (M17/M18 codegen, encoder, QMD, submit)Native sm_121 code generation and submissionFORGE realization for GPU-placed reactionsKeepphysics m16M19R Lane D is adding FP32 SIMTM17/M18 gates (GPU)R12G2
branch m20-shared-world: omega_shared_world_worker.*, STRONG.SYS/MEMBAR opcodesPersistent GPU worker scaffold (returns WORKER_INCOMPLETE); ordering opcodes fixture-checkedResident GPU reaction worker: observe eligible GPU reactions → claim → execute → publish descriptors (§15)AdaptR2, idle GB10Never silicon-observed; the name collides with ROADMAP M20 = OMEGA_TENSORcodegen fixturesR12G2

3.2 FORGE / historical PHYSICS (aien-spark/physics)

Current moduleCurrent responsibilityTarget responsibilityDecisionDepends onRiskTestsMilestoneGroup
branch m20-shared-world: shared_world/omega_shared_world_abi.h, omega_shared_world.{c,h}Pointer-free 128-byte descriptor; object records {id, generation, offset, length}; epoch; SPSC rings with ABA/replay/torn guards; LDAR/STLR confirmedCanonical R1/R2 substrate. Extend object records with type, version, per-field change mask, persistence class, capability reference, publication state. Rings become wake/claim transport, not RPC.Adaptphysics_coherentTurning rings into "one queue for everything" (§57)test_shared_world_host: 58/58, 2.3M messages (host)R1, R2G2
branch m20-shared-world: coherent/physics_coherent.{c,h}Coherent region allocate / resolve / revoke; hides RM handlesTrusted machine registry: physical addresses stay here (I1)AdaptnvrmNot run on GB10 yetsyntax-checked onlyR2, R12G2
nvrm/nvrm.{c,h} (+ nvrm_free, M19R #12)Userspace RM client: allocation, free, completionGPU resource backend; GPU reset and worker kill for containmentKeepdriver 580.173.02—tests/run_nvrm_lifecycle_gates.shR12, R14G2
m3/capability.s, m3/effect_broker.s, m3/receipt_ledger.sBare-metal 32-slot capability ledger (slot + generation, attenuation, revoke), 10-stage effect broker, SHA-256 receipt chainAssembly-level reference oracle for capability and effect semanticsKeep (historical, QEMU-qualified)—Python gate tooling at repo root violates the no-Python rulem3/tests/test_m3_authority.s 21/21R7 oracle, R8 effects—
m16/ native pathlibcuda-free channel/GPFIFOUnchangedKeep——M16 requalificationR12—

3.3 Aienux (aien-dev/aienux, Rust; kernel files are under crates/aienos-kernel/src/)

Current moduleCurrent responsibilityTarget responsibilityDecisionDepends onRiskTestsMilestoneGroup
crates/aienos-kernel/src/caps.rs (466 lines)Kernel-owned CapTable; handles {index, generation}; derive enforces subset + DERIVE right; cascading revoke; tombstonesThe native capability root (ADR 0014 gives capabilities to Aienux). Add epoch and lease/expiry; expose a read-only authority view for resident readiness checksAdapt—ABI frozen in abi.rs (generation-0 rejected); adding fields needs an ABI versionkernel unit tests, ipc.rs:461, task_runtime.rs:664/813R7 (native)G3
artifact_loader.rs:796, admission.rs:291Only mint path: admission grants → capsAEGIS PolicyDecision → root mint (slow path); fast path = existing capabilityAdaptR7Minting remains centralized in the kernel (correct)artifact_loader_tests.rs, H01–H29 corpusR8G3
kernel/src/scheduler.rs (380 lines, host-tested)Fixed-capacity run-queue policyNative physical admission below semantic readiness (§8): schedules work, not facultiesAdaptR5 host semanticsNot driven by a live loop yethost testsR5 (native)G3
store/engine.rs, checkpoint.rs, recovery.rs, recovery_core.rs (Store v1)A/B superblock atomic commit; crash recoveryDurable side of the generation barrier; commits go through the ADR 0015 ordered protocolKeepADR 0015 (merged)Store v1 catalog bound of 4,096 entries (ADR 0015 Builder 9)Store golden/negative, qemu_store_crash_test.shR9G4
continuity.rs (872 lines)Agent provisioning/resume, manifest sequence"Boot becomes awakening" (§30): restore last valid generation, rebuild indexes, re-mint capabilitiesAdaptR9, ADR 0015Continuity format not frozen (aienos ADR 0016 Proposed)continuity_tests.rs, qemu_continuity_test.shR9, R14G4
aienos-aegis (host crate): capability.rs HMAC token, broker.rs, world.rs JSpaceWorldHMAC-SHA256 token over editable JSON scope; in-memory audit; branch overlay with rollbackToken: Replace as an authority mechanism (a keyed MAC over editable fields in the same process is convention, not a root). JSpaceWorld rollback semantics: Adapt for speculative reactions (§24)Replace / AdaptR7, R8Not linked into kernel or boot today, so low blast radiusphase_3_to_5_integration.rsR8, R13G3
aienos-cortex (host)Epistemic records (observation / fact / hypothesis)Cortex hot state as world objects; new observation wakes AIEN reactionsAdaptR11—crate testsR11G5
aienos-boot/src/handoff.rs:1621Fixed boot demo sequence → haltAwakening sequence (§30); deterministic maintenance controls stayKeep as maintenance/recovery pathR9Must never be removed (§49)QEMU suitesR14, R16 (kept)—

3.4 AIEN runtime (aien-spark/aien-sovereign-core, Rust)

Current moduleCurrent responsibilityTarget responsibilityDecisionDepends onRiskTestsMilestoneGroup
aien-runtime/src/spine.rs (339), aien-scheduler/src/lib.rs (927)Per-request inference spine: run_until_complete loop, token scheduler, KVToken scheduler stays as a physical batching scheduler. Cognition (interpret, update belief, plan) becomes reactions over world objects; inference is a realization those reactions requestOracle for request handling; Adapt the schedulerR5, R8Largest behavioral change; must shadow first (§32 REACTION SHADOW)runtime_end_to_end, runtime_spine_integrationR11, R15, R16G5
aien-runtime/src/world.rs WorldStore (fork_world, commit_draft)Path-copying branchable worldSpeculative branches as native reactions (§24); promotion explicitAdaptR9—runtime testsR11, R13G5
aien-runtime/src/sequence.rs SequenceArena {slot, generation}Generation-checked sequence handlesPattern already matches I2; keepKeep——runtime testsR11—
aien-proof (evidence.rs 1,235 lines, chain.rs 434 lines, gate.rs 1,438 lines)Content-addressed receipts (BLAKE3), dependency DAG with cycle rejection, gate manifestsDurable form of causal crumbs at generation commit; gate manifests for R-receiptsAdaptR4, R9Hash mismatch: Omega uses SHA-256, aien-proof uses BLAKE3. Choose one causal-identity hash before crumbs become durable (R9).proof testsR4 → R9G4
cortex-rs (SQLite)Claims/entities memoryStays outside the trusted runtime path; reached via typed EpistemicRef (ADR 0015)KeepADR 0015SQLite conflicts with ADR 0015's "no generic DB in semantic layers" if pulled inwardcortex testsR11—
aien-cli/src/goals.rs:33 (goals.json)Goals as a JSON fileGoal objects in the shared world; changing one wakes cognitionReplaceR11——R11G5
aien-cli/src/commands.rs:1536 (spawns spark-aegis)AEGIS reached by shelling outRemoved from the reaction path; AEGIS state participates in readinessReplaceR8——R8G5
crates/spark-aegis symlink → ~/workspace/spark-aegis (not a git repo)Workspace member via absolute symlinkMust become a real repository or be removedFix (build hygiene)—Repo does not build anywhere but this machine———

3.5 aegis-runtime (aien-spark/aegis-runtime, Rust; last change 2026-09-23)

Current moduleCurrent responsibilityTarget responsibilityDecisionDepends onRiskTestsMilestoneGroup
agent.rs:130 tool-turn loop; heartbeat.rs:94 / main.rs:251 pollingLLM agent loop; timed SQLite task pollingLegacy orchestration; never on the reaction pathOracle → retire——aegis_tests.rsR16—
enforcement.rs:31 string denylist; policy_guard.rs probe scorePre-dispatch checksNot authority. Effect admission belongs to capability root + effect broker (ADR 0005)ReplaceR7, R8—policy_guard_tests.rsR8—
events/bus.rs (tokio broadcast; used only by a test)Event busDo not adopt: "one queue for everything" (§57)Retire——stage2_primitives_tests.rs——
orchestration/ (run, budget, trigger, termination)Types onlyBudgets become reaction activation budgets (R6)ReplaceR6——R6—

3.6 aien-protocols

Current moduleCurrent responsibilityTarget responsibilityDecisionMilestone
aien-action-protocol CapabilityGrant {capability, scope, expires_at}Serde description of a grantWire description only; never authorityKeep as descriptionR8
aien-agent-state-abi AgentStateEvent (before/after digests)State transition eventMaps onto a causal crumb's inputs/outputs digestsAdaptR4 → R9

4. Order and parallelization

G0  R0 ADR 0016 ─────────────────────────────────────────────── (merge)
         │
G1  host runtime (omega src/runtime; new files only)
    R3 ✔ ─ R4 ✔ ─ R5 modulation ─ R6 storm/loop ─ R7-host ─ R8 resident AEGIS
         │                                            │
G2  shared-world substrate (physics shared_world + omega worker)
    [after M19R Gate 2 and an idle GB10]              │
    R1 unify pool ↔ OMEGA_SHARED_WORLD_V1 ─ R2 ABI ───┼──────────── R12 silicon
         │                                            │
G3  native root (aienos)                              │
    caps.rs epoch + lease ─ read-only authority view ─ R7-native ─ R8-native
         │
G4  durability [ADR 0015 merged 2026-09-27; starts after R5–R8]
    choose causal hash ─ R9 generation barrier via Store v1
         │
G5  faculties
    R10 Omega continuous realization   (after R5, R6)
    R11 AIEN continuous cognition      (after R8, shadow mode first)
         │
G6  integration (serial)
    R13 golden path ─ R14 failure path ─ R15 performance proof ─ R16 retire orchestration

Why this order:

Disjoint ownership, so these groups can run at the same time:

These groups share no files with M19R Lanes A–E, except that G2 must wait for M19R Gate 2 before adapting omega_accelerator_world.*.

5. Open items found while mapping

  1. Naming collision. The unmerged "M20 Stage 1 OMEGA_SHARED_WORLD" work conflicts with ROADMAP M20 = OMEGA_TENSOR. Recommend relabelling it R1/R2 under ADR 0016 when those branches are merged.
  2. Causal-identity hash. Omega uses SHA-256 (semantic IDs, crumbs). aien-proof uses BLAKE3. Pick one before crumbs become durable (R9). Recommend SHA-256 for continuity with SEMANTIC_ID and the Physics/M3 receipt chain.
  3. Mint authentication. Both the host root and the kernel root enforce attenuation. Neither yet authenticates which principal may request a fresh (non-delegated) mint. This is R7/R8 scope.
  4. Python. It remains in physics (run_milestone2_gates.py, seam*_*.py), sovereign-core (11 files) and spark-rsi. None of it is touched by this track, and R-gate tooling stays C/bash/Rust.
  5. spark-aegis symlink. sovereign-core depends on an absolute-path symlink to an untracked directory.