Add OpenSpec for declpac CLI tool

- OpenSpec for declarative pacman package management
- stdin and --state file inputs with merging
- Full system upgrades, transitive deps, orphan cleanup
- AUR support with pacman/makepkg fallback
- Machine-readable output for scripting
This commit is contained in:
AI Bot
2026-04-13 15:42:35 +02:00
committed by Riyyi
parent cb3936c42a
commit 6699c62d9e
14 changed files with 443 additions and 1 deletions
@@ -0,0 +1,29 @@
## ADDED Requirements
### Requirement: Can mark non-state packages as non-explicit
The system SHALL mark all packages not declared in the state as non-explicit
(dependencies) before syncing, so they can be safely removed later.
#### Scenario: Mark packages as non-explicit
- **WHEN** packages are declared in state
- **THEN** system shall mark those packages as explicitly installed via pacman -D --explicit
- **AND** mark all other installed packages as non-explicit
### Requirement: Can clean up orphaned packages
After syncing, the system SHALL remove packages that are no longer required
(as dependencies of removed packages).
#### Scenario: Orphan cleanup after sync
- **WHEN** sync operation completes successfully
- **THEN** system shall run pacman -Rsu to remove unneeded dependencies
- **AND** report the number of packages removed
#### Scenario: Orphan cleanup respects explicitly installed
- **WHEN** a package not in state is marked as explicitly installed by user
- **THEN** system shall NOT remove it during orphan cleanup
#### Scenario: No orphans to clean
- **WHEN** there are no orphaned packages to remove
- **THEN** system shall report "No packages to remove" in output