Files
ersatztv/scripts/tests
timothy 77585ca13a fix(742): inherit an h10 verdict only from an allow-listed reviewer
`review-verdict.yml` left an existing `review-verdict/h10` alone when it was "positively
identifiable as a human verdict" — a non-null `.creator.login` plus a `Review-verdict:`
description. Non-null only proves SOME user credential posted it, and this repo stores
credentials for accounts that are not reviewers. `RENOVATE_TOKEN` is a `write:repository`
PAT of the `renovate` bot; unlike #697's registry credential it cannot be scoped off
status-write (Renovate needs repo write to push branches and open PRs), and secrets are a
per-repo store any workflow can reference — so a status posted with it read back
`creator: renovate`, non-null, and was inherited as a verdict.

The test is now membership in `H10_REVIEWERS="timothy"`, a literal in the base-resolved
definition. Not a repo `vars:` entry or a secret: those are settable without a PR, i.e.
without this gate, while `.gitea/` is on the PROTECTED path list so the edit cannot ride a
docs-only exemption. Membership is an exact `[ = ]` comparison over word-split entries,
never `grep -xF` — an API-supplied creator containing a newline would be read as several
patterns, any one of which could match an allow-listed line.

The allow-list is applied to INHERITANCE ONLY. The post-write raced-verdict check reads the
same `.creator` field for the opposite purpose — "did anything human land while we were
writing" — so narrowing it would not make it stricter, it would make it count fewer rows,
and a raced verdict from an off-list account would leave the exemption `success` standing
over a rejection. That is the one path in this job whose failure direction is toward
SUCCESS, so it stays broad on `creator != null` and the repair is allowed to be over-eager.

Both directions are mutation-proven against the shipped file, not a hand-written mutant:
reverting the membership clause to `[ -n "$ex_creator" ]` reddens the seven new inheritance
cases; narrowing the raced jq to `.creator.login == "timothy"` reddens
`test_the_RACED_verdict_check_still_counts_a_NON_allowlisted_creator` alone; `H10_REVIEWERS`
set to `tim*`, empty, or `bob` reddens the two list-shape tests. `scripts/tests`: 965 passed,
2 skipped.

What this does NOT close, unchanged: an allow-listed collaborator's own write-scoped token
can still post a verdict nobody formed. Branch protection binds the context NAME, not its
issuer, and Gitea offers no way to restrict who may post a context.

fixes #742

Decisions-Edit: yes
2026-08-27 00:07:43 +02:00
..