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 / adr / 0020-belief-estimation-layer.md

135 lines · 11242 bytes Raw Blame History Source

ADR 0020: Belief / Estimation Layer

Status: Accepted by operator Drake Stapleton, 2026-09-30 (course-correction brief "Belief-state / estimation layer" of that date). Gate: EST-0 may begin when this ADR is merged to main. EST-4 and later wait for R16 closure. Supersedes: nothing. Amends: nothing. Extends: ARCH-0016 (resident reaction architecture: AIEN contributes BELIEFS, PREDICTIONS, UNCERTAINTY, 0016 section on contributions) by giving those words a typed contract. Related: ARCH-0005 (Effect Broker), ARCH-0007 (J-Space effect boundary), ARCH-0015 (Resident Semantic Store), ARCH-0017 (ARGUS observes, never authorizes), ARCH-0018 (AR3 substrate calibration), ARCH-0019 (selection records). Workstream: EST-0 to EST-10 (section 5); supporting documents in docs/plans/belief-estimation/ (NOT A MASTER PLAN). Sequencing stays in CURRENT_EXECUTION_PLAN.md.

Citation note: in this repository "ADR 0020" and ARCH-0020 name the same decision. In other repositories cite it as ARCH-0020.


1. Context

AIEN's later stages (TURING predictive evaluation, J-Space comparison under uncertainty, Cortex predictive abstraction, information-gain experiments, Physics Zero) all depend on predictions about physical and operational state. Today nothing in the code represents an uncertain dynamic state: there is no belief, covariance, innovation or estimator anywhere (current state section 1). Two narrow predictors exist, the Omega cost model and TURING PRD1, and neither carries a state that evolves over time.

Without a contract, later stages would each invent their own notion of "what the machine believes", and the easiest failure is the quiet one: a smoothed or predicted number gets stored or used as if it had been measured.

2. Decision

AIEN REPRESENTS OBSERVATION, ESTIMATE, PREDICTION, INNOVATION AND
UNCERTAINTY AS DISTINCT TYPED RECORDS, BOUND TO A MODEL IDENTITY AND AN
EVIDENCE ROOT, BEFORE ANY LATER STAGE MAY DEPEND MATERIALLY ON PREDICTED STATE.

THE ARCHITECTURE IS GENERAL PROBABILISTIC STATE ESTIMATION.
THE LINEAR KALMAN FILTER IS ONLY THE FIRST REFERENCE REALIZATION.

2.1 The five categories never collapse

RecordWhat it isRule
observationa measured value with its declared noise, source and evidence digestevidence; immutable once recorded; an estimator only reads it
belief (state estimate)state vector and covariance at a generationderived; carries model identity, parent digest and evidence root
predictiona belief propagated forward, plus the predicted observation distributionnever an observation, never overwrites one
innovationobservation minus predicted observation, its covariance, normalized squared surprisea number, never a proof
modeltransition model and observation modelidentity is the digest of its canonical encoding
estimate      != fact
prediction    != observation
confidence    != authority
probability   != permission
surprise      != proof

Each record is a separate type with a separate kind byte and a separate digest domain, so bytes of one kind cannot be decoded or digested as another. Digests follow the TURING rule: SHA-256(domain, 0x00, encoding).

2.2 Ownership does not move

FacultyKeeps
ARGUSobserves and detects (ARCH-0017)
Estimatorestimates; consumes observations; owns no observation
Omegamodels and realizes; the cost model stays the one cost model
J-Spacecompares alternatives; uncertainty is one more dimension, never a collapsed score
AEGISauthorizes; reads no estimator output as an authority input
Effect Broker / physical authorityexecutes
Worldcommits operational state; estimated state enters only after EST-3 passes
TURING / provenancerecords and scores predictive evidence
Cortexkeeps epistemically significant events as claims, never every estimator tick

2.3 The estimation layer must never

mint capabilities; authorize effects; grant credentials; change AEGIS policy; commit an irreversible external effect; promote its own model; rewrite raw evidence; silently discard contradictory observations; convert probability into authority; declare an estimated state to be observed fact.

Enforcement: estimator object files are built by their own mk/estimation.mk and refused if nm -u shows any authority, World, generation, capability, ARGUS, FORGE, memory-mapping, process or file operation (the cost-model pattern, omega Makefile:716-720). The pluggable AienosContainAuthorizer.decide hook (aienos aienos_contain.h:223-227) must never be given an estimator-derived verdict. ARGUS's reserved STATISTICAL confidence class is not fed by estimator output without a separate decision.

2.4 Estimators behind one contract

