Skip to content

feat(scripts): OS maintenance helper (update/clean) via task#32

Merged
fnayou merged 1 commit into
mainfrom
feat/os-maintenance
Jun 24, 2026
Merged

feat(scripts): OS maintenance helper (update/clean) via task#32
fnayou merged 1 commit into
mainfrom
feat/os-maintenance

Conversation

@fnayou

@fnayou fnayou commented Jun 24, 2026

Copy link
Copy Markdown
Owner

What

Adds an OS-aware system maintenance helper, built through the full repo workflow
(PRD → Architecture → Review → Plan → Review → Build → Review).

scripts/os-maintenance.sh detects the OS and runs the matching package-manager
commands, exposed via the task runner:

Task Action
task update sync + upgrade (Arch: yay/pacman, macOS: brew) — interactive
task clean dry-run report of cleanup — deletes nothing
task clean:apply perform cleanup; re-prints the report first

clean covers orphans, package-cache pruning, and journal vacuum. Destructive
removal is opt-in via --apply only.

Safety

  • clean is non-destructive by default (verified: orphans and cache size unchanged
    after a dry run).
  • clean:apply re-prints the report immediately before deleting.
  • pacdiff / mirrorlist are excluded from automation — documented as a manual
    runbook in docs/guides/os-maintenance.md (a blind .pacnew overwrite emptied a
    mirrorlist before; this prevents a repeat).
  • paccache is guarded (pacman-contrib may be absent); yay is never run as root.
  • No $HOME, stow, symlink, rm/mv against $HOME. set -euo pipefail.

Process notes

  • update and clean:apply are mutating tasks. ADR-0052 explicitly lifts the
    ADR-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.
  • No stow package added/removed → status blocks unchanged.
  • macOS path is written and guarded but unexercised on an Arch host; smoke-test on
    macOS before relying on it.

Documents

PRD 0018 · Architecture 0018 · Plan 0021 (Complete) · Reviews 0049 / 0050 / 0051 ·
ADRs 0050 / 0051 / 0052.

Validation

  • bash -n clean; no-arg and bogus-command exit non-zero with usage.
  • task clean dry-run produced a report and deleted nothing (orphans 0→0, cache
    3.3G→3.3G).
  • task --list shows update, clean, clean:apply.

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.
@fnayou fnayou merged commit 7f77df0 into main Jun 24, 2026
2 checks passed
@fnayou fnayou deleted the feat/os-maintenance branch June 24, 2026 02:25
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