Skip to content

OpenSpec: add-project-clean-branch-retirement (a removed worktree's merged local branch is retired only by a second explicit command, one branch at a time) #23

Open

Description

@brettheap

Lane: openRepoProject-5

Governing issue for a new OpenSpec change, add-project-clean-branch-retirement, proposed on Brett Heap's word "usage reset, resume all. read handoff and resume and fan out wide and do as much as possible in parallel" (2026-10-11), which lanes openRepoProject-4 and openRepoProject-5 read as a go for the candidate list they had put to him, lane 5 taking the project-maintenance design packet's separately governed extensions (ideation/brainstorm/next-session-project-maintenance-fix-handoff.md:47-50 at da33d92). If that reading is wrong, closing this issue ends the change. Refs #6, the record of the packet.

Problem

A batch or single removal under project clean --apply removes a merged, clean worktree and keeps its local branch; the branch is retired only by a second explicit command, one branch at a time (--apply --action delete-branch --branch <b>). The ratified change add-project-clean-all-safe keeps that rule on purpose ("Removing a worktree leaves its branch"; "Cleanup SHALL never delete a branch, so that a branch race cannot lose commits") and names paired retirement as a separate change written as a MODIFIED requirement on project-clean (openspec/changes/add-project-clean-all-safe/proposal.md:690-696; PR #2 decision record, comment 6035824335). The packet fixes the contract such a change must meet (project-maintenance-batch-cleanup.md:1339-1345 at da33d92): a separate post-removal stage; an immediate branch-head and local-ancestry check using the reconciliation record's branch_sha; a changed head or a Git refusal retains the branch, stops later targets and reports the removed worktree and the surviving branch; the explicit delete-branch command stays the retry path; nothing ever force-deletes or force-pushes. The closed PR #2's commit 5fc2b51 (with the helpers 1789ad9 and bb91a49 added for it) is the harvest source; it met none of that contract and Copilot found it deleted by name without checking the planned head.

Intended scope (for the proposal to settle)

An opt-in flag on --apply --action remove (single and --all-safe) that retires each removed worktree's local branch as a bounded post-removal stage under the packet's contract, reported per target as a sub-record of the versioned JSON and in the human report, with the question and success line naming the branches; never the default; never a remote branch; never force.

Out of scope unless the proposal argues otherwise

Cache disposal and remote merge status (their own changes, governed beside this one); any change to the fifteen ladder class names or to the closed stage enum; the explicit delete-branch command's own behaviour; the CI matrix.

Sibling search

No open issue, PR, branch or active OpenSpec change covers this surface (searched for "branch retirement", "paired", "delete-branch", "branch -d"). The ratified, unarchived change add-project-clean-all-safe (#9, PR #11, amended by draft PR #19) and add-project-overview (#10, PR #12) are lane openRepoProject-2's; this change is written against their delta text and archives after change 1 and after add-project-clean-cache-disposal. Draft PR #16 (lane 3) revises the packet; citations here pin da33d92. #20 (lane 1) touches project new only. PR #2 (closed) is the harvest source and is not reopened.

Activity

  1. brettheap commented on Oct 11, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoProject-5, session 01e99fe7-bec0-4838-8159-eae2b41ad4ea@Eagle, 2026-10-11T16:34:17Z, for #23

    Logged in lanes/log/openRepoProject-5.md at 0ed8ea9aeb4426e3cc8e3b32d9185aa7b5e296b6.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoProject#23:
       none
    2. `gh pr list --repo opensoft/openRepoProject --state all --search "#23"`, kept where the row or its body names `#23`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoProject` branches naming `23` as a whole token:
       none
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions