Skip to content

break-glass sweep: actually remove the block, and say so when it does not - #143

Merged
lex00 merged 3 commits into
mainfrom
sweep-branch-fix
Sep 12, 2026
Merged

lex00 merged 3 commits into
mainfrom
sweep-branch-fix

Conversation

@lex00

@lex00 lex00 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

The sweep has never removed anything, in any run, since it was written.

It cds to the repository root and then calls blocks and revoke_in_file, which resolve their paths from the access root. The guard matched nothing, no block was ever revoked, and the sweep went on to commit an empty tree and open a pull request with no diff. It reported success every time.

Worse, the pull requests it left behind read as adding the grant they were meant to retire, because a stale branch of the same name was reused as the base and the base had moved on. A burndown pull request whose diff is the inverse of its title is the most dangerous shape in this repo.

Three changes. The edit happens first, from the access root, so the helpers resolve. A file where nothing is still expired says so and opens nothing. And a leftover branch is deleted rather than reused — by deletion rather than by checking out a start point, because a switch with a start point rewrites every file in the tree including this script while bash is still reading it.

Proven: a grant past its expiry sitting on main now produces a pull request that removes it, which is the opposite direction from a reconcile pull request and the distinction lesson 13 turns on.

🤖 Generated with Claude Code

https://claude.ai/code/session_013JoNB9iUGjsiwRAJvyZPrt

lex00 and others added 3 commits September 12, 2026 02:09
…lure

The sweep reused whatever local branch of the same name it found. A sweep
branch holds one edit against what main declares, so a leftover from an
earlier run makes a pull request whose diff is the inverse of its title, where
the base has moved on and the stale branch reads as adding back the very grant
the sweep means to retire. It succeeds and it lies, which is worse than the
same bug in reconcile, where it at least failed.

It now starts from the base every time, forces the push under the desk prefix
guard for the reason reconcile does, and says so when a push fails instead of
sending the next command off to fail for an unrelated reason.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013JoNB9iUGjsiwRAJvyZPrt
… not

The sweep has never removed anything. It cd'd to the repository root and then
called blocks and revoke_in_file, which resolve their paths from the access
root, so the guard matched nothing, no block was ever revoked, and the sweep
committed an empty tree and opened a pull request with no diff in it. It
reported success every time, and the pull requests it left behind read as
adding the very grant they were meant to retire, because a stale branch of the
same name was being reused as the base.

Three changes. The edit happens first, from the access root, so the helpers
resolve. A file where nothing was still expired says so and opens nothing
rather than filing an empty pull request. And a branch left over from an
earlier sweep is deleted rather than reused, by deletion rather than by
checking out a start point, because a switch with a start point rewrites every
file in the tree including this script while bash is still reading it.

Proven on the class stack. A grant whose expiry had passed, sitting on main,
now produces a pull request that removes it, which is the opposite direction
from a reconcile pull request and the whole distinction lesson 13 turns on.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013JoNB9iUGjsiwRAJvyZPrt
@lex00
lex00 merged commit 7f2d7f7 into main Sep 12, 2026
5 checks passed
@lex00
lex00 deleted the sweep-branch-fix branch September 12, 2026 08:13
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