prune is still inconsistent and broken #449

Closed
opened 2026-08-18 19:19:59 +00:00 by hexajon · 2 comments
Owner

prune is still broken:

$ madtea prune
Found 10 merged branch(es):
  ci/concurrency-cancel-in-progress
  docs/remove-prelaunch-hedges
  feat/repos-merge-flags
  issue-371-init-help-topic
  issue-373-fixpull-unborn-branch-misread-as-dirty-diff-index
  issue-375-branch-protection-command
  issue-378-smoke-go-1266
  issue-384-codeberg-purge
  issue-387-mcp-protocol-2026-07-28
  issue-390-forge-resolution
Would delete (squash-merged, content already in main): 4 branch(es):
  docs/drop-prelaunch-hedges
  fix-mcp-conformance-mark-expected-error
  issue-425-commit-identity-from-target-repo
  issue-431-432-repos-protection-and-merge-flags
Re-run with delete_branches=true (CLI: --delete-branches) to delete the branches above. To also remove merged remote-only branches not shown above, first preview the full set with a --remote dry run, then re-run with --delete-branches --remote.

$ madtea prune --remote
Found 10 merged branch(es):
  ci/concurrency-cancel-in-progress
  docs/remove-prelaunch-hedges
  feat/repos-merge-flags
  issue-371-init-help-topic
  issue-373-fixpull-unborn-branch-misread-as-dirty-diff-index
  issue-375-branch-protection-command
  issue-378-smoke-go-1266
  issue-384-codeberg-purge
  issue-387-mcp-protocol-2026-07-28
  issue-390-forge-resolution
Found 1 merged remote branch(es) with no local copy:
  ci/sha-dedup-push-rerun
Would delete (squash-merged, content already in main): 4 branch(es):
  docs/drop-prelaunch-hedges
  fix-mcp-conformance-mark-expected-error
  issue-425-commit-identity-from-target-repo
  issue-431-432-repos-protection-and-merge-flags
Re-run with delete_branches=true (CLI: --delete-branches) to delete. The full set is listed above.

$ madtea prune --remote --delete-branches
Deleted local branch(es):
  ci/concurrency-cancel-in-progress
  docs/remove-prelaunch-hedges
  feat/repos-merge-flags
  issue-371-init-help-topic
  issue-373-fixpull-unborn-branch-misread-as-dirty-diff-index
  issue-375-branch-protection-command
  issue-378-smoke-go-1266
  issue-384-codeberg-purge
  issue-387-mcp-protocol-2026-07-28
  issue-390-forge-resolution
Deleted remote branch(es):
  docs/remove-prelaunch-hedges
  issue-371-init-help-topic
  issue-375-branch-protection-command
  issue-378-smoke-go-1266
  issue-384-codeberg-purge
  issue-387-mcp-protocol-2026-07-28
  issue-390-forge-resolution
  fix-mcp-conformance-mark-expected-error
Deleted remote-only branch(es) (no local copy):
  ci/sha-dedup-push-rerun
Deleted squash-merged branch(es) (content already in main):
  docs/drop-prelaunch-hedges
  fix-mcp-conformance-mark-expected-error
  issue-425-commit-identity-from-target-repo
  issue-431-432-repos-protection-and-merge-flags
Deleted 10 local branch(es)
Deleted 9 remote branch(es)
Deleted 4 squash-merged branch(es) (content already in main)
Cleaned 9 stale remote-tracking ref(s)
Error: ci/concurrency-cancel-in-progress (remote): API error 500: {"message":"object does not exist [id: refs/heads/ci/concurrency-cancel-in-progress, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"}

Error: feat/repos-merge-flags (remote): API error 500: {"message":"object does not exist [id: refs/heads/feat/repos-merge-flags, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"}

Error: issue-373-fixpull-unborn-branch-misread-as-dirty-diff-index (remote): API error 500: {"message":"object does not exist [id: refs/heads/issue-373-fixpull-unborn-branch-misread-as-dirty-diff-index, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"}

Error: docs/drop-prelaunch-hedges (remote): API error 500: {"message":"object does not exist [id: refs/heads/docs/drop-prelaunch-hedges, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"}

Error: issue-425-commit-identity-from-target-repo (remote): API error 500: {"message":"object does not exist [id: refs/heads/issue-425-commit-identity-from-target-repo, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"}

