Skip to content

fix(gds): a plan that cannot carry a ruleset is not drift - #43

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/anchor-contract-knows-a-plan-limit
Aug 23, 2026
Merged

rldyourmnd merged 1 commit into
mainfrom
fix/anchor-contract-knows-a-plan-limit

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Correction to #42, found by a consumer who declined to adopt it and gave the reason.

The defect

The contract read the caller's live ruleset and treated every API failure identically. On a private repository in a free organization the API answers:

403 Upgrade to GitHub Pro or make this repository public to enable this feature.

So the job would have failed on every run with "cannot read the ruleset" — one message covering three unrelated facts: real drift, a token without permission, and a plan where branch protection cannot be bought at all.

Not an edge case

Measured across the estate on 2026-08-24:

repositories that can carry a ruleset 68
repositories that cannot, by plan 9

All nine are private repositories in free organizations. A tenth of the estate would have got a permanent red check that said the wrong thing.

What it does now

Where rulesets are unavailable the check inverts instead of disappearing. No branch there can require anything, so the one claim an anchor can still get wrong is claiming assurance that cannot exist:

free plan, anchor claims nothing   -> passes, and says why
free plan, anchor claims contexts  -> fails, with the lines to remove
ruleset present, both agree        -> passes
ruleset present, they disagree     -> fails, with the lines to add or remove

All four verified against live repositories before this commit.

Worth recording

The consumer's second reason was policy, not mechanics: the owner asked today for guards to come off, not go on, and a new mandatory check on a repository where it cannot work is the worst version of that. They were right to refuse, and the refusal is what exposed the defect.

The contract read the live ruleset and treated every failure the same way, so
a private repository on a free plan -- where the API answers 403 "Upgrade to
GitHub Pro or make this repository public" -- would have failed on every run
with a message about an unreadable ruleset. Three different facts wearing one
error: drift, a token without permission, and a plan that cannot buy branch
protection at all.

Measured across the estate on 2026-08-24: 68 repositories can carry a ruleset,
9 cannot, all of them private on free organizations. So this was not an edge
case, it was a tenth of the estate.

Where rulesets are unavailable the check inverts rather than disappearing. No
branch can require anything there, so the only claim the anchor can get wrong
is claiming assurance that cannot exist -- and that still fails, with the exact
lines to remove.

Found by a consumer refusing to adopt it and saying why, which is the review
this needed and did not get from me.
@github-actions github-actions Bot added ci and removed ci labels Aug 23, 2026
@rldyourmnd
rldyourmnd merged commit a14f8ec into main Aug 23, 2026
28 checks passed
@rldyourmnd
rldyourmnd deleted the fix/anchor-contract-knows-a-plan-limit branch August 23, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant