rfc/spec/ostree-capability-review.md
Pavel Isaev 0bdec1f6d3 docs: approve RFC v0 architectural baseline
Ratify RFC-0001 through RFC-0007 and record decisions through D-061. Define composition, lifecycle, support and release policies; add the approval audit, OSTree capability review and illustrative manifests. Preserve explicit implementation questions and unfrozen schemas.
2026-11-04 00:53:43 +03:00

18 KiB
Raw Permalink Blame History

OSTree Capability and Archipelago Contract Review

  • Date: 2026-11-03
  • Status: Research findings and recommendations; not an accepted architecture decision
  • Coverage: RFC-0001–0006, D-017 and D-020–D-029, illustrative manifests
  • Upstream reference: latest release reported by upstream GitHub at review time: v2026.6, published 2026-10-30

1. Executive assessment

Follow-up: RFC-0007 and D-030–D-035 record subsequent selections. The Arch package file list was subsequently checked and includes /usr/lib/initcpio/install/ostree and /etc/ostree-mkinitcpio.conf. F-09's original assumption that a new adapter would be needed was premature: review and test the packaged integration first. See Arch file list.

The architecture is broadly aligned with libostree. In particular, independently stored component trees, union assembly, global post-processing and a complete deployable image are an upstream-documented build pattern [S2]. D-026 and D-027 therefore reuse OSTree as intended.

The main implementation blockers are package database integration, the final filesystem layout, mkinitcpio boot integration and account continuity across deployments. These are distribution integration contracts, not missing object-store features that require replacing OSTree.

The wording “no semantic layer merge engine” is correct only when referring to Archipelago's package/category/dependency/authorization semantics. OSTree already has tree overlay/union operations. Avoid interpreting our RFCs as requiring a new low-level filesystem composition implementation.

This is a documentation review, not validation of an installed Arch OSTree package, a chosen package snapshot, a bootable prototype or runtime behavior. Published documentation can mix historical and current descriptions. Version-sensitive prepare-root and account guidance was also checked in the v2026.6 source [S15].

2. Capability map

Area Native OSTree capability Archipelago responsibility
Storage Content-addressed objects, commits, refs, deduplication, metadata Layer schema, package index, source/build provenance
Assembly Overlay trees in commit; union/subpath/filtering checkout primitives Dependency solving, common snapshot, package ownership, authorized overrides, deterministic policy
Distribution Incremental object pulls, archive HTTP repositories, static deltas, signature mechanisms Release/channel policy, trust roots, publication workflow and retention
Deployment Multiple complete deployments, boot selection, staged deployment, deployment pinning Desired-state management, update policy, recovery UX and health checks
Configuration /usr/etc defaults and per-deployment writable /etc, three-way configuration handling Arch staging conversion, diagnostics, application-specific migrations
Persistent state Shared /var within a stateroot State schema migrations, user data policy and explicit layout for other writable paths
Boot Kernel/initramfs deployment, BLS-oriented boot configuration, prepare-root mkinitcpio integration, installation profile, bootloader binaries, Secure Boot policy
Accounts No package account provisioning; numeric file owners are stored Standard sysusers/systemd integration, conflict checks and cross-deployment identity continuity
Runtime integrity Optional composefs/fs-verity/signature integration Explicit feature/version profile and validation of the full boot trust chain

3. Detailed findings

F-01 — Reuse native union operations; retain our policy engine

Applies to: RFC-0001 §4.2; RFC-0002 §§2–3, 8–9; RFC-0003 §6.

ostree commit --tree=ref=... --tree=dir=... overlays existing trees without requiring all existing content to be rehashed. Checkout supports --union, --union-add, --union-identical, subpaths and skip lists [S2, S3].

These are building blocks, not a package solver: ordinary union may silently replace files, and --union-identical does not implement owner permissions, directory metadata reconciliation or package replacement policy. Validate our resolved merge plan before using these operations. Native whiteout support also does not decide whether Archipelago authorizes a deletion.

Recommendation: explicitly describe Composition Engine as policy and orchestration over libostree primitives. Preserve D-024–D-026 without implementing a second store.

F-02 — Finalization must not mutate shared repository objects

Applies to: RFC-0003 pipeline; RFC-0005 §§5–6.

Checkout can hardlink content into the repository. In-place writes, ownership or xattr changes can then affect shared objects. Upstream's component-union example uses rofiles-fuse; checkout also offers --force-copy (which may reflink), and libostree exposes hardlink-breaking support [S2, S3, S14].

Recommendation: initially use a writable staging strategy that guarantees no repository aliasing, then optimize under tests. This supports, rather than changes, RFC-0005. Image finalization here is distinct from OSTree's staged-deployment finalization at shutdown.

