feat(scripts): OS maintenance helper (update/clean) via task#32
Merged
Conversation
Add scripts/os-maintenance.sh, an OS-detecting helper for routine system maintenance on Arch/EndeavourOS (pacman/yay) and macOS (brew), exposed through the task runner: task update sync + upgrade (interactive) task clean dry-run report of cleanup (deletes nothing) task clean:apply perform cleanup; re-prints the report first clean is non-destructive by default; deletion (orphans, package-cache prune, journal vacuum) is opt-in via --apply. pacdiff and mirrorlist handling are deliberately excluded from automation and documented as a manual runbook in docs/guides/os-maintenance.md. update and clean:apply are mutating tasks; ADR-0052 explicitly lifts the ADR-0009 Taskfile non-mutation ban for them (precedent: ADR-0032/0043), and both are marked MANUAL USE ONLY. Follows the full PRD -> Architecture -> Review -> Plan -> Review -> Build -> Review workflow: PRD 0018, Architecture 0018, Plan 0021 (Complete), Reviews 0049/0050/0051, ADRs 0050/0051/0052. No stow package added, so status blocks are unchanged.
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
Adds an OS-aware system maintenance helper, built through the full repo workflow
(PRD → Architecture → Review → Plan → Review → Build → Review).
scripts/os-maintenance.shdetects the OS and runs the matching package-managercommands, exposed via the task runner:
task updateyay/pacman, macOS:brew) — interactivetask cleantask clean:applycleancovers orphans, package-cache pruning, and journal vacuum. Destructiveremoval is opt-in via
--applyonly.Safety
cleanis non-destructive by default (verified: orphans and cache size unchangedafter a dry run).
clean:applyre-prints the report immediately before deleting.pacdiff/mirrorlistare excluded from automation — documented as a manualrunbook in
docs/guides/os-maintenance.md(a blind.pacnewoverwrite emptied amirrorlist before; this prevents a repeat).
paccacheis guarded (pacman-contribmay be absent);yayis never run as root.$HOME, stow, symlink,rm/mvagainst$HOME.set -euo pipefail.Process notes
updateandclean:applyare mutating tasks. ADR-0052 explicitly lifts theADR-0009 Taskfile non-mutation ban for those two tasks only (precedent: ADR-0032 /
ADR-0043); both are marked MANUAL USE ONLY. PRD 0018 records the lift.
macOS before relying on it.
Documents
PRD 0018 · Architecture 0018 · Plan 0021 (Complete) · Reviews 0049 / 0050 / 0051 ·
ADRs 0050 / 0051 / 0052.
Validation
bash -nclean; no-arg and bogus-command exit non-zero with usage.task cleandry-run produced a report and deleted nothing (orphans 0→0, cache3.3G→3.3G).
task --listshowsupdate,clean,clean:apply.