Repository navigation
feat(code-tidying): run upkeep as a daily batch of at most 3 PRs - #12674
Conversation
…batch gate Settings upkeep_cadence, upkeep_backstop and upkeep_max_open live in <home>/code-tidying.yaml and resolve through one reader. The tidy throttle takes its limit from upkeep_max_open. A push job names the areas each merge changed. upkeep.mjs gate plans the daily batch from git log, the open tidy PR count and earlier ad hoc sweeps; no workflow runs it yet. Refs: #12475 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
…'s edge A listing of 1000 pull requests here reaches back about three days, so a limit-based read stopped every run short of the weekly window. The gate now pages newest first until it passes the window, and reads open pull requests separately so an old open sweep still counts. Refs: #12475 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
An area nobody changed is never eligible, since 108 areas cannot fit the sweeps a cap of 3 allows in a week. An area is overdue once its oldest unswept commit passes the backstop window, and overdue areas go first. The gate reads commits and pull requests back twice the window. Refs: #12475 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
…n in view A squash-merged sweep's own commit no longer counts as churn in its area. The gate reads every sweep by branch prefix and reads commits back to the oldest sweep, at least 90 days, so overdue churn no longer leaves a fixed window. A sweep list at the listing limit stops the batch with a reason. The throttle test clears the inherited git environment. Refs: #12475 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
The sweep search returns at most 1000 results, so stopping on a full list would have stopped the gate for good within a year. The oldest listed sweep is the lookback floor instead, and an area the list has lost is still judged correctly. Refs: #12475 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
The maintenance-code-tidying-upkeep workflow gains the daily batch on schedule and dispatch: gate, model, scan, push-branches and publish, in the shape of upstream-apply-changelog. The model runs on the automations subscription token with a read-only token. The scan job is the scan-carrier key's third holder, by the owner's decision on #12475, and records a clean sweep as a workflow artifact, which needs no write token, so a clean area is not picked again until it changes. Refs: #12475 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
…daily-batch # Conflicts: # .github/scripts/maintenance-code-tidying-upkeep/upkeep.mjs
…de-upkeep The vocabulary needs a verb first, and code is not a verb. The sweep record artifact becomes tidy-code-upkeep-sweeps and the vocabulary function tidy-code-upkeep. Refs: #12475 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
…plugins into feat/12475-upkeep-daily-batch
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a445421f9a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The sweep record took its time from the artifact's creation, so a commit that landed on main while the model swept the fixed base counted as swept. The scan job now writes the base commit's committer time, and the gate drops a record without a valid one. Refs: #12475 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
|
claude-review reviewed Code review: PR #12674, incremental from
|
|
claude-security-review reviewed Security review: PR #12674, incremental from
|
… main's records Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
…olding scan job Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
…eep the decided cadence Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn
Closes #12475
session: lane-2
Summary
Adds the upkeep batch: the model job that opens one
chore/tidy-adhoc-<slug>-<date>pull request per due area. #12614 shipped the settings, the cap, detection and the gate. This renames the lane verb-first tomaintenance-tidy-code-upkeep, as the vocabulary requires (melodic-software/standards#945).Fix
upstream-apply-changelog.yml. The kill switch is read before the model step, and the model job holds no write token.scanjob is the third holder ofSCAN_CARRIER_PRIVATE_KEY, under the second holder's limits, on the owner's decision. Pinned incallers.test.mjs.push-branchesreadsupkeep_max_openagain after the model job, before its first new branch, so no branch is left without a pull request. A sweep past the cap goes unrecorded and stays due. That job gainspull-requests: readand counts with its read-only token; the scan job, as the key holder, stayscontents: read.pushreuses a branch at the planned tree, and stops on one holding another tree with no pull request.publishskips a branch that already has a pull request.tidy-code-upkeep-sweepsartifact (90 days) with the swept commit's time, so that area isn't picked again until it changes. The gate trusts only records from this repository'smain. Basis: uploading needs no write token.pr-mergemerges them under its usual gates (docs/conventions/pr-pipeline.yaml,adoption). The README andtidy/SKILL.mdsaid a person always merges; both now say the repository's merge lane or a person.Verification
check-artifact-retention.sh: 80 uploads match.test_floor_paths.py: 28 pass, with the floor pins updated for the new workflow row. Staticcheck-affected: 14 passed, 1 skipped.scan,push,publishand the workflow YAML are not exercised end to end. Aworkflow_dispatchafter merge is the first live run. Whether an upkeep PR goes throughpr-mergeis unproven until then.--tests, per check-affected --tests overruns its budget and stalls the ready flip #12639; CI runs the suites.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01VQb9Pzf47aw4gsMAyk98Wn