Uh oh!
There was an error while loading. Please reload this page.
feat(inventory): assert WHICH checks are required, not just that a caller exists (backend#1681) - #209
Merged
Merged
Conversation
…ller exists (backend#1681) The guard opened `required_status_checks`, kept `strict`, and threw the rest away. So `required` has meant "a caller workflow exists somewhere in this repo", never "this check can block a merge" -- and the two are not the same thing. What that cost, measured 2026-08-11: * `.github/staging` required exactly ONE context (`actionlint`) while the inventory reported it conformant. Two release-train promotions merged with the contract audit RED -- .github#203 (-> staging) and #205 (-> main), both with `audit` and `gate` at conclusion=failure. * `quality / gitleaks` is required on 16/16 develops but only 13/16 staging and prod, and the three gaps are public repos. This adds `required_checks` as a per-branch-role policy key: * READ from BOTH protection systems and BOTH API spellings -- classic `checks` (modern) and `contexts` (legacy), plus ruleset-supplied `required_status_checks`. Reading only the modern spelling would report a branch's required set as EMPTY, which is the fail-open shape this guard exists to eliminate. * COMPARED AS A SUBSET, not equality: backend's Django suite and cli's golangci-lint sit on top of the baseline legitimately. The policy is a floor. * SCHEMA-ENFORCED, so a missing value is a failure rather than a default, and `divergent` may narrow the set only with a written reason naming it. Baselines are the measured status quo, not aspiration: develop asserts the three contexts already required in all 16 repos; staging/prod assert fr-gate plus the two content gates. The real gaps become NAMED divergences instead of silence -- `docs` ([], its 2026-06-04 exemption is broader than review alone), `model-zoo` and `start-training` (["gate / gate"], content gates missing on both promotion branches). `quality / action-pins` is deliberately NOT in the staging/prod baseline: 16/16 on develop and 0/32 on promotion branches is an asymmetry nobody has decided, so the file records the question rather than blessing it. Its first live run also surfaced three postures nobody had stated: claude-skills, release-train and rfcs carry a `divergent` prod cell for being working branches, which never said anything about required checks, so they inherited a baseline naming the fr-gate -- a gate that only exists on a promotion pipeline they do not have. Now written down. release-train states its REAL set (actionlint, mutation, shell) rather than [], since it is the tool that performs every promotion. Verified, not asserted: * selftest 86 -> 97 pass, 0 fail. The load-bearing case is "a check that runs but cannot block IS a finding"; also covered are subset-not-equality, the legacy spelling, ruleset-supplied contexts, a divergent cell judged against its own list (and still failing when that list is unmet), and four schema shapes that would silently assert less than they appear to. * LIVE against all 20 repos: "No drift. Every repo read, every entry matched." * MUTATION: the same run with one impossible context added to the develop baseline produces 16 findings, one per repo carrying that role, each naming it. Green here means something because red is reachable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bcda74a. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
…#209) My edit adding `required_checks` to OVERRIDABLE re-emitted the explanatory comment that was already above it. Comment-only; no behaviour change. Selftest re-run: 97 pass, 0 fail. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Aug 11, 2026
ContributorAuthor
Fixed in |
saadqbal
approved these changes
Aug 11, 2026
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 freeto 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.

What
Adds
required_checkstorepo-inventory.yml's per-branch-role policy, and makescaller-drift.pyassert it.Why
The guard opened
required_status_checks, keptstrict, and discarded the rest. Sorequiredhas meant "a caller workflow exists somewhere in this repo" — never "this check can block a merge". Measured 2026-08-11:.github/stagingrequired exactly one context (actionlint) while the inventory reported it fully conformant. Two release-train promotions merged with the contract audit red — #203 (→ staging) and #205 (→ main), both withauditandgateatconclusion=failure.quality / gitleaksis required on 16/16 develops but only 13/16 staging and prod — and all three gaps are public repos.Both were invisible to the guard by construction.
Design
checks(modern) andcontexts(legacy), plus ruleset-suppliedrequired_status_checks. Reading only the modern spelling would report a branch's required set as empty: the exact fail-open this guard exists to eliminate.divergentmay narrow the set, but only with a written reason naming the narrower list — and is then held to that list.Baselines are the measured status quo, not aspiration
developasserts the three contexts already required in all 16 repos.staging/prodassert fr-gate plus the two content gates. The real gaps become named divergences rather than silence:docs[]model-zoo["gate / gate"]start-training["gate / gate"]quality / action-pinsis deliberately not in the staging/prod baseline: 16/16 on develop, 0/32 on promotion branches. That asymmetry is unexplained rather than decided, so this records the question instead of blessing it (backend#1681).Its first live run surfaced three postures nobody had stated:
claude-skills,release-trainandrfcscarry adivergentprod cell for being working branches, which said nothing about required checks — so they inherited a baseline naming the fr-gate, a gate that only exists on a promotion pipeline they don't have. Now written down.release-trainstates its real set (actionlint,mutation,shell) rather than[], since it's the tool that performs every promotion.Test plan / evidence
The load-bearing new test is "a check that runs but cannot block IS a finding". Also covered: subset-not-equality, the legacy
contextsspelling, ruleset-supplied contexts, adivergentcell judged against its own list and still failing when that list is unmet, and four schema shapes that would silently assert less than they appear to (bare string, non-string entry, blank context, duplicate).The mutation run is the point: green here means something because red is reachable.
Follow-up
rulesetsis the sibling property (nothing in the org audits rulesets at all today) and lands separately. Parent epic: backend#1680.Note
Medium Risk
Changes merge-gate conformance auditing for all org repos; mis-stated baselines or read bugs could false-positive drift or miss gaps, but scope is guard tooling and inventory YAML with expanded selftests.
Overview
Adds
required_checksto fleet branch-protection policy inrepo-inventory.ymland teachescaller-drift.pyto verify those contexts actually block merges—not merely that caller workflows exist.Guard behavior:
read_protectionnow unions required status-check contexts from classic protection (bothchecksand legacycontexts) and from rulesetrequired_status_checks. Evaluation uses a subset floor: policy contexts must be present; extra repo-specific checks are allowed. Missing contexts produce findings that explain the check may run red without stopping the merge.Inventory: Measured baselines on develop (
quality / gitleaks,house-rules,action-pins) and staging/prod (gate / gateplus the two content gates). Repos with narrower reality get explicitdivergentrequired_checks(e.g.docs[]on promotion branches, public repos with onlygate / gate,release-trainwithactionlint/mutation/shell).Tests: Selftest coverage for fail-on-missing, subset-not-equality, legacy spelling, ruleset union, divergent overrides, and schema rejection of bad list shapes.
Reviewed by Cursor Bugbot for commit 66c53aa. Bugbot is set up for automated code reviews on this repo. Configure here.