interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / seed / helix / rsi-loop1.sh

87 lines · 5182 bytes Raw Blame History
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]
24set -eu
25R=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd)
26cd "$R"
27LEAN_ARG=""
28for 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
33done
34
35B=build/rsi-loop1
36rm -rf "$B"
37mkdir -p "$B/sandbox" "$B/ratchet" "$B/jit"
38
39bad() { printf 'RSI_LOOP1 FAIL: %s\n' "$*" >&2; exit 1; }
40sha() { sha256sum "$1" | cut -d' ' -f1; }
41
42printf '========================================================================\n'
43printf '=== WALL 1 & 2: COLD REGROWTH + MONK + EGP2 + 12+ ANTIBODIES + LEAN4 ===\n'
44printf '========================================================================\n'
45sh seed/helix/cold-regrowth.sh $LEAN_ARG
46OMC_A=build/cold-regrowth/omc_A
47OMC_B=build/cold-regrowth/omc_B_fast
48
49printf '\n========================================================================\n'
50printf '=== WALL 3: SEALED JUDGE EVALUATOR + DUAL-STRAND EVOLUTIONARY JIT ===\n'
51printf '========================================================================\n'
52# Build pure-Omega spark-rsi evaluator suite identically with Strand A & Strand B
53EVAL_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"
54cat $EVAL_SRCS | "$OMC_A" > "$B/ratchet/rsi_eval_test_A"
55cat $EVAL_SRCS | "$OMC_B" > "$B/ratchet/rsi_eval_test_B"
56cmp -s "$B/ratchet/rsi_eval_test_A" "$B/ratchet/rsi_eval_test_B" || bad "rsi_eval_test diverged across strands"
57chmod +x "$B/ratchet/rsi_eval_test_A"
58"$B/ratchet/rsi_eval_test_A"
59printf '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)
62sh seed/helix/helix-build-jit.sh "$OMC_A" "$OMC_B" "$B/jit"
63
64printf '\n========================================================================\n'
65printf '=== WALL 4: CRYPTOGRAPHIC RATCHET (RSI V2 ECDSA P-256 + 4-STRAND BFT)===\n'
66printf '========================================================================\n'
67P256_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"
68cat $P256_GATE_SRCS | "$OMC_A" > "$B/ratchet/rsi_v2_gate_A"
69cat $P256_GATE_SRCS | "$OMC_B" > "$B/ratchet/rsi_v2_gate_B"
70cmp -s "$B/ratchet/rsi_v2_gate_A" "$B/ratchet/rsi_v2_gate_B" || bad "rsi_v2_gate diverged across strands"
71chmod +x "$B/ratchet/rsi_v2_gate_A"
72"$B/ratchet/rsi_v2_gate_A" version
73"$B/ratchet/rsi_v2_gate_A" selfcheck
74printf 'PASS Wall 4 RSI V2 P-256 gate dual-strand identical + selfcheck PASS (%s)\n' "$(sha "$B/ratchet/rsi_v2_gate_A")"
75
76P256_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"
77cat $P256_TEST_SRCS | "$OMC_A" > "$B/ratchet/rsi_v2_test_A"
78cat $P256_TEST_SRCS | "$OMC_B" > "$B/ratchet/rsi_v2_test_B"
79cmp -s "$B/ratchet/rsi_v2_test_A" "$B/ratchet/rsi_v2_test_B" || bad "rsi_v2_test diverged across strands"
80chmod +x "$B/ratchet/rsi_v2_test_A"
81"$B/ratchet/rsi_v2_test_A"
82printf '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
85sh seed/helix/braid4-verify.sh
86
87printf '\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'