F-03 — Metadata preservation and reproducibility need an explicit profile

Applies to: RFC-0002 metadata/conflicts; RFC-0003 reproducibility.

OSTree records numeric UID/GID, modes, symlinks and xattrs, but not ordinary file timestamps. A commit separately records a timestamp, parent and metadata, so equal trees do not necessarily have equal commit checksums [S1, S3, S14].

bare-user preserves ownership/xattrs as encoded metadata without applying them; bare-user-only does not preserve the same metadata. User-mode checkout omits ownership/xattr application. Copying a convenient unprivileged checkout into a fresh commit can therefore lose metadata unless the pipeline preserves it explicitly.

Recommendation: select repository and checkout modes per build/registry/host role; test capabilities and non-root ownership. Specify whether reproducibility means identical tree content or identical commit, and normalize commit metadata when the latter is required. Do not assume deduplication preserves source hardlink topology as a separately declared property.

F-04 — /etc merge is per-deployment configuration handling, not a text merge

Applies to: RFC-0001 filesystem table; RFC-0003 §8; RFC-0005 caches; RFC-0006.

The final OS tree supplies defaults under /usr/etc; the deployed system has a writable /etc. The documented merge compares old defaults, the source deployment's configuration and new defaults: locally modified files are retained, while unmodified files receive new defaults [S4, S5]. This is not a general line-level merge of passwd entries, INI sections or package .pacnew files.

Recommendation: define the Arch staging /etc → image /usr/etc conversion, package-file accounting for that conversion, and runtime override handling. Generate caches after the effective inputs are known; do not assume an image cache always matches locally overridden configuration.

F-05 — Staged deployments address a real configuration race

Applies to: System Manager, update lifecycle, RFC-0006.

An immediately prepared deployment merges /etc when prepared; later changes to the booted /etc are not automatically merged again at reboot. Staged deployments delay the merge and bootloader update until shutdown via ostree-finalize-staged.service [S4].

Recommendation: evaluate staged deployments as the normal update path and define failure reporting, activation locking and recovery. Staging helps forward updates but does not synchronize the account databases of old rollback deployments.

F-06 — /var persistence is scoped to a stateroot

Applies to: RFC-0001, RFC-0003, RFC-0004 state guarantees.

Deployments in one stateroot share /var; a different stateroot has a different state directory [S4]. Since 2024.3, OSTree can initialize an empty stateroot /var from commit contents. That is initialization, not ongoing package-managed updates: existing state is not replaced or removed by later image versions [S6].

The older “OSTree never touches /var” explanation in the general deployment page must be read with this newer dedicated /var documentation. Archipelago's stricter policy of provisioning state through tmpfiles/units remains valid.

Recommendation: specify stateroot identity across Purpose switches and rebases; do not change it accidentally. Preserve data while separately defining migration compatibility: rollback of OS files is not rollback of a database schema in /var.

F-07 — Account policy is supported, but rollback continuity is extra work

Applies to: RFC-0006, D-028/D-029.

Upstream explicitly recommends sysusers for per-machine accounts without owned image content, DynamicUser where appropriate, and discusses nss-altfiles or /usr/lib/userdb for static image identities [S7]. This supports our preference for existing mechanisms and does not require adopting a custom global UID registry.

However, each deployment has its own /etc. Booting an old deployment selects its configuration, not a globally current passwd/shadow database [S4, S8]. Running sysusers on that old image cannot recreate accounts whose declarations existed only in the newer image, nor recover changed passwords or explicit human-account deletions. Thus D-028/D-029's continuity requirements exceed the native default.

Recommendation: keep this as an implementation blocker. Distinguish “deploy an older commit while merging current configuration” from “boot a previously prepared deployment”. Do not select shared account files, a ledger or a custom NSS backend without a separate design. Define the scope of the system-account deletion ban for ephemeral DynamicUser= identities without breaking standard systemd behavior.

F-08 — The pacman installed-package database must follow the deployment

Applies to: RFC-0002 §9; RFC-0003; Host Extension staging.

Upstream explicitly explains why an installed-package database cannot simply live in shared /var: different deployments contain different packages [S7]. Pacman's default DBPath is /var/lib/pacman, and its documented configuration permits overriding that path [S16].

Recommendation: design a per-image/deployment installed-package database and separate writable staging copy, using standard pacman/libalpm facilities. Select the exact path and read-only query behavior separately; caches, logs and repository sync databases have different lifecycles. Preserve upstream database semantics rather than creating an incompatible replacement database.

