feat(sweep): daily stranded-work detector for remote branches and local trees - #138
Merged
Conversation
…al trees One scheduled job that asks whether work is going stale anywhere we own, following the default-branch-sweep pattern of one issue rewritten in place. - remote detector (hosted-safe): branches that are not the default branch, have no open pull request, and have been quiet past --stale-days are listed as stranded; queue/dependabot machinery and fresh branches stay quiet - local detector (--local-root): bin/oa-fresh ported so clones behind origin, unpushed commits, and uncommitted files land in the same issue; duplicate clones of one remote are marked instead of double-counted; a runner without workspace visibility says so instead of implying the trees are fine - sync dispatch input fast-forwards clean default-branch clones only, using bin/oa-fresh's exact safety rule, and refuses loudly on any runner without OA_SRC_ROOT; nothing else in this job mutates anything 20 offline classifier tests cover the fire and stay-quiet conditions plus real-git scratch-repository tests proving sync cannot touch dirty or feature-branch trees.
Copies the default-branch-sweep self-test setup; a bare python -m pytest has no pytest module on the hosted image.
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.
What changed
default-branch-sweep.ymlpattern (stdlib only, explicit per_page, one issue rewritten in place, silent when clear)--stale-days(default 14) is reported as stranded;gh-readonly-queue/*,dependabot/*, fresh branches, and open-PR heads stay quiet--local-root):bin/oa-freshported here, so clones behind origin, unpushed commits, and uncommitted files land in the same issue; duplicate clones of one remote are marked as duplicates instead of double-counting; a runner without workspace visibility says exactly that instead of implying the trees are finebin/oa-fresh's exact safety rule (never touches dirty trees, feature branches, or clones with local commits; the only mutation attempted isgit merge --ff-only) and refuses loudly on any runner withoutOA_SRC_ROOTOA_SRC_ROOT, switchruns-onto[self-hosted])Why
On 2026-08-21
bin/oa-fresh --syncfound 32 local clones behind their origin carrying unpushed or uncommitted work. Stale-tree misreads have produced four confident wrong findings this year.oa-freshanswers the local question but nothing schedules it, and no cross-repository detector watches for stranded remote branches at all. This repository already owns the multi-repo registry and files one issue per day from two other scheduled sweeps.Validation
20 passedintests/test_sweep_workspace_staleness.py: fire and stay-quiet classifier cases, plus real-git scratch repositories proving sync fast-forwards only clean default branches and cannot touch dirty or feature-branch treesruff check/ruff format --checkclean on both filesactionlintclean on the workflow--local-root <real workspace>produced the expected table against live trees