deadgate 0.2.0__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {deadgate-0.2.0 → deadgate-1.0.0}/PKG-INFO +268 -56
- {deadgate-0.2.0 → deadgate-1.0.0}/README.md +267 -55
- deadgate-1.0.0/deadgate/cli.py +234 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate/detectors.py +244 -178
- deadgate-1.0.0/deadgate/expr.py +357 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate/resolve.py +15 -5
- deadgate-1.0.0/deadgate/sarif.py +154 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate.egg-info/PKG-INFO +268 -56
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate.egg-info/SOURCES.txt +8 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/pyproject.toml +1 -1
- deadgate-1.0.0/tests/test_action.py +47 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/tests/test_api_status_gates.py +29 -35
- {deadgate-0.2.0 → deadgate-1.0.0}/tests/test_corpus.py +3 -82
- deadgate-1.0.0/tests/test_d1_gate_live_shape.py +276 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/tests/test_d1_requires_protection.py +4 -4
- {deadgate-0.2.0 → deadgate-1.0.0}/tests/test_d3_narrowing.py +9 -20
- deadgate-1.0.0/tests/test_d3_shell_pipefail.py +94 -0
- deadgate-1.0.0/tests/test_d5_outputs_skip.py +354 -0
- deadgate-1.0.0/tests/test_known_gaps.py +51 -0
- deadgate-1.0.0/tests/test_sarif.py +176 -0
- deadgate-0.2.0/deadgate/cli.py +0 -153
- {deadgate-0.2.0 → deadgate-1.0.0}/LICENSE +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate/__init__.py +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate/checknames.py +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate/predicates.py +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate/protection.py +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate/sandbox.py +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate.egg-info/dependency_links.txt +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate.egg-info/entry_points.txt +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate.egg-info/requires.txt +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/deadgate.egg-info/top_level.txt +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/setup.cfg +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/tests/test_predicates.py +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/tests/test_protection.py +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/tests/test_sandbox.py +0 -0
- {deadgate-0.2.0 → deadgate-1.0.0}/tests/test_wildcard_gates.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deadgate
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Find CI checks that cannot fail: gates satisfied by skipped jobs, exit statuses swallowed by pipes, fan-ins that never read whether their upstream passed.
|
|
5
5
|
Author-email: Erik Hill <contact@erikhill.dev>
|
|
6
6
|
License: MIT
|
|
@@ -28,59 +28,228 @@ Dynamic: license-file
|
|
|
28
28
|
|
|
29
29
|
# deadgate
|
|
30
30
|
|
|
31
|
-
**Find CI checks that cannot fail.**
|
|
31
|
+
**Find CI checks that cannot fail.** deadgate reads your GitHub Actions workflow files and
|
|
32
|
+
reports checks that are structurally unable to go red: a required job that skips (and a
|
|
33
|
+
skipped job reports Success), or a step whose failure is swallowed by a pipe.
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
```bash
|
|
36
|
+
pip install deadgate
|
|
37
|
+
deadgate . # offline, no network
|
|
38
|
+
deadgate . --repo owner/name # also reads which checks are required (read-only, via `gh`)
|
|
39
|
+
```
|
|
35
40
|
|
|
36
|
-
|
|
41
|
+
### Real output: heygen-com/hyperframes before PR #5182
|
|
37
42
|
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
The 19 workflow files at `f76fa5c9`, the parent of the
|
|
44
|
+
[PR #5182](https://github.com/heygen-com/hyperframes/pull/5182) merge commit, scanned with
|
|
45
|
+
`--repo` (reproduced 2026-12-03, exit code 1):
|
|
40
46
|
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
```text
|
|
48
|
+
$ deadgate . --repo heygen-com/hyperframes
|
|
49
|
+
branch main: PROTECTED, 12 required check(s), required set INCOMPLETE (no admin) [classic FORBIDDEN]
|
|
50
|
+
|
|
51
|
+
[D5] .github/workflows/ci.yml::studio-edit-accuracy-gate skipped when its upstream fails, reading outputs that are unset
|
|
52
|
+
job 'studio-edit-accuracy-gate' runs after upstream failure (!cancelled()), but its if: reads needs.changes.outputs and not needs.changes.result. If 'changes' fails its outputs are empty, the condition is false, 'studio-edit-accuracy-gate' skips, and a skipped job reports Success. NOTE: 'build', 'test', 'test-runtime-contract', 'typecheck' also need 'changes' and read its result; if one of them is required and fails closed, a failed 'changes' still blocks the merge and this is a dead check rather than a merge hole.
|
|
53
|
+
branch: REQUIRED: required on the protected branch as 'Studio: edit accuracy gate'; NOTE 'build', 'test', 'test-runtime-contract', 'typecheck' also required: if any of them fails closed on a failed 'changes', the merge is still blocked and this is a dead check, not a merge hole
|
|
54
|
+
repro: Make a step of 'changes' fail before the step that writes the output. 'studio-edit-accuracy-gate' is skipped and its check reports Success. Guard with needs.changes.result != 'success' || ..., and fail the job in that case.
|
|
55
|
+
|
|
56
|
+
19 workflow file(s), 1 finding(s), 1 D1 and 2 D5 finding(s) not attributable to a required check
|
|
57
|
+
required checks: 12/12 attributed to a job in this repository
|
|
58
|
+
jobs whose check name could not be derived: 5
|
|
44
59
|
```
|
|
45
60
|
|
|
61
|
+
The bracket is only why the classic protection endpoint did not count. A non-admin user
|
|
62
|
+
token often gets `classic HTTP 404 without admin, so not authoritative` there instead. The
|
|
63
|
+
finding above does not change with it.
|
|
64
|
+
|
|
65
|
+
What that finding is. The required check "Studio: edit accuracy gate" ran on
|
|
66
|
+
`!cancelled() && needs.changes.outputs.edit_accuracy == 'true'`. If the `changes` job failed
|
|
67
|
+
before writing `edit_accuracy`, the output was unset, the condition was false, the gate job
|
|
68
|
+
skipped, and a skipped required check reports Success: **the required check is satisfied
|
|
69
|
+
with nothing run.** It was a dead required check, not a merge hole. `build`, `typecheck`,
|
|
70
|
+
`test`, and `test-runtime-contract` also need `changes`. Each runs on `always()` or
|
|
71
|
+
`!cancelled()` and exits 1 when `needs.changes.result != 'success'`, so a failed `changes`
|
|
72
|
+
still blocked the merge. The finding's NOTE names those four and says the merge is still
|
|
73
|
+
blocked if one of them is required and fails closed. The exit 1 that fails them closed is
|
|
74
|
+
in the step, which deadgate does not read.
|
|
75
|
+
[PR #5182](https://github.com/heygen-com/hyperframes/pull/5182) (merged 2026-10-25) made the
|
|
76
|
+
gate job also run when `changes` did not succeed, the guard those four jobs already had, so a
|
|
77
|
+
failed `changes` no longer silently satisfies it. The same scan of the merged `ci.yml` reports
|
|
78
|
+
no finding on that job.
|
|
79
|
+
|
|
80
|
+
D5, the detector behind this, is only printed with `--repo`, when branch protection
|
|
81
|
+
confirms the job is a required check, so the run above needs a working `gh` login. Offline,
|
|
82
|
+
the same tree prints `19 workflow file(s), 0 finding(s), 1 D1 and 3 D5 finding(s) not
|
|
83
|
+
attributable to a required check`.
|
|
84
|
+
|
|
46
85
|
Exit code is 1 when there are findings, 0 when clean, and **2 when a workflow file could not
|
|
47
86
|
be parsed**. A file it could not read is never counted as a file with no problems.
|
|
48
87
|
|
|
88
|
+
### SARIF, pre-commit, and the GitHub Action
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
deadgate . --format sarif --output deadgate.sarif
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`--format sarif` writes a SARIF 2.1.0 log with exactly the findings the text report prints:
|
|
95
|
+
D1 and D5 findings that branch protection does not confirm are counted in the run's
|
|
96
|
+
`properties`, not reported as results. The human summary goes to stderr, and the exit codes
|
|
97
|
+
are the same as in text mode. A run that exits 2 still writes a log, with
|
|
98
|
+
`executionSuccessful: false`. Each result points at the job's key line in the workflow file.
|
|
99
|
+
|
|
100
|
+
As a [pre-commit](https://pre-commit.com) hook (offline, never calls the GitHub API):
|
|
101
|
+
|
|
102
|
+
```yaml
|
|
103
|
+
- repo: https://github.com/egnaro9/deadgate
|
|
104
|
+
rev: <tag>
|
|
105
|
+
hooks:
|
|
106
|
+
- id: deadgate
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
As a GitHub Action, uploading to code scanning (needs `security-events: write`):
|
|
110
|
+
|
|
111
|
+
```yaml
|
|
112
|
+
- uses: actions/checkout@v4
|
|
113
|
+
- uses: egnaro9/deadgate@<tag>
|
|
114
|
+
with:
|
|
115
|
+
fail-on-findings: true
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The action passes `--repo ${{ github.repository }}` by default, using `gh` with the `gh-token`
|
|
119
|
+
input (default `github.token`) as `GH_TOKEN`. That token reads rulesets but not classic
|
|
120
|
+
branch protection, which needs admin, so the required set is reported incomplete unless the
|
|
121
|
+
token belongs to a repository admin. Set `repo: ''` for an offline scan. GitHub-hosted
|
|
122
|
+
runners have `gh`; a self-hosted runner needs it on PATH when `repo` is set. The
|
|
123
|
+
`setup-python` step changes the job's Python for later steps. `upload-sarif` defaults to
|
|
124
|
+
true and fails the job when code scanning cannot accept the file (a fork pull request, or
|
|
125
|
+
a repository with code scanning turned off). Set `upload-sarif: false` to scan without
|
|
126
|
+
uploading. See `action.yml` for every input. Third-party actions it runs are pinned to
|
|
127
|
+
commit SHAs.
|
|
128
|
+
|
|
49
129
|
## What it detects
|
|
50
130
|
|
|
51
131
|
| id | defect | why it matters |
|
|
52
132
|
|----|--------|----------------|
|
|
53
|
-
| D1 | a job depends on a skip-prone job and never reads `needs.*.result` | **only reported with `--repo`**, when branch protection confirms the job is a required check |
|
|
133
|
+
| D1 | a job depends on a skip-prone job and never reads `needs.*.result` | **only reported with `--repo`**, when branch protection confirms the job is a required check. Measured firing rate on the 275-repo corpus: **0**. |
|
|
54
134
|
| D3 | a `run:` step ends a pipeline in a filter with no `pipefail` | the step's status is the filter's, so an upstream failure passes |
|
|
135
|
+
| D5 | a job opts in to running after upstream failure (`always()`, `failure()`, or `!cancelled()`) but its `if:` reads only that upstream's outputs, never its `needs.X.result` | if the upstream fails before writing the output, the job skips and a skipped required check reports Success. **Only reported with `--repo`**, like D1. The pre-fix gate in heygen-com/hyperframes, fixed by PR #5182 |
|
|
55
136
|
|
|
56
137
|
**Two detectors have been removed rather than tuned**, each on hand-labelled evidence
|
|
57
|
-
that it was never right: D4 on 0 true of 18 sampled
|
|
138
|
+
that it was never right: D4 on 0 true of 18 sampled, of which 8 false and **10 left
|
|
139
|
+
unresolved** (0.1.5), and D2 on 0 true of 27
|
|
58
140
|
censused (0.1.6). The shapes they fired on are described in those sections, including
|
|
59
141
|
the one real hazard that is now undetected by design.
|
|
60
142
|
|
|
143
|
+
## Out of scope and known gaps
|
|
144
|
+
|
|
145
|
+
deadgate reports a narrow set of shapes it can show are wrong from the workflow file. It
|
|
146
|
+
does **not** catch the following, and a clean run says nothing about them.
|
|
147
|
+
|
|
148
|
+
- **Failure masked inside the step: `cmd || true`, `cmd || exit 0`, `set +e`, or
|
|
149
|
+
`continue-on-error: true`.** No detector reads these. A required check whose only test
|
|
150
|
+
step is `pytest || true` passes when the tests fail, and deadgate stays silent. The
|
|
151
|
+
shape is common and usually deliberate (cleanup, optional uploads, best-effort linting,
|
|
152
|
+
a step whose failure a later step inspects), and the workflow file does not say which
|
|
153
|
+
step is the one the required check exists for. Telling the defect from the intended use
|
|
154
|
+
needs that, and this project removes detectors that cannot show they are right (D2 and
|
|
155
|
+
D4 below) rather than shipping them. The one form of masking it does report is D3: a
|
|
156
|
+
pipeline whose status is a filter's because `pipefail` is off.
|
|
157
|
+
`tests/test_known_gaps.py` asserts this silence, so adding such a detector means
|
|
158
|
+
rewriting this section in the same change.
|
|
159
|
+
- **A change-detection skip with no status function.** D5 only covers a job that opts in to
|
|
160
|
+
running after upstream failure (`always()`, `failure()`, or `!cancelled()`). The plain shape,
|
|
161
|
+
`if: needs.detect.outputs.rust == 'true'`, skips when `detect` fails, but GitHub would
|
|
162
|
+
skip it then anyway, and it is indistinguishable from the intended optimisation. See
|
|
163
|
+
"A real hazard that is now undetected by design" below.
|
|
164
|
+
- **Anything about required checks, offline.** D1 and D5 are only reported with `--repo`
|
|
165
|
+
and a working `gh` login; offline they are counted in the summary line and never printed.
|
|
166
|
+
`--repo` reads today's required set, and without admin on the repository classic branch
|
|
167
|
+
protection is invisible, so a job can be attributed to a required check but never
|
|
168
|
+
cleared.
|
|
169
|
+
- **What a step actually runs.** deadgate reads workflow YAML under `.github/workflows`. It
|
|
170
|
+
does not run your workflows, does not follow scripts or composite actions a step calls
|
|
171
|
+
(apart from D1 reading a status-check script it can find on disk), and does not test that
|
|
172
|
+
a gate reacts to the condition it claims to catch. A check that runs but tests nothing,
|
|
173
|
+
such as an empty test selection, is out of scope.
|
|
174
|
+
|
|
175
|
+
## Why "cannot fail"
|
|
176
|
+
|
|
177
|
+
Flaky-test tools find checks that fail randomly. This finds the opposite: checks that are
|
|
178
|
+
structurally incapable of going red, so your pipeline is green for reasons unrelated to your code.
|
|
179
|
+
|
|
180
|
+
GitHub documents the sharpest case itself:
|
|
181
|
+
|
|
182
|
+
> A job that is skipped will report its status as `Success`. It will not prevent a pull
|
|
183
|
+
> request from merging, even if it is a required check.
|
|
184
|
+
|
|
185
|
+
## How the detectors were measured
|
|
186
|
+
|
|
187
|
+
### There is no severity any more
|
|
188
|
+
|
|
189
|
+
Every D3 stratum was censused, and the tiers did not rank anything:
|
|
190
|
+
|
|
191
|
+
| tier | n | false |
|
|
192
|
+
|---|---|---|
|
|
193
|
+
| HIGH | 94 | 30.9% `[22.4, 40.8]` |
|
|
194
|
+
| LOW | 415 | 31.6% `[27.3, 36.2]` |
|
|
195
|
+
| MEDIUM | 144 | **52.8%** `[44.7, 60.8]` |
|
|
196
|
+
|
|
197
|
+
HIGH's interval `[22.4, 40.8]` overlaps the merged non-HIGH tier, 37.0% `[33.1, 41.1]`, so
|
|
198
|
+
the loudest tier was not reliably better than everything else. LOW was indistinguishable from HIGH. The one real separation
|
|
199
|
+
was MEDIUM being **worse**, and that came from `_d3_severity` short-circuiting on whether
|
|
200
|
+
the workflow runs on `pull_request` before it looked at the finding at all: the axis
|
|
201
|
+
measured the trigger, not correctness.
|
|
202
|
+
|
|
203
|
+
A severity that hid the better findings behind `--all` and shouted the worse ones is worse
|
|
204
|
+
than none, so it is gone. `--all` is accepted and ignored. **D3 is 36.1% false overall**,
|
|
205
|
+
236 of 653, and that is the number.
|
|
206
|
+
|
|
207
|
+
> **The 0.3.0 release notes said 37.0%, 245 of 662. Both figures were stale and this is
|
|
208
|
+
> the correction.** MEDIUM was censused at **153** findings on 0.1.9. The `grep -q`
|
|
209
|
+
> suppression that shipped in 0.2.0 then removed **9** of them, so adding that stratum to
|
|
210
|
+
> a post-0.2.0 LOW double-counted findings the tool no longer emits: 94 + 153 + 415 = 662,
|
|
211
|
+
> while every commit from 0.1.9 on emits 653. Verified by running the scanner at three
|
|
212
|
+
> release commits and diffing the MEDIUM population: exactly 9 gone, 0 added, and all 9
|
|
213
|
+
> are `cmd | grep -q X`, the class the suppression removed **because it is not a defect**.
|
|
214
|
+
> So all 9 were false, the numerator drops with the denominator, and MEDIUM's own rate
|
|
215
|
+
> falls from 55.6% to 52.8%.
|
|
216
|
+
>
|
|
217
|
+
> **The 0.1.11 commit message said 54.9% for the same 144, and that figure is also wrong.**
|
|
218
|
+
> It removed only 6 of the 9 from the false count, because 3 had been labelled TRUE in an
|
|
219
|
+
> earlier sample taken *before* the `grep -q` insight that refutes them
|
|
220
|
+
> (`mise ... | grep -Fq -- 'install'` twice, and `curl -sf ... | grep -q 200`: in each one
|
|
221
|
+
> a failing head emits nothing, grep matches nothing and exits 1, so the step fails
|
|
222
|
+
> correctly). Shipping the suppression on that reasoning and keeping the old labels is
|
|
223
|
+
> holding both positions at once. The arithmetic carries its own check: the census was
|
|
224
|
+
> **68 true, 85 false** of 153, so removing 9 false findings must leave true at **68**, and
|
|
225
|
+
> 68 + 76 = 144. Under 54.9% it would have to be 65, which would mean the suppression
|
|
226
|
+
> deleted 3 real defects.
|
|
227
|
+
>
|
|
228
|
+
> The conclusion is unchanged either way: 30.9% against 52.8% is still the only real
|
|
229
|
+
> separation, and LOW at 31.6% is still indistinguishable from HIGH.
|
|
230
|
+
|
|
61
231
|
### Measured precision, so the table above is not the only claim
|
|
62
232
|
|
|
63
233
|
Every figure below is hand-labelled. None is an estimate of an estimate.
|
|
64
234
|
|
|
65
|
-
| detector |
|
|
66
|
-
|
|
67
|
-
| D3
|
|
68
|
-
|
|
|
69
|
-
| D3 | LOW (426) | uncapped sample, n=15 | **47%** `[25, 70]` |
|
|
70
|
-
| D1 | **not reported without `--repo`** | see below | n/a |
|
|
71
|
-
|
|
72
|
-
**What you see by default is about 45% false.** The CLI hides LOW without `--all`, so the
|
|
73
|
-
default output is HIGH plus MEDIUM, 238 D3 findings, of which about 108 are wrong.
|
|
235
|
+
| detector | basis | false |
|
|
236
|
+
|---|---|---|
|
|
237
|
+
| D3, all 653 | **complete census of all three former strata** | **36.1%** |
|
|
238
|
+
| D1 | not reported without `--repo`, and 0 findings with it | see below |
|
|
74
239
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
240
|
+
**Everything is reported now.** Nothing is hidden, so what you see is the whole 36.1%.
|
|
241
|
+
Collapsing the tiers raised the default output from 238 findings to 653 and *lowered* the
|
|
242
|
+
false rate a reader experiences from 44.1% to 36.1%, because the hidden tier was the
|
|
243
|
+
better one.
|
|
79
244
|
|
|
80
|
-
|
|
81
|
-
|
|
245
|
+
Two samples along the way were notably off, and both were caught only by censusing the
|
|
246
|
+
thing they estimated. An uncapped n=30 sample put MEDIUM at 70%; the census says 52.8%, 17
|
|
247
|
+
points out and near the edge of its own interval. A n=15 sample put LOW at 47% `[25, 70]`;
|
|
248
|
+
the census says 31.6%. Small samples were the cost even after the per-repository cap was
|
|
249
|
+
removed.
|
|
82
250
|
|
|
83
|
-
MEDIUM
|
|
251
|
+
The former MEDIUM was not one population. Classified by shape, it split sharply, and the
|
|
252
|
+
same shapes explain the whole detector:
|
|
84
253
|
|
|
85
254
|
| shape | n | false |
|
|
86
255
|
|---|---|---|
|
|
@@ -125,7 +294,35 @@ claim, but unlike D4 the tool can check it: `--repo` reads the required contexts
|
|
|
125
294
|
detector deleted. **Without `--repo`, deadgate is a one-detector tool**, and the table
|
|
126
295
|
above should be read that way.
|
|
127
296
|
|
|
128
|
-
|
|
297
|
+
#### With `--repo`, measured: it reports nothing on 275 repositories
|
|
298
|
+
|
|
299
|
+
The gate was run against live branch protection for all 373 findings, 2026-10-09.
|
|
300
|
+
|
|
301
|
+
| | |
|
|
302
|
+
|---|---|
|
|
303
|
+
| 73 repos carry D1 findings | 49 UNREADABLE, 24 PROTECTED, **0** where we have admin |
|
|
304
|
+
| verdicts over the 373 | UNREADABLE 237, AMBIGUOUS 126, **REQUIRED 10** |
|
|
305
|
+
| the 10 on a complete checkout | **0** |
|
|
306
|
+
|
|
307
|
+
All ten were WordPress/gutenberg `*-status-check` jobs. They appeared only because the
|
|
308
|
+
corpus cache stores workflow YAML without the `scripts/` directory beside it. On a real
|
|
309
|
+
tree `_script_reads_status` reads `ci-status-check.js`, finds it listing the run's jobs
|
|
310
|
+
and checking their conclusions, and suppresses all three before the finding is built.
|
|
311
|
+
|
|
312
|
+
The attribution itself is sound and worth stating, because it is the part that could have
|
|
313
|
+
been broken and was not: the required context is `Unit Tests - Status Check`, the job key
|
|
314
|
+
is `unit-status-check`, and `derive()` joined them through the `name:` field.
|
|
315
|
+
|
|
316
|
+
So `--repo` is not a mode that makes D1 useful. **It is a mode in which D1 has never
|
|
317
|
+
reported a finding on a real repository.** It is kept because the gate is correct, not
|
|
318
|
+
because it is productive, and `tests/test_d1_gate_live_shape.py` pins both directions
|
|
319
|
+
against the captured live payload.
|
|
320
|
+
|
|
321
|
+
`NOT_REQUIRED` is a third state and it is **unreachable here**: clearing a finding needs
|
|
322
|
+
`complete=True`, which needs admin on both endpoints. Of 43 repositories we do
|
|
323
|
+
administer, 36 answer 404 "not protected" and 7 answer 403 because private-repo
|
|
324
|
+
protection needs a paid plan. None carries a required status check, so that branch has
|
|
325
|
+
never run against live data anywhere reachable from this machine.
|
|
129
326
|
|
|
130
327
|
Every finding carries a reproduction. A finding without one is an opinion, and this tool
|
|
131
328
|
does not emit opinions.
|
|
@@ -172,25 +369,27 @@ On a repository you do not administer, only the first answers. It says nothing a
|
|
|
172
369
|
protection, so an empty result does not mean the branch is unprotected. That asymmetry decides
|
|
173
370
|
what the tier is allowed to claim:
|
|
174
371
|
|
|
175
|
-
- a **match proves** the check is required
|
|
372
|
+
- a **match proves** the check is required
|
|
176
373
|
- **no match proves nothing** unless the required set is complete, which needs admin on both
|
|
177
|
-
endpoints. Without that, the verdict is AMBIGUOUS
|
|
374
|
+
endpoints. Without that, the verdict is AMBIGUOUS
|
|
178
375
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
not become a merge gate by appearing in a list.
|
|
376
|
+
This tier used to move a severity: MEDIUM escalated to HIGH on a match and dropped to LOW on a
|
|
377
|
+
complete miss, because MEDIUM was the tier that meant "the workflow file does not say". With the
|
|
378
|
+
tiers gone it decides exactly one thing, whether a D1 or D5 finding is reported at all, and annotates
|
|
379
|
+
every finding with the verdict it reached.
|
|
184
380
|
|
|
185
381
|
### Verdicts
|
|
186
382
|
|
|
187
|
-
| verdict | meaning |
|
|
383
|
+
| verdict | meaning | effect |
|
|
188
384
|
|---|---|---|
|
|
189
|
-
| `REQUIRED` | a derived check name matches a required context |
|
|
190
|
-
| `NOT_REQUIRED` | complete required set, no match |
|
|
191
|
-
| `UNPROTECTED` | complete, and the branch requires nothing at all |
|
|
192
|
-
| `AMBIGUOUS` | the name could not be derived, or the set is incomplete |
|
|
193
|
-
| `UNREADABLE` | the API did not answer |
|
|
385
|
+
| `REQUIRED` | a derived check name matches a required context | the only verdict that lets D1 or D5 report |
|
|
386
|
+
| `NOT_REQUIRED` | complete required set, no match | D1 and D5 suppressed. Unreachable without admin |
|
|
387
|
+
| `UNPROTECTED` | complete, and the branch requires nothing at all | D1 and D5 suppressed. Unreachable without admin |
|
|
388
|
+
| `AMBIGUOUS` | the name could not be derived, or the set is incomplete | D1 and D5 suppressed |
|
|
389
|
+
| `UNREADABLE` | the API did not answer | D1 and D5 suppressed |
|
|
390
|
+
|
|
391
|
+
A D3 finding is reported whatever the verdict says; the verdict is printed beside it as context
|
|
392
|
+
and never gates it.
|
|
194
393
|
|
|
195
394
|
### Why it reports contexts it could not attribute
|
|
196
395
|
|
|
@@ -224,13 +423,6 @@ The `DEADGATE_NAIVE` arm was removed in 0.1.2. It had stopped isolating what it
|
|
|
224
423
|
suppressions live in the shared path, so both arms reported identical figures and the
|
|
225
424
|
pre-narrowing column had quietly become a copy of the current one.
|
|
226
425
|
|
|
227
|
-
## Scope, stated plainly
|
|
228
|
-
|
|
229
|
-
This reads workflow files. It does **not** read branch-protection settings, so it reports the
|
|
230
|
-
*shape* of a defect, not whether a given check is actually required on your default branch.
|
|
231
|
-
Semantic gate testing, planting the condition a gate claims to catch and asserting it reacts,
|
|
232
|
-
is a separate and harder problem and is not in this release.
|
|
233
|
-
|
|
234
426
|
## Licence
|
|
235
427
|
MIT
|
|
236
428
|
|
|
@@ -372,10 +564,14 @@ of the first three cost true positives:
|
|
|
372
564
|
|
|
373
565
|
All three now have regression tests and are killed by mutation.
|
|
374
566
|
|
|
375
|
-
### What is still not measured
|
|
567
|
+
### What is still not measured, as of 0.1.7
|
|
376
568
|
|
|
377
569
|
D3's MEDIUM (152) and LOW (408) are unmeasured. They are 560 of its 654 findings.
|
|
378
570
|
|
|
571
|
+
> Both were censused later: MEDIUM at 0.1.9 and LOW at 0.3.0. Nothing in D3 is unmeasured
|
|
572
|
+
> now. The counts here are 0.1.7's and do not match today's 144 and 415, because the
|
|
573
|
+
> `grep -q` suppression in 0.2.0 changed both.
|
|
574
|
+
|
|
379
575
|
## 0.1.6 removes D2, on a census
|
|
380
576
|
|
|
381
577
|
**D2 is gone. Every one of its 27 findings was hand-labelled: 0 true, 27 false, 0
|
|
@@ -411,7 +607,8 @@ said the branch protection that job provides is decorative.
|
|
|
411
607
|
That is not a precision problem a narrowing fixes. The detector's own gate test disagreed
|
|
412
608
|
with its own finding text, every single time.
|
|
413
609
|
|
|
414
|
-
D4 was removed on
|
|
610
|
+
D4 was removed on a sample of 18 that scored 0 true, 8 false and **10 arguable**. D2
|
|
611
|
+
goes on 0 true of 27 **censused**, with no arguable bucket at all.
|
|
415
612
|
|
|
416
613
|
Total output across the corpus: **1054 to 1027.** HIGH is unchanged at 125, all D3.
|
|
417
614
|
|
|
@@ -424,6 +621,18 @@ Both comments now name the function that actually does the work.
|
|
|
424
621
|
|
|
425
622
|
## 0.1.5 removes D4
|
|
426
623
|
|
|
624
|
+
> **Correction.** This section originally read "0 defensible findings out of 18", and
|
|
625
|
+
> that overstates it. The sample was **0 defensible, 8 false and 10 ARGUABLE**: ten of the
|
|
626
|
+
> eighteen were never resolved. A later census of D3's HIGH stratum established that an
|
|
627
|
+
> arguable bucket is not a random sample of its population, running 66% false against 34%
|
|
628
|
+
> overall, enough to flip a verdict. The ten were probably mostly false; probably is not a
|
|
629
|
+
> measurement. The sample was also drawn from D4's HIGH stratum, and severity has since
|
|
630
|
+
> been measured to carry no quality signal, so that stratification means nothing either.
|
|
631
|
+
>
|
|
632
|
+
> **The removal still stands, on evidence that depends on neither:** 80% of D4's 932
|
|
633
|
+
> findings describe a mechanism redundant with GitHub's needs-skip rule, which is
|
|
634
|
+
> measured below and is severity-independent.
|
|
635
|
+
|
|
427
636
|
**D4 is gone, not demoted.** It scored **0 defensible findings out of 18** in a
|
|
428
637
|
pre-registered hand-labelled sample, and it was the largest detector by volume: **932
|
|
429
638
|
findings over 93 repositories, 47% of everything this tool emitted.**
|
|
@@ -583,9 +792,9 @@ because it asked "does this job consult its upstreams?" and looked in too few pl
|
|
|
583
792
|
|
|
584
793
|
| # | what was missed | found on |
|
|
585
794
|
|---|---|---|
|
|
586
|
-
| 1 | `needs.*.result
|
|
795
|
+
| 1 | `needs.*.result`, the WILDCARD form, matched with `[A-Za-z0-9_-]+`, which cannot match `*` | Arize-ai/openinference |
|
|
587
796
|
| 2 | D4 judged a job alone, ignoring the workflow's own gate | Arize-ai/openinference |
|
|
588
|
-
| 3 | `toJSON(needs)
|
|
797
|
+
| 3 | `toJSON(needs)`, every upstream read with no `result` token anywhere; and gates written `always() && <cond>` rather than bare `always()` | astral-sh/ruff |
|
|
589
798
|
| 4 | PLACEMENT, not spelling: a reusable-workflow call has `uses:` and no `steps:`, passing `needs.X.result` through JOB-level `with:` | scikit-learn |
|
|
590
799
|
|
|
591
800
|
1 and 2 shipped in 0.1.0 and were fixed in 0.1.1; 3 and 4 were found afterwards by pointing the
|
|
@@ -605,7 +814,7 @@ with: { job_status: "${{ needs.check-sdist.result }}" }
|
|
|
605
814
|
```
|
|
606
815
|
|
|
607
816
|
Measured on one 275-repository, 4543-file corpus, both arms reading identical bytes:
|
|
608
|
-
**4562 findings and 1104 HIGH before, 2917 and 658 after
|
|
817
|
+
**4562 findings and 1104 HIGH before, 2917 and 658 after**, 40% of HIGH removed. On the
|
|
609
818
|
repositories that write their gates carefully the share is far higher: openinference went from
|
|
610
819
|
13 HIGH to 1, ruff from 21 to 3, and in both cases the survivors are unrelated D3 findings.
|
|
611
820
|
|
|
@@ -613,5 +822,8 @@ That gap is the lesson worth keeping. The tool was least accurate on the reposit
|
|
|
613
822
|
BEST CI, which is the worst place for a linter to cry wolf, and no corpus average would have
|
|
614
823
|
surfaced it. The suite passed unchanged through every one of the four, 149 of it through the
|
|
615
824
|
first two fixes and 161 through the second two, so not one of them was covered by anything.
|
|
616
|
-
There are
|
|
617
|
-
|
|
825
|
+
There are 290 tests now, and CI fails if that number and the suite ever drift apart again.
|
|
826
|
+
The check used to be `scripts/check_readme_test_count.py` here; four other repositories
|
|
827
|
+
held byte-identical copies of it, so it is now
|
|
828
|
+
[readme-test-count](https://github.com/egnaro9/readme-test-count), installed at a pinned
|
|
829
|
+
commit.
|