2.9 KiB
2.9 KiB
Vertical Slice Plan: linux-system-updater
-
Slice 1 (Tracer Bullet): Minimal end-to-end wire.
- Creates basic package layout
linux_updater/(__init__.py,__main__.py,models.py,cli.py,core/detector.py, stubmanagers/base.py). - Implements distro detection from
/etc/os-releaseand basic CLI dispatch. - Runs and verifies immediately via
python3 -m linux_updater --helpand initial test suite (test_detector.py).
- Creates basic package layout
-
Slice 2 (Pre-flight Health & Auto-Remediation):
- Implements
core/health.py: disk space checks (/boot,/var,/), active/stale lock detection (/proc/locks&fcntl), memory/OOM warnings, and AC power status. - Implements
core/remediation.py: safe cache cleanup and stale lock removal. - Fully verified via unit test suite (
test_health.pyandtest_remediation.py).
- Implements
-
Slice 3 (Package Managers & Routine Updates):
- Implements
core/runner.pyfor subprocess execution (Python 3.6+ compatible). - Implements
AptManager(Debian/Ubuntu),DnfManager(RHEL 8/9/Fedora/Rocky), andPacmanManager(Arch Linux). - Implements repo refresh, update simulation/parsing, full or selective package installation (
--packages), autoremove, and reboot required checks. - Integrates interactive prompt and
--yes/--non-interactivemode. - Verified via
test_managers.pyagainst mock outputs.
- Implements
-
Slice 4 (Major Release Upgrade & Configuration Engine):
- Implements
release-upgradesubcommand with distro-specific drivers (do-release-upgrade,dnf system-upgrade, Arch rolling notice) and--target-releaseflag. - Implements
config.pyloading/etc/linux-updater.jsonwith CLI flag overrides. - Implements structured
--jsonoutput and strict exit codes (0clean,1error,2reboot required,3user abort). - Verified via
test_cli.py.
- Implements
-
Slice 5 (Packaging & Distribution - .tar.gz, .deb, .rpm):
- Implements
packaging/build_packages.pyin pure Python standard library. - Adds Debian packaging templates (
control.template) and RPM spec (linux-updater.spec). - Adds standalone tarball builder with
install.sh. - Integrates installation of man page and default configuration into package trees.
- Verified via
test_packaging.pygenerating valid archive artifacts.
- Implements
-
Slice 6 (Documentation & MAN Pages):
- Implements
man/linux-updater.8(standard Section 8 troff/groff manual page for system administrators). - Implements
README.md(project overview, feature matrix, installation quickstart, and basic usage). - Implements
docs/user-guide.md(end-user manual: interactive CLI workflow, options, interpreting outputs). - Implements
docs/admin-guide.md(system administration guide: cron/systemd automation, JSON config, pre-flight tuning). - Implements
docs/developer-guide.md(developer manual: architecture, adding new package managers, running tests and packaging).
- Implements