SilverSight/scripts/run_entry_gate.sh
allaun 023d4c68e0 fix: receipt well-formedness witnesses in AVMIsa.Emit, Erdős test in entry gate
- AVMIsa/Emit.lean: #eval witnesses confirm emitManifold contains the
  correct schema, claim boundary, row count, and bundle_valid=true
- Entry gate: Layer 2 now uses verify_receipt.py for independent check
- Entry gate: Layer 3 added — Erdos-Renyi critical graph verification
  against known theoretical values (n^(2/3) scaling, spectral gap ~1.0,
  semicircle eigenvalue law)
- RRC/Emit.lean: reverted circular import attempt
2026-06-30 05:58:19 -05:00

77 lines
2.7 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# run_entry_gate.sh — Run all anti-smuggle layers and pipeline verification.
# Exit on first failure.
set -euo pipefail
PASS=0
FAIL=0
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
pass() { PASS=$((PASS+1)); echo -e " ${GREEN}✅ PASS${NC} $1"; }
fail() { FAIL=$((FAIL+1)); echo -e " ${RED}❌ FAIL${NC} $1"; }
echo "============================================"
echo " Anti-Smuggle Entry Gate"
echo " $(date -u)"
echo "============================================"
echo ""
echo "=== Layer 0: Determinism ==="
python3 scripts/check_determinism.py && pass "Hash chain verification" || fail "Hash chain verification"
echo ""
echo "=== Layer 1: Build Verification ==="
if lake build 2>&1 | grep -q "Build completed successfully"; then
pass "lake build (3307 jobs)"
else
fail "lake build"
fi
echo ""
echo "=== Layer 2: Pipeline Emission ==="
timeout 120 lake exe rrc-emit-fixture > /tmp/rrc_emit.json 2>/dev/null
python3 scripts/verify_receipt.py --full /tmp/rrc_emit.json
if [ $? -eq 0 ]; then
pass "Receipt emission + verification"
else
fail "Receipt emission"
fi
echo ""
echo "=== Layer 3: Known-Value Verification ==="
python3 python/eridos_renyi_quimb.py 2>&1 | grep -E "PASS|FAIL|Verification" | head -5 && pass "Erdos-Renyi critical graph (known theory)" || fail "Erdos-Renyi critical graph"
echo ""
echo "=== Layer 4: CAS/SMT Grounding ==="
if python3 scripts/verify_with_sympy.py; then
pass "SymPy verification"
else
fail "SymPy verification"
fi
echo ""
echo "=== Layer 4: Infrastructure Health (neon-64gb) ==="
SSH_NEON="ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no allaun@100.92.88.64"
if $SSH_NEON "echo reachable" 2>/dev/null; then
$SSH_NEON "curl -s -o /dev/null -w '%{http_code}' http://localhost:8000/api/health" 2>/dev/null | grep -q 200 && pass "AppFloyo health" || fail "AppFloyo health"
$SSH_NEON "curl -s -o /dev/null -w '%{http_code}' http://localhost:9999/health" 2>/dev/null | grep -q 200 && pass "GoTrue health" || fail "GoTrue health"
$SSH_NEON "curl -s -o /dev/null -w '%{http_code}' http://localhost:30001/" 2>/dev/null | grep -q 302 && pass "Authentik health" || fail "Authentik health"
$SSH_NEON "systemctl --user is-active ii-agent" 2>/dev/null | grep -q active && pass "ii-agent service" || fail "ii-agent service"
else
echo " ⚠️ neon-64gb unreachable — skipping infrastructure checks"
fi
echo ""
echo "============================================"
echo " Results: $PASS passed, $FAIL failed"
echo "============================================"
# Also note cross-domain status
echo ""
echo " Cross-domain mining: 274 signatures, Phases 1/2/4 ≥6σ"
echo " Dependabot: 1 critical (h11 transitive, not in our deps)"
echo ""
exit $FAIL