Error: issue-431-432-repos-protection-and-merge-flags (remote): API error 500: {"message":"object does not exist [id: refs/heads/issue-431-432-repos-protection-and-merge-flags, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"}
prune is still broken: ``` $ madtea prune Found 10 merged branch(es): ci/concurrency-cancel-in-progress docs/remove-prelaunch-hedges feat/repos-merge-flags issue-371-init-help-topic issue-373-fixpull-unborn-branch-misread-as-dirty-diff-index issue-375-branch-protection-command issue-378-smoke-go-1266 issue-384-codeberg-purge issue-387-mcp-protocol-2026-07-28 issue-390-forge-resolution Would delete (squash-merged, content already in main): 4 branch(es): docs/drop-prelaunch-hedges fix-mcp-conformance-mark-expected-error issue-425-commit-identity-from-target-repo issue-431-432-repos-protection-and-merge-flags Re-run with delete_branches=true (CLI: --delete-branches) to delete the branches above. To also remove merged remote-only branches not shown above, first preview the full set with a --remote dry run, then re-run with --delete-branches --remote. $ madtea prune --remote Found 10 merged branch(es): ci/concurrency-cancel-in-progress docs/remove-prelaunch-hedges feat/repos-merge-flags issue-371-init-help-topic issue-373-fixpull-unborn-branch-misread-as-dirty-diff-index issue-375-branch-protection-command issue-378-smoke-go-1266 issue-384-codeberg-purge issue-387-mcp-protocol-2026-07-28 issue-390-forge-resolution Found 1 merged remote branch(es) with no local copy: ci/sha-dedup-push-rerun Would delete (squash-merged, content already in main): 4 branch(es): docs/drop-prelaunch-hedges fix-mcp-conformance-mark-expected-error issue-425-commit-identity-from-target-repo issue-431-432-repos-protection-and-merge-flags Re-run with delete_branches=true (CLI: --delete-branches) to delete. The full set is listed above. $ madtea prune --remote --delete-branches Deleted local branch(es): ci/concurrency-cancel-in-progress docs/remove-prelaunch-hedges feat/repos-merge-flags issue-371-init-help-topic issue-373-fixpull-unborn-branch-misread-as-dirty-diff-index issue-375-branch-protection-command issue-378-smoke-go-1266 issue-384-codeberg-purge issue-387-mcp-protocol-2026-07-28 issue-390-forge-resolution Deleted remote branch(es): docs/remove-prelaunch-hedges issue-371-init-help-topic issue-375-branch-protection-command issue-378-smoke-go-1266 issue-384-codeberg-purge issue-387-mcp-protocol-2026-07-28 issue-390-forge-resolution fix-mcp-conformance-mark-expected-error Deleted remote-only branch(es) (no local copy): ci/sha-dedup-push-rerun Deleted squash-merged branch(es) (content already in main): docs/drop-prelaunch-hedges fix-mcp-conformance-mark-expected-error issue-425-commit-identity-from-target-repo issue-431-432-repos-protection-and-merge-flags Deleted 10 local branch(es) Deleted 9 remote branch(es) Deleted 4 squash-merged branch(es) (content already in main) Cleaned 9 stale remote-tracking ref(s) Error: ci/concurrency-cancel-in-progress (remote): API error 500: {"message":"object does not exist [id: refs/heads/ci/concurrency-cancel-in-progress, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"} Error: feat/repos-merge-flags (remote): API error 500: {"message":"object does not exist [id: refs/heads/feat/repos-merge-flags, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"} Error: issue-373-fixpull-unborn-branch-misread-as-dirty-diff-index (remote): API error 500: {"message":"object does not exist [id: refs/heads/issue-373-fixpull-unborn-branch-misread-as-dirty-diff-index, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"} Error: docs/drop-prelaunch-hedges (remote): API error 500: {"message":"object does not exist [id: refs/heads/docs/drop-prelaunch-hedges, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"} Error: issue-425-commit-identity-from-target-repo (remote): API error 500: {"message":"object does not exist [id: refs/heads/issue-425-commit-identity-from-target-repo, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"} Error: issue-431-432-repos-protection-and-merge-flags (remote): API error 500: {"message":"object does not exist [id: refs/heads/issue-431-432-repos-protection-and-merge-flags, rel_path: ]","url":"https://git.cheshirecube.cloud/api/swagger"}
Author
Owner

The 500-error half is fixed and merged (PR #462): a delete of an already-gone remote ref (500 "object does not exist [id: refs/heads/...]") is now classified as already-gone, not an error, so the six spurious "API error 500" lines are gone. That was the actual breakage.

Two things stay open for a decision.

1. Display of defect 1. A squash-merged branch whose live remote twin is also deleted (e.g. fix-mcp-conformance-mark-expected-error) still appears under BOTH "Deleted remote branch(es)" and "Deleted squash-merged branch(es)". This is truthful, not a double-delete: its local ref goes to the squash-merged list and its remote twin is folded into the remote list (the #301 fold), and each ref is deleted exactly once. But it reads as a repeat. Options:

  • Keep the fold as-is (truthful; with the 500s gone the output no longer reads as broken).
  • Relabel so it does not read as a repeat (annotate the squash line "(+remote twin)").
  • Give squash remote twins their own "Deleted squash-merged remote branch(es)" line (a new result field plus a format-layer change), so each branch shows under exactly one heading.

I lean to the separate line: it keeps every deletion named (the "nothing deleted that is not reported" invariant) while removing the read-as-double-delete. It reverses the documented 2026-07-10 fold, so the call is yours.

2. A defensive guard I added, disclosed. The merged fix also carries a skipRemotes guard so a branch reached by both the ancestry and the squash-merged pass deletes its remote twin at most once. The two candidate sets are disjoint by construction today (findSquashMerged excludes ancestry-merged branches), so the guard never fires in practice - it is defensive, not a live path. I kept it self-documented, but it is removable if you prefer it lean, and the display change in (1) touches this same area, so both can be reconciled together.

Marking needs-decision on (1).

The 500-error half is fixed and merged (PR #462): a delete of an already-gone remote ref (500 "object does not exist [id: refs/heads/...]") is now classified as already-gone, not an error, so the six spurious "API error 500" lines are gone. That was the actual breakage. Two things stay open for a decision. **1. Display of defect 1.** A squash-merged branch whose live remote twin is also deleted (e.g. fix-mcp-conformance-mark-expected-error) still appears under BOTH "Deleted remote branch(es)" and "Deleted squash-merged branch(es)". This is truthful, not a double-delete: its local ref goes to the squash-merged list and its remote twin is folded into the remote list (the #301 fold), and each ref is deleted exactly once. But it reads as a repeat. Options: - Keep the fold as-is (truthful; with the 500s gone the output no longer reads as broken). - Relabel so it does not read as a repeat (annotate the squash line "(+remote twin)"). - Give squash remote twins their own "Deleted squash-merged remote branch(es)" line (a new result field plus a format-layer change), so each branch shows under exactly one heading. I lean to the separate line: it keeps every deletion named (the "nothing deleted that is not reported" invariant) while removing the read-as-double-delete. It reverses the documented 2026-07-10 fold, so the call is yours. **2. A defensive guard I added, disclosed.** The merged fix also carries a skipRemotes guard so a branch reached by both the ancestry and the squash-merged pass deletes its remote twin at most once. The two candidate sets are disjoint by construction today (findSquashMerged excludes ancestry-merged branches), so the guard never fires in practice - it is defensive, not a live path. I kept it self-documented, but it is removable if you prefer it lean, and the display change in (1) touches this same area, so both can be reconciled together. Marking needs-decision on (1).
Author
Owner

Decided: give squash-merged remote twins their own line.

Add a "Deleted squash-merged remote branch(es)" heading (a new result field plus the format-layer change) so each branch appears under exactly one heading. This keeps the "nothing deleted that is not reported" invariant while removing the read-as-double-delete. It reverses the documented 2026-07-10 #301 fold, which is the intended change here.

The 500-error breakage was the real bug and is already fixed (PR #462).

Companion, reconciled in the same change: remove the never-firing skipRemotes guard. findSquashMerged excludes ancestry-merged branches, so the two candidate sets are disjoint by construction and the guard cannot fire. With each branch now shown under exactly one heading, the dead guard adds nothing. If you would rather keep it as defensive scaffolding, say so and I will leave it self-documented.

Clearing needs-decision.

Decided: give squash-merged remote twins their own line. Add a "Deleted squash-merged remote branch(es)" heading (a new result field plus the format-layer change) so each branch appears under exactly one heading. This keeps the "nothing deleted that is not reported" invariant while removing the read-as-double-delete. It reverses the documented 2026-07-10 #301 fold, which is the intended change here. The 500-error breakage was the real bug and is already fixed (PR #462). Companion, reconciled in the same change: remove the never-firing `skipRemotes` guard. `findSquashMerged` excludes ancestry-merged branches, so the two candidate sets are disjoint by construction and the guard cannot fire. With each branch now shown under exactly one heading, the dead guard adds nothing. If you would rather keep it as defensive scaffolding, say so and I will leave it self-documented. Clearing needs-decision.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#449
No description provided.