system/DBUS-AUDIT.md

15 KiB

D-Bus source audit and Managed Overlay completion

Scope: current working sources, not the published image. Reference surface: ../contracts/dbus/org.archipelago.System1.xml. This is a source audit, not runtime introspection or Polkit/VM acceptance. No method below has newly acquired runtime acceptance through this audit. PackageKit is excluded by D-095.

Method coverage

Present means an exported handler and the indicated backend exist. It does not mean the full scenario has passed. Manager handlers are in src/service/mod.rs, transaction handlers in transactions.rs, other interfaces in their named files.

Interface / method Source implementation / execution path Assessment
Manager.GetCapabilities Manager advertises durable-transactions, kernel-arguments, host-extensions, host-extensions-v1, local-package-import-v1 Present; managed-overlays-v1 and packagekit-broker-v1 stay unadvertised
Manager.GetStatus observation snapshot + transaction projection Present
Manager.Refresh Runtime worker → updates::managed Present
Manager.GetUpdateDetails plan_operation → managed::prepare, details-only Present
Manager.PrepareUpdate plan_operation → managed::prepare Present; general overlay reapplication unfinished
Manager.Download execute_operation → dispatch by plan intent Present for update/extensions; overlay executor missing
Manager.Stage same dispatch; plan-derived authorization Present for update/extensions; overlay executor missing
Manager.GetTransaction runtime exposes retained operation Present
Manager.ListTransactions journal pagination Present
Manager.ValidatePending observed pending deployment identity Present; not a replacement for boot acceptance
Transaction.Cancel initiator-aware authorization → journal cancellation Present; worker observes cancellation boundaries
Transaction.GetSnapshot durable record → wire snapshot Present
Transaction.GetLog ReadLogs authorization + bounded journal log Present
HostExtensions.GetState context-bound package catalog projection Present
HostExtensions.Search filtered catalog + bound pagination Present
HostExtensions.Resolve names/context → exact catalog entries Present
HostExtensions.GetPackage exact entry/context Present
HostExtensions.GetHistory successful staged generation records Present
HostExtensions.RefreshCatalog worker → packages::refresh_catalog Present
HostExtensions.PrepareEnable worker → packages::prepare_enable Present
HostExtensions.ImportPackage authorized Unix FD import → inputs Present; pacman identity cross-check uses the image DBPath (/usr/lib/archipelago/package-db), never /var/lib/pacman
HostExtensions.PrepareChange typed changes → packages::prepare_change Present
HostExtensions.PrepareRestore retained successful generation → prepare_restore Present
ManagedOverlays.GetState verified catalog state projection Present; requires catalog
ManagedOverlays.ListAvailable catalog filtering/pagination Present
ManagedOverlays.GetOverlay exact catalog identity Present
ManagedOverlays.RefreshCatalog worker → overlays::refresh_catalog Present; producer/profile not deployed
ManagedOverlays.PrepareSet exported handler → Runtime → overlays::prepare_set Source implemented after audit; runtime acceptance pending

Manager StatusRevision, HostExtensions/ManagedOverlays Revision, Transaction properties and Finished are declared in source. ObjectManager registers the three main objects and retained transaction exposure. PropertiesChanged emission exists for the revisions. Actual signatures, signal timing, owner loss/reconnect and permission behavior must be checked against runtime introspection in the pipeline.

End-to-end client coverage

  • src/service/client.rs: CLI status, update check/diff/plan/download/apply, transaction list/status/log/wait/cancel, extension status/import/add/remove, local/override/reset, enable/disable/history/restore call the typed service. extension add accepts repository names, local archive paths and mixed requests: each archive is imported through ImportPackage first, then one PrepareChange/Stage applies the whole set. A path is recognised by ./, ../, /, ~/ or a package suffix; --file PATH is the explicit form and an unrecognised option fails instead of being treated as a name.
  • ManagedOverlays CLI now has a separate proxy: status/list, add ID EXACT_COMMIT, remove ID, order ALL_IDS and clear. Mutations fetch state/context, edit the complete selection, invoke PrepareSet and then Manager.Stage. The exact commit chooses the initial authenticated artifact; rebuild-on-update is still missing.
  • integrations/gnome-software/gs-plugin-archipelago.c and integrations/discover/ArchipelagoBackend.cpp implement native OS-update D-Bus flows. These are OS clients, not overlay/package installation frontends.
  • Existing client fixture/compile results do not prove communication with the installed daemon, Polkit subjects, restart recovery or successful staging.

