Added a fourth guardrail and closed three silent-failure bugs found in a self-audit.
Added
deflated_sharpemodule — Probabilistic Sharpe Ratio (PSR), Deflated Sharpe Ratio (DSR), and minimum track-record length (Bailey & López de Prado). The multiple-testing correction the first three guardrails don't do: it asks whether a Sharpe survives after accounting for how many variants were tried. Stdlib-only (no new dependency).examples/deflation_demo.py— shows the demo strategy's Sharpe (significant on 1 trial) failing once a realistic search size is admitted.py.typedmarker;.gitattributes(LF normalization); this changelog.- Tests:
test_deflated_sharpe.py,test_silent_failures.py,test_report_and_data.py(73 → 92 tests; report.py/data.py now covered).
Fixed
- Engine now raises on a non-finite (NaN/inf) strategy weight instead of silently producing a fake flat 0%-return curve.
block_bootstrap_deltareturns an honest "UNDEFINED" verdict when the metric is undefined on the point estimate or most resamples (e.g. Calmar on a zero-drawdown series), instead of fabricating a confident-lookingp_delta_gt_0 = 0.0.audit_no_lookaheadreports INCONCLUSIVE (andpassed=False) when the strategy never made a real decision on any sampled date, instead of a vacuous{} == {}pass; addsn_nonempty_checked.data.load_priceshandles yfinance's single-ticker Series return shape.
Docs
- Clarified that the cash symbol is a real tradeable instrument (its rebalancing is costed), that
{}means "go flat" not "hold", and the block-length caveat for path-dependent metrics.
Initial public release: look-ahead-safe engine, three guardrails (look-ahead audit, matched-exposure control, block-bootstrap significance), demo strategy, property fuzzer + mutation test, three case studies.