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 / adaptive-intelligence / inventory / authority-and-cortex.md

105 lines · 19706 bytes Raw Blame History Source

Authority and Cortex ownership inventory (Milestone 0)

Scout: read-only. Repos at pins in ~/workspace/adaptive/PINS.txt (omega 16e729b6d844, aienos 3b2004b692a7, aegis-runtime 1eba7a7223ba, aien-sovereign-core 00e7ef05302c, cortex-rs 0606636f110d). Paths are relative to ~/workspace/adaptive/. Claims without a source are marked UNVERIFIED.

1. Classification table

CapabilityWhereClass
Canonical Cortex store (C CxStore, single writer, journal)omega/src/runtime/rx_cortex.h:2-29Implemented and integrated (called by rx_projection.c per header :8-10; reached by sovereign-core via aien-omega-compose, crates/aien-omega-compose/src/lib.rs:1-9)
Cortex HTTP memory service (:18080)aien-sovereign-core/crates/cortex-rsImplemented and integrated (live), but declared NON-authoritative and slated for deletion (rx_cortex.h:12-29)
Standalone cortex-rs repocortex-rs/README.md:1-3Superseded or deprecated (ARCHIVED; canonical home is the sovereign-core copy)
aienos-cortex Rust epistemic storeaienos/crates/aienos-cortexImplemented, integrated into host-side aienos-aegis/aienos-explain only; declared non-authoritative (rx_cortex.h:18-20)
Operator emergency stop (world level)omega/src/runtime/rx_world.h:805-830Implemented and integrated (tests: omega/tests/r16_qualify/run.sh, tests/runtime/rx_operator_mutants.sh, rx_r12_resident.c)
Capability authority, kernel-nativeaienos/crates/aienos-capability/src/lib.rsImplemented (7 unit tests), consumed by aienos-kernel caps.rs:9; not on Linux path
Resource admission + budgets, kernelaienos/crates/aienos-kernel/src/{admission,budget}.rsImplemented (native only; Aienux is not what runs on this Spark today, per memory)
Priority classes (Background/Normal/Latency)aienos/crates/aienos-kernel/src/scheduler.rs:8-12Implemented (native only)
Host effect broker: intent, token, operator grantaienos/crates/aienos-aegis/src/{effect,broker,capability,evaluator}.rsImplemented but disconnected (only crate depending on it is itself; grep of crates/*/Cargo.toml)
aegis-runtime ExecutionAuthority traitaegis-runtime/src/execution/broker.rs:15-18Implemented but disconnected (zero impl ExecutionAuthority in src or tests)
aegis-runtime RunBudget / SessionBudgetorchestration/budget.rs:3-9, sessions/session.rs:34-38Implemented but disconnected (no enforcement site; only constructed and serialized)
aegis-runtime DoctrineDecision / ContainmentLevel::EmergencyStopdefense/decision.rs:7-21Implemented but disconnected (type only; no producer found)
aegis-runtime dispatch allowlist membrane + probe gatesrc/enforcement.rs:14-80, skills.rs:131-163Implemented and integrated (used by every dispatch path, enforcement.rs:73 comment)
sovereign-core approval desk + durable effect ledgeraien-runtime/src/{spine,approved,approved_auth,approved_replay,effects}.rsImplemented and integrated (daemon path, many attack tests)
sovereign-core compose run (bounded experiment entry)control.rs:89 RunComposeTask, aien-omega-compose Compose::run lib.rs:332Implemented and integrated
Inference interfaceaien-abi-core AienInferenceBackend (lib :587) ; aegis-runtime InferenceEngine inference.rs:79Implemented and integrated (two separate traits, see section 4)
Serve-path observation snapshot (queue, KV, batch)aien-dual-observation/src/lib.rs:118-158Implemented but disconnected (only dev-dependency users found: aien-scheduler tests)
Typed resource-condition state (latency, contention, memory pressure, deadline risk) as one typenoneMissing (pieces only, section 5)
Legacy Aien scoped memoryaien-allen-memory/src/lib.rs:1-16Implemented, separate store, not Cortex

2. Cortex ownership table

Quoted migration plan, omega/src/runtime/rx_cortex.h:2-3 "Cortex, AIEN's durable typed memory. CANONICAL (M20)." and :4-10 AUTHORITY paragraph. Lines 22-29 verbatim: "Their records are not AIEN memory until they enter this store, and they enter only as CX_K_IMPORTED claims whose tag names the source (CX_SRC_*): never as facts and never by writing a journal directly. ... both are retired, not ported. (1) No new caller may be added to either. (2) Whatever is worth keeping is imported as CX_K_IMPORTED records through cx_append_as. (3) The crates are deleted. Until step 3 nothing may treat them as a source of truth."

ConsumerWhich Cortex implementationAuthoritative?Migration state
Live HTTP service on 127.0.0.1:18080cortex-rs binary ~/.local/bin/cortex-rs (built Sep 18, 9974712 bytes), process pid 4773 listening on 18080, --db-path ~/.config/cortex/cortex.db (ss and ps output this session). Routes /api/cortex/{write,search,recall,get,traverse} match aien-sovereign-core/crates/cortex-rs/src/main.rs:109-116. Which source tree built the binary: UNVERIFIED (high confidence sovereign-core copy, since the standalone repo is archived)No (rx_cortex.h:12-16)Step 1 stated by header; no import into CxStore found by this scout (UNVERIFIED, not searched in omega beyond headers)
MCP "cortex" tools (lessons memory)~/workspace/cortex-mcp/lib.js:12 BASE = CORTEX_URL or http://127.0.0.1:18080; calls /api/cortex/search (:81), /recall (:85), /get (:91), /write (:179, :204). README says "stored in the local cortex-rs server"No (HTTP client of the non-authoritative service)Not migrated. Not a Rust crate caller, so "no new caller to the crates" does not cover it
aien-cliHTTP :18080 via crates/aien-cli/src/cortex.rs:5, :39, :66NoHeader names this caller (rx_cortex.h:15-16); still live
spark-mail-rsLibrary link: Cargo.toml:27 cortex-rs path dep; src/effect.rs:8 use cortex_rs::{...Database...}; also cortex_sync.rs (HTTP client, :9-15)NoNot migrated
cortex-path-m1 (read-only experiment)Library link: Cargo.toml:21; tests/m1.rs:7, src/run.rs:7NoExperimental consumer, not migrated
aien-runtime (compose daemon)Declares cortex-rs = { path = "../cortex-rs" } at crates/aien-runtime/Cargo.toml:18 but NO cortex_rs use in any aien-runtime .rs file (grep). Its real Cortex is omega C CxStore through aien-omega-compose (crates/aien-omega-compose/src/lib.rs:1-9 "recorded in the Cortex journal <dir>/cortex.cx"; aien-runtime/src/cortex_mark.rs:1-14, effects.rs:1-30, approved_replay.rs use it)Yes (CxStore)Already on canonical store; the Cargo.toml dependency on cortex-rs looks like a leftover (unused dependency; build.rs/cfg use UNVERIFIED)
spark-rsi (Cargo.toml only)NO dependency on cortex-rs or any cortex crate (grep -i cortex of spark-rsi/Cargo.toml returned nothing; deps at lines 21-37 are clap, serde, spark-crumbs, crumb-spec, tokio, reqwest etc.). reqwest is present, so HTTP to :18080 is possible but UNVERIFIED (src not read, per scope)n/an/a
aienos-aegis, aienos-explain, aienos-kernel continuityaienos/crates/aienos-cortex (aienos-aegis/Cargo.toml:13, aienos-explain/Cargo.toml:12; kernel continuity.rs:260 holds a cortex_wal ObjectId list only)No (rx_cortex.h:18-20)Not migrated; aegis uses it as a dependency but src/*.rs had no aienos_cortex reference in grep (dependency possibly unused: UNVERIFIED)
omega runtime (rx_projection.c, rx_world.c, compose)omega C CxStore, rx_cortex.h / rx_cortex_record.hYES, only oneCanonical (M20, 2026-09-30)
AEGIS runtime (aegis-runtime)No Cortex implementation. cortex.search and cortex_recall are in ALLOWED_SKILLS but "Registered but unconnected; their handlers only report Unavailable" (src/enforcement.rs:20-24)n/aDisconnected
Aien memorySeparate store <home>.allen-memory/ (aien-allen-memory/src/lib.rs:1-5)Not CortexSeparate by design

Reading: three live stores coexist (CxStore, cortex-rs SQLite at ~/.config/cortex/cortex.db, aienos-cortex in-process). The header declares only CxStore authoritative, yet all agent-memory traffic on this Spark (MCP, aien-cli, mail) goes to cortex-rs. Step 3 (delete) is far from done because step 2 (import as CX_K_IMPORTED) has no evidence of existing in what this scout read.

3. aegis-runtime: execution authority and enforcement

Public types (aegis-runtime/src/lib.rs:18-63 re-exports):

Tests that show enforcement independent of the caller:

Gap: the "grant, budget, emergency stop" the Adaptive Intelligence loop needs exist as unenforced data types here. The enforced path is allowlist plus probe, with no per-experiment grant or budget accounting.

4. aienos: native authority, capability, kernel (public interface only)

Relevance: this is the only place with unforgeable, revocable, leased capabilities plus resource envelopes, but it targets native Aienux, not the Linux Spark path used today (memory note aienos-local-copy-stale does not apply; the repo is a fresh clone). UNVERIFIED whether any of it runs on this machine.

5. aien-sovereign-core: Worlds, inference, spine, desk, entry point

6. Existing resource-condition observation

Pieces exist, no single typed condition state:

7. Ownership conflicts and duplication risks

  1. Biggest: Cortex has two live authorities in practice. rx_cortex.h declares C CxStore canonical and the crates retired, but every agent memory path on this Spark (MCP lessons, aien-cli, mail) writes to cortex-rs on :18080 with no import path observed. A new Adaptive Intelligence memory must write via omega CxStore (cx_append/cx_append_as, single writer) and NOT add a new caller to cortex-rs (rx_cortex.h:27-28 rule 1).
  2. aegis-runtime has authority-shaped types (ExecutionAuthority, RunBudget, EmergencyStop) with no implementation. Do not build a new "budget" or "grant" type on them without deciding whether to implement them or use omega/aienos primitives. Three candidates for the same job: aegis-runtime types (unenforced), aienos-capability/aienos-aegis (native, strong, disconnected from Linux path), omega RxWorld authority and halt (enforced, C).
  3. Three World implementations (sovereign-core WorldStore, omega RxWorld, aienos JSpaceWorld) and two inference traits (AienInferenceBackend, aegis InferenceEngine).
  4. Stale dependency edges: aien-runtime -> cortex-rs and aienos-aegis -> aienos-cortex appear unused (grep), which will block step 3 deletion tracking unless cleaned.