chore(fleet): wire the prune:backups and prune:caches scripts - #75
Merged
Conversation
The fleet cascade already ships both tools — scripts/fleet/prune-backup-branches.mts and scripts/fleet/prune-actions-caches.mts are on disk — but package.json never got the entries that invoke them, so neither was reachable through pnpm run. This matters for the cache one: the repo is holding 5.14 GB of Actions cache with 9 entries over the keep budget. GitHub caps a repo at 10 GB and silently evicts past that, so the entries CI restores most get dropped and jobs rebuild cold while still reporting green. Fleet sync-scaffolding reported both as missing recommended scripts; with these wired it reports none.
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.
Our shared template already ships two maintenance tools into this repo, but
package.jsonnever got the entries that run them. Both files sit on disk atscripts/fleet/prune-backup-branches.mtsandscripts/fleet/prune-actions-caches.mts, and neither was reachable throughpnpm run. This adds the two missing lines.This is not a cosmetic gap. The cache tool is the one that matters: this repo is currently holding 5.14 GB of GitHub Actions cache with 9 entries over the keep budget. GitHub caps a repo at 10 GB and silently evicts the oldest entries past that, so the caches CI restores most often get dropped and jobs quietly rebuild cold while still reporting green.
How this was found — our shared converge check named both scripts
Running the shared scaffolding check against this repo reported exactly two findings, and nothing else:
With the two entries wired, that check reports none. Worth noting this repo was already the most converged of the ones sampled — 2 findings against 3 apiece for the sibling repos checked, which are also missing these same scripts. So this is a shared wiring gap that happens to be getting fixed here first.
Why the names use a colon — we namespace with
:, and the shared manifest was renamed to matchEvery other namespaced script in this repo already uses a colon:
setup:brew,setup:go,check:paths,lockstep:emit-schema,weekly-update:ci,format:check. The shared manifest was the outlier, listing these two with hyphens.That manifest is what the converge check matches against, so the rename had to happen there first or this repo would have gone straight back to reporting both scripts missing. The rename has landed upstream and covers the recommended-scripts manifest, the template's own
package.json, a doc comment in both mirrors, and the check's test fixture.Verification — the wiring was exercised, not just added
Ran.
pnpm run prune:caches --dry-runresolves and does real work, reporting 105 caches totalling 5.14 GB against the 10 GB ceiling and naming the 9 entries it would remove.pnpm run prune:backupsruns read-only by default and reported the current backup ref as kept. Fullnode scripts/fleet/test.mts --allpasses at 95 tests, andpnpm run buildexits 0.Did not run.
prune:cacheswithout--dry-run. That flag is opt-in, meaning a bare run deletes, so pruning the 9 entries is left as a deliberate decision rather than a side effect of this PR.Not changed. Only
package.json, and only two added lines. No script bodies, no config, no source.Note
Low Risk
Package.json script aliases only; no runtime, auth, or extension behavior changes.
Overview
Adds
prune:backupsandprune:cachestopackage.jsonso existing fleet maintenance entrypoints atscripts/fleet/prune-backup-branches.mtsandscripts/fleet/prune-actions-caches.mtsare reachable viapnpm run, matching the colon naming used elsewhere (setup:brew,lockstep:emit-schema, etc.).No script bodies or config change—only two wiring lines so converge checks and operators can run backup-branch and GitHub Actions cache pruning without invoking
nodepaths directly.Reviewed by Cursor Bugbot for commit 74dc421. Configure here.