|
|
|
|
@ -0,0 +1,469 @@
|
|
|
|
|
# RFC-0013: archipelagod, Host Extensions, Managed Overlays and PackageKit
|
|
|
|
|
|
|
|
|
|
- **Status:** Accepted — D-093, explicit user approval 2026-11-07
|
|
|
|
|
- **Version:** 1.0 contract; implementation pending
|
|
|
|
|
- **Scope:** Installed-host D-Bus control and PackageKit Host Extension adapter
|
|
|
|
|
- **Extends:** RFC-0012 / D-092; refines RFC-0001, RFC-0002, RFC-0004 and RFC-0009
|
|
|
|
|
|
|
|
|
|
## 1. Accepted direction
|
|
|
|
|
|
|
|
|
|
`archipelagod` is the installed-system authority for Archipelago operations.
|
|
|
|
|
The `archipelago` CLI, native OS-update plugins, PackageKit adapter and future
|
|
|
|
|
host-management UIs are clients of its typed system D-Bus interfaces. The daemon
|
|
|
|
|
owns checked plans, execution, cache, durable transactions, locks and reconciliation.
|
|
|
|
|
It delegates storage/deployment to OSTree and package execution to the existing
|
|
|
|
|
isolated composition engine. No frontend invokes live-host pacman or gains an
|
|
|
|
|
independent deployment writer.
|
|
|
|
|
|
|
|
|
|
Host Extensions can be installed/removed through **PackageKit**, whose Archipelago
|
|
|
|
|
backend calls archipelagod over D-Bus. Managed Overlays use a separate typed D-Bus
|
|
|
|
|
interface, also used by the CLI; they are not represented as fake packages.
|
|
|
|
|
OS image updates remain in the native GNOME Software/Discover Archipelago plugins.
|
|
|
|
|
Flatpak/fwupd continue to use their own backends.
|
|
|
|
|
|
|
|
|
|
This is an accepted implementation contract, not a claim that a daemon, PackageKit
|
|
|
|
|
backend or general overlay engine is already implemented. Frozen API semantics
|
|
|
|
|
cannot be advertised until their engine and acceptance paths actually work.
|
|
|
|
|
|
|
|
|
|
## 2. Executable, service and CLI scope
|
|
|
|
|
|
|
|
|
|
Canonical service entrypoint: `/usr/bin/archipelagod`; systemd unit:
|
|
|
|
|
`archipelagod.service`, `Type=dbus`, `BusName=org.archipelago.System1`.
|
|
|
|
|
Keep the D-092 bus name, object paths and existing method signatures stable.
|
|
|
|
|
The old planned `archipelago-daemon.service` may be an alias, never a second unit
|
|
|
|
|
starting another daemon. `archipelago daemon` may remain a compatibility/internal
|
|
|
|
|
alias to the same service mode. D-Bus activation targets the canonical unit.
|
|
|
|
|
|
|
|
|
|
`archipelago` remains the unified user CLI. `archipelagod` is a service entrypoint
|
|
|
|
|
from the same Rust workspace/shared modules, not a forked package/composition
|
|
|
|
|
implementation. Packaging may use a thin second executable target or an alias
|
|
|
|
|
with explicit service-mode dispatch; neither duplicates business logic. D-093
|
|
|
|
|
refines the earlier single-executable packaging assumption to allow this named
|
|
|
|
|
daemon while retaining a single CLI and one transaction engine.
|
|
|
|
|
|
|
|
|
|
**All installed-host management commands** route through the daemon: status/diff,
|
|
|
|
|
updates, extensions/overrides/history, overlays, Purpose/rebase, deployments and
|
|
|
|
|
host accounts when their methods are implemented. Local `help`, binary `version`,
|
|
|
|
|
manifest editing and offline validation need no RPC. Builder, registry publishing,
|
|
|
|
|
live installation and explicitly offline maintenance remain direct contexts under
|
|
|
|
|
their existing privilege/lock contracts. This does not turn D-Bus into a remote
|
|
|
|
|
builder protocol. Installed-host root invocation uses the same daemon and locks;
|
|
|
|
|
it is not an implicit direct-mode escape hatch.
|
|
|
|
|
|
|
|
|
|
Unavailable host methods return Unsupported. No generic `Execute(argv)` or shell
|
|
|
|
|
RPC is introduced to pretend that the entire CLI is implemented. Additional
|
|
|
|
|
Purpose/account/rebase method schemas require an explicit additive contract before
|
|
|
|
|
advertisement; their routing through archipelagod is settled here.
|
|
|
|
|
|
|
|
|
|
## 3. Shared plans and transaction model
|
|
|
|
|
|
|
|
|
|
Use RFC-0012's Manager and Transaction, durable operation IDs, request-ID retries,
|
|
|
|
|
GetSnapshot, progress, error names, cancellation boundaries and restart recovery.
|
|
|
|
|
Additive capabilities: `host-extensions-v1`, `managed-overlays-v1`,
|
|
|
|
|
`local-package-import-v1`, `packagekit-broker-v1`. Report each only when implemented.
|
|
|
|
|
The Manager minor version increases; major remains 1.
|
|
|
|
|
|
|
|
|
|
Extend immutable plans with `kind`, `required_actions`, authenticated initiator,
|
|
|
|
|
exact managed base/layer commits, shared snapshot, booted/pending identities,
|
|
|
|
|
desired-state generation, requested-vs-resolved packages, package/source checksums,
|
|
|
|
|
overlay order, bounded replacement permissions and expected support transition.
|
|
|
|
|
Expose an inspectable sanitized diff and all removals/replacements before staging.
|
|
|
|
|
|
|
|
|
|
Additive transaction kinds are `extension-enable`, `package-import`,
|
|
|
|
|
`extension-change`, `extension-restore`, `overlay-change`, `package-catalog-refresh`
|
|
|
|
|
and `overlay-catalog-refresh`. Planning success retains RFC-0012's `planned`
|
|
|
|
|
outcome with plan ID; import success uses `imported` with `input_id: s`,
|
|
|
|
|
`checksum: s`, `size_bytes: t` and sanitized package identity; catalog refresh uses
|
|
|
|
|
`catalog-ready` with context/revision. These outcomes do not claim staged effects.
|
|
|
|
|
Payload-changing Stage results use the existing `staged`/`no-change` outcomes and
|
|
|
|
|
exact deployment identity. An enable/disable-only plan records the feature policy
|
|
|
|
|
as `configured`, with `changed: b`, without fabricating a new deployment or changing
|
|
|
|
|
booted support status. Advertise additive kinds/outcomes with the corresponding v1.1 features
|
|
|
|
|
so older clients do not misinterpret an unfamiliar result as an OS update.
|
|
|
|
|
|
|
|
|
|
`Manager.Download` and `Manager.Stage` accept supported **service-owned plan kinds**,
|
|
|
|
|
not just OS-update plans. Their signatures stay unchanged. Authorization is derived
|
|
|
|
|
from stored plan contents and required actions; the method name `Stage` never
|
|
|
|
|
implies passwordless `stage-update` for arbitrary plans. Reject client-supplied
|
|
|
|
|
action names or attempts to relabel an extension/overlay plan as an OS update.
|
|
|
|
|
Require request IDs and retain the RFC-0012 deduplication/reconciliation guarantees.
|
|
|
|
|
|
|
|
|
|
Planning is side-effect-free with respect to desired state/deployments. Importing
|
|
|
|
|
local bytes may persist a bounded protected input, but does not enable/apply it.
|
|
|
|
|
Successful payload staging commits the new generation and selects it for next boot
|
|
|
|
|
under D-077; a feature-policy-only change does not change boot selection.
|
|
|
|
|
Failures keep the previous generation, pending deployment and boot selection
|
|
|
|
|
unless a real committed effect is reconciled and explicitly reported. Never remove
|
|
|
|
|
persistent application/user data or historical extension inputs as part of removal.
|
|
|
|
|
|
|
|
|
|
New requests can accumulate against an Archipelago-owned pending generation under
|
|
|
|
|
RFC-0009; all clients must select the same explicit context and expected generation.
|
|
|
|
|
An unrelated pending deployment cannot be silently replaced. Query responses carry
|
|
|
|
|
`context_id: s`, an opaque service-generated binding of selected base/snapshot and
|
|
|
|
|
effective intent generation. Every Prepare call below requires it; drift is PlanStale.
|
|
|
|
|
The frontend displays whether changes target the booted base or an existing pending
|
|
|
|
|
generation. Replanning after drift requires a new review/request, not silent retarget.
|
|
|
|
|
|
|
|
|
|
## 4. Host Extension interface
|
|
|
|
|
|
|
|
|
|
Object `/org/archipelago/System1/HostExtensions`, interface
|
|
|
|
|
`org.archipelago.System1.HostExtensions`. Expose through ObjectManager.
|
|
|
|
|
Read-only `Revision: t`; emit PropertiesChanged when effective/requested state changes.
|
|
|
|
|
|
|
|
|
|
| Method | Inputs | Outputs |
|
|
|
|
|
|---|---|---|
|
|
|
|
|
| `GetState` | — | `a{sv} state` |
|
|
|
|
|
| `Search` | `s query, as filters, s cursor, u limit` | `aa{sv} packages, s next_cursor, s context_id` |
|
|
|
|
|
| `Resolve` | `as names, s context_id` | `aa{sv} packages` |
|
|
|
|
|
| `GetPackage` | `s package_id, s context_id` | `a{sv} package` |
|
|
|
|
|
| `GetHistory` | `s cursor, u limit` | `aa{sv} generations, s next_cursor` |
|
|
|
|
|
| `PrepareEnable` | `b enabled, s context_id, a{sv} options` | `o transaction` |
|
|
|
|
|
| `ImportPackage` | `h fd, a{sv} options` | `o transaction` |
|
|
|
|
|
| `PrepareChange` | `aa{sv} requests, s context_id, a{sv} options` | `o transaction` |
|
|
|
|
|
| `PrepareRestore` | `s generation_id, s context_id, a{sv} options` | `o transaction` |
|
|
|
|
|
|
|
|
|
|
Options use RFC-0012 `interactive`, `offline`, `request_id` where applicable;
|
|
|
|
|
ImportPackage also requires a request ID. Enable/disable, request changes, overrides
|
|
|
|
|
and restore each yield a plan consumed through Manager.Stage. Disable fails while
|
|
|
|
|
requests remain; it is not a hidden remove-all. Read methods are bounded and use
|
|
|
|
|
the local base-bound catalog. Missing catalog yields Unavailable; a separate
|
|
|
|
|
`RefreshCatalog(a{sv} options) -> o transaction` fetches/verifies the selected base's
|
|
|
|
|
snapshot catalogs with the same bounded/coalesced read-only lifecycle.
|
|
|
|
|
|
|
|
|
|
### 4.1 Package state and identity
|
|
|
|
|
|
|
|
|
|
GetState provides `context_id`, `enabled: b`, `booted`, `pending`, `desired` maps,
|
|
|
|
|
and separately `requested: aa{sv}` and `resolved: aa{sv}`. Each includes selected
|
|
|
|
|
base/snapshot and support provenance. No global mutable package DB is authoritative
|
|
|
|
|
for all deployments. Queries distinguish `managed`, `extension-explicit`,
|
|
|
|
|
`extension-dependency` and `available` ownership/state. Managed packages can be
|
|
|
|
|
inspected but cannot be removed through Host Extension package removal.
|
|
|
|
|
|
|
|
|
|
Package descriptors contain `package_id: s` (opaque), `name: s`, `version: s`,
|
|
|
|
|
`architecture: s`, `source: s` (`repository`, `local`, `unknown`), `repository: s`
|
|
|
|
|
when applicable, `snapshot_id: s`, `checksum: s`, `owner: s`,
|
|
|
|
|
`booted: b`, `pending: b`, `explicit: b`, and a sanitized summary.
|
|
|
|
|
Package IDs bind exact identity, source and context; filenames/names alone do not.
|
|
|
|
|
Unknown legacy provenance remains unknown. Repository additions preserve supported
|
|
|
|
|
status only on a verified supported composition and retain D-088's `customed`
|
|
|
|
|
annotation; local files/overrides/custom overlays do not acquire that guarantee.
|
|
|
|
|
|
|
|
|
|
### 4.2 Requested mutations
|
|
|
|
|
|
|
|
|
|
PrepareChange accepts a bounded array of discriminated request maps:
|
|
|
|
|
|
|
|
|
|
- `op=add-repository`, `package_id: s` from the selected snapshot catalog;
|
|
|
|
|
- `op=add-local`, `input_id: s` from a successful ImportPackage;
|
|
|
|
|
- `op=remove`, `request_id: s` identifying an explicit extension request;
|
|
|
|
|
- `op=override-repository`, `package_id: s`, `replaces: s`, `reason: s`;
|
|
|
|
|
- `op=override-local`, `input_id: s`, `replaces: s`, `reason: s`;
|
|
|
|
|
- `op=reset-override`, `request_id: s` identifying the override being reset.
|
|
|
|
|
|
|
|
|
|
`request_id` inside these request maps identifies durable extension intent, not the
|
|
|
|
|
options' transaction retry token. Unknown discriminants/keys fail validation.
|
|
|
|
|
Unsupported search filters fail explicitly. The v1 filter vocabulary is `installed`,
|
|
|
|
|
`available`, `managed`, `extension-explicit`, `extension-dependency`, `repository`,
|
|
|
|
|
`local`; `installed` refers to booted state. Contradictory state/source filters are
|
|
|
|
|
InvalidArgument. Search cursors bind catalog/context and filter/query identity;
|
|
|
|
|
do not continue a page stream against a different snapshot after a base change.
|
|
|
|
|
Dependencies are resolved by the daemon from the selected base snapshot. An addition
|
|
|
|
|
that needs replacement reports Conflict; it cannot silently become an override.
|
|
|
|
|
Base packages are not removable; reset-override restores the selected managed base's
|
|
|
|
|
package. Removing a dependency still required by surviving requests fails with the
|
|
|
|
|
dependents identified; removing an explicit request rebuilds the remaining closure.
|
|
|
|
|
All changes in one request are atomic and expose exact consequences in the plan.
|
|
|
|
|
|
|
|
|
|
Snapshot retirement/unavailability is an explicit error, not fallback to the live
|
|
|
|
|
Arch mirror. Update recomposes from the new base DB with all retained requests,
|
|
|
|
|
never from stale mutated package DB state. Restore revalidates the recorded inputs
|
|
|
|
|
and base; it does not reinterpret old identities as packages from a newer snapshot.
|
|
|
|
|
|
|
|
|
|
### 4.3 Local package FD import
|
|
|
|
|
|
|
|
|
|
Clients open the file and pass a Unix FD; the daemon does not open arbitrary caller
|
|
|
|
|
paths. Accept only bounded regular-file content, copy into a root-owned retained
|
|
|
|
|
input, hash the **copied bytes**, parse package identity and apply normal trust/input
|
|
|
|
|
validation before issuing `input_id`. An FD is not immutable: concurrent source
|
|
|
|
|
modification must not permit a validated/different-byte TOCTOU. Retained bytes,
|
|
|
|
|
checksum and parsed identity are what planning/execution use. Ignore the supplied
|
|
|
|
|
filename as authority; do not execute scriptlets while inspecting/importing.
|
|
|
|
|
|
|
|
|
|
Enforce import quota/size and request ownership, do not expose private paths in
|
|
|
|
|
public responses, and remove only unreferenced transient partial copies on failure.
|
|
|
|
|
Committed local inputs/history retain their existing explicit-cleanup policy.
|
|
|
|
|
Import never changes the source classification to repository even if name/version
|
|
|
|
|
match. Required local signature/unsigned-input handling follows the configured
|
|
|
|
|
trust contract; PackageKit cannot weaken it by a transaction flag.
|
|
|
|
|
|
|
|
|
|
## 5. Managed Overlay interface
|
|
|
|
|
|
|
|
|
|
Object `/org/archipelago/System1/ManagedOverlays`, interface
|
|
|
|
|
`org.archipelago.System1.ManagedOverlays`, read-only `Revision: t` and normal
|
|
|
|
|
ObjectManager/PropertiesChanged integration.
|
|
|
|
|
|
|
|
|
|
| Method | Inputs | Outputs |
|
|
|
|
|
|---|---|---|
|
|
|
|
|
| `GetState` | — | `a{sv} state` |
|
|
|
|
|
| `ListAvailable` | `s query, s cursor, u limit` | `aa{sv} overlays, s next_cursor, s context_id` |
|
|
|
|
|
| `GetOverlay` | `s overlay_id, s commit` | `a{sv} overlay` |
|
|
|
|
|
| `RefreshCatalog` | `a{sv} options` | `o transaction` |
|
|
|
|
|
| `PrepareSet` | `aa{sv} selection, s context_id, a{sv} options` | `o transaction` |
|
|
|
|
|
|
|
|
|
|
Selection is the **complete ordered desired list**, not an ambiguous delta. Each
|
|
|
|
|
element has `overlay_id: s` (configured registry identity) and `commit: s` (verified
|
|
|
|
|
exact layer commit). No arbitrary URL or client-provided trust key. CLI add/remove/
|
|
|
|
|
order fetches state, edits that list and calls PrepareSet with the original context.
|
|
|
|
|
Concurrent list edits fail PlanStale rather than losing the other caller's change.
|
|
|
|
|
Duplicates are invalid. Empty selection explicitly removes all overlays through
|
|
|
|
|
recomposition. Adding/updating/removing/reordering all produce inspectable plans.
|
|
|
|
|
|
|
|
|
|
State and descriptors expose Core/Purpose identities, snapshot/architecture,
|
|
|
|
|
booted/pending/desired order, required overlays, before/after constraints,
|
|
|
|
|
incompatibilities, packages and bounded file-operation permissions/provenance.
|
|
|
|
|
Metadata must be trusted and verified against the actual layer commit; finding a
|
|
|
|
|
name in a catalog is not sufficient authorization to execute arbitrary content.
|
|
|
|
|
|
|
|
|
|
Preserve D-023/D-025/D-039/D-040/D-054: common snapshot, deterministic package owner,
|
|
|
|
|
no implicit dependency insertion or list reordering, no later-position overwrite
|
|
|
|
|
privilege, expected owners and bounded operations/reasons, symlinks as objects,
|
|
|
|
|
no blanket `replace_lower_layer_files`, no disguised lower-package deletion.
|
|
|
|
|
Missing dependencies, cycles, incompatibility and snapshot mismatch fail before
|
|
|
|
|
payload composition. Removal rebuilds the remaining composition and reassigns
|
|
|
|
|
still-needed dependencies without mutating original layer commits or persistent data.
|
|
|
|
|
Host Extensions are reapplied afterward in full under D-056. Failure cannot silently
|
|
|
|
|
drop an overlay/extension or activate a clean fallback. Custom combinations do not
|
|
|
|
|
become officially supported because their constituent overlays are signed.
|
|
|
|
|
|
|
|
|
|
General overlay composition is required before advertising managed-overlays-v1.
|
|
|
|
|
The existing test-marker prototype is not an implementation of this interface.
|
|
|
|
|
Layer serialization and general release-gate evidence remain their own contracts.
|
|
|
|
|
|
|
|
|
|
## 6. PackageKit integration and role matrix
|
|
|
|
|
|
|
|
|
|
Architecture:
|
|
|
|
|
|
|
|
|
|
```text
|
|
|
|
|
GNOME Software / Discover PackageKit frontend
|
|
|
|
|
-> org.freedesktop.PackageKit (system bus, packagekitd)
|
|
|
|
|
-> Archipelago PackageKit backend
|
|
|
|
|
-> org.archipelago.System1 (system bus, archipelagod)
|
|
|
|
|
-> common plans / isolated package execution / OSTree deployment
|
|
|
|
|
|
|
|
|
|
Native OS plugin and archipelago CLI -> org.archipelago.System1 directly
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Implement a real PackageKit backend against the pinned PackageKit ABI, not a
|
|
|
|
|
replacement masquerading as the standard PackageKit D-Bus service. It translates
|
|
|
|
|
PackageKit package transactions to Host Extension queries/plans/transactions.
|
|
|
|
|
The stock ALPM backend must not be selected on an Archipelago installed host.
|
|
|
|
|
No PackageKit-specific pacman database, alternate resolver or separate state writer.
|
|
|
|
|
|
|
|
|
|
| PackageKit role | Archipelago mapping / boundary |
|
|
|
|
|
|---|---|
|
|
|
|
|
| SearchNames / Resolve / GetDetails / GetPackages | Base-bound catalog and booted package state; ownership clearly identified |
|
|
|
|
|
| RefreshCache | HostExtensions.RefreshCatalog; force does not change snapshot |
|
|
|
|
|
| InstallPackages | PrepareChange add-repository for exact package IDs, then authorized Stage |
|
|
|
|
|
| InstallFiles | Protected local file handoff -> ImportPackage -> PrepareChange add-local -> Stage |
|
|
|
|
|
| RemovePackages | Remove explicit extension intent and recompose surviving closure |
|
|
|
|
|
| Simulation flag | Return the actual daemon plan/diff; no intent/deployment mutation |
|
|
|
|
|
| Download-only flag | Manager.Download of exact plan; never Stage |
|
|
|
|
|
| GetUpdates | No independent package updates from a fixed base snapshot; OS updates belong to the native OS plugin |
|
|
|
|
|
| UpdatePackages / UpgradeSystem / repository mutation / repair | Unsupported in this backend unless a future explicit contract adds them |
|
|
|
|
|
|
|
|
|
|
Advertise only implemented, semantically faithful roles, filters and transaction
|
|
|
|
|
flags. Unsupported flags are rejected, never silently ignored. PackageKit `only
|
|
|
|
|
trusted` must be honored; absence of that flag is not permission to bypass daemon
|
|
|
|
|
trust policy. Preserve untrusted/local provenance. Version selection cannot escape
|
|
|
|
|
the base snapshot. OS-update refresh and PackageKit catalog refresh share cache/
|
|
|
|
|
concurrency coordination but remain different result kinds.
|
|
|
|
|
|
|
|
|
|
PackageKit package IDs keep its `name;version;arch;data` syntax. `data` is a backend
|
|
|
|
|
opaque identifier bound to snapshot/repository/source/context, not an accepted
|
|
|
|
|
filesystem path or URL. Validate each ID by resolving it against daemon-owned
|
|
|
|
|
catalog state; stale/forged IDs fail, never silently resolve to a new version.
|
|
|
|
|
Exact encoding is a versioned backend implementation detail and must be tested
|
|
|
|
|
against PackageKit parsing; frontend state must not depend on parsing it.
|
|
|
|
|
|
|
|
|
|
RemovePackages cannot remove Core/Purpose/overlay-owned packages or dependencies
|
|
|
|
|
still needed by surviving intent. `allow_deps=false` rejects a plan requiring extra
|
|
|
|
|
removals; `allow_deps=true` permits only consequences the daemon plan exposes, not
|
|
|
|
|
permission to remove managed packages or silently drop additional explicit requests.
|
|
|
|
|
Explicitly requested dependents require explicit request selection. `autoremove`
|
|
|
|
|
cannot preserve unrequested orphan dependencies or trigger independent live cleanup:
|
|
|
|
|
the recomposition contract determines the surviving closure. If a flag combination
|
|
|
|
|
requires different semantics, reject it before effects rather than approximating it.
|
|
|
|
|
|
|
|
|
|
Host Extension enablement remains explicit. PackageKit Install may proceed only
|
|
|
|
|
when enabled, or after a frontend explicitly obtains consent and stages a separate
|
|
|
|
|
enable plan. A generic InstallPackages call does not silently enable the feature.
|
|
|
|
|
Frontend integration must make this usable rather than exposing an unexplained
|
|
|
|
|
failure loop. Existing support/provenance disclosures remain accurate under D-088.
|
|
|
|
|
|
|
|
|
|
### 6.1 Staged installation semantics
|
|
|
|
|
|
|
|
|
|
PackageKit completion means that its requested deployment transaction successfully
|
|
|
|
|
**staged**, not that the booted `/usr` changed. Emit its system restart requirement,
|
|
|
|
|
normal terminal result and real phase progress; do not emit a false live-installed
|
|
|
|
|
state. Package queries report actual booted installed state; pending additions/
|
|
|
|
|
removals are separately exposed through archipelagod and shown by the adapted
|
|
|
|
|
frontends as “after restart”. Repeated requests attach/no-op against matching
|
|
|
|
|
pending intent instead of creating duplicate requests or reverting pending state.
|
|
|
|
|
|
|
|
|
|
PackageKit frontend integration must reconcile optimistic UI state with the daemon's
|
|
|
|
|
booted/pending split. A stock plugin that cannot show this honestly is not sufficient
|
|
|
|
|
acceptance evidence. The client must not launch a newly staged executable as though
|
|
|
|
|
it exists in the current deployment. Removal does not remove current running files.
|
|
|
|
|
Reboot remains explicit; one OS pending deployment represents all staged changes.
|
|
|
|
|
|
|
|
|
|
No per-package update entries duplicate the native OS image update. Application
|
|
|
|
|
ownership chooses the backend: native packages/Host Extensions use PackageKit,
|
|
|
|
|
OS resource uses native Archipelago, Flatpak uses Flatpak. Presenting the same app
|
|
|
|
|
from different legitimate sources is allowed if source labels are clear.
|
|
|
|
|
Native application metadata must map to the actual package IDs in the base-bound
|
|
|
|
|
catalog; an AppStream name or rolling-repository recommendation cannot select an
|
|
|
|
|
unavailable package version. AppStream availability and PackageKit plugin loading
|
|
|
|
|
are separate integration checks, not consequences of providing the daemon methods.
|
|
|
|
|
|
|
|
|
|
### 6.2 Authorization and caller delegation
|
|
|
|
|
|
|
|
|
|
PackageKit is a privileged broker, but the originating user's authorization must
|
|
|
|
|
not disappear when its backend calls archipelagod as root. Record original caller,
|
|
|
|
|
PackageKit transaction ID and Archipelago operation ID together. Ordinary clients
|
|
|
|
|
cannot submit a fabricated UID or bypass policy by claiming to be PackageKit.
|
|
|
|
|
|
|
|
|
|
Add broker interface `org.archipelago.System1.PackageKitBroker` on
|
|
|
|
|
`/org/archipelago/System1/PackageKitBroker`:
|
|
|
|
|
|
|
|
|
|
- `CreateContext(s packagekit_transaction, s original_sender) -> s context_token`;
|
|
|
|
|
- `ImportPackage(s context_token, h fd, a{sv} options) -> o transaction`;
|
|
|
|
|
- `PrepareChange(s context_token, aa{sv} requests, s context_id, a{sv} options) -> o transaction`;
|
|
|
|
|
- `Download(s context_token, s plan_id, a{sv} options) -> o transaction`;
|
|
|
|
|
- `Stage(s context_token, s plan_id, a{sv} options) -> o transaction`;
|
|
|
|
|
- `Cancel(s context_token, s operation_id, a{sv} options) -> b accepted`.
|
|
|
|
|
|
|
|
|
|
Restrict this interface to the authenticated owner of `org.freedesktop.PackageKit`
|
|
|
|
|
with the expected service credentials; bind token to that unique bus connection,
|
|
|
|
|
the PackageKit transaction and verified original unique sender/session. PackageKit
|
|
|
|
|
backend/core glue must derive the original sender from its actual transaction,
|
|
|
|
|
not a client hint or unvalidated UID field. If the pinned backend API does not expose
|
|
|
|
|
enough information, implement reviewed glue or keep mutation roles unavailable.
|
|
|
|
|
Do not silently treat such requests as trusted root automation.
|
|
|
|
|
|
|
|
|
|
archipelagod remains final authorization authority and checks the original subject
|
|
|
|
|
against its action policy. PackageKit's own checks are additional, not a bypass.
|
|
|
|
|
Align shipped PackageKit and Archipelago policies to avoid duplicate prompts while
|
|
|
|
|
preserving identical effective authorization to direct CLI calls. Document the
|
|
|
|
|
exact verified handoff; never temporarily grant all wheel users arbitrary backend
|
|
|
|
|
root execution. A passed PackageKit password check alone is not a universal daemon
|
|
|
|
|
authorization token. Existing Polkit retention may avoid repeated prompts for the
|
|
|
|
|
same action; do not invent reusable root bearer credentials.
|
|
|
|
|
|
|
|
|
|
Tokens are opaque, memory-only, scope-bound and expire with broker connection;
|
|
|
|
|
accepted durable operations continue after PackageKit/GUI disconnect. Audit records
|
|
|
|
|
survive; tokens do not. After broker restart, recovery uses transaction/operation
|
|
|
|
|
correlation and explicit authorization, not replaying orphaned tokens or blindly
|
|
|
|
|
reissuing InstallPackages. Broker request deduplication uses original UID plus a
|
|
|
|
|
broker transaction namespace, method and exact inputs, and remains distinct from
|
|
|
|
|
unrelated direct-client retry IDs.
|
|
|
|
|
|
|
|
|
|
PackageKit cancellation maps to cooperative Transaction.Cancel. If atomic staging
|
|
|
|
|
has begun, report cancellation unavailable/too late and the real terminal result.
|
|
|
|
|
Closing the PackageKit client is not permission to kill a daemon transaction.
|
|
|
|
|
Map Busy/PlanStale/trust/no-track/no-space/authorization failures to the closest
|
|
|
|
|
PackageKit error with an operation diagnostic reference; do not report success
|
|
|
|
|
merely because a backend RPC returned an accepted object path.
|
|
|
|
|
|
|
|
|
|
## 7. Extended authorization matrix
|
|
|
|
|
|
|
|
|
|
Use the `org.archipelago.system.` action prefix and RFC-0012 interaction rules.
|
|
|
|
|
Reads are sanitized/passwordless; catalog refresh and repository-only planning
|
|
|
|
|
are allowed to active local sessions and root automation with bounded resources.
|
|
|
|
|
Local import/private history or other sensitive inspection requires authorization.
|
|
|
|
|
|
|
|
|
|
| Action | Operations | Default mutation policy |
|
|
|
|
|
|---|---|---|
|
|
|
|
|
| `extension-enable` | Enable/disable feature | Administrator authorization |
|
|
|
|
|
| `extension-change` | Add/remove repository-name requests | Administrator authorization |
|
|
|
|
|
| `extension-local` | Import/add local package inputs | Administrator authorization |
|
|
|
|
|
| `extension-override` | Explicit whole-package replacement/reset | Administrator authorization |
|
|
|
|
|
| `extension-restore` | Restore retained generation | Administrator authorization |
|
|
|
|
|
| `overlay-change` | Add/update/remove/reorder managed overlays | Administrator authorization |
|
|
|
|
|
|
|
|
|
|
For these actions active local users may request `auth_admin_keep`; inactive/remote
|
|
|
|
|
interactive callers require `auth_admin`; noninteractive unauthorized calls fail.
|
|
|
|
|
Authenticated root automation retains explicit audited permission. When a plan
|
|
|
|
|
requires several actions, authorize all of them before mutation. Merely being active
|
|
|
|
|
local wheel is not a passwordless extension/overlay grant: D-092's passwordless
|
|
|
|
|
exception applies only to the existing trusted-track **OS update** operation.
|
|
|
|
|
Local import/planning that requires sensitive inputs uses the matching action.
|
|
|
|
|
|
|
|
|
|
No backend can use Manager.Download to bypass local-input/private-plan authorization.
|
|
|
|
|
Plan ownership/access and required actions are checked for Download and Stage,
|
|
|
|
|
including broker calls. General history queries expose sanitized provenance only;
|
|
|
|
|
protected local file locations and raw logs require the separate read authorization.
|
|
|
|
|
|
|
|
|
|
## 8. Packaging and migration
|
|
|
|
|
|
|
|
|
|
Ship archipelagod, bus activation/policy, Polkit actions and CLI bindings in Core.
|
|
|
|
|
Desktop Purposes add PackageKit, the **Archipelago** backend, and working native
|
|
|
|
|
PackageKit frontend integration alongside native OS/Flatpak/fwupd backends.
|
|
|
|
|
The daemon remains authoritative even when PackageKit is absent on Core/Server/IoT.
|
|
|
|
|
|
|
|
|
|
Current source constraints to remove deliberately:
|
|
|
|
|
|
|
|
|
|
- GNOME native OS plugin declares a global PackageKit conflict; narrow ownership
|
|
|
|
|
to the OS resource so native Host Extension applications can coexist.
|
|
|
|
|
- Stock GNOME Software package lacks the needed PackageKit plugin in the reviewed
|
|
|
|
|
snapshot; build/package a matching plugin or supported adaptation, validate ABI.
|
|
|
|
|
- Discover launcher currently selects only Archipelago/Flatpak/fwupd; add the tested
|
|
|
|
|
PackageKit backend with native-package ownership and staged-state integration.
|
|
|
|
|
- Both desktop finalizers currently mask packagekit.service; remove those masks
|
|
|
|
|
only in images carrying the replacement Archipelago PackageKit backend and policy.
|
|
|
|
|
Never unmask stock ALPM as a transitional shortcut.
|
|
|
|
|
|
|
|
|
|
PackageKit and native clients share daemon capabilities/status; no dual writers
|
|
|
|
|
during migration. Same-version private package signatures/ABI constraints remain
|
|
|
|
|
part of normal build input validation. Removing compatibility helpers must not
|
|
|
|
|
break an installed client during an in-progress operation. Preserve root-owned
|
|
|
|
|
journal migration and rollback compatibility from RFC-0012.
|
|
|
|
|
|
|
|
|
|
## 9. Acceptance in the normal pipeline
|
|
|
|
|
|
|
|
|
|
Extend existing installed-VM acceptance, not a separate unchecked release path:
|
|
|
|
|
|
|
|
|
|
1. CLI and PackageKit install the same repository package from the selected base
|
|
|
|
|
snapshot with equivalent plan/provenance/support; verify staged then booted state.
|
|
|
|
|
2. Two native package frontends, CLI and OS updater cannot create overlapping writers;
|
|
|
|
|
stale package/context IDs fail; repeated PackageKit requests do not duplicate intent.
|
|
|
|
|
3. Local package FD import retains exact copied checksum, applies configured trust,
|
|
|
|
|
records unsupported provenance and survives update/rollback; reject path/FD races.
|
|
|
|
|
4. Remove explicit extension, reject removal of managed package/required dependency,
|
|
|
|
|
preserve persistent data, and reapply the complete remaining set on OS update.
|
|
|
|
|
5. PackageKit simulation/download-only never stage. Unsupported flags/roles fail
|
|
|
|
|
before effects. Restart requirement and current/pending application state are honest.
|
|
|
|
|
6. Validate original-subject delegation, spoofed broker/sender rejection, no duplicate
|
|
|
|
|
authorization prompts, reconnect/cancel/crash and no privilege-policy widening.
|
|
|
|
|
7. CLI/D-Bus add/remove/reorder a real Managed Overlay; validate common snapshot,
|
|
|
|
|
ordering/missing dependencies/conflicts/permissions and reapplication of extensions.
|
|
|
|
|
8. GUI displays one OS update, native packages via PackageKit, Flatpaks via Flatpak;
|
|
|
|
|
GNOME/Discover PackageKit plugins load and no ALPM backend touches live `/usr`.
|
|
|
|
|
9. Disabled capabilities/unsupported future CLI methods fail explicitly rather than
|
|
|
|
|
invoking old direct paths. Daemon aliases cannot start a second writer.
|
|
|
|
|
|
|
|
|
|
Archive exact versions, source revisions, PackageKit role/flag matrix, D-Bus policy,
|
|
|
|
|
original-subject evidence (without secrets), plans and deployment identities.
|
|
|
|
|
These scenarios do not claim general reproducibility or all overlay release gates.
|
|
|
|
|
|
|
|
|
|
## 10. Remaining implementation details
|
|
|
|
|
|
|
|
|
|
Architecture/routing, action policies, method semantics and backend boundaries are
|
|
|
|
|
accepted by D-093. Still implementation work: pinned PackageKit ABI and sender
|
|
|
|
|
handoff API, role/flag mapping constants, generated introspection/bindings, package
|
|
|
|
|
ID encoding, journal migration, overlay engine coverage, trusted catalog format,
|
|
|
|
|
frontend pending-state presentation and measured operational limits. General trust
|
|
|
|
|
policy for local unsigned artifacts and future host-operation schemas remain in
|
|
|
|
|
their own contracts. Do not infer approval to weaken trust or invent absent methods.
|
|
|
|
|
|
|
|
|
|
Upstream integration reference (reviewed 2026-11-07, not a frozen build input):
|
|
|
|
|
[PackageKit backend API](https://github.com/PackageKit/PackageKit/blob/main/src/pk-backend.h).
|
|
|
|
|
Use the actual pinned release's API/transaction semantics during implementation.
|