Repository navigation
Description
The defect
scripts/org-ruleset.sh cannot see — and verify cannot report — a non-canonical ruleset, so the org's own rule gate reports green while a rule it does not own is enforcing a check.
Measured today on opencharly/crabbox. A session (me) added an org-scoped ruleset 25635615 ("crabbox required workflow & main protection", source_type: Organization, repository_name.include = ["crabbox"]) that required validate / validate. That repo executes no workflows at all — GitHub disabled runs at the fork level ("Workflows are not currently being run on this fork due to the scale of GitHub Actions usage") — so the required check could never be produced and two PRs were permanently unmergeable.
org-ruleset.sh verify reported the org healthy throughout.
Why the existing checks miss it — from source
applydeletes per-repo rulesets matched by exact name:select(.name == "main branch protection")(org-ruleset.sh:149-152, constant at:49).- It iterates only
discover_repos— active, non-fork,main-default (lib-org.sh:24-30).crabboxis a fork, so it is indiscover_excludes(:32-38): 437 targets, 34 excludes. verify(:282-294) and the membership arm (:310-341) likewise scan only targets, and:303-308documents this as "excluded BY DESIGN".
So an org-scoped ruleset naming a single excluded repo is invisible to both modes — and apply would not remove it even if crabbox were a target, because the name does not match.
Blast radius
Any org-scoped ruleset whose repository_name.include names a repo outside the target set, or that carries a non-canonical name. It is a standing trap: a session that reaches for a per-repo rule by API can make a repo unmergeable while verify stays green — which is exactly what happened.
Root fix
verifyfails on any org ruleset that is not the canonical one (23827016) — i.e. any org ruleset whose name is not the canonical name, or whoserepository_name.includenames a repo outsidediscover_repos.applyremoves such a ruleset, viaDELETE /orgs/{org}/rulesets/{id}(an org-scoped ruleset is not deleted from/repos/{owner}/{repo}/rulesets/…— that endpoint 404s, which is what misled the session).- Tests in
org-ruleset_test.shwith the mockgh: a non-canonical org ruleset naming an excluded repo must be reported byverifyand removed byapply; the canonical ruleset must be untouched.
Separately worth stating in the skill: a repo is not made protected by adding a ruleset that requires a check the repo cannot produce — a fork with workflow runs disabled makes such a check unobtainable, and the remedy is to leave the repo out of the gate (as openclaw-enterprise is) rather than to require a verdict it can never get.
RCA: the missed control is that the org's rule gate only ever inspects the set it intends to govern, so a rule outside that set is uncheckable by construction.
Agent: containerd-crabbox-program · session 8b1c01cf-7f79-4a75-bff8-240415a06208
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (documentation reviewed)
Activity
feat(fork-gate)!: gate every first-party fork with the org ruleset, n…