Add fail-closed GitHub protection policy tooling - #151
Draft
abrichr wants to merge 6 commits into
Draft
Conversation
abrichr
force-pushed
the
codex/core-protection-policy-recovery
branch
from
August 26, 2026 20:56
9e1cb15 to
02ca8cb
Compare
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.
Replaces #136.
What this changes
This PR checks in the policy and tooling for nine public OpenAdapt repositories. The planner reads GitHub state without changing it. The apply path requires a fresh plan, an exact confirmation value, and the same audited main commit in every managed repository before the first write.
The validator now checks the exact App owner, repository scope, permissions, workflow guard, token use, and release effect. It rejects compound expressions, replacement credentials, ignored shell failures, stale main reads, and workflows that can report success without the required tag or GitHub Release.
Private Cloud stays audit-only because the current GitHub plan can't enforce protection on that repository.
Merge behavior
This is policy and tooling only. Merging it doesn't call GitHub's protection APIs. It won't create or change a ruleset, branch protection rule, environment rule, GitHub App, secret, release, or deployment.
safe_to_applyis false. The tool refuses to apply the current plan.Work before one final apply
The Release, Lifecycle, and Docs App identities still need to exist at the configured slugs. The remaining package release workflows need their target-state migrations. The protected release, lifecycle, and docs environments need their final variables, secrets, and reviewer rules. After that work lands, an operator must create a new 15-minute plan, review every action, and run one confirmed apply.
Checks
02ca8cbffee77388ea5957e535c9f3d01b0059f2b0327de8019db6a925104148a094f6f0756b90d2