Commit 8b99983
authored
autorevert metrics: third FN category for killswitch-active windows (#8089)
Human reverts that landed while autorevert was disabled via the `ci:
disable-autorevert` label on an open issue are misclassified as False
Negatives — autorevert wasn't running, it didn't miss. Surface them as a
third category and exclude from the recall denominator.
## What changed
- New saved query `autorevert_killswitch_windows` returns raw label
add/remove events from `default.issues_label_event` plus each issue's
`closed_at`.
- `lib/autorevert/killswitchWindows.ts` folds the events per-issue into
`[on, off]` intervals, treating a close as an implicit `unlabeled` (the
lambda only honors the label on **open** issues).
- `pages/api/autorevert/metrics.ts` partitions `falseNegatives` into the
lambda-up subset (counted in recall) and a new
`falseNegativesKillswitch` subset, linked to the killswitch issue.
Weekly recall uses the lambda-up subset only.
- `pages/metrics/autorevert.tsx` adds a `FN (Disabled)` StatCard, chart
series (purple, stacked next to FN), legend entry, and renders FN chips
that fall in a killswitch window with the `FN (disabled)` label linking
to the issue.
## API additions
```
summary.false_negatives_killswitch: number
weeklyMetrics[].false_negatives_killswitch: number
killswitchWindows: [{ issue_number, on, off }]
falseNegativesKillswitch: [{ recovery_sha, recovery_time, signals_fixed, reverted_pr_numbers, killswitch_issue }]
```
`recall` (overall and weekly) now uses `tp / (tp + fn_lambda_up)`.
## Validation
Historical signal verified: issue #183016 was `labeled` 2026-05-09
01:36:48Z and `unlabeled` 2026-05-12 16:47:26Z, matching the ~79h
`misc.autorevert_state` row gap. Unit test
(`test/autorevertKillswitchWindows.test.ts`) covers labeled/unlabeled
pairing, `closed_at` fallback, still-active intervals, multi-cycle
issues, and cross-issue ordering.
`yarn tsc --noEmit` and `eslint` clean on the changed files. New +
existing autorevert jest tests pass.1 parent 33f82bb commit 8b99983
6 files changed
Lines changed: 404 additions & 37 deletions
File tree
- torchci
- clickhouse_queries/autorevert_killswitch_windows
- lib/autorevert
- pages
- api/autorevert
- metrics
- test
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
2 | 7 | | |
3 | 8 | | |
4 | 9 | | |
| |||
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| 89 | + | |
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
| |||
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
166 | 179 | | |
167 | 180 | | |
168 | 181 | | |
| |||
191 | 204 | | |
192 | 205 | | |
193 | 206 | | |
194 | | - | |
195 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
196 | 214 | | |
197 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
198 | 231 | | |
199 | 232 | | |
200 | 233 | | |
| |||
236 | 269 | | |
237 | 270 | | |
238 | 271 | | |
239 | | - | |
240 | | - | |
| 272 | + | |
| 273 | + | |
241 | 274 | | |
242 | 275 | | |
243 | 276 | | |
244 | 277 | | |
245 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
246 | 284 | | |
247 | 285 | | |
248 | 286 | | |
| 287 | + | |
249 | 288 | | |
250 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
251 | 293 | | |
252 | 294 | | |
253 | 295 | | |
254 | 296 | | |
| 297 | + | |
255 | 298 | | |
256 | 299 | | |
257 | 300 | | |
| |||
272 | 315 | | |
273 | 316 | | |
274 | 317 | | |
| 318 | + | |
275 | 319 | | |
276 | 320 | | |
277 | 321 | | |
| |||
282 | 326 | | |
283 | 327 | | |
284 | 328 | | |
| 329 | + | |
285 | 330 | | |
286 | 331 | | |
287 | 332 | | |
| |||
294 | 339 | | |
295 | 340 | | |
296 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
297 | 349 | | |
298 | 350 | | |
299 | 351 | | |
| |||
0 commit comments