# SAE-1.4 Validation Package

A rigorous structural + empirical test of the Sanatan Awareness Equation v1.4,
run against honestly-generated synthetic HOPE-style logs.

## Files
- `sae14.py` — canonical SAE-1.4 reference implementation (all clamps, coherence gate, stage gate, overdrive metric, display transform)
- `test_structural.py` — 5000-trial randomized invariant property tests
- `gen_data.py` — synthetic data generator (200 users x 120 days = 24,000 rows)
- `analyze.py` — full empirical suite (model comparison, stratification, causality, fairness)
- `hope_synth.csv` — the generated dataset
- `results_output.txt` — captured run output

## Critical methodological choice
The ground-truth synthetic world uses a DIFFERENT functional form than SAE-1.4
(saturating tanh in purity, multiplicative blockers, smooth belief gate, diminishing
shakti returns, heavy-tailed additive grace). SAE-1.4's additive bracket is only an
APPROXIMATION of it. This avoids circularity: SAE-1.4 is not being tested against data
it generated. It must compete to recover an independent causal structure out-of-sample.

Crucially, the ground truth was built so that PHYSICAL CONSTRAINT does NOT reduce inner
awareness (only an expression channel), to test the spec's fairness requirement.

## Findings
1. STRUCTURAL: all invariants PASS over 5000 trials (monotonicity in blockers/purity/
   constraints, range bounds, stage gate).
2. PREDICTIVE: SAE-1.4 components model reaches R^2 = 0.896 out-of-sample (walk-forward,
   train day<80 / test day>=80) vs best baseline 0.156. SAE earns its keep on data it
   did not generate.
3. STRATIFICATION CONFIRMED: corr(Purity, Awareness) = +0.489 in positive-belief regime
   vs +0.403 pooled. Belief regime must be conditioned on, exactly as the spec warned.
4. DIRECTIONALITY: Blockers(t) -> Awareness(t+1) strong (beta=-6.19, p~3e-11); reverse
   null (p=0.93). Arrow points as the model claims.
5. FALSIFICATION (important): "Purity(t) reduces future Blockers(t+1)" did NOT hold
   (beta~0, p=0.91) — because that pathway was not built into the ground truth. This is
   the model being genuinely falsifiable. If real HOPE data shows the same null, that
   sub-claim must be dropped or rebuilt.
6. FAIRNESS: after matching on Purity+Belief, high- vs low-constraint users differ by
   only +2.70 on a 0-100 scale. Small residual leak (mental-constraint/blocker confound),
   within fair range, but flags the constraint split for careful design.

## Honest scope
This validates that SAE-1.4 is STRUCTURALLY COHERENT, FALSIFIABLE, and BEHAVES CORRECTLY,
and that it can recover non-trivial structure better than baselines. It does NOT validate
that SAE-1.4 describes real consciousness — the data is synthetic. Real validation
requires real (even anonymized) HOPE logs of >=60-120 days with a logged ObservedAwareness
proxy (e.g., a daily 0-100 Witness-access/clarity/steadiness rating).

## Next step with real data
Provide anonymized HOPE log columns matching the schema in `gen_data.py`. Then:
compute SAE outputs, fit weights under the spec's definitional constraints, run
walk-forward validation against baselines, rank blocker/purity dimensions by predictive
leverage, and characterize the empirical grace (epsilon) distribution.
