docs: branch audit + cleanup plan (linear vs squash, dead-branch scan) - #302
Open
drunkcoding wants to merge 2 commits into
Open
docs: branch audit + cleanup plan (linear vs squash, dead-branch scan)#302drunkcoding wants to merge 2 commits into
drunkcoding wants to merge 2 commits into
Conversation
…scan)
Classify every local/remote branch vs origin/main into linear-merged (ancestor of main), squash-merged (net diff already in main, detected via git cherry patch-id), and unmerged; add an age-based dead/stale scan and a staged deletion plan. This operationalizes PR_MERGE_POLICY.md section 4 ("delete the PR branch once merged"). Measured against origin/main because local main was 104 commits behind at snapshot.
drunkcoding
force-pushed
the
docs/branch-maintenance
branch
from
July 14, 2026 13:55
54ac946 to
675a152
Compare
16 tasks
The delete plan was executed (owner-run CLI): 116 branches deleted (104 remote + 12 local) after per-branch fresh re-verification, with recovery SHAs captured. Add an Execution Log documenting deleted tiers, held protected/worktree branches, recovery, and the resulting state (100 remote branches remain: 2 protected-merged + 98 unmerged). Retain the audit-time snapshot table as the record.
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.
Description
Adds
docs/branch-maintenance.md— a point-in-time audit of every branch (local + remote) classified by how its work relates tomain, with a staged deletion plan and a dead/stale scan.Status update: the delete plan has since been executed (owner-run CLI). The doc now includes an Execution Log recording exactly what was removed. The audit-time snapshot table is retained as the record.
Motivation
The branch count had grown large and it was unclear which branches were safe to delete.
PR_MERGE_POLICY.md§4 already requires "delete the PR branch once merged," but a backlog of merged-but-undeleted branches accumulated. This doc operationalizes §4 and distinguishes linear from squash merges (the repo's de-facto strategy) so cleanup proceeds with zero risk to unmerged work.Type of Change
docs— documentation onlyFile changes
docs/branch-maintenance.mdWhat was executed (see the doc's Execution Log)
origin/mainbefore deletion; recovery SHAs captured.release/*branches (merged) and 1 local branch checked out in another worktree.Method (measured against
origin/main, not localmain)origin/main(git merge-base --is-ancestor);-dsafe.mainvia synthetic full-tree commit +git cherrypatch-id (≡git-delete-merged-branches --effort=3);-Drequired.main; kept.Checklist
PR Merge Policy Contract — pre-merge checklist
git diff --stat origin/mainreviewed; onlydocs/branch-maintenance.md— no unrelated files.docs) ticked; the single file is within thedocsallowlist.debug_*/check_*/scratch_*/tmp_*scripts added.test_*.pyadded inside the runtime package.BATCHGEN_*env-var debug guard.print()or commented-out code.-f.MODULE.mdupdate needed.Co-Authored-By.