23. Verification and Algorithmic Gates (G1–G8 and 13 Negative Proofs)
23.1 The Philosophy of Positive and Negative Verification
In ordinary software engineering, a test suite checks that valid inputs produce the expected output (positive testing). In an auditable epistemological machine, positive testing alone is never enough.
Suppose a gate is supposed to reject dogmatic $0%$ probabilities or Moulton-Campbell pseudoreplication, but a programmer accidentally wrote if true { return Ok(()); } inside the validator. Every positive test will pass with flying colors! The only way to prove that a gate has genuine refutation power (Deborah Mayo’s Severity Principle, Chapters 14 and 16) is to deliberately inject each forbidden methodological pathology into the system and verify that the binary halts and exits with non-zero status code 1.
A single command at the root of the repository runs the complete positive and negative verification suite:
scripts/verify.sh
23.2 The Six Verification Stages of scripts/verify.sh
- Formatting Check (
cargo fmt --all --check): Enforces canonical Rust formatting across all 5 crates. - Zero-Warning Static Analysis (
cargo clippy --workspace --all-targets -- -D warnings): Rejects any compiler or Clippy lint warning anywhere in library, binary, or test targets. - Unit and Integration Tests (
cargo test --workspace): Executes all unit tests acrossstochology-core,stochology-lenses,stochology-siga,stochology-governance, and the end-to-end integration suite incrates/stochology-cli/tests/protocol_integration.rs. - The Seven Methodological and Empirical Laboratories (
labs):cargo run --release --bin labs -- --allcargo run --release --bin labs -- --layers(Lab 1: Meng, Manski, Jensen, Performativity)cargo run --release --bin labs -- --uncertainty(Lab 2: Kennedy-O’Hagan GP, Info-Gap + Sniedovich)cargo run --release --bin labs -- --lenses(Lab 3: The 5 Lenses, Machine $M=(T,\Phi,\theta)$, 6-Axis Relational Ontology, 5-Axis Analog & Wave Computing, 4-Axis Critical Stochastic Rationality, and 4-Axis Stochary-Conjectural & Cybernetic Synthesis)cargo run --release --bin labs -- --invariants(Lab 4: $\Phi_1$–$\Phi_5$, Moulton-Campbell, Exceedance, Chouldechova)cargo run --release --bin labs -- --siga(Lab 5: 4-Filter Funnel and 8-Step SIGA on the 3 YAML Cards)cargo run --release --bin labs -- --governance(Lab 6: Bitemporal Clock, Canary, Vault, and 4 Drift Regimes)cargo run --release --bin labs -- --real-data(Lab 7: Transversal Synthesis across all 13 CSVs & 3 YAML Cards)
- The Eight Epistemological Gates (
gates, exit code0) and Thirteen Negative Proofs (--defect, exit code1). - Repository Tag Hygiene (
git tag --list): Verifies that no git tags pollute the tree.
23.3 The Eight Epistemological Gates (G1 to G8)
When you run cargo run --release --bin gates, the binary executes eight sequential gates:
| Gate | Name | What It Audits at Runtime |
|---|---|---|
G1 | Simulability & Cryptographic Integrity ($\Phi_1$) | Verifies seed = 2026 (SplitMix64), executable null models, and FIPS 180-4 SHA-256 digests of all 13 CSV datasets against data/SHA256SUMS and cards/*.yaml. |
G2 | Independent Unit & Exceedance Design Effect ($\Phi_2$) | Verifies Moulton-Campbell unequal-cluster $\tilde{m} = \bar{m}(1 + \mathrm{CV}^2)$, tail-exceedance ICC $\rho_I(p)$, and $n_{\mathrm{eff}}(p)$ across all 3 canonical cards and empirical benchmarks. |
G3 | Severe Testing, Missingness & Pre-Registration ($\Phi_3$) | Verifies Rubin missingness (MCAR, MAR, MNAR), Meng’s Identity, Manski bounds, Pearl’s Ladder rung, and 64-hex SHA-256 pre-registration seals. |
G4 | Scope, Fairness & Exit Clause ($\Phi_4$) | Verifies cost-loss threshold $p^{\ast} = \frac{C}{\eta L}$, action consistency (protect iff $p > p^{\ast}$), Chouldechova’s algebraic fairness identity, and numeric exit clauses. |
G5 | Question Resolution Alignment ($\Phi_5$) | Verifies $R_{\text{data}} \ge R_{\text{decision}}$ so coarse annual/monthly aggregates never answer daily, shift, or 6-hour operational questions. |
G6 | Prohibitions 1–4, Performativity, Info-Gap & Lenses | Verifies Cromwell’s Rule ($p \in [\varepsilon_{\text{floor}}, 1-\varepsilon_{\text{floor}}]$), 7-number NonlinearSummary, Stackelberg $\theta_{\mathrm{PO}}$ vs. $\theta_{\mathrm{PS}}$ ($r_{\mathrm{RRM}} < 1$), Info-Gap + Sniedovich Wald floor, SDPI/DPI hierarchy, and exact PAV CORP-Murphy closure. |
G7 | Bitemporal Governance, Vault & Drift Breaker | Verifies Bitemporal Clock ($t_{\text{disp}} \le \tau$), Synthetic Canary ($I(\text{Canary}; Y) = 0$), Single-Opening Temporal Vault (0 -> 1), ExTRA-WCP-T Lei & Candès bounds, 4 Label Shift estimators, and the Murphy-CORP Circuit Breaker. |
G8 | Almost-Perfect Machine, Authentic Form, Relational, Analog/Wave, Critical Rationality & Stochary-Conjectural Cybernetics | Verifies $(\varepsilon, \delta)$-Almost-Perfect Machine $M=(T,\Phi,\theta)$ (P1–P5), First-Class Authentic Model Form ($\delta(x)+\hat{S}^{\ast}$, named discarded atoms, 6 closed identities, $A(\text{model}) = \text{true}$), Fair-Coin Benchmark, the 6-Axis Relational & Complex Systems Synthesis, the 5-Axis Physical, Analog, and Wave-Interference Computing Synthesis, the 4-Axis Critical Theory of Stochastic Rationality, and the 4-Axis Stochary-Conjectural, Supply-Chain Physics & Cybernetic Synthesis (StocharyConjecturalCyberneticSynthesis, SupplyChainPhysicsAudit, StocharyStressTestNotebook, and 5-CSV EmpiricalStocharyCyberneticAudit). |
23.4 The Thirteen Negative Defect Proofs (--defect)
Each command below injects a targeted methodological defect and must exit with code 1:
Command (cargo run --release --bin gates -- ...) | Injected Pathology | Blocking Gate & Mechanism |
|---|---|---|
--defect cromwell | Sets a forecast probability to dogmatic $0%$ or $100%$ outside $[\varepsilon_{\text{floor}}, 1 - \varepsilon_{\text{floor}}]$. | Gate G6 (Prohibition 4): Rejects violation of Cromwell’s Rule. |
--defect phi5 | Attempts to answer a 5-minute shift-staffing decision using coarse monthly aggregate data ($R_{\text{data}} < R_{\text{decision}}$). | Gate G5 (Invariant $\Phi_5$): Rejects temporal resolution mismatch. |
--defect moulton | Claims nominal sample size $n$ as effective sample size $n_{\mathrm{eff}}(p)$, ignoring Moulton-Campbell cluster inflation ($\mathrm{DEFF} > 1$). | Gate G2 (Invariant $\Phi_2$): Rejects pseudoreplicated margin of error. |
--defect performativity | Deploys a performative retraining loop with contraction ratio $r_{\mathrm{RRM}} = \frac{\varepsilon\beta}{\gamma} \ge 1$ or conflates $\theta_{\mathrm{PS}}$ with $\theta_{\mathrm{PO}}$. | Gate G6 (Prohibition 3): Rejects divergent performative feedback. |
--defect sniedovich | Selects a fragile “Christmas Turkey” option with positive local $\hat{\alpha}$ that collapses below the global Wald Maximin floor in “No-Man’s Land.” | Gate G6 (Chapter 4): Rejects Info-Gap No-Man’s Land collapse. |
--defect clock | Disables the bitemporal filter ($t_{\text{disp}} \le \tau$), allowing future records to leak into features and spiking canary mutual information $I(\text{Canary}; Y) > 0$. | Gate G7 (Chapter 19): Trips the Bitemporal Canary Intrusion Alarm. |
--defect vault | Attempts to call open_once() a second time (opened_count: 1 -> 2) on an already-opened TemporalVault. | Gate G7 (Chapter 19): Blocks vault reopening (VaultReopenError). |
--defect concept_drift | Injects a structural breakdown where resolution collapses ($\Delta\mathrm{RES}_{\mathrm{CORP}} < -\tau_{\mathrm{RES}}$) while attempting to continue automated predictions. | Gate G7 (Chapter 19): Trips the Murphy-CORP Concept Drift Circuit Breaker. |
--defect chouldechova | Claims simultaneous equality of $\mathrm{FPR}, \mathrm{PPV},$ and $\mathrm{FNR}$ across groups with unequal base rates ($p_A \neq p_B$). | Gate G4 (Invariant $\Phi_4$): Rejects algebraic violation of Chouldechova’s identity. |
--defect machine | Injects a non-invariant spurious proxy into $\hat{S}^{\ast}$, hides a discarded atom, or breaks Gram effective dimension $d_{\mathrm{eff}} < 0.80 W$. | Gate G8 (Chapter 8): Rejects inauthentic model form ($A(\text{model}) = \text{false}$). |
--defect analog_wall | Deploys standard digital weights onto a noisy analog RRAM/PCM crossbar ($\sigma = 0.60$) without Noise-Aware Training (NAT), Analog ECC, or PKU HP-INV iterative refinement. | Gate G8 (Chapter 11): Rejects uncompensated Analog Wall threshold cliff ($35.0% < 50.0%$). |
--defect instrumental_reason | Liquidates Adorno’s Non-Identical via Gaussian outlier amputation, deploys an ungrounded Marcuse/Rouvroy “Stochastic Parrot” without causal invariance ($\hat{S}^{\ast}$) or named discarded atoms, and disables neurosymbolic/wave overcoming. | Gate G8 (Chapter 12): Rejects instrumental stochastic reification and counterfactual collapse. |
--defect stochary_cybernetics | Operates an acyclic taxonomy without feedback loops, runs Just-in-Time without low-pass stock buffering (Bullwhip $= 8.38\times$, Kingman $W_q = 26.5\text{ h}$), exposes full capital to Peters’s non-ergodic $+50%/-40%$ ruin ($g_{\text{tempo}} = -5.13%$), operates with $\mathrm{TTS} < \mathrm{TTR}$ ($0.43$) and $\varepsilon = 0$ Optimizer’s Curse ($+2.79$), and rewards a PATE Q3 Happy Accident jackpot without triggering the S3* Algedonic alarm. | Gate G8 (Chapter 13): Rejects non-ergodic ruin, Bullwhip/Optimizer’s Curse fragility, and PATE Q3 moral-luck indulgence. |