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 / doctrine / TRUST.md

447 lines · 38646 bytes Raw Blame History Source

DOCTRINE-005: TRUST — Epistemic Verification Doctrine & Trust Boundaries

The Foundations of Epistemic Soundness, The Verification Ladder, and Fault Containment for the Sovereign Machine

Document ID:     DOCTRINE-005
Milestone:       Milestone 0 (DOCTRINE_V1)
Classification:  Sovereign Machine Canonical Doctrine
Target Substrate: Epistemic Engine, Verification Kernels, AEGIS Capability Verifier, Hardware Fault Isolation
Status:          AUTHORITATIVE / CANONICAL / RATIFIED

1. Executive Summary & The Epistemic First Principle

1.1 The Epistemic First Principle

The Fundamental Axiom of Epistemic Trust: $$\mathbf{\text{Intelligence} \ne \text{Authority}}$$ Cognitive capacity, neural inference, speculative planning, and heuristic optimization are strictly UNTRUSTED. No output of search, synthesis, or machine learning may act upon physical reality without passing through an explicit, deterministic, and formally verified trust boundary.

In conventional computing architectures, systems routinely conflate optimization power with operational authority. Compilers are trusted blindly to generate correct machine code; language models are granted direct access to tool APIs; and autotuning frameworks mutate runtime configurations without mathematical bounds. When a component grows sufficiently complex, human engineers abdicate formal verification in favor of empirical hope.

The Sovereign Machine rejects this compromise. In my architecture:

  1. Search and Optimization are Untrusted: The cognitive engine (Aien), large language models, reinforcement learning policies, equality-saturation e-graph rewrites, heuristic autotuners, and program synthesizers operate exclusively on the untrusted side of the epistemic boundary. They are creative generators of candidate hypotheses, never arbiters of truth.
  2. Correctness is Strictly Trusted: Semantic specifications (Omega), verification kernels, capability checkers (AEGIS), and physical admission controllers (Physics) operate exclusively on the trusted side of the boundary. They are deterministic, inspectable, and mathematically sound arbiters of reality.
  3. Soundness Outlives Intelligence: If the cognitive engine hallucinates, mischaracterizes hardware, synthesizes malicious machine instructions, encounters catastrophic memory corruption, or suffers complete adversarial compromise, the Sovereign Machine remains sound, safe, and recoverable.
┌────────────────────────────────────────────────────────────────────────┐
│                      UNTRUSTED DOMAIN (Cognition)                      │
│                                                                        │
│   ┌───────────────────┐    ┌────────────────────┐    ┌─────────────┐   │
│   │ AIEN Core (LLM)   │    │ Autotuner / Search │    │ E-Graph IR  │   │
│   │ Heuristic Planner │    │ Realization Synth  │    │ Speculation │   │
│   └─────────┬─────────┘    └─────────┬──────────┘    └──────┬──────┘   │
│             │                        │                      │          │
│             └──────────────────┬─────┴──────────────────────┘          │
│                                │ Candidate Realization (G_R)           │
│                                │ + Proof Certificate (Π)               │
└────────────────────────────────┼───────────────────────────────────────┘
                                 │
                     THE EPISTEMIC TRUST BOUNDARY
                                 │
