WIP: Manage packages through PackageKit over D-Bus #3
Loading…
Reference in a new issue
No description provided.
Delete branch "plan/apt-management"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a package-management surface to gilfoyle, backed by PackageKit
(
org.freedesktop.PackageKit) over in-process D-Bus — the same mechanism already usedfor systemd. PackageKit is addressed over a channel gilfoyle already uses, so this adds
no privileged binary, no
std::process::Commandand nounsafe, and polkit staysthe authority.
The hard constraint is respected: gilfoyle never installs or removes a package.
Tools
list_packagesname_contains?,limit?list_updatesmin_severity?,limit?preview_upgraderefresh_package_cacheforce?(defaulttrue)apt updateupgrade_packagesapt upgradeNever install, never remove — by construction
RefreshandUpgrade; thereis no
Install/Removevariant, so[packagekit] allow = ["install"]fails theconfig load.
UpdatePackagesalways carriesONLY_TRUSTED;PURGE,ALLOW_REINSTALLandALLOW_DOWNGRADEare never set.upgrade_packagesruns a SIMULATE transaction first (PackageKit authorises itwithout polkit). If the plan would install, remove, obsolete or downgrade a package it
is refused, unless the operator sets
allow_transitive_changes = true.gilfoyle never answers
InstallSignatureorAcceptEula.actions for the gilfoyle user.
Configuration
Authority stays out of process:
gilfoyle packagekit polkit-rulerenders a rule for/etc/polkit-1/rules.d/49-gilfoyle-packagekit.rules(same shape as the systemd rule),and gilfoyle warns at startup when it is missing or out of sync.
Crates
gilfoyle-core: package domain types, the closed operation vocabulary, thePackageManager/PackageAdminports, a pure transaction collector, andPackageService(allowlist + transitive-change gate).gilfoyle-packagekit(new): zbus adapter for the PackageKit 1.x dialect, signal-driventransactions on a single stream, bus-name detection,
LazyPackagekit.gilfoyle-server: the five MCP tools,[packagekit]config and the polkit rule.Dialect
Released PackageKit (1.2–1.4) uses
org.freedesktop.PackageKitand the classicenumeration values; the unreleased 2.x renamed the bus and re-ordered the enums (they
are sent as
1 << indexbitfields). Gilfoyle decodes signals by member name (so both thesingular
Packageand batchedPackagesshapes work) but targets the 1.x wire values andrefuses 2.x with a clear error rather than mis-decoding. See ADR 0007.
Tests
plan/apply/refresh, untrusted, error codes, failed exit, timeout→Cancel, missing
authorisation and unsupported version.
package_id.cargo fmt --check,cargo clippy -D warningsandcargo test --workspacepass locally.The 100% mutation gate passes (
cargo-mutants: 362 caught / 138 unviable / 0 missed), and the fuzzers ran clean (20 000 runs per target).Notes / trade-offs
minimal host the package tools report a clear "PackageKit is unavailable" error. This
trades a binary we would control for a daemon we do not.
0005-packagekit-over-dbus,0006-no-install-by-constructionand0007-packagekit-bus-negotiation.Pull request closed