fix: the stale-branch gate reddened against a clean repo (C-320 addendum) - #417
Merged
Merged
Conversation
…dum)
Found by using it, at the end of the v1.11.0 release, and initially
written off as an anecdote. The operator asked whether it was something
we should address. It was.
TestF8StaleBranches read `git branch -a`, which folds in remote-tracking
refs — a local cache that goes stale the moment anyone deletes a branch
and that only `git fetch --prune` refreshes. So the gate failed against a
repository that was genuinely clean.
Demonstrated rather than argued: fabricating ONLY a
refs/remotes/origin/release/v1.11.0 ref — no branch on the remote, none
locally — was enough to fail it.
It had already cost something. delete_branch_on_merge had removed every
merged branch from the remote, the gate went red anyway, and I deleted
nine local branches chasing a problem that did not exist. The actual
cause was a stale view of the world.
This is C-320's own failure mode occurring inside C-320's own test file:
a gate that reddens for reasons unrelated to what it asserts stops being
read. Registered as an addendum there rather than a new concern — same
root cause, existing home.
Split into two checks:
local — `git branch`, authoritative for your own leftovers
remote — `git ls-remote`, authoritative for the remote, and skipped
when offline per this file's existing idiom (C-320: skip
where the environment cannot answer, do not guess)
Drilled three ways: clean repo passes; the old false positive now passes;
a real local leftover still fails.
The post-mortem gains this as its fourth guard-drill finding, since it
was found while writing the document about exactly this failure mode. The
irony is kept rather than smoothed: my view of the repository was a
record describing a world that had moved on.
Verified: full suite exit 0, ruff clean, validate_docs.sh exit 0,
register invariants unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Recovers work orphaned from #416, and fixes the defect that produced it.
The defect
TestF8StaleBranchesreadgit branch -a, which folds in remote-tracking refs — a local cache that goes stale the moment anyone deletes a branch, and that onlygit fetch --prunerefreshes.So the gate failed against a repository that was genuinely clean.
Demonstrated rather than argued: fabricating only a
refs/remotes/origin/release/v1.11.0ref — no branch on the remote, none locally — was enough to fail it.It had already cost something.
delete_branch_on_mergehad removed every merged branch from the remote; the gate went red anyway; nine local branches were deleted chasing a problem that did not exist.This is C-320's own failure mode, inside C-320's own test file: a gate that reddens for reasons unrelated to what it asserts stops being read.
The fix
Split into two checks with two sources of truth:
release/*leftoversgit branchrelease/*leftoversgit ls-remote— authoritativeDrilled on this branch, not carried over from the earlier run
Also recovered here
Both were orphaned when I pushed to
docs/postmortem-v190-v1110after #416 had already auto-merged. No error was raised; the work simply was not ondevelopment.Verification
Full suite exit 0 ·
ruffclean ·validate_docs.shexit 0 · register invariants unchanged (index 1764 < 8000, header ≤ 3500)