There is also wording tension inside RFC-0002: D-026 materializes managed payloads from commits, while §9 broadly requires package installation/replacement through pacman-compatible staging. Clarify layer-build transactions, composition database assembly and local Host Extension transactions as distinct operations. OSTree does not resolve this package bookkeeping problem.

F-09 — mkinitcpio needs OSTree integration, not just initramfs generation

Applies to: RFC-0001 acceptance criteria; RFC-0003; RFC-0005 matrix.

The documented upstream integration is dracut/systemd. ostree-prepare-root remaps the physical root to the selected deployment before switch-root. With systemd it is ordered after sysroot.mount and before initrd-root-fs.target [S7, S10].

Recommendation: keep the chosen Arch tool, mkinitcpio, but specify its integration hook/module contract: required binaries/libraries/config, units, ostree= handling, mount ordering and failure behavior. Reuse prepare-root instead of reimplementing its mount algorithm. Arch already packages an integration hook; a new implementation is not presumed necessary. A successful ordinary mkinitcpio run alone does not establish that the initramfs can boot an OSTree deployment.

The recommended image kernel paths are /usr/lib/modules/$kver/vmlinuz and /usr/lib/modules/$kver/initramfs.img [S4]. They are a concrete candidate, not an accepted Archipelago layout. Bootloader integration must be tested with Arch's actual packages; Fedora GRUB capabilities must not be assumed for Arch GRUB.

F-10 — “Conventional Linux paths” still require an explicit persistence layout

Applies to: RFC-0001 §4.3–4.4; RFC-0003 §§7–8.

Usr-merge fits OSTree, but /home, /root, /srv, /usr/local and /opt do not gain persistence merely by keeping their conventional names. Upstream describes symlink/mount layouts, /sysroot and /ostree integration [S7]. /opt particularly needs care: redirecting packaged application binaries to /var/opt can prevent later image updates from updating them [S6].

Recommendation: keep conventional runtime paths and ELF compatibility while documenting necessary OSTree backing layout. Distinguish application payload from mutable application data. Do not interpret “follow Arch layout” as byte-for-byte retention of all Arch rootfs placement choices.

F-11 — Rollback availability needs retention; automatic recovery is separate

Applies to: RFC-0001 invariants; RFC-0004 D-017.

OSTree supports multiple deployments, explicit pinning and retain options [S11]. Atomic deployment transitions do not imply health checks or an automatic fallback when a kernel or workload fails; upstream points to additional integration such as greenboot [S8].

Recommendation: define retention/pinning for the prior working deployment and Host Extension inputs. Account for storage exhaustion and unpin/cleanup policy. Keep boot health evaluation and persistent-data compatibility as separate contracts.

F-12 — Registry and offline transport can be mostly upstream mechanisms

Applies to: RFC-0001 registries; RFC-0003 publication; installer open questions.

An archive repository can be served by a static HTTP server. Pulls transfer missing objects; static deltas optimize transfers and can be self-contained for offline use. Applying an offline delta imports content but does not itself deploy it [S2, S12, S13]. The summary must be updated when refs/deltas change.

Recommendation: avoid inventing a new layer/image transfer protocol. Define Archipelago's namespace, trust, release metadata and coordinated publication on top. Separate object availability, ref promotion and signed summary visibility; an atomic local commit is not automatically atomic multi-registry release publication.

Checksums embedded in a manifest provide identity, not indefinite availability. Define retention roots for released layers/images and source/package snapshots; provenance mentioning a layer checksum must not be assumed to pin it against GC.

F-13 — composefs is an optional deployment backend, not our package compositor

Applies to: filesystem, security and platform baseline open questions.

OSTree documents composefs and yes, signed, verity modes; these offer different runtime integrity properties from plain hardlink deployments. The checked v2026.6 documentation still labels the integration experimental. Its prepare-root manual states that root.transient requires composefs [S10, S15].

Recommendation: select a supported libostree version/build-feature baseline before choosing these modes. Do not conflate downloading a signed commit with verified boot/runtime integrity, or composefs with package-aware layer merging. No composefs adoption decision is made by this review.

  1. Supported libostree version/features and final filesystem layout: /usr/etc, stateroot, /var, persistent paths, installed-package database.
  2. Package index/database assembly and metadata-safe OSTree composition primitives.
  3. mkinitcpio/prepare-root/bootloader integration and a minimal VM boot test.
  4. Account/credential continuity for forward updates and both rollback paths.
  5. Staged activation, retention, failure recovery and persistent-state migrations.
  6. Registry promotion, signing, offline bundles and garbage-collection roots.

These are recommendations, not newly accepted decisions. Existing acceptance criteria require implementation tests before these contracts can be called proven.

5. Sources