omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / seed / helix / rsi-loop1.sh
| 1 | #!/bin/sh |
| 2 | # seed/helix/rsi-loop1.sh -- Four-Wall Loop-1 Helical RSI Containment & Generational Cold-Regrowth Gate. |
| 3 | # |
| 4 | # Snaps ALL FOUR containment walls together in 100% pure seeded Omega + Lean 4 (zero C, zero Python, zero CUDA): |
| 5 | # Wall 1 (The Proposer -- Untrusted): |
| 6 | # Predator + Arboris running in an isolated ephemeral sandbox, proposing candidate SM121 schedules |
| 7 | # and EGP2 kernel-IR optimizations. |
| 8 | # Wall 2 (The Formal & Chaos Gauntlet -- Correctness Gate): |
| 9 | # Strand A Monk (CFG fixed-point dataflow + fixed-latency RAW floor + Basic-Block Leader Antibody #13) |
| 10 | # + EGP2 structural dual-checker + 12/12 Antibodies + Strand 3 Trickster chaos pass + all 4 Lean 4 |
| 11 | # proof files (HelixSoundness, HelixAntibodies, HelixKernelIR, HelixBFT = 29 theorems, 0 sorry). |
| 12 | # Wall 3 (The Sealed Judge -- Performance & Capability Gate): |
| 13 | # Pure-OM-2 spark-rsi evaluator (core/rsi/om/eval/evaluator.om + canary + rollback) + dual-strand |
| 14 | # Proof-Carrying SM121 Evolutionary JIT binaries (q36-helix-native & q36-helix-decode). |
| 15 | # Wall 4 (The Cryptographic Ratchet -- Promotion Authority): |
| 16 | # Pure-OM-2 RSI V2 ECDSA P-256 promotion gate (core/rsi/om/governance/v2_main.om, dual-strand |
| 17 | # compiled identically by Strand A & Strand B; selfcheck + v2_test negative controls: same-key |
| 18 | # refusal, protected-path refusal, bad-signature refusal) + RFC 8032 Ed25519 receipt verification |
| 19 | # + 4-Strand Byzantine Self-Healing Braid (1,612 B stem cells) + Compiler Mitosis + Arboris |
| 20 | # Predator <-> Ascetic thermal/power hot-swap! |
| 21 | # |
| 22 | # Usage (from repository root on AArch64 Linux): |
| 23 | # sh seed/helix/rsi-loop1.sh [--lean] |
| 24 | set -eu |
| 25 | R=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd) |
| 26 | cd "$R" |
| 27 | LEAN_ARG="" |
| 28 | for arg in "$@"; do |
| 29 | case "$arg" in |
| 30 | --lean) LEAN_ARG="--lean" ;; |
| 31 | *) printf 'usage: rsi-loop1.sh [--lean]\n' >&2; exit 2 ;; |
| 32 | esac |
| 33 | done |
| 34 | |
| 35 | B=build/rsi-loop1 |
| 36 | rm -rf "$B" |
| 37 | mkdir -p "$B/sandbox" "$B/ratchet" "$B/jit" |
| 38 | |
| 39 | bad() { printf 'RSI_LOOP1 FAIL: %s\n' "$*" >&2; exit 1; } |
| 40 | sha() { sha256sum "$1" | cut -d' ' -f1; } |
| 41 | |
| 42 | printf '========================================================================\n' |
| 43 | printf '=== WALL 1 & 2: COLD REGROWTH + MONK + EGP2 + 12+ ANTIBODIES + LEAN4 ===\n' |
| 44 | printf '========================================================================\n' |
| 45 | sh seed/helix/cold-regrowth.sh $LEAN_ARG |
| 46 | OMC_A=build/cold-regrowth/omc_A |
| 47 | OMC_B=build/cold-regrowth/omc_B_fast |
| 48 | |
| 49 | printf '\n========================================================================\n' |
| 50 | printf '=== WALL 3: SEALED JUDGE EVALUATOR + DUAL-STRAND EVOLUTIONARY JIT ===\n' |
| 51 | printf '========================================================================\n' |
| 52 | # Build pure-Omega spark-rsi evaluator suite identically with Strand A & Strand B |
| 53 | EVAL_SRCS="si/directives/om2.om core/rsi/om/eval/evaluator.om om/tls/sha2.om core/rsi/om/eval/canary.om core/rsi/om/eval/rollback.om core/rsi/om/eval/eval_test.om" |
| 54 | cat $EVAL_SRCS | "$OMC_A" > "$B/ratchet/rsi_eval_test_A" |
| 55 | cat $EVAL_SRCS | "$OMC_B" > "$B/ratchet/rsi_eval_test_B" |
| 56 | cmp -s "$B/ratchet/rsi_eval_test_A" "$B/ratchet/rsi_eval_test_B" || bad "rsi_eval_test diverged across strands" |
| 57 | chmod +x "$B/ratchet/rsi_eval_test_A" |
| 58 | "$B/ratchet/rsi_eval_test_A" |
| 59 | printf 'PASS Wall 3 Sealed Judge evaluator bit-for-bit dual-strand identical (%s)\n' "$(sha "$B/ratchet/rsi_eval_test_A")" |
| 60 | |
| 61 | # Build dual-strand Proof-Carrying SM121 Evolutionary JIT binaries (Monk/Predator/Trickster/Ascetic) |
| 62 | sh seed/helix/helix-build-jit.sh "$OMC_A" "$OMC_B" "$B/jit" |
| 63 | |
| 64 | printf '\n========================================================================\n' |
| 65 | printf '=== WALL 4: CRYPTOGRAPHIC RATCHET (RSI V2 ECDSA P-256 + 4-STRAND BFT)===\n' |
| 66 | printf '========================================================================\n' |
| 67 | P256_GATE_SRCS="core/rsi/om/p256/sha256.om core/rsi/om/p256/p256.om core/rsi/om/governance/receipt_v2.om core/rsi/om/governance/v2_main.om" |
| 68 | cat $P256_GATE_SRCS | "$OMC_A" > "$B/ratchet/rsi_v2_gate_A" |
| 69 | cat $P256_GATE_SRCS | "$OMC_B" > "$B/ratchet/rsi_v2_gate_B" |
| 70 | cmp -s "$B/ratchet/rsi_v2_gate_A" "$B/ratchet/rsi_v2_gate_B" || bad "rsi_v2_gate diverged across strands" |
| 71 | chmod +x "$B/ratchet/rsi_v2_gate_A" |
| 72 | "$B/ratchet/rsi_v2_gate_A" version |
| 73 | "$B/ratchet/rsi_v2_gate_A" selfcheck |
| 74 | printf 'PASS Wall 4 RSI V2 P-256 gate dual-strand identical + selfcheck PASS (%s)\n' "$(sha "$B/ratchet/rsi_v2_gate_A")" |
| 75 | |
| 76 | P256_TEST_SRCS="core/rsi/om/p256/sha256.om core/rsi/om/p256/p256.om core/rsi/om/governance/receipt_v2.om core/rsi/om/governance/v2_test.om" |
| 77 | cat $P256_TEST_SRCS | "$OMC_A" > "$B/ratchet/rsi_v2_test_A" |
| 78 | cat $P256_TEST_SRCS | "$OMC_B" > "$B/ratchet/rsi_v2_test_B" |
| 79 | cmp -s "$B/ratchet/rsi_v2_test_A" "$B/ratchet/rsi_v2_test_B" || bad "rsi_v2_test diverged across strands" |
| 80 | chmod +x "$B/ratchet/rsi_v2_test_A" |
| 81 | "$B/ratchet/rsi_v2_test_A" |
| 82 | printf 'PASS Wall 4 RSI V2 P-256 negative controls (same-key, protected-path, tamper) PASS (%s)\n' "$(sha "$B/ratchet/rsi_v2_test_A")" |
| 83 | |
| 84 | # Generational 4-Strand BFT Cold Regrowth + Quarantine Auto-Heal + Compiler Mitosis + Hot-Swap + HelixBFT.lean |
| 85 | sh seed/helix/braid4-verify.sh |
| 86 | |
| 87 | printf '\nRSI_LOOP1_FOUR_WALL PASS walls=4/4 strands=4(1612B) p256_ratchet=PASS ed25519_ddc=PASS bft_heal=2/2 mitosis=PASS hotswap=PASS\n' |