flake-update-cascade: read protected-branches by the same rule as the rails #245
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools!245
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/cascade-protection-rule"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Owner summary
flake-update-cascadedecides whether a branch is protected by the same rule asallod changeand the git hook. A protected entry written with extra spaces or a trailing slash is now honoured, where before it silently read as "not protected" and a direct run pushed to that branch.allod changebehaves exactly as before; its rule only moved into a shared package. A correctly written list on a machine with the default work folder gives the same answers as before.work/<repo>, still matches, so a customWORK_DIRkeeps its protection.allod check; the new cases go red on the code before each fix; forcing protection off turns the suite red.Closes allod/tools#237
What changed
390 lines added and 247 removed, most of it the rule moving.
cmd/allod/workspace.goto a new package,internal/protection. It returns errors and never exits or prints. The shared case table,tests/fixtures/protection-cases.tsv, is now tested there, once, for both commands.cmd/allodcalls the package through wrappers that produce the messages and exit codes it produced before.flake-update-cascadecalls the package in place of its exact-text match.gitused by the cascade's test suites answers two more questions, because the rule now asks git where a repository's main checkout is.Where this departs from the issue
The issue says a misplaced checkout is "skipped with a message". It is a preflight error instead: that mechanism already existed, stops the run, and matches
allod change, which refuses outright in the same situation.Risk
R2. The change is in how a tool that pushes to default branches decides what is protected. The rule itself was already in use and tested; what is new is one call site.
Known limits:
flake.lock, an active PR, no matching input) gets no verdict, so an unreadable list goes unreported if every repository is skipped first. The README now says so.flake-update-cascade-chain.sh, which the implementing agent ran by hand on the first commit and not after the fix round, andflake-update-cascade-nixconfig.sh, which was not run.cmd/flake-update-cascade/workspace.gostill has its own copy of the expression that readsowner/repofrom a remote URL. Left alone.Validation
Run by the integrator on
acc67de:allod checktests/flake/flake-update-cascade/preflight.shwith a build ofacc67debe3c65d, before the fix roundReported by the implementing agent and not repeated by the integrator: restoring the old exact-text rule turns the two-spaces case red while the single-space case stays green;
tests/allod-change.sh270 andtests/git-hooks/protected-refs-policy.sh89 run directly (both also run insideallod check).Review
One cold review of
be3c65dbygpt-5.6-solathigheffort, followed by one fix round inacc67de. The model was run through thepirunner with providernullsink, inside a read-only sandbox, because the Codex account had reached its usage limit. The reviewer was also asked what in the change should not exist and found nothing.WORK_DIRset to anything but$HOME/work, a repository the old rule protected was pushed to. The reviewer executed itacc67de684to3f917ebfa9