Concrete integration breaks

  1. PrepareSet now exports strict complete-list parsing, context/catalog checks, authenticated input loading, composition/DB-accounting preflight and immutable plan persistence. This is not yet an executable overlay Stage path; ALPM runtime checks, lifecycle/replacement limits and pipeline acceptance remain open.
  2. Manager now dispatches Overlays explicitly to overlays::execute; it validates the retained plan/commit and calls the shared package Download/Stage executor.
  3. PrepareSet now calls compose_tree/finalize, commits private managed output and resolves retained extensions against it. The plan pins this composed target and exact extension closure. Runtime validation of this new path is pending.
  4. Whole-package replacements are explicitly rejected in composer.
  5. Catalog transport expects the configured image remote to contain signed layer and catalog commits. Producer/ref/profile rollout is unfinished.
  6. RefreshCatalog unnecessarily scanned a full base. Removed during this audit; load_base must instead be called by PrepareSet/Stage. Catalog listing must not perform an OS composition preflight. Runtime latency remains unmeasured.
  7. New lifecycle adapters and final package conformance still need completion; inherited ALPM preservation alone does not implement new runtime actions.
  8. PrepareUpdate now invokes declaration rebuild for retained overlays against the verified target base, then prepares exact Host Extension reapplication and uses the overlay executor. This requires the target base's versioned build policy; policy provisioning, build tools/lifecycle coverage and runtime acceptance are still incomplete. Capability remains disabled.

Hardware enablement goal

Update semantics clarified by the user: rebuild selected declarations into new Managed Overlay commits against the new common snapshot, then reapply Host Extensions. Compatible prepublished layer commits are not a prerequisite for an update. Source manifests/inputs are intentions; commit/lock identities describe one resolved build. A generic YAML-overlay builder is still missing from builder; the existing private Core/GNOME/KDE scripts do not implement this lifecycle.

The user's target is a reusable foundation for NVIDIA and other proprietary hardware support. Current architecture models hardware adaptation as Managed Overlays plus profiles selecting them; this audit does not introduce a fourth LayerKind or declare a new architecture decision.

Required before claiming hardware readiness:

  • Finish the generic complete-list PrepareSet → inspectable plan → Stage path, including remove/reorder, update reapplication and rollback retention.
  • Implement verified kernel binding: package archive identity, exact release and ABI evidence. artifact::validate_compatibility currently rejects every kernel binding. Removing that rejection without an evidence adapter is not a fix.
  • Bind binary modules to the exact kernel, or execute reviewed DKMS inputs in isolated staging; depmod precedes initramfs generation. Required failures abort.
  • Carry firmware, userspace libraries and vendor configuration through ordinary indexed package/file ownership. Version conflicts and file replacements remain explicit; NVIDIA graphics/multilib integration needs profile-specific checks.
  • Validate runtime units/tmpfiles/sysusers declarations and their target lifecycle; installation must not mutate live /usr or silently reset administrator settings.
  • Demonstrate atomic kernel+driver updates and failure preservation in the normal pipeline. GPU behavior additionally needs relevant hardware or passthrough evidence; a generic UEFI VM cannot prove NVIDIA acceleration.
  • Secure Boot/module signing is outside the currently selected non-Secure-Boot profile; do not advertise that support without its own implemented contract.

Execution order after this audit

Run 20261109T034026Z successfully staged nano; the next mc/htop preparation terminated the service while encoding a transaction snapshot. before was forced to a string array even for nonempty package records, also preventing journal replay. Wire conversion now distinguishes populated package-record arrays from overlay ordering strings; a regression test covers both signatures and mixed-array rejection. Runtime and Rust-test confirmation await the next normal pipeline. No publication.

