Commit 5df09ed
feat(robustness): wire LOO grid into CPCV suite — real PBO=0.20 replaces trivial mirror
Self-audit finding: the fold-mirror PBO was structurally trivial (=0.00) because
a 2-column matrix with a median-shifted mirror always picks the same best IS
strategy. The offline-robustness packet already ships a 13×5 LOO grid at
results/cross_asset_kuramoto/offline_robustness/leave_one_asset_out.csv
(13 asset-LOO perturbations × 5 walk-forward folds) — this is a bona-fide
OOS matrix for Bailey et al. (2017) PBO estimation.
Changes:
- kuramoto_contract.py — optional loo_grid field on the contract; inline
LOO_GRID_SHA256 constant for fail-closed hash verification outside the
28-entry SOURCE_HASHES.json contract (additive, SOURCE_HASHES untouched).
Missing file is tolerated (loo_grid=None); present-but-mismatched file
raises FrozenArtifactMismatch.
- kuramoto_cpcv_suite.py — _loo_oos_matrix() builds (folds × strategies)
from non-baseline LOO rows; estimate_pbo() runs on it when present.
KuramotoCPCVResult now carries loo_pbo (float|None), loo_pbo_pass,
loo_n_strategies alongside the existing fields.
- backtest/robustness_gates.py — _CPCVEvidence Protocol gains loo_pbo_pass;
evaluate_robustness_gates() includes it in cpcv_pass conjunction.
- CLI + ROBUSTNESS_v1.md now surface 'CPCV | PBO (LOO grid, n=13) | 0.2000 ✓'.
First-run evidence on the frozen bundle:
PBO (fold mirror): 0.0000 (trivial, as before — kept for continuity)
PBO (LOO grid): 0.2000 (13 strategies × 5 folds — real estimator)
best-IS each fold: tradable:TLT × 5 (OOS ranks 6, 13, 14, 14, 14)
Interpretation: 1/5 folds has best-IS below-median OOS → 20 % overfit
probability on the LOO family. Consistent with SEPARATION_FINDING.md
('drop TLT → Sharpe 1.26 → 1.73'): the TLT-drop variant is genuinely
best on 4 of 5 folds, not a lucky pick.
Tests:
- test_loo_pbo_present_and_bounded — loo_pbo ∈ [0, 1], n=13.
- test_loo_pbo_matches_hand_computed — regression pin at 0.20.
- test_loo_pbo_red_gives_fail — decision layer correctly propagates
loo_pbo_pass=False to FAIL.
- Existing _FakeCPCV fixture gained loo_pbo_pass: bool = True default
so existing decision-layer tests stay green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 81762cd commit 5df09ed
9 files changed
Lines changed: 944 additions & 211 deletions
File tree
- backtest
- research/robustness/protocols
- results/cross_asset_kuramoto/robustness_v1
- scripts
- tests/research/robustness
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
97 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
| 106 | + | |
| 107 | + | |
102 | 108 | | |
103 | 109 | | |
104 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
39 | 62 | | |
40 | 63 | | |
41 | 64 | | |
| |||
91 | 114 | | |
92 | 115 | | |
93 | 116 | | |
| 117 | + | |
94 | 118 | | |
95 | 119 | | |
96 | 120 | | |
97 | 121 | | |
98 | 122 | | |
99 | 123 | | |
100 | 124 | | |
101 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
102 | 133 | | |
103 | 134 | | |
104 | 135 | | |
| |||
112 | 143 | | |
113 | 144 | | |
114 | 145 | | |
| 146 | + | |
115 | 147 | | |
116 | 148 | | |
117 | 149 | | |
118 | 150 | | |
119 | 151 | | |
120 | 152 | | |
| 153 | + | |
121 | 154 | | |
122 | 155 | | |
123 | 156 | | |
| |||
136 | 169 | | |
137 | 170 | | |
138 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
139 | 188 | | |
140 | 189 | | |
141 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | | - | |
| 40 | + | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
| |||
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
48 | 71 | | |
49 | 72 | | |
50 | 73 | | |
| |||
55 | 78 | | |
56 | 79 | | |
57 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
58 | 85 | | |
59 | 86 | | |
60 | 87 | | |
| |||
67 | 94 | | |
68 | 95 | | |
69 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
70 | 108 | | |
71 | 109 | | |
72 | 110 | | |
| |||
76 | 114 | | |
77 | 115 | | |
78 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
79 | 120 | | |
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
0 commit comments