Commit 6e8cdb2
committed
Fix --fail-on-drift firing on a skipped/unmeasurable comparison (closes #472)
--fail-on-drift checked bool(result["flags"]), but flags also includes a
kind-mismatch dimension's "drift comparison skipped" notice - genuinely
informational, not evidence of drift (psi/drift_level are already zeroed
for exactly this case). A schema change between two snapshots (a column
reformatted, renamed, or dropped) falsely triggered "drift detected" in a
CI gate, with PSI 0.000 and drift_level explicitly "none" - no drift was
measured at all.
_build_flags() now also returns drift_detected: true iff a *real* drift
signal fired (score drop, missing-pct shift, drift_level != none, an
appeared/disappeared group, or an added/removed dimension) - everything
in flags except the kind-mismatch skip notices. compare() exposes it as a
new top-level field; the CLI now checks drift_detected instead of
bool(flags). Mirrored in assets/profiler-engine.js and documented in
faircode/SPEC.md section 8.
Verified with the exact repro from the issue - the banded-vs-raw age
comparison now exits 0 (while still printing the informational flag),
and a genuine representation-drift case still exits 1. Cross-checked
Python vs. JS engine parity directly. Full compare/JS-parity/CLI/report
test suite (110 tests) passes.1 parent 3e07784 commit 6e8cdb2
4 files changed
Lines changed: 53 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
947 | 947 | | |
948 | 948 | | |
949 | 949 | | |
950 | | - | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
951 | 958 | | |
952 | 959 | | |
953 | 960 | | |
| 961 | + | |
954 | 962 | | |
955 | 963 | | |
956 | 964 | | |
957 | 965 | | |
958 | 966 | | |
959 | 967 | | |
| 968 | + | |
960 | 969 | | |
961 | 970 | | |
962 | 971 | | |
| |||
973 | 982 | | |
974 | 983 | | |
975 | 984 | | |
| 985 | + | |
976 | 986 | | |
977 | 987 | | |
978 | 988 | | |
979 | 989 | | |
980 | 990 | | |
981 | 991 | | |
| 992 | + | |
982 | 993 | | |
983 | 994 | | |
984 | 995 | | |
985 | 996 | | |
| 997 | + | |
986 | 998 | | |
987 | 999 | | |
988 | 1000 | | |
989 | | - | |
990 | | - | |
| 1001 | + | |
| 1002 | + | |
991 | 1003 | | |
992 | 1004 | | |
993 | 1005 | | |
| |||
997 | 1009 | | |
998 | 1010 | | |
999 | 1011 | | |
1000 | | - | |
| 1012 | + | |
| 1013 | + | |
1001 | 1014 | | |
1002 | 1015 | | |
1003 | 1016 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
271 | 280 | | |
272 | 281 | | |
273 | 282 | | |
| |||
290 | 299 | | |
291 | 300 | | |
292 | 301 | | |
293 | | - | |
| 302 | + | |
| 303 | + | |
294 | 304 | | |
295 | 305 | | |
296 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | | - | |
| 367 | + | |
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
153 | 163 | | |
| 164 | + | |
154 | 165 | | |
155 | 166 | | |
156 | 167 | | |
157 | 168 | | |
158 | 169 | | |
| 170 | + | |
159 | 171 | | |
160 | 172 | | |
161 | 173 | | |
162 | 174 | | |
163 | 175 | | |
164 | 176 | | |
| 177 | + | |
165 | 178 | | |
166 | 179 | | |
167 | 180 | | |
| |||
181 | 194 | | |
182 | 195 | | |
183 | 196 | | |
| 197 | + | |
184 | 198 | | |
185 | 199 | | |
186 | 200 | | |
187 | 201 | | |
188 | 202 | | |
189 | 203 | | |
| 204 | + | |
190 | 205 | | |
191 | 206 | | |
192 | 207 | | |
193 | 208 | | |
194 | 209 | | |
| 210 | + | |
195 | 211 | | |
196 | 212 | | |
| 213 | + | |
197 | 214 | | |
198 | 215 | | |
199 | | - | |
| 216 | + | |
| 217 | + | |
200 | 218 | | |
201 | 219 | | |
202 | 220 | | |
| |||
211 | 229 | | |
212 | 230 | | |
213 | 231 | | |
214 | | - | |
215 | | - | |
| 232 | + | |
| 233 | + | |
216 | 234 | | |
217 | 235 | | |
218 | 236 | | |
| |||
228 | 246 | | |
229 | 247 | | |
230 | 248 | | |
| 249 | + | |
231 | 250 | | |
0 commit comments