Skip to content

docs: branch audit + cleanup plan (linear vs squash, dead-branch scan) - #302

Open
drunkcoding wants to merge 2 commits into
mainfrom
docs/branch-maintenance
Open

docs: branch audit + cleanup plan (linear vs squash, dead-branch scan)#302
drunkcoding wants to merge 2 commits into
mainfrom
docs/branch-maintenance

Conversation

@drunkcoding

@drunkcoding drunkcoding commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds docs/branch-maintenance.md — a point-in-time audit of every branch (local + remote) classified by how its work relates to main, 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 only

File changes

File Δ Note
docs/branch-maintenance.md add Branch audit (linear/squash/unmerged) + dead-branch scan + staged delete plan + execution log

What was executed (see the doc's Execution Log)

  • Deleted: 116 branches (104 remote + 12 local) — 7 linear, 51 remote + 12 local single-commit squash, 44 multi-commit squash, 2 trivial dead. Each re-verified fresh against origin/main before deletion; recovery SHAs captured.
  • Held: 2 protected release/* branches (merged) and 1 local branch checked out in another worktree.
  • State now: 100 remote branches remain — 2 protected-merged + 98 unmerged (24 with open PRs; 10 dead, 25 stale, 39 active). No unmerged/dead/stale branch was deleted.

Method (measured against origin/main, not local main)

  • Linear-merged — ancestor of origin/main (git merge-base --is-ancestor); -d safe.
  • Squash-merged — net diff already in main via synthetic full-tree commit + git cherry patch-id (≡ git-delete-merged-branches --effort=3); -D required.
  • Unmerged — unique work not in main; kept.
  • Dead/stale — age axis on unmerged branches (>180d dead, 90–180d stale).

Checklist

  • I have read the CONTRIBUTING guide and the PR Merge Policy Contract.
  • I have updated the tests (if applicable). — n/a (docs only)
  • I have updated the documentation (this PR is the documentation).

PR Merge Policy Contract — pre-merge checklist

  • git diff --stat origin/main reviewed; only docs/branch-maintenance.md — no unrelated files.
  • Exactly one Type of Change (docs) ticked; the single file is within the docs allowlist.
  • File changes table matches the diff.
  • No debug_*/check_*/scratch_*/tmp_* scripts added.
  • No test_*.py added inside the runtime package.
  • No new BATCHGEN_* env-var debug guard.
  • No leftover print() or commented-out code.
  • No logs, traces, CSVs, checkpoints, wheels, or compiled artifacts staged; nothing added with -f.
  • No public API change → no MODULE.md update needed.
  • One concern only; diff is surgical (single doc, 2 commits: plan + execution log).
  • Commits are clean: Angular format, body present, no Co-Authored-By.
  • CI is green (format, lint, hygiene, tests). — pending CI

…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
drunkcoding force-pushed the docs/branch-maintenance branch from 54ac946 to 675a152 Compare July 14, 2026 13:55
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.
@github-actions github-actions Bot added the ci:run Trigger build + GPU regression on H20 label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run Trigger build + GPU regression on H20

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant