# SilverSight

A formally verified, hardware-native computation stack for braid topology analysis,
eigensolid compression, and cross-domain 1/n-scaling signature mining.

## Quick Start

```bash
# Verify the entire pipeline (∼4 min)
bash scripts/run_entry_gate.sh
```

This runs all 4 anti-smuggle layers:

| Layer | Gate | What it proves |
|-------|------|----------------|
| 0 | `check_determinism.py` | All artifacts are reproducible (SHA-256 chains, seeded RNG) |
| 1 | `lake build` | All 3307 Lean jobs compile (Q16_16 fixed-point, AVM ISA, PIST classifiers) |
| 2 | `rrc-emit-fixture` | The manifold receipt emits with 278/278 rows passing alignment |
| 3 | `verify_with_sympy.py` | All Q16_16 computations cross-checked against SymPy symbolic math |

## What It Does

**Core idea:** Every byte is signal. Gaps, timing, and absences are the encoding.
The compressor encodes everything; the decompressor must reconstruct everything,
including the gaps — because the gaps *are* the compression.

### Pipeline

```
Equation text → tokenizer → 8×8 strand adjacency matrix
                                       ↓
                              PIST spectral classifier
                              (MatrixN → SpectralN → ClassifyN)
                                       ↓
                              Q16_16Manifold (278 fixture rows)
                                       ↓
                              AVM ISA receipt (JSON)
```

### Key Modules

| Module | Purpose |
|--------|---------|
| `MatrixN` | Generic n×n matrix operations (power iteration, Laplacian, A^T A) |
| `SpectralN` | Spectral profile: eigenvalue, spectral gap, density, Frobenius norm |
| `ClassifyN` | Spectral-radius → color → shape-name classifier |
| `BraidStateN` | n-strand braid state, crossStep, eigensolid convergence |
| `FisherRigidityN` | n-dimensional Fisher-Rao geometric rigidity |
| `FixedPointBridge` | Q16_16 ↔ Q0_64 quad matrix bridge (zero LSB error) |
| `FeasibleSet` | QUBO k-hot relaxation with weak monotonicity proofs |

### Infrastructure

| Service | Host | Purpose |
|---------|------|---------|
| AppFloyo Cloud | neon-64gb:8000 | Module dependency dashboard |
| GoTrue | neon-64gb:9999 | JWT auth for API access |
| Authentik | neon-64gb:30001 | SSO provider (OAuth2/OIDC) |
| Homarr | neon-64gb:7575 | Infrastructure dashboard |
| CouchDB | neon-64gb:5984 | Document store |

## Verification

```bash
# Full formal build
lake build                          # 3307 jobs, 0 errors

# Generate predictions from equations
python3 python/generate_predictions.py

# Build matrix data
python3 python/build_pist_matrices_250.py

# Build manifold fixture rows
python3 python/build_manifold.py

# Emit signed receipt
lake exe rrc-emit-fixture

# Cross-domain significance mining (arXiv + CORE API)
CORE_API_KEY="<key>" python3 infra/sigs/rydberg_miner.py
python3 scripts/cross_domain_significance.py
```

## Project Structure

```
formal/          Lean 4 source (truth)
python/          Python I/O shims
scripts/         Anti-smuggle protocol, infrastructure
signatures/      Cross-domain signature data
infra/sigs/      Literature mining tools
specs/           Design documents
```

## License

Apache 2.0
