Commit c4aa1e7
fix(metrics): count orphaned-workflow governance incidents in the window rollup (#17)
The window governance counters (blocked_budget, blocked_policy, failed)
were incremented inside the per-workflow loop, so a run whose workflow_id
is no longer in the config (a pilot deleted/renamed while its historical
runs remain) was never counted — while the all-time counters, tallied in a
per-run pass with no workflow lookup, DO count it. So for an in-window
incident on a since-deleted workflow the window counter read 0 while the
all-time counter read 1, breaking the documented "_all is a superset of the
window" relationship and understating the window's governance posture.
Add a small pass over the window runs for workflows absent from the config,
classifying their blocks/failures the same way. Runs of known workflows are
already tallied above, so the pass is disjoint — no double counting, and no
change for any org whose runs all belong to current workflows.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 2fdbaa2 commit c4aa1e7
2 files changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
324 | 340 | | |
325 | 341 | | |
326 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
129 | 146 | | |
130 | 147 | | |
131 | 148 | | |
| |||
0 commit comments