Skip to content

chore(fleet): wire the prune:backups and prune:caches scripts - #75

Merged
John-David Dalton (jdalton) merged 1 commit into
mainfrom
fleet/wire-prune-scripts
Aug 2, 2026
Merged

chore(fleet): wire the prune:backups and prune:caches scripts#75
John-David Dalton (jdalton) merged 1 commit into
mainfrom
fleet/wire-prune-scripts

Conversation

@jdalton

@jdalton John-David Dalton (jdalton) commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Our shared template already ships two maintenance tools into this repo, but package.json never got the entries that run them. Both files sit on disk at scripts/fleet/prune-backup-branches.mts and scripts/fleet/prune-actions-caches.mts, and neither was reachable through pnpm 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:

missing_recommended_script | Missing recommended script: prune-backups
missing_recommended_script | Missing recommended script: prune-caches

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 match

Every 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-run resolves 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:backups runs read-only by default and reported the current backup ref as kept. Full node scripts/fleet/test.mts --all passes at 95 tests, and pnpm run build exits 0.

Did not run. prune:caches without --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:backups and prune:caches to package.json so existing fleet maintenance entrypoints at scripts/fleet/prune-backup-branches.mts and scripts/fleet/prune-actions-caches.mts are reachable via pnpm 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 node paths directly.

Reviewed by Cursor Bugbot for commit 74dc421. Configure here.

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.
@jdalton
John-David Dalton (jdalton) merged commit 5be5250 into main Aug 2, 2026
14 checks passed
@jdalton
John-David Dalton (jdalton) deleted the fleet/wire-prune-scripts branch August 2, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant