---
name: qdsr-sips-auditor
description: Audit quantitative trading backtests, ML validation pipelines, and neural representation privacy for post-selection overfitting, heavy-tail data dredging, shortcut learning, and Berkson collider bias using CERN-archived theorems (Heavy-Tail Q-DSR_nu, Minimax SIPS_infinity, Manski-Rosenbaum bounds, and Welch-MIA Duality). Use whenever evaluating Sharpe ratios, CSV backtest logs, model evaluation tables, prompt selection sweeps, or membership inference leakage.
---

# Q-DSR_nu & SIPS_infinity Post-Selection Overfitting Auditor

> **Scientific Grounding (CERN Zenodo Archive — Fabien Pierret, ORCID `0009-0001-1223-2170`):**
> - **Software Suite (`v1.0.0`):** `DOI: 10.5281/zenodo.24591062`
> - **Paper 1 (Heavy-Tail `Q-DSR_nu` & Quantum Overfitting Amplification):** `DOI: 10.5281/zenodo.24591340`
> - **Paper 2 (LLM Contextuality–Signaling Dichotomy & Confidence Loophole):** `DOI: 10.5281/zenodo.24591378`
> - **Paper 3 (Minimax `SIPS_infinity`, Manski–Rosenbaum Bounds & Welch–MIA Duality):** `DOI: 10.5281/zenodo.24591422`

## Epistemic Hygiene Rules (Mandatory)

1. **Zero *quantum woo*:** Never attribute physical entanglement, retrocausality, or non-local Bell violations to classical trading models or neural networks on silicon. Grover search enters strictly as a formal query-complexity bound ($M_{\text{quant}}(C) = \lfloor (\frac{4}{\pi}C)^2 \rfloor$).
2. **Never trust naive $C$-indexed or Gaussian-only DSR under heavy tails:** Under Student-$t_\nu$ tails ($\nu \in \{3, 4, 6\}$) or large search spaces, classical Bonferroni($C$), naive Bailey–López de Prado DSR($C$), and Gaussian Q-DSR suffer up to `53.4%–100%` false-positive collapse. Always report exact $\mathrm{Q\text{-}DSR}_\nu$.
3. **Never certify a pipeline with a linear average of audit pillars:** By Paper 3 Theorem 1(a), every convex linear aggregator $\sum_k w_k I_k$ has worst-case minimax risk $R_{\max} = 1$ on orthogonal failure modes. Always enforce the non-compensatory $\mathrm{SIPS}_\infty(I) = \max(I_{\text{mul}}, I_{\text{OOD}}, I_{\text{inv}}, I_{\text{col}})$ hard veto.
4. **Never use the naive Participation Ratio $M_{\text{PR}} = M^2 / \|\Sigma\|_F^2$ as an anti-conservative discount for extreme maxima:** Flag it explicitly against Slepian's conservative bound whenever average pairwise correlation $\rho \ge 0.20$.

## Execution Workflow

When the user provides a backtest CSV, strategy metrics, ML prediction logs, or neural bottleneck dimensions:

### Mode 1: Audit a CSV File (Auto-Detects Backtest Returns Matrix OR ML Predictions Log)

```bash
python3 scripts/audit_qdsr_sips.py csv <path_to_file.csv> \
  --annualization 252 \
  --hidden-trials 0 \
  --tail auto \
  --gamma 1.5 \
  --alpha 0.05 \
  --html-out ./audit_certificate.html \
  --json-out ./audit_report.json
```

- For crypto daily returns, set `--annualization 365`.
- If the user tested 200 parameter combinations before exporting the top 5 into the CSV, **always** pass `--hidden-trials 195` so true multiplicity is audited!
- Add `--search quantum_grover` to evaluate amplitude-amplified query budgets ($M_{\text{quant}} = \lfloor (\frac{4}{\pi}C)^2 \rfloor$).

### Mode 2: Direct Heavy-Tail `Q-DSR_nu` Parameter Audit (Paper 1)

```bash
python3 scripts/audit_qdsr_sips.py qdsr \
  --sharpe 2.85 \
  --T 252 \
  --trials 500 \
  --tail student_t \
  --nu 3.0 \
  --skew -0.6 \
  --kurtosis 9.5 \
  --rho 0.35 \
  --search classical
```

Use `--t-stat <value>` instead of `--sharpe` when auditing a raw $t$-statistic or $z$-score.

### Mode 3: Minimax `SIPS_infinity` + Manski–Rosenbaum Causal Audit (Paper 3, Theorem 1)

```bash
python3 scripts/audit_qdsr_sips.py sips \
  --i-mul 0.12 \
  --i-ood 0.14 \
  --i-inv 0.88 \
  --i-col 0.08 \
  --gamma 2.0 \
  --archetype berkson_collider
```

### Mode 4: Neural Superposition $\leftrightarrow$ MIA Privacy Duality Audit (Paper 3, Theorem 2)

```bash
python3 scripts/audit_qdsr_sips.py mia \
  --d 16 \
  --M 48 \
  --delta-mem 1.60 \
  --sigma0 0.55 \
  --sigma-b 0.90
```

## Required Deliverable Structure

Always return to the user:
1. **Executive Verdict Banner** (`CERTIFIED_SIGNAL` / `BORDERLINE_CAUTION` / `POST_SELECTION_MIRAGE` or `CAUSAL_CERTIFIED` / `POST_SELECTION_REJECTED`).
2. **Exact Numerical Audit Table** comparing Naive DSR / Linear Average vs Exact Heavy-Tail $\mathrm{Q\text{-}DSR}_\nu$ & $\mathrm{SIPS}_\infty$, explicitly flagging any **False Green Light Trap** or **Linear Blindness Exposure**.
3. **Minimum Surviving Threshold** (exact Sharpe or $t$-stat required to clear $\alpha = 0.05$, or exact Manski–Rosenbaum breakdown point $\Gamma^*$).
4. **Actionable Remediation** (what concrete out-of-sample split, counterfactual ablation, or propensity check is required before allocating capital or deploying the model).
5. **Audit Certificate Artifact** (HTML/JSON path + SHA-256 integrity digest when `--html-out` or `--json-out` was generated).

## References

- Read `references/THEORY_AND_DOIS.md` for full theorem statements, closed-form equations, and BibTeX citations.
- Run `python3 scripts/test_audit_suite.py` anytime to verify deterministic precision against the CERN benchmark suite.
