Commit 643efaa
fix(detection-stats): treat external as default and scope reported_reasons to it (#911)
* fix(detection-stats): treat external detector as default after gh-aw #54111
gh-aw PR #54111 flipped `features: gh-aw-detection` to enabled by default,
so every compiled `.lock.yml` now carries the `Install threat-detect binary`
step unless the workflow explicitly opts out. Validated against gh-aw main:
236/274 workflows with a `detection` job carry the marker; the other 38 all
set `gh-aw-detection: false` in frontmatter.
Update the daily stats collector to match:
- Add a symmetric built-in path rollup (mirroring the external path rollup),
so skipped / cancelled / in-progress detection jobs on a workflow whose
other runs went through the built-in path are classified as built-in
instead of leaking into the `unknown` bucket.
- For `.lock.yml` runs with no evidence either way, default to external
(the new gh-aw default) instead of `unknown`, so residual reliability
failures on rarely-run workflows are still counted in the external rate.
- Refresh the marker comment, the summary description, and
`detection-stats-daily.md` so they document the new default.
- Update the offline stub-API test to reflect that wf1's skipped / cancelled
/ in-progress runs are now built-in via the rollup.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: David Slater <12449447+davidslater@users.noreply.github.com>
* fix(detection-stats): scope reported_reasons to the external population
The "Reasons reported by gh-aw" table counted every warning/failure
comment in `[aw] Detection Runs`, including those for built-in-detector
runs and (pre-classifier fix) indeterminate runs that never entered the
external population every other rate on the report is measured over. That
made the table incomparable with the "By workflow" and "Notable runs"
sections below it.
Bind an `$ext_ids` set from the external-detector population and filter
`$reasons` against it before grouping. Update the summary blurb and the
workflow-doc bullet to spell out the new scoping, and extend the offline
stub-API test with a built-in-workflow reason comment and a total-count
assertion to lock in the scoping.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: David Slater <12449447+davidslater@users.noreply.github.com>
* fix(detection-stats): tighten built-in evidence and gate external default on cutover date
Address PR #911 review comments:
- Built-in classification (both the workflow-path rollup and the per-run
fallback) now requires `conclusion == "success"`. A completed detection
job whose steps failed before the `Install threat-detect binary` position
(e.g. Setup Scripts failure) is not conclusive built-in evidence and
would otherwise cause every sibling run under that workflow path to be
excluded from the external reliability rates.
- The residual-agentic-→-external fallback is gated on
`GHAW_EXTERNAL_DEFAULT_DATE` (default 2026-08-20, matching gh-aw
PR #54111's merge). Historical replay of pre-cutover dates keeps
unresolved `.lock.yml` runs as `unknown` rather than back-labelling
them as external.
Fixture gains a `wf-residual` workflow whose detection jobs always fail
at Setup Scripts, exercising both properties: pre-cutover they land in
`unknown`; with `GHAW_EXTERNAL_DEFAULT_DATE=2026-08-15` (post-cutover)
the same runs flip to `external` and their failures count in the error
rate and absent verdicts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: David Slater <12449447+davidslater@users.noreply.github.com>
---------
Co-authored-by: GitHub Ace <githubnext@users.noreply.github.com>
Co-authored-by: David Slater <12449447+davidslater@users.noreply.github.com>1 parent de7b42f commit 643efaa
4 files changed
Lines changed: 226 additions & 43 deletions
File tree
- .github/workflows
- scripts
- test
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
140 | 149 | | |
141 | 150 | | |
142 | 151 | | |
| |||
157 | 166 | | |
158 | 167 | | |
159 | 168 | | |
160 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
161 | 172 | | |
162 | 173 | | |
163 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
111 | 133 | | |
112 | 134 | | |
113 | 135 | | |
| |||
416 | 438 | | |
417 | 439 | | |
418 | 440 | | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
424 | 463 | | |
425 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
426 | 476 | | |
427 | 477 | | |
428 | 478 | | |
| |||
431 | 481 | | |
432 | 482 | | |
433 | 483 | | |
434 | | - | |
435 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
436 | 490 | | |
437 | | - | |
438 | | - | |
| 491 | + | |
439 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
440 | 501 | | |
441 | 502 | | |
442 | 503 | | |
| |||
644 | 705 | | |
645 | 706 | | |
646 | 707 | | |
| 708 | + | |
| 709 | + | |
647 | 710 | | |
648 | 711 | | |
649 | 712 | | |
| |||
713 | 776 | | |
714 | 777 | | |
715 | 778 | | |
716 | | - | |
| 779 | + | |
717 | 780 | | |
718 | 781 | | |
719 | 782 | | |
| |||
823 | 886 | | |
824 | 887 | | |
825 | 888 | | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
830 | 896 | | |
831 | 897 | | |
832 | 898 | | |
| |||
894 | 960 | | |
895 | 961 | | |
896 | 962 | | |
897 | | - | |
| 963 | + | |
| 964 | + | |
898 | 965 | | |
899 | 966 | | |
900 | 967 | | |
| |||
0 commit comments