system/SERVICE.md

106 lines
6.8 KiB
Markdown

# archipelagod implementation checkpoint
2026-11-07. D-092/D-093 are accepted; the full service migration is in progress.
**D-095 supersedes the PackageKit work below:** the backend, broker and store
adaptations have been removed. Host Extension package installation is through
the CLI/direct typed daemon API. Stock Arch Software/Discover retain native
Archipelago OS D-Bus plugins and Flatpak/fwupd; no PackageKit dependency is shipped.
The older PackageKit build notes below are historical evidence only.
## Current integration work (not yet accepted or published)
The read-only foundation below describes the last published source slice. The
working tree now adds durable asynchronous mutations, worker supervision,
original-subject PackageKit delegation, FD imports, extension planning and native
D-Bus clients. Installed-host CLI dispatch uses the service; unsupported workflows
fail without falling back to direct mutation. General Managed Overlay execution
and the corresponding capability/acceptance migration remain unfinished.
The PackageKit backend is built with pinned upstream 1.4.0 and a narrowly scoped
Sender/transaction-path handoff. Simulation consumes the daemon's added/removed
inventory diff. Additional removals require `allow_deps`; recomposition retains
the surviving explicit requests and never uses autoremove as permission to remove
managed packages. GNOME's pending adaptation queries HostExtensions GetState and
Resolve asynchronously rather than interpreting opaque PackageKit ID data.
Native GNOME and Discover OS clients observe retained transactions through D-Bus.
Legacy software-helper and its broad Polkit policy are no longer packaged in the
Desktop assets. Latest native/Rust compilation and normal-pipeline runtime
acceptance are pending; no new release has been started. See the workspace
`IMPLEMENTATION-PLAN-DBUS.md` for current build handles and remaining work.
## Previously published foundation
- Thin `cli/src/bin/archipelagod.rs` entrypoint uses the existing system crate.
- System-bus Manager, Properties, Introspectable and ObjectManager. Only
GetCapabilities/GetStatus are advertised. Other Manager calls explicitly return
`org.archipelago.System1.Error.Unsupported`, without spawning a CLI or admitting
work. Extension/overlay/broker features are absent.
- Local OSTree observation on a worker outside the D-Bus executor. It takes the
existing `/run/archipelago-compose.lock` nonblocking, reads with a 10-second
command deadline, retains cached state with `reconciling=true` on failure and
emits StatusRevision after durable publication. Deployment IDs include serial;
unknown base/Purpose/snapshot/support fields are omitted. No mirror request.
- Private `/var/lib/archipelago/service/observation.json` contains versioned local
observations, not update intent or a second operation authority. Revisions
survive restart; unsupported schema stops startup without resetting it.
- Admission journal foundation: private bounded records, lifetime ownership lock,
UID/method/request-ID/canonical-input binding, reconnect deduplication, explicit
transitions, file+directory fsync, immutable terminal records and fail-closed
unknown schemas/durability errors. Surviving active work blocks new admission
until engine reconciliation. No auto-replay, guessed success or automatic GC.
- Async Polkit helper derives UID/unique sender from the bus, requires both
interactive flags and uses a service-selected action. PackageKit's current
owner is rejected from direct authorization: broker verification is still needed.
Cancellation-own checks compare authenticated UID to the retained initiator in
the service, not a caller option or an undocumented Polkit subject field.
- Unit, activation, bus policy, separate Polkit actions/rules are provided under
`integrations/dbus/`. They are **not installed by the image builder yet**.
- `updates::prepare` returns its result instead of formatting it internally;
current CLI wrappers preserve output. Exact-target callers cannot silently
follow a moved track. This legacy engine adapter is not yet admitted by D-Bus.
- Explicit development CLI: `archipelago service capabilities|status`. Ordinary
installed-host commands retain their existing path until coordinated migration.
## Dependency and compilation
Use pure-Rust zbus **5.12.0**, async-io executor and blocking client wrapper; no
new libdbus/GIO link dependency in the core Rust binary. Existing engine work is
blocking and stays outside the bus executor. Pin `zbus_macros=5.12.0` as well:
the initial resolver selected macros 5.19 against zbus 5.12, producing a private
DispatchResult2 API mismatch. Matching versions compile on the existing Rust 1.90
tools image. CLI/system lockfiles retain exact checksums for transitive crates.
Build preparation uses yabloko `/opt/archipelago/dbus-next/`, separate from frozen
release sources and the regular target directory. Rust release compilation and
compilation of the contract/system test executables have been checked there.
Tests are wired into the regular release-cycle compile stage; no separate VM or
standalone test run has been executed for this slice. Native proxy compilation,
activation, real bus calls and Polkit session behavior still need pipeline evidence.
## Next integration boundary
Do not install this read-only slice as a completed installed-host replacement.
Still required: typed execution/progress/results; one migrated legacy plan/operation
authority; durable terminal results and recovery against OSTree/boot state; bounded
worker admission and cache; fast refresh; exact plan Download/Stage; safe Cancel;
owned workers; full CLI routing and native GUI migration; measured limits; real
Host Extension/overlay/broker implementation and acceptance. Local-package trust
and future host method schemas remain governed by their RFC contracts.
The service observer's output does not claim that a legacy update job is a durable
service transaction. The new journal is not connected to the mutation engine yet
and must not be used as an independent second writer. Keep old records/inputs for
migration. Feature policy and package plans must derive their required actions on
the service side; an eventual Stage handler must never select `stage-update` solely
because of its method name. Read-only compilation is not rollout or VM acceptance.
Future packaging destinations: binary `/usr/bin/archipelagod`, unit
`/usr/lib/systemd/system/archipelagod.service`, bus activation
`/usr/share/dbus-1/system-services/`, bus policy `/usr/share/dbus-1/system.d/`,
Polkit action XML `/usr/share/polkit-1/actions/`, rules
`/usr/share/polkit-1/rules.d/`. Keep `KillMode=control-group`; sandbox changes require
real compose/mount acceptance. No service enablement or timer change is needed for
bus activation. Both native clients must transition together before old helpers
and their broad action are removed.