File size: 4,576 Bytes
9425aed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# QUANTUM PIPER β€” Sovereign Quantum Civilization

Inverted Piper architecture. Local-first. WORM-anchored. Capability-gated.
Formal law: `LiquidLean.QuantumPiper` (8-phase pipeline).

## Structure

```

quantum-piper/

β”œβ”€β”€ orchestrator/     BOB sovereign compliance agent β€” WORM, NATS, Ada gate, Lean 4, Prolog

β”œβ”€β”€ kernels/

β”‚   β”œβ”€β”€ fortran/      BOB quantum civilization engine (15 modules: QFT/Grover/Shor/WORM ABI)

β”‚   └── cuda/         RTX 4090 inference β€” PagedAttention PTX, scheduler C--, GGUF loader

β”œβ”€β”€ bindings/

β”‚   β”œβ”€β”€ rust/         bob-quantum-sys β€” Rust FFI over Fortran engine

β”‚   β”œβ”€β”€ elixir/janet/julia/odin/r/racket/zig/

β”œβ”€β”€ reasoning/        BOB reasoning engine β€” SSM pipeline + Lean 4 Goldilocks proof

β”œβ”€β”€ qec/              Quantum error correction β€” stabilizer search (Rust + Fortran)

β”œβ”€β”€ resonance/        quantum.mjs / entropy.mjs β€” superposition monad, Born rule, KL divergence

β”œβ”€β”€ formal/

β”‚   β”œβ”€β”€ axioms/       quantum.axiom β€” base axioms

β”‚   └── lean/         SovereignGate.lean β€” capability gate theorems

β”œβ”€β”€ wasm/             Compiled WASM frontend

β”œβ”€β”€ demos/            BOB vortex civilization ASCII renderer

β”œβ”€β”€ tools/            build_quantum.py, nemotron.py β€” automated build + Nemotron agent

β”‚

β”œβ”€β”€ infra/            SOV-KERNEL-MONSTER sovereign Docker + registry stack (Haiku swarm infra)

β”‚   β”œβ”€β”€ docker-compose.sov.yml    gitea + sov-registry-proxy + haiku-fn-ops (internal net only)

β”‚   β”œβ”€β”€ Dockerfile.gitea          hardened Gitea from source, FROM scratch, no telemetry

β”‚   β”œβ”€β”€ Dockerfile.hauki          Haiku fn-ops runner (Rust, musl static)

β”‚   β”œβ”€β”€ sov-base.Dockerfile       base template for all sovereign agent images (FROM scratch)

β”‚   β”œβ”€β”€ sov-registry.yaml         standalone local registry, 127.0.0.1:5000

β”‚   β”œβ”€β”€ sov-attest.sh             Blake3 hash β†’ Ed25519 sign β†’ .worm sidecar β†’ push

β”‚   └── hooks/

β”‚       β”œβ”€β”€ pre-receive           ASP enforcer β€” rejects unsigned/unauthorized git pushes

β”‚       └── verify_asp.pl         Prolog deterministic heart β€” architect_key/engineer_key rules

β”‚

β”œβ”€β”€ provision/        Ansible bootstrap for sovereign infrastructure

β”‚   β”œβ”€β”€ sov-bootstrap.yml         6-phase playbook: WORM vol + Ed25519 keys + hooks + deed

β”‚   β”œβ”€β”€ inventory/sov-local.yml   7 identities: architect, 5 engineers, hauki-bot

β”‚   └── templates/sov-worm.mount.j2  systemd unit for persistent loop mount across reboots

β”‚

β”œβ”€β”€ .sov/             Sovereign kernel config (gitignored locally, tracked in WORM)

β”‚   └── personas/

β”‚       └── SnapKitty_Sovereign_Transformer.xml   Haiku swarm identity + constraint set

β”‚

└── TRUST_DEED.xml    Signed sovereign trust deed β€” ASP_MAXIMAL/STRICT/POLITE_CODING rules

```

## Sovereign Infra β€” How It Works

The `infra/` module implements a **Bifrost WORM-Chain** attestation pipeline for the Haiku swarm:

```

Haiku agent builds image

        ↓

sov-attest.sh: Blake3(image tar) β†’ Ed25519 sign β†’ write .worm sidecar

        ↓

git push β†’ sov-git-server (localhost:3000)

        ↓

pre-receive hook: verify all commits signed, run verify_asp.pl (Prolog)

        ↓  fail β†’ push rejected

Gitea mirrors to GitHub (--mirror, read-only facade)

        ↓

haiku-fn-ops: pulls image, checks .worm sidecar, verifies hash + sig

        ↓  fail β†’ quarantine + alert

VALID β†’ push to GHCR with semver tag. Chain sealed.

```

**Mock mode (current):** `verify_asp.pl` uses deterministic mock fingerprints. `sov-attest.sh`
falls back to `MOCK_SIG` when `BIFROST_KEY` env var is not set. Safe to run and test without
real keys.

**To activate real keys:** run `provision/sov-bootstrap.yml`, copy the Ed25519 fingerprints
from its audit output into `infra/hooks/verify_asp.pl`, set `BIFROST_KEY=/path/to/ed25519.priv`.

## Absorbed from (now archivable)
- `bob-orchestrator` (.newrepos)
- `tmp_bob/`
- `sov-kernel-monster/rust/bob-quantum-sys/`
- `sov-kernel-monster/` multi-lang bindings
- `tmp/main-repo/bob-reasoning-engine/`
- `qec-discovery/`
- `bobs-games/`
- `build_quantum.py`

## Formal law
`liquidlean/src/LiquidLean/QuantumPiper.hs` β€” 8-phase kernel pipeline governs all artifacts.
All kernels must pass: Parse β†’ TypeCheck β†’ Entangle β†’ Optimize β†’ AliveCheck β†’ Compile β†’ Attest β†’ Deploy.