[ai] fix(ci): support stale batch in branch-cleanup-delete.sh - #1840
Draft
github-actions[bot] wants to merge 5 commits into
Draft
[ai] fix(ci): support stale batch in branch-cleanup-delete.sh#1840github-actions[bot] wants to merge 5 commits into
github-actions[bot] wants to merge 5 commits into
Conversation
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
The Branch Cleanup workflow lets a workflow_dispatch or sentinel commit select batch=stale, but branch-cleanup-delete.sh only recognized safe|review and exited 2 for any other argument, failing the run. Add a STALE_BRANCHES case (currently empty, since no branch in docs/branch-cleanup-matrix.csv carries the CLOSE-STALE verdict yet) so the stale batch runs as a no-op instead of erroring out. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8 tasks
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Locks in the stale-batch fix on this branch with automated pytest coverage instead of only manual DRY_RUN verification. Confirmed the new tests fail against main's unfixed script (2/7 failures reproducing the original usage/exit-2 bug) and pass against this branch's fix (7/7). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
Commit pushed:
|
8 tasks
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.
Canonical issue
Fixes #aw_bcstale
Problem
.github/workflows/branch-cleanup.ymlexposes astalebatch option (bothvia
workflow_dispatchand the[run-cleanup:stale]sentinel-commit path),but
scripts/maintenance/branch-cleanup-delete.shonly implementedsafe|reviewand fell through tousage: ... {safe|review}withexit 2for
stale. Every historical run selecting thestalebatch has failed withthis exact signature since at least 2026-08-07 (15+ occurrences), most
recently https://github.com/groupthinking/EventRelay/actions/runs/34392035516
on 2026-09-09.
Fix
STALE_BRANCHESarray (empty today —docs/branch-cleanup-matrix.csvhas no
CLOSE-STALEverdict rows yet) and astale)case inscripts/maintenance/branch-cleanup-delete.sh.stalebatch now runs as adocumented no-op instead of erroring, matching the workflow's existing
safe/reviewbehavior pattern.Verification
bash -n scripts/maintenance/branch-cleanup-delete.sh— syntax check passes.DRY_RUN=1 scripts/maintenance/branch-cleanup-delete.sh stale— exits 0(previously exited 2 with the usage error).
scripts/maintenance/branch-cleanup-delete.sh bogus— still correctlyrejects unknown batches with
exit 2and the updated usage string.DRY_RUN=1 scripts/maintenance/branch-cleanup-delete.sh safe— unchangedbehavior confirmed (still lists CLOSE-SAFE branches).
git diff origin/main -- scripts/maintenance/branch-cleanup-delete.sh—confirms the change is an 11-line, single-file, additive diff.
Evidence
15+ failed
Branch Cleanupruns over 5 weeks share this identical exit-code-2signature (
gh run list --workflow "Branch Cleanup" --status failure).Risk
STALE_BRANCHESis empty, sostaleis aguaranteed no-op until a future branch audit populates it.
stalebatch selection as before (not a regression from current
main).Research pattern recommendation
Agentic Workflows best fits this checkpoint: the failure is a scheduled/
dispatch-triggered GitHub Actions script bug, discoverable and fixable purely
through natural-language-programmed CI automation (this very pr-iteration-loop
workflow) without needing real-time multiplayer planning (Chopin), generic
platform-embedded LLM automation (Continuous AI), or open-ended autonomous
goal-seeking (Autoloop). The fix is small, verifiable by direct script
execution, and the evidence trail (workflow run history) is exactly the kind
of structured signal agentic workflows are built to consume and act on.