Skip to content

fix(check): let --fix activate yolo when a credential environment admits the default branch - #1398

Merged
max-sixty merged 1 commit into
mainfrom
fix/yolo-activation-credential-envs
Sep 23, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/yolo-activation-credential-envs

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

tend check --fix can't switch a repo to merge: yolo when the repo has a reviewer-less credential environment (e.g. deploy) whose policy admits the default branch. The fix accepts the default branch for the credential audit whenever it passes the maintainer protection check, so activation goes ahead.

Why it looped. Before activation, main still has maintainer's never bypass, so branch-protection:main fails against yolo's pull_requests_only expectation. operational_refs only admits branches whose check passed, so main drops out and _policy_gate rejects the environment ("admits 'main', which tend has not verified the bot cannot write"). credential-environments isn't in _yolo_activation_blockers's fixable set, so --fix falls back to maintainer rulesets, and the final yolo re-run fails the same way. Every later --fix repeats that. #1390 made this environment shape acceptable under yolo, but its test only covered a repo where yolo was already active.

Why this is safe. A default branch that passes the maintainer check can't be written by the bot at all, so an environment admitting it is gated even more tightly than under active yolo. The extra maintainer-expectation read runs only when yolo is configured and the default branch failed its yolo check. check_environment for the tend environment is unchanged: it's fixable and is re-derived after the rulesets are applied.

Verification. The new test_run_all_checks_yolo_accepts_main_deploy_before_activation runs the existing yolo deploy fixture with main at the never bypass. It fails before the change, and after it credential-environments passes while branch-protection:main still fails, which is what --fix repairs. The full Python suite passes, apart from the two test_refresh_consumers.py tests that need network.

…its the default branch

Before activation, main carries maintainer's bypass, so its yolo
branch-protection check fails and main drops out of the refs the
credential-environment audit accepts. A reviewer-less environment
admitting main then fails credential-environments, which --fix treats
as an activation blocker, so every run reapplied maintainer rulesets
and yolo could never be switched on. Accept main for that audit when it
passes the maintainer check: the bot cannot write it at all then.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit ae72336 into main Sep 23, 2026
11 checks passed
@max-sixty
max-sixty deleted the fix/yolo-activation-credential-envs branch September 23, 2026 07:38
max-sixty added a commit that referenced this pull request Sep 23, 2026
Add the restricted merge mode rename from #1408 to the 0.3.2 release
notes, and align the existing #1398 note with that name. #1408 reached
`main` during the release PR's CI wait and will be included in the
immutable 0.3.2 tag.

The tag remains unpushed until these notes are on `main`. All pre-commit
hooks passed.

> _This was written by Codex on behalf of max-sixty_
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.

2 participants