|
| 1 | +#!/usr/bin/env bash |
| 2 | +# prove.sh — one-command reproduction harness for RuView / wifi-densepose. |
| 3 | +# |
| 4 | +# Mission: this project has been publicly accused of being "AI slop / fake." |
| 5 | +# The answer is reproducibility. Clone the repo, run THIS script, and every |
| 6 | +# headline claim is either VERIFIED on your machine (MEASURED) or printed as |
| 7 | +# "CLAIMED — not reproduced here (why)". Nothing is asserted without a command. |
| 8 | +# |
| 9 | +# Usage: |
| 10 | +# bash scripts/prove.sh # core gate + anti-slop assertion tests |
| 11 | +# bash scripts/prove.sh --full # also run the tch/GPU/dataset-gated claims |
| 12 | +# |
| 13 | +# Exit code 0 only if every NON-gated claim passes. Gated claims never fail the |
| 14 | +# run; they print exactly what they need (libtorch, a GPU, a dataset) so you can |
| 15 | +# reproduce them yourself. |
| 16 | +set -uo pipefail |
| 17 | + |
| 18 | +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" |
| 19 | +cd "$ROOT" |
| 20 | +FULL=0; [ "${1:-}" = "--full" ] && FULL=1 |
| 21 | + |
| 22 | +pass=0; fail=0; skip=0 |
| 23 | +PASS(){ echo " [PASS] $1"; pass=$((pass+1)); } |
| 24 | +FAIL(){ echo " [FAIL] $1"; fail=$((fail+1)); } |
| 25 | +SKIP(){ echo " [CLAIMED — not reproduced here] $1"; skip=$((skip+1)); } |
| 26 | +hr(){ echo "------------------------------------------------------------"; } |
| 27 | + |
| 28 | +echo "RuView / wifi-densepose — PROOF harness" |
| 29 | +echo "repo: $ROOT" |
| 30 | +echo "date: $(date -u +%Y-%m-%dT%H:%M:%SZ)" |
| 31 | +hr |
| 32 | + |
| 33 | +# ── 1. HARD GATE: Rust workspace tests (no native libs required) ──────────── |
| 34 | +echo "[1] Rust workspace tests (cargo test --workspace --no-default-features)" |
| 35 | +if command -v cargo >/dev/null 2>&1; then |
| 36 | + if ( cd v2 && cargo test --workspace --no-default-features ) > /tmp/prove_ws.log 2>&1; then |
| 37 | + n=$(grep -oE "result: ok\. [0-9]+ passed" /tmp/prove_ws.log | grep -oE "[0-9]+" | awk '{s+=$1} END {print s}') |
| 38 | + PASS "workspace tests green — ${n:-?} passed, 0 failed (CARGO exit 0)" |
| 39 | + else |
| 40 | + FAIL "workspace tests — see /tmp/prove_ws.log (grep 'test result: FAILED')" |
| 41 | + fi |
| 42 | +else |
| 43 | + SKIP "cargo not installed — install Rust to run the workspace gate" |
| 44 | +fi |
| 45 | +hr |
| 46 | + |
| 47 | +# ── 2. HARD GATE: deterministic Python pipeline proof (SHA-256) ───────────── |
| 48 | +echo "[2] Deterministic CSI pipeline proof (archive/v1/data/proof/verify.py)" |
| 49 | +if command -v python >/dev/null 2>&1; then |
| 50 | + if python archive/v1/data/proof/verify.py > /tmp/prove_py.log 2>&1 && grep -q "VERDICT: PASS" /tmp/prove_py.log; then |
| 51 | + PASS "Python proof VERDICT: PASS (bit-exact SHA-256 of reference features)" |
| 52 | + else |
| 53 | + FAIL "Python proof — see /tmp/prove_py.log" |
| 54 | + fi |
| 55 | +else |
| 56 | + SKIP "python not installed — install Python 3.10+ to run the deterministic proof" |
| 57 | +fi |
| 58 | +hr |
| 59 | + |
| 60 | +# ── 3. ANTI-SLOP ASSERTION TESTS — each encodes a headline MEASURED claim ──── |
| 61 | +# Format: claim_test <crate> <test-name-filter> <human claim> [extra cargo args] |
| 62 | +claim_test(){ |
| 63 | + local crate="$1" filt="$2" desc="$3"; shift 3 |
| 64 | + if ! command -v cargo >/dev/null 2>&1; then SKIP "$desc (cargo missing)"; return; fi |
| 65 | + if ( cd v2 && cargo test -p "$crate" "$@" "$filt" ) > /tmp/prove_claim.log 2>&1 \ |
| 66 | + && grep -qE "test result: ok\. [1-9]" /tmp/prove_claim.log; then |
| 67 | + PASS "$desc" |
| 68 | + else |
| 69 | + # distinguish "didn't run" (feature/lib gated) from real failure |
| 70 | + if grep -qE "0 passed|filtered out;? finished|error: no test target" /tmp/prove_claim.log \ |
| 71 | + && ! grep -q "test result: FAILED" /tmp/prove_claim.log; then |
| 72 | + SKIP "$desc (test gated/absent in this build — see /tmp/prove_claim.log)" |
| 73 | + else |
| 74 | + FAIL "$desc — see /tmp/prove_claim.log" |
| 75 | + fi |
| 76 | + fi |
| 77 | +} |
| 78 | + |
| 79 | +# Variant for workspace-excluded crates (e.g. wasm-edge): run from the crate dir. |
| 80 | +claim_test_indir(){ |
| 81 | + local dir="$1" filt="$2" desc="$3"; shift 3 |
| 82 | + if ! command -v cargo >/dev/null 2>&1; then SKIP "$desc (cargo missing)"; return; fi |
| 83 | + if ( cd "$dir" && cargo test "$@" "$filt" ) > /tmp/prove_claim.log 2>&1 \ |
| 84 | + && grep -qE "test result: ok\. [1-9]" /tmp/prove_claim.log; then |
| 85 | + PASS "$desc" |
| 86 | + else |
| 87 | + if grep -qE "0 passed|error: no test target" /tmp/prove_claim.log \ |
| 88 | + && ! grep -q "test result: FAILED" /tmp/prove_claim.log; then |
| 89 | + SKIP "$desc (test gated/absent — see /tmp/prove_claim.log)" |
| 90 | + else |
| 91 | + FAIL "$desc — see /tmp/prove_claim.log" |
| 92 | + fi |
| 93 | + fi |
| 94 | +} |
| 95 | + |
| 96 | +echo "[3] Anti-slop assertion tests (each fails on the pre-fix code)" |
| 97 | +echo " ADR-156 §2.2 — fusion crafted-input DoS panics are closed:" |
| 98 | +claim_test wifi-densepose-ruvector triangulation_out_of_range_index_returns_none_no_panic \ |
| 99 | + "crafted out-of-range index returns None, no panic" --no-default-features |
| 100 | + |
| 101 | +echo " Soul Signature §3.6 — the audit's 'identity does not lock' claim, MEASURED:" |
| 102 | +claim_test wifi-densepose-bfld cardiac_alone_cannot_separate_identity_matches_audit \ |
| 103 | + "WiFi-only cardiac+respiratory channels CANNOT separate two people (gap ~0.0005)" |
| 104 | + |
| 105 | +echo " OccWorld — predict() is real (input-dependent), not random:" |
| 106 | +claim_test wifi-densepose-occworld-candle predict_is_deterministic_for_same_input \ |
| 107 | + "same occupancy input -> identical prediction (no randn stub)" |
| 108 | + |
| 109 | +echo " ADR-159 A1 — pose runtime actually emits under its own default config:" |
| 110 | +claim_test cog-pose-estimation default_config_emits_frames_with_real_model \ |
| 111 | + "default install emits pose frames (confidence >= min_confidence)" --no-default-features |
| 112 | + |
| 113 | +echo " ADR-159 A2 — person-count flags untrained classes (no count inflation):" |
| 114 | +claim_test cog-person-count untrained_class_argmax_is_flagged_low_confidence \ |
| 115 | + "argmax on an untrained class is flagged low_confidence" --no-default-features |
| 116 | + |
| 117 | +echo " ADR-160 A1 — medical edge skills carry a not-a-medical-device disclaimer:" |
| 118 | +# wasm-edge is a workspace-excluded crate → run from its own directory. |
| 119 | +claim_test_indir v2/crates/wifi-densepose-wasm-edge a1_med_modules_have_clinical_disclaimer \ |
| 120 | + "every med_* module carries the experimental/non-clinical disclaimer" --features std |
| 121 | +hr |
| 122 | + |
| 123 | +# ── 4. DATA/HARDWARE-GATED claims — honestly NOT reproduced by this script ─── |
| 124 | +echo "[4] DATA/HARDWARE-GATED claims (reproduce instructions, not asserted here)" |
| 125 | +if [ "$FULL" = "1" ]; then |
| 126 | + echo " (--full) attempting the gated claims; missing prereqs are reported, not failed:" |
| 127 | + claim_test wifi-densepose-mat test_identical_vitals_no_location_dedup_to_one \ |
| 128 | + "ADR-158 §2 survivor dedup 3->1 (count-inflation fix)" --features mat |
| 129 | +else |
| 130 | + SKIP "WiFlow-STD ~96% PCK@20 reproduction — needs an NVIDIA GPU + MM-Fi dataset; see benchmarks/wiflow-std/RESULTS.md" |
| 131 | + SKIP "named person-identity — DATA-GATED: needs a real enrollment feeding the AETHER/body-resonance channel (see docs/research/soul/)" |
| 132 | + SKIP "OccWorld trained accuracy — needs a trained checkpoint (predict() carries weights_trained=false until then)" |
| 133 | + SKIP "native wlanapi 9.74 Hz scan — Windows-only; run: cargo test -p wifi-densepose-wifiscan -- --ignored measure_native_scan_rate" |
| 134 | + echo " (re-run with --full to attempt the feature-gated subset where prereqs exist)" |
| 135 | +fi |
| 136 | +hr |
| 137 | + |
| 138 | +# ── verdict ────────────────────────────────────────────────────────────────── |
| 139 | +echo "VERDICT: $pass verified · $fail failed · $skip claimed-not-reproduced-here" |
| 140 | +if [ "$fail" -eq 0 ]; then |
| 141 | + echo "RESULT: PASS — every reproducible claim verified on this machine." |
| 142 | + exit 0 |
| 143 | +else |
| 144 | + echo "RESULT: FAIL — $fail claim(s) did not reproduce. See the /tmp/prove_*.log files." |
| 145 | + exit 1 |
| 146 | +fi |
0 commit comments