Run 20261109T014200Z passed local package DB validation and initramfs generation. Ownership validation rejected base /usr/bin/write (GID 5): the service checkout had not run systemd-sysusers, unlike the legacy download path. Service install now runs the same base sysusers initialization inside the isolated checkout before install/validation. Host-versus-staging identity checks remain mandatory and factory account files are restored before commit as before. Normal-pipeline confirmation is pending; no release was published by this run.

Run 20261108T225854Z passed JSON download and exact nano installation in the private checkout. Validation then failed because pacman -Dk initialized the runtime DownloadUser=alpm from pacman.conf, absent in this checkout. Post-install local DB reason updates, consistency checks and inventory now use --config /dev/null with explicit /usr/lib/archipelago/package-db, matching builder queries. Repository download/signature checks remain in the package adapter. Confirmation of validation/finalization and installed activation awaits the next normal run.

Run 20261108T202529Z passed adapter builds and reached package download in Core Stage, past the previous lock failure. The package command exited successfully but its output failed JSON decoding. nspawn defaults to a read-only PTY for nonterminal callers, multiplexing stderr (including download-mode pacman-key diagnostics) into stdout. The package adapter now explicitly uses --console=pipe to preserve its JSON stdout channel. Runtime confirmation awaits the next normal pipeline. Failure diagnostics were collected, but their completion marker contained CRCRLF; the probe now accepts repeated CR before LF rather than timing out after collection.

Run 20261108T173013Z passed catalog signature checks, extension enable and nano resolution. Stage then failed acquiring the compose lock. The read-only observer also owns that lock for up to 10s plus 2s termination; mutation previously tried only once. Mutation lock acquisition now waits at most 15s on contention; other lock errors fail immediately, and external writers still exclude mutation. Added contention/release and bounded-failure tests to the normal Rust test stage. Runtime confirmation remains pending. Core failure diagnostics also renew sudo credentials before fetching logs, since a long operation can expire the timestamp.

Retry 20261108T050444Z reused the completed images in the normal pipeline and captured authorized transaction logs. Catalog failure is in systemd-nspawn (exit 1), but the worker retained only stderr; container console output on stdout was lost. Failed workers now retain the bounded tail of both streams in private GetLog diagnostics. This is a diagnostic fix; the catalog failure itself remains unresolved until the next pipeline provides its guest error.

Run 20261108T000830Z built all three ISO variants and passed Core installation, boot, provisioning and login. Installed self-check failed on mtimes of the two new package symlinks: OSTree does not retain their mtimes. CLI self-check now captures strict pacman diagnostics in C locale and accepts only mtime warnings for the two known aliases on an OSTree-booted host, independently verifying their targets/type/root ownership/mode. Every other diagnostic remains fatal. The package mtree and signatures are unchanged. Next normal pipeline must verify this deployment-specific adaptation; no release was published by the failed run.

Normal run 20261107T230815Z passed Rust and filesystem checks and both Flatpak refreshes, then failed in the native GNOME fixture teardown: it skipped GNOME Software 51's required gs_plugin_shutdown_async() before unref, leaving an updates-changed source pending. The fixture now awaits shutdown and checks its result before disposal. All update/download/stage/error assertions remain; verification is pending the next normal release run. Failure evidence is archived on terra under that run's failure-evidence/ directory; nothing was published.

Compatibility requirement: existing installations must update through their current signed image track without first acquiring new overlay metadata/policy. Refresh/update age comparisons now use the retained clean upstream identity for local overlay compositions; hosts without overlay metadata keep their old path. Clean bases are signature-verified and retained in the sysroot repository. The pipeline still needs an old-published-image → new-candidate upgrade scenario; source fixtures and clean-install VM results cannot establish this transition.

  1. Finish generic composition/lifecycle/replacement prerequisites needed by the PrepareSet plan, with bounded inputs and indexed lookups.
  2. Implement exported PrepareSet and immutable context-bound plans, then explicit Overlays execution dispatch, commit/stage and extension reapplication.
  3. Complete CLI/catalog producer/profile and migrate normal acceptance scenarios.
  4. Close kernel ABI/module adapters against the hardware goal; retain explicit unsupported errors until they have real evidence.
  5. Run normal source/VM checks and publication workflow; record source SHAs, signatures, installed behavior and remaining hardware evidence separately.