feat: implement slice 1 tracer bullet (cli entrypoint, distro detector, and test suite)

This commit is contained in:
soda64 committed 2026-10-02 10:05:39 +02:00
commit 63c6cc846b
16 files changed
+1317

No files matched your search

@@ -0,0 +1,19 @@
# Product Spec: linux-system-updater
## Problem Statement
System administrators and engineers managing diverse Linux installations often face fragile, distribution-dependent upgrade procedures. Running package updates on an unhealthy machine can leave systems in an unbootable or corrupted state if disk space on `/boot` or `/var` runs out, memory is exhausted, or stale package locks block the process. Furthermore, administering updates across Debian/Ubuntu, RHEL/Fedora, and Arch requires remembering disparate commands, flags, and major-version upgrade workflows, leading to accidental mistakes during maintenance windows.
## Measurable Success Criteria
1. **Distribution Compatibility**: 100% automated detection and update execution across the three primary families: Debian/Ubuntu, RHEL/Fedora/Rocky/Alma/CentOS, and Arch Linux.
2. **Pre-flight Health Safety**: Zero updates allowed to begin if `/boot` has less than 250 MB free, `/var` has less than 1 GB free, or available RAM is below 300 MB without successful remediation.
3. **Auto-Remediation Success**: Automatically recovers from low `/var` cache space and dead package manager lockfiles in 100% of detected safe cases before aborting.
4. **Zero External Dependencies**: Operates entirely using the standard runtime available out-of-the-box on clean Linux installs without requiring external package installations.
5. **Operational Modes**: Flawlessly supports both fully unattended automation (CLI flags or configuration file without blocking prompts) and an interactive review mode with clear progress and post-update reboot notices.
6. **Selective Package Updates**: Allows updating either the full system or an explicit subset of packages via `--packages`.
7. **Targeted Release Upgrade**: Supports upgrading to a specific target OS release version via `--target-release` on supported platforms (Debian, Ubuntu, RHEL/Fedora).
## Announcement / User Story
Linux System Updater is a single, bulletproof CLI tool designed to safely inspect, heal, and update your Linux systems. Before changing a single package, it verifies your system health—ensuring sufficient `/boot` and `/var` storage, checking memory headroom, and clearing stale locks. It supports both routine package maintenance and major operating system version upgrades across Debian, RHEL, and Arch families. Whether run interactively during maintenance or silently via automation timers, it guarantees your systems update safely with clear reporting and reboot notifications.
## UI Screens & Mockups
No UI (CLI-only tool). The terminal interface provides structured textual diagnostics, clear pre-flight check tables, interactive confirmation prompts, and unattended execution modes.