# CAIN ORACLE — Architecture

**ORACLE = Predictive Reality Assurance & Counterfactual Authorization Fabric.**

> NO TRUSTED PREDICTION → NO CONSEQUENCE-CRITICAL AUTONOMOUS AUTHORITY.
> OBSERVED REALITY OUTRANKS PREDICTED REALITY.

ORACLE conditions autonomous authority not only on whether an action is authorized, but on whether the system's
prediction of the action's consequences is trustworthy enough for the consequence class involved. It adds no new moat
and builds no second CAIN; it is the predictive-reliability layer above ARGUS, VIGIL, HERMES, IRONCLAD and CRUCIBLE.

## Position

```
AGENT → IDENTITY → INTENT → AUTHORITY → HERMES COVERAGE → ORACLE PREDICTION → WORLD-MODEL ASSURANCE →
COUNTERFACTUAL VALIDATION → VIGIL VIABILITY → ARGUS ASSURANCE LEASE → CAIN DECISION → MCPGATE →
EXTERNAL EFFECT → IRONCLAD OBSERVATION → VERIFIED EFFECT → ORACLE PREDICTION ERROR → AUTHORITY RECALIBRATION →
CRUCIBLE CONTROL VALIDATION → EVIDENCE → ATLAS FEDERATION
```

## Collision matrix (what existed, not duplicated)

| Existing | Where | ORACLE difference |
|---|---|---|
| WorldModelAuthorityFirewall | `cain/continuum/world_governance.py` | ORACLE grades the **predictor** so a prediction can gate authority (the firewall only forbids prediction from *creating* authority) |
| RealityConformanceEngine | `cain/continuum/world_governance.py` | ORACLE's reality override invalidates **authority** on contradiction |
| WorldModelDriftEngine | `cain/continuum/world_governance.py` | ORACLE adds calibration + prediction-error → authority impact |
| counterfactual / causal_graph | `cain/omniscience/` | ORACLE counterfactuals are machine-checkable authorization conditions with a robustness state |
| VIGIL world-state confidence | `cain/vigil/worldstate.py` | VIGIL grades the *state*; ORACLE grades the *prediction/model/simulator* |
| frontier world_model/gate | `cain/frontier/` | ORACLE adds certificates, calibration, authority impact and clean-room verification |

## ORACLE II — predictive-assurance hardening

| Engine | File | Question it answers |
|---|---|---|
| OracleDisagreementEngine | `disagreement.py` | Do independent predictors actually agree, and is their agreement independent? |
| WorldModelEvidenceIndependenceGraph | `independence.py` | Is the evidence supporting the prediction genuinely independent (no shared dataset/simulator/sensor)? |
| PredictionFailureLearningEngine | `learning.py` | How must a prediction failure reduce authority, through governance? |
| OracleChaosEngine | `chaos.py` | Does consequence-critical predictive authorization stay fail-closed under faults? |
| OraclePathSelector | `paths.py` | FAST / STANDARD / HIGH_ASSURANCE requirement sets from real policy logic |

An ORACLE II failure record is independently verifiable by the clean-room verifier (`kind=failure`).

## Modules (`cain/oracle/`)
`prediction` · `worldmodel` · `calibration` (tracker + authority impact) · `counterfactual` · `reality` (admissibility +
override) · `certificate` · `disagreement` · `independence` · `learning` · `chaos` · `paths` · `hosted_stages` ·
`properties11` · `properties12` · `lab`. Clean-room verifier: `cain-oracle-verify`.

## Status
See `ORACLE_PUBLIC_TRUTH.md`. Same-project tests only; no third-party validation; no real physical system.