┌────────────────────────────────┼───────────────────────────────────────┐
│                       TRUSTED COMPUTING BASE                           │
│                                │                                       │
│                                ▼                                       │
│                ┌───────────────────────────────┐                       │
│                │   THE VERIFICATION LADDER     │                       │
│                │        (V0 ───► V5)           │                       │
│                └───────────────┬───────────────┘                       │
│                                │ Verified Admission                    │
│                                ▼                                       │
│                ┌───────────────────────────────┐                       │
│                │            PHYSICS            │                       │
│                │ (Machine Lowering & Realizer) │                       │
│                └───────────────┬───────────────┘                       │
│                                │ Lowered Realization                   │
│                                ▼                                       │
│                ┌───────────────────────────────┐                       │
│                │             AEGIS             │                       │
│                │(Invariant & Capability Checker│                       │
│                └───────────────┬───────────────┘                       │
└────────────────────────────────┼───────────────────────────────────────┘
                                 ▼
                     PHYSICAL REALITY / SUBSTRATE

2. The Epistemic Trust Boundary

The system maintains a strict, unbreachable perimeter between the Untrusted Domain ($\mathcal{U}$) and the Trusted Computing Base ($\mathcal{T}$).

2.1 The Domain Taxonomy

Domain CategorySubsystem ElementsEpistemic ClassificationJustification & Guarantees
Untrusted ($\mathcal{U}$)AIEN Cognitive Engine, LLMs, Neural Models, J-Space SpeculationUNTRUSTED_SEARCHNon-deterministic, probabilistic, vulnerable to hallucination, jailbreaks, and prompt injections.
Untrusted ($\mathcal{U}$)Realization Synthesizers, Autotuners, Loop Schedulers, HeuristicsUNTRUSTED_OPTIMIZATIONComplex search algorithms, empirical hill-climbing, heuristic cost functions with zero inherent soundness.
Untrusted ($\mathcal{U}$)Equality Saturation E-Graphs, Rewriter Passes, JIT Code GeneratorsUNTRUSTED_TRANSFORMATIONRewrite rules may contain subtle unsoundness, bugs, or unproven edge cases. Output must be checked.
Untrusted ($\mathcal{U}$)Generated AArch64 / PTX / SASS Assembly, Dynamic Native BinariesUNTRUSTED_EXECUTIONDirect machine instructions synthesized by untrusted processes. Must never execute in privileged EL1/EL2.
Trusted ($\mathcal{T}$)Omega Semantic Calculus ($G_S$), Type & Invariant ContractsTRUSTED_CONTRACTPure mathematical declarations of truth, conservation laws, shape relations, and numerical bounds.
Trusted ($\mathcal{T}$)Verification Kernels ($V_0$ through $V_5$), Static Shape / SMT CheckersTRUSTED_VERIFIERSmall, formally verified, deterministic algorithms with provable polynomial-time complexity bounds.
Trusted ($\mathcal{T}$)AEGIS Capability Verifier, Contract CheckerTRUSTED_VERIFIERMachine-verifiable capability contracts, bounds checking, monotonic reference/generation counters, strict invariant verification.
Trusted ($\mathcal{T}$)Machine Physics Realizer, SMMUv3 Page Tables, Watchdogs, ResetsTRUSTED_PHYSICSPhysical lowering compiler, hardware-enforced DMA isolation, interrupt management, and hardware reset rails.
Trusted ($\mathcal{T}$)Cryptographic Provenance Ledger, Merkle DAG, Keyed SignersTRUSTED_PROVENANCEAppend-only, tamper-evident cryptographic evidence tree with hardware Root-of-Trust anchors.

2.2 Boundary Invariants

  1. The Inward Non-Authority Invariant: No component in $\mathcal{U}$ can confer authority, mint capability tokens, grant memory mappings, or modify verification rules.
  2. The Outward Confinement Invariant: Components in $\mathcal{U}$ execute exclusively within EL0 userland containers, under SMMUv3 Stage-2 translation faulting, with zero direct MMIO or hardware control access.
  3. The Zero-Assumption Admission Invariant: The Trusted Computing Base ($\mathcal{T}$) never relies on the internal state, history, or claimed intent of $\mathcal{U}$. $\mathcal{T}$ evaluates strictly the candidate artifact $\mathcal{R}$, the associated formal proof $\Pi$, and the Omega semantic contract $G_S$.

3. The Verification Ladder ($V_0 \to V_5$)

Every realization candidate synthesized by untrusted search must ascend the Verification Ladder before it can be admitted for physical dispatch. The ladder establishes progressively deeper guarantees, transitioning from cheap syntactic checks to full proof-carrying code verification.

┌────────────────────────────────────────────────────────────────────────┐
│                       THE VERIFICATION LADDER                          │
│                                                                        │
│   [V5] Proof-Carrying Realization   (Soundness: Mathematical Proof)    │
│    ▲   Check(Π, R, G_S) in O(|Π|) deterministic polynomial time        │
│    │                                                                   │
│   [V4] Symbolic Equivalence         (Soundness: SMT / Polyhedral)      │
│    ▲   Affine transformation proofs & e-graph rewrite certificates     │
│    │                                                                   │
│   [V3] Adversarial Corner Fuzzing   (Soundness: Stress Boundary)       │
│    ▲   Denormals, NaNs, zero-strides, extreme ranks, warp divergence   │
│    │                                                                   │
│   [V2] Property-Based Invariants    (Soundness: Semantic Invariants)   │
│    ▲   Conservation laws, Lipschitz continuity, associativity bounds   │
│    │                                                                   │
│   [V1] Differential Verification    (Soundness: Reference Equivalence) │
│    ▲   Bitwise / ε-ball parity against golden EL1/EL0 scalar baseline   │
│    │                                                                   │
│   [V0] Structural / Capability Gate (Soundness: Syntactic & Bounds)    │
│        Object form, shapes, memory ranges [base, size), tokens         │
└────────────────────────────────────────────────────────────────────────┘

3.1 Tier $V_0$: Structural & Capability Verification

3.2 Tier $V_1$: Differential Verification

3.3 Tier $V_2$: Property-Based Invariant Verification

3.4 Tier $V_3$: Adversarial & Corner-Condition Verification

3.5 Tier $V_4$: Symbolic Equivalence Verification

3.6 Tier $V_5$: Proof-Carrying Realization (PCR)


4. Correctness Authority vs. Performance Authority

A fatal flaw of unprincipled compiler and runtime designs is conflating whether a program is correct with whether it is fast. The Sovereign Machine enforces an absolute division of authority between Verification and Profiling.

┌────────────────────────────────────────────────────────────────────────┐
│                     THE AUTHORITY DICHOTOMY                            │
│                                                                        │
│   CORRECTNESS AUTHORITY (Verification)  PERFORMANCE AUTHORITY (Profile)│
│   ───────────────────────────────────  ────────────────────────────────│
│   "Is this realization ALLOWED?"        "Should this realization RUN?" │
│                                                                        │
│   • Sovereign Arbiter: Physics & Omega • Sovereign Arbiter: Profiler   │
│   • Metric: Formal Proof / Parity / V  • Metric: Latency / Joules / TFL│
│   • Logic: Deterministic, Boolean      • Logic: Empirical, Continuous  │
│   • Power: Absolute Veto               • Power: Advisory Selection     │
│   • Speed cannot grant admission       • Fast garbage is still garbage │
└────────────────────────────────────────────────────────────────────────┘

4.1 The Division of Powers

pub enum VerificationOutcome {
    Admitted {
        rung: VerificationTier,     // V0 through V5
        proof_digest: Sha256Digest,
        receipt: VerificationReceipt,
    },
    Rejected {
        rung: VerificationTier,
        syndrome: VerificationFailureSyndrome,
        violating_node: Option<NodeId>,
    },
}

pub struct ProfilingTelemetry {
    pub kernel_latency_ns: u64,
    pub p99_latency_ns: u64,
    pub joules_per_inference: f64,
    pub tensor_core_utilization: f32,
    pub memory_bandwidth_pct: f32,
    pub cache_hit_rates: CacheMetrics,
}

4.2 Invariant Rules of Authority

  1. The Inviolable Veto Rule: Performance telemetry can never override a verification failure. A realization that achieves 10x throughput but fails Tier $V_1$ or $V_0$ is instantly purged from consideration and recorded as a failure in Cortex memory.
  2. The Advisory Boundary Rule: Profiling results are advisory to the search planner. They populate the Pareto frontier of valid realizations in the Realization Graph ($G_R$), guiding future search iterations, but confer zero execution authority.
  3. The Static Admission Gate: No realization candidate may be benchmarked on bare-metal production accelerators until it has cleared at least Tiers $V_0$ and $V_1$ in an isolated canary sandbox.

5. Failure Model & Adversarial Containment

The Sovereign Machine is designed under the assumption of Cognitive Malice and Substrate Unreliability. The system must remain provably stable, sound, and recoverable across five catastrophic failure modes:

┌────────────────────────────────────────────────────────────────────────┐
│                        FAILURE TAXONOMY MATRIX                         │
├────────────────────────┬─────────────────────┬─────────────────────────┤
│ Failure Mode           │ Mechanism           │ Enforcement Containment │
├────────────────────────┼─────────────────────┼─────────────────────────┤
│ 1. Semantic            │ Hallucinated logic, │ Blocked at V1/V2/V4.    │
│    Corruption          │ wrong math, drift   │ Dropped before effect.  │
├────────────────────────┼─────────────────────┼─────────────────────────┤
│ 2. Hardware            │ Illegal opcodes,    │ Blocked at V0. SMMUv3   │
│    Misunderstanding    │ wrong alignment, OOM│ traps illegal derefs.   │
├────────────────────────┼─────────────────────┼─────────────────────────┤
│ 3. Adversarial /       │ Hostile injection,  │ EL0 sandbox, memory-tag │
│    Trojan Synthesis    │ ROP chains, covert  │ validation, AEGIS gate. │
├────────────────────────┼─────────────────────┼─────────────────────────┤
│ 4. Compute / Resource  │ Infinite loop, spin │ Preemptive timer tick,  │
│    Starvation          │ lock, bus lockup    │ hard watchdog cutoff.   │
├────────────────────────┼─────────────────────┼─────────────────────────┤
│ 5. Catastrophic        │ OOM panic, core     │ Subsystem isolation,    │
│    Cognitive Crash     │ dump, corrupted J-Sp│ restart, ledger replay. │
└────────────────────────┴─────────────────────┴─────────────────────────┘

5.1 Adversarial Containment Mechanisms

  1. EL0 Isolation & No-Execute Stack: All untrusted cognitive components run in ARMv8.2-A / ARMv9-A EL0 (User Mode) with page tables mapping code segments strictly Read-Only + Execute-Never (UXN/PXN) for mutable data structures.
  2. SMMUv3 DMA Sandboxing: Any device DMA or accelerator transfer requested by an untrusted entity is routed through Stage-2 translation tables owned exclusively by the Physics EL1 kernel. Physical host RAM is completely inaccessible outside explicitly mapped contiguous guest buffers.
  3. AEGIS Non-Bypassability: Direct MMIO registers and accelerator doorbells are unmapped from user space. Ringing an accelerator doorbell requires submitting an authenticated EFFECT_INTENT token to the trusted Effect Broker adapter after AEGIS verifies the contract.
  4. Cold-State Reconstruction: If the AIEN cognitive engine suffers memory corruption or becomes unresponsive, the Physics host runtime issues an immediate SIGKILL, wipes the transient scratchpad, reloads the immutable checkpoint from the cryptographic ledger, and resumes execution from the last ratified World state.

6. Hardware & Accelerator Failure Containment

In heterogeneous supercomputing environments (e.g., AArch64 host CPUs coupled via PCIe Gen5 / NVLink to Blackwell/Hopper GPUs, NPUs, or custom ASICs), hardware failures, bus deadlocks, and thermal stalls are physical certainties.

┌────────────────────────────────────────────────────────────────────────┐
│                 ACCELERATOR RESILIENCY PIPELINE                        │
│                                                                        │
│   ┌───────────────────┐               ┌────────────────────┐           │
│   │ Periodic Heartbeat│ ──Timeout───► │ Level-1 Interrupter│           │
│   │ Monotonic Ping    │               │ (Drain Work Queue) │           │
│   └───────────────────┘               └─────────┬──────────┘           │
│                                                 │ Failed Drain         │
│   ┌───────────────────┐                         ▼                      │
│   │ Hardware Watchdog │ ──Timeout───► ┌────────────────────┐           │
│   │ Hard T_cutoff     │               │ Level-2 Revocation │           │
│   └───────────────────┘               │ (AEGIS Doorbell Off│           │
│                                       └─────────┬──────────┘           │
│                                                 │ Hard Deadlock        │
│                                                 ▼                      │
│                                       ┌────────────────────┐           │
│                                       │ Level-3 Hardware   │           │
│                                       │ Reset (PCIe FLR)   │           │
│                                       └─────────┬──────────┘           │
│                                                 │                      │
│                                                 ▼                      │
│                                       ┌────────────────────┐           │
│                                       │ Forensic Ledgering │           │
│                                       │ (AER Dump & Purge) │           │
│                                       └────────────────────┘           │
└────────────────────────────────────────────────────────────────────────┘

6.1 Multi-Stage Liveness & Watchdog Architecture

Heterogeneous accelerator pipelines enforce a three-stage temporal bounding contract:

6.2 GPU Capability Revocation & Hardware Reset Protocol

When an accelerator locks up, fails an MMU check, or exhausts watchdog bounds:

  1. Atomic Capability Revocation: Physics unmaps the accelerator doorbell registers from all EL0 address spaces and clears the corresponding AEGIS capability tokens. In-flight command descriptors are marked TERMINATED_BY_WATCHDOG.
  2. Hardware Secondary Bus / Function-Level Reset (FLR): Physics asserts a PCIe Function-Level Reset (FLR) or Secondary Bus Reset to the physical PCIe endpoint. The GPU core undergoes a complete silicon reset without rebooting the host AArch64 CPU or destabilizing the EL1 kernel.
  3. VRAM Cleansing & State Re-isolation: Following the reset, the physical VRAM address space is zeroed by the Physics kernel to prevent cross-tenant or speculative data leakage.
  4. Queue Recovery & Transaction Rollback: Active tasks assigned to the failed accelerator are rolled back to their last verified checkpoint in the World graph and rescheduled on an alternate compute engine (or fallen back to scalar CPU execution). AEGIS verifies required rollback / recovery obligations when the contract requires them. If the obligation cannot be demonstrated, the realization remains unverified.
  5. Forensic Evidence Ledgering: The crash syndrome registers (Advanced Error Reporting [AER] caps, MMU fault syndromes, device status words) are serialized into a signed forensic record and appended to the persistent ledger.

7. Auditable Provenance & Ledger Integration

In the Sovereign Machine, no operation is forgotten, no realization is anonymous, and no authorization is untraceable. Every transition of state is cryptographically bound into an append-only, tamper-evident Epistemic Provenance Ledger.

7.1 The Epistemic Merkle DAG

Every event—from training update and semantic specification to proof verification and physical execution—forms a node in an immutable Merkle Directed Acyclic Graph:

┌────────────────────────────────────────────────────────────────────────┐
│                        EPISTEMIC MERKLE NODE                           │
├────────────────────────────────────────────────────────────────────────┤
│ Node Digest:   SHA256( Parent_Hash ∥ Payload_Hash ∥ Signature )        │
├────────────────────────────────────────────────────────────────────────┤
│ Payload Elements:                                                      │
│  ├─ Parent World Hash:       Digest of predecessor world state         │
│  ├─ Semantic Graph Root:     SHA-256 root of Omega specification (G_S) │
│  ├─ Realization Hash:        SHA-256 digest of executed binary (atlas) │
│  ├─ Proof Certificate:       Digest of formal proof document (Π)       │
│  ├─ Verification Receipt:    Cryptographic attestation of V-Ladder pass│
│  ├─ Profiling Telemetry:     Signed hardware counter measurements     │
│  ├─ Policy Digest:           Digest of active AEGIS constitutional rule│
│  ├─ Signer Identity:         Public Key of authorized Machine/Signer   │
│  └─ Hardware Freshness:      Monotonic hardware counter / TPM nonce    │
└────────────────────────────────────────────────────────────────────────┘

7.2 Separation of Proofs Doctrine

To ensure cryptographic hygiene and prevent architectural circularities, the ledger enforces strict separation between three distinct classes of cryptographic proof:

                     SEPARATION OF PROOFS
┌────────────────────────┬───────────────────────────────────────────────┐
│ PROOF TYPE             │ PURPOSE AND CRYPTOGRAPHIC MECHANISM           │
├────────────────────────┼───────────────────────────────────────────────┤
│ 1. Physical Integrity  │ Unkeyed collision-resistant digests (SHA-256) │
│    Proof               │ proving data has not suffered bit rot or crash│
│                        │ corruption. (Store v1 DAG / CRC32-C).         │
├────────────────────────┼───────────────────────────────────────────────┤
│ 2. Authorization Proof │ Keyed asymmetric signatures (Ed25519) proving │
│                        │ an authorized machine or signer explicitly    │
│                        │ admitted the action under active AEGIS policy.│
├────────────────────────┼───────────────────────────────────────────────┤
│ 3. Freshness /         │ Hardware-rooted monotonic counters proving    │
│    Anti-Rollback Proof │ that state has not been rolled back to an     │
│                        │ earlier valid-but-deprecated epoch.           │
└────────────────────────┴───────────────────────────────────────────────┘

7.3 The Memory Promotion Protocol

No inference, heuristic observation, or synthetic realization may be asserted as durable truth in Cortex memory without satisfying the Promotion Protocol:

pub struct MemoryPromotionProposal {
    pub candidate_id: MemoryCandidateId,
    pub claim_statement: OmegaPredicate,
    pub empirical_evidence: Vec<ExecutionReceipt>,
    pub verification_tier: VerificationTier, // Must be >= V1
    pub formal_proof_ref: Option<ProofDigest>,
    pub reproducibility_score: f32,          // Over independent trials
}

impl MemoryPromotionProtocol {
    pub fn promote(
        proposal: MemoryPromotionProposal,
        aegis_key: &AegisPrivateKey,
    ) -> Result<PromotedMemoryEntry, EpistemicRejection> {
        // 1. Verify that empirical evidence exists and is reproducible
        if proposal.reproducibility_score < 1.0 {
            return Err(EpistemicRejection::InsufficientEmpiricalEvidence);
        }
        // 2. Enforce minimum verification tier
        if proposal.verification_tier < VerificationTier::V1Differential {
            return Err(EpistemicRejection::BelowVerificationFloor);
        }
        // 3. Check for conflict with existing Omega constitutional invariants
        if !Physics::check_consistency(&proposal.claim_statement) {
            return Err(EpistemicRejection::ConstitutionalConflict);
        }
        // 4. Emit cryptographically signed Cortex entry
        Ok(PromotedMemoryEntry::commit(proposal, aegis_key))
    }
}

8. Summary & Doctrinal Sign-Off

The doctrine of Trust guarantees that the Sovereign Machine maintains uncompromised integrity across all layers of execution:

This specification forms an inviolable foundation of the DOCTRINE_V1 milestone.

==========================================================================
                     RATIFICATION & STATUS CONFIRMATION
==========================================================================
Document:        DOCTRINE-005 (TRUST.md)
Status:          RATIFIED / CANONICAL
Authority:       Physics & Sovereign Machine Architecture Board
Sign-off Hash:   e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
==========================================================================

8.1 Synthesis is Untrusted

8.2 Staged Verification Ladder for Synthesis

For early program synthesis (Milestones 7-11):