Estimator
  linear Kalman         EST-1 (only one built now)
  extended Kalman       only after a benchmark shows a nonlinearity the linear filter misses
  unscented Kalman      only after a benchmark shows the Jacobian route is inadequate
  particle              only after a benchmark shows non-Gaussian / multimodal failure
  Omega-synthesized     only after a benchmark shows recurring unexplained structure

A new estimator enters only with a named failure class of the previous one, the same calibration protocol, and a head-to-head comparison. Mathematical sophistication earns no production influence.

3. Placement and the R16 boundary

The sequence becomes:

R16 (migration closure)
  -> post-R16 convergence
  -> BELIEF / ESTIMATION FOUNDATION (EST-0 .. EST-3)
  -> calibrated predictive state in World and the cost model (EST-4, EST-5)
  -> TURING predictive evaluation (EST-6)
  -> J-Space uncertainty-aware reasoning (EST-7)
  -> Cortex predictive abstraction (EST-8)
  -> innovation as curiosity signal, information-gain experiments (EST-9, EST-10)
  -> Evolution Arena
  -> Physics Zero

R16 is not interrupted. EST-0 to EST-3 may run before R16 closes only as a standalone module with zero runtime linkage: new files under omega/src/estimation/ and omega/tests/estimation/, its own mk/estimation.mk targets, not in all, not in test, not included by anything under src/runtime/. This is more than schema work and is allowed only because it has no production coupling. EST-4 onward edits World, the cost model or runtime paths and waits for R16 closure and the src/runtime/ hold to lift.

4. Reuse, not duplication

5. Gates

StageExit tokenRequires
EST-0ESTIMATION_SEMANTIC_CONTRACT = PASStyped records, validation (finite, dimensions, symmetric, PSD, declared units), digests, exact serialization round trip, kind confusion refused, staleness detectable, property tests
EST-1LINEAR_KALMAN_REFERENCE = PASSpredict / update (Joseph form), deterministic, bounded, no hidden state; analytic cases and an independent information-form reference written without reading the implementation
EST-2ESTIMATION_REAL_SIGNAL = PASSone real AIEN signal replayed strictly causally from digest-bound raw evidence; raw observations preserved; prediction then later observation then innovation
EST-3ESTIMATION_CALIBRATION = PASSprotocol frozen before evaluation; noise fitted on one segment, scored on another; NIS against chi-square, interval coverage with binomial bounds, bias, drift, autocorrelation, regime breakdown; baseline comparison. A failure is recorded and the estimator is not promoted
EST-4WORLD_BELIEF_STATE = PASSafter R16; estimated state explicit in World, only where uncertainty is meaningful
EST-5OMEGA_ESTIMATION_INTEGRATION = PASScost model treats 111 GB +/- 8 differently from 111 GB +/- 0.1 near a hard limit; no universal penalty
EST-6TURING_ESTIMATION_EVIDENCE = PASSmodel, prediction distribution, observation, innovation, calibration, score
EST-7JSPACE_BELIEF_INTEGRATION = PASSuncertainty dimensions added without collapsing existing ones; information gain is never permission
EST-8CORTEX_PREDICTIVE_MEMORY = PASSsignificant events become claims under existing promotion rules
EST-9INNOVATION_CURIOSITY_SIGNAL = PASSpersistent, structured, out-of-calibration innovation opens a hypothesis, not a silent refit
EST-10ACTIVE_INFORMATION_GAIN = PASSinformation-gain experiment selection beats a defined baseline on a controlled benchmark; J-Space proposes, AEGIS authorizes

Every gate gets a hostile review that tries to show, at least: the filter only smooths and is not calibrated; uncertainty is numerically invalid; future information leaks into the replay; noise was tuned on the test sequence; raw evidence was overwritten; prediction and observation are conflated; confidence is treated as authority; innovation thresholds create false discoveries; covariance collapses numerically; the test is circular; a simpler baseline does as well. Failures stay as evidence; qualification tests are not tuned until a feature passes.

6. Doctrine wording to tighten (separate change)

Recorded in the current-state document section 4: the observation record is immutable ground truth while the value is noisy evidence (AIEN.md:534); Bayesian confidence scores never grant authority or promotion (AIEN.md:533); Cortex keeps significant events while live estimates live in the estimation layer and World (doctrine/ARCHITECTURE.md:55,160); receipts record measured ground truth, not estimates (doctrine/ARCHITECTURE.md:75).

7. Success criterion for the whole workstream

AIEN can state from replayable evidence: at generation G it believed physical state X with uncertainty U using estimator M and evidence root E; it predicted observation Y with predicted uncertainty V; reality produced Z; the innovation was I; under the calibrated model that residual had surprise S; the observation caused belief update B; and a persistently unexplained innovation produced a hypothesis for evaluation instead of forcing reality to fit the old model.