feat(inventory): assert the selftests gate is REQUIRED, not merely present (backend#1680) - #272
Merged
Merged
Conversation
…esent (backend#1680)
selftests.yml was added to be a required status check -- its own header says so,
and cites the org rule it turns on itself: a guard in a non-required job is
advice, not a gate (backend#1729). Nothing made it required. So the eight suites
guarding the reusables every other repo's CI depends on could go red and block no
merge, and the protection audit reported conformance without ever looking.
`selftests` is now armed on develop and staging, and this states it, so a later
removal is drift rather than silence.
Armed while green, and verified reporting first:
- selftests.yml triggers on `pull_request:` with NO branches and NO paths
filter, deliberately (its header explains why), so it reports on every PR. A
required context that can never report leaves the PR waiting forever
(client#665, `pii-gate/pii-check`).
- Green in all 4 runs since it landed, measured per job, including on the
release-train/to-staging head of promotion PR .github#268.
NOT armed on prod, and that is sequencing rather than a decision against it:
`selftests.yml` reaches staging only when the promotion carrying it merges, so
until then a staging -> main PR head cannot report the context. The comment on
the cell carries the follow-up.
`divergent` is the only cell shape that can state a repo's own set. It diverges
by requiring MORE than the fleet baseline; the comparison in
evaluate_protection() is a subset test, so this strictly strengthens the
assertion and the live audit could not have gone red from arming alone.
Verification: `make selftests` green; the new cell mutation-proved through the
REAL evaluate_protection() against the LIVE branches -- renaming the armed
context reddens both develop and staging, with the anchor asserted as applied
(2 occurrences), and the unmutated cell probes clean.
Found by Bugbot on release-train promotion PR .github#268.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
selftests.ymlwas added to be a required status check — its own header saysso, and cites the org rule it turns on itself: a guard in a non-required job is
advice, not a gate (backend#1729). Nothing made it required.
So the eight suites guarding the reusables every other repo's CI depends on could
go red and block no merge, and the protection audit reported conformance without
ever looking at it. The workflow said "required"; the protection said nothing.
selftestsis now armed ondevelopandstaging, and this states it — so alater removal is drift rather than silence.
Armed while green, and verified reporting first
selftests.ymltriggers onpull_request:with nobranches:and nopaths:filter, deliberately (its header explains why), so it reports on everyPR. A required context that can never report leaves the PR waiting forever
(
client#665,pii-gate/pii-check).release-train/to-staginghead of promotion PR release-train: develop -> staging #268.Not armed on prod, deliberately
Sequencing, not a decision against it.
selftests.ymlreachesstagingonly whenthe promotion carrying it merges, so until then a
staging -> mainPR head cannotreport the context. The comment on the cell carries the follow-up.
Type
feat(inventory)
Test plan
divergentis the only cell shape that can state a repo's own set. It diverges byrequiring more than the fleet baseline; the comparison in
evaluate_protection()is a subset test, so this strictly strengthens theassertion — and arming alone could not have reddened the live audit.
make selftestsgreen.evaluate_protection()againstthe live branches: renaming the armed context reddens both
developandstaging, with the anchor asserted as applied (2 occurrences), and theunmutated cell probes clean.
Provenance
Found by Bugbot on release-train promotion PR #268 (High). Per the staging-hop
policy, findings at
develop -> stagingare fixed on the source branch. Thisunblocks the
.githubleg of the current staging hop.Checklist
developNote
Low Risk
Contract-only change to repo-inventory.yml; it strengthens the conformance audit and does not alter runtime code or live GitHub settings by itself.
Overview
Documents that
.githubmust treat theselftestsstatus check as required ondevelopandstaging, not merely run it. The inventory replaces plainrequiredcells withdivergententries that list the fleet baseline contexts plusselftests, socaller-drift/evaluate_protection()fails if that context is dropped from branch protection.prodstays on the fleet baseline only; inline comments record thatselftestsis intentionally not required there until the workflow is onstaging, avoiding PRs stuck on a check that never reports.The added commentary ties this to backend#1680 / backend#1729: a non-required guard is advice, and the prior gap let reusable selftest suites go red without blocking merges.
Reviewed by Cursor Bugbot for commit 84637ce. Bugbot is set up for automated code reviews on this repo. Configure here.