builder/LAYERED-GNOME.md
2026-11-21 12:20:59 +03:00

119 lines
8.7 KiB
Markdown

# Core reuse and Purpose composition — private v0 adapter
Run `20261108T051148Z` reached installed Core catalog refresh, which rejected
missing package signatures. Archived databases show both private archipelago.db
entries lacked PGPSIG while all Core/Extra/Multilib entries retained it. Package
signatures existed separately. The producer now explicitly uses repo-add
--include-sigs and checks embedded signature bytes against every detached .sig
before capturing the database. Daemon signature requirements remain unchanged;
end-to-end verification is pending the next normal release run.
Release run `20261107T232229Z` passed native adapter builds but stopped before
Core packaging: makepkg required the newly declared `python-pyalpm` and `polkit`
dependencies in the isolated build environment. `build-iso.sh` now installs both
alongside the existing packaging prerequisites. Dependency checking stays enabled;
Run `20261107T234505Z` exposed an incorrect package name in both the bootstrap
list and CLI PKGBUILD: Arch provides `pyalpm`, not `python-pyalpm`. Both now use
`pyalpm`; the configured mirror's extra.db confirms version `0.12.0-1`.
Verification is pending the next normal pipeline. Failure logs are retained on
terra under that run's `failure-evidence/cli-logs/`; no images were published.
The GNOME build path now requires `ARCHIPELAGO_CORE_BUILD` pointing to an existing
Core build artifact (repository, pinned sync databases and signed package inputs).
The old full-root GNOME pacstrap branch is no longer selected. Core builds remain
the existing Core-only path. This is a constrained adapter, not a frozen layer API.
1. Pin `layers/core` to its checksum and import it from a read-only source.
2. Check out its payload as the isolated Purpose build environment. Reuse its
package database and frozen repository universe; never refresh target databases.
3. Install missing GNOME packages, rejecting Core package changes/removal and
changes to Core files. GNOME identity and initramfs configuration use separate
Purpose-owned `defaults/os-release-gnome` and `mkinitcpio-gnome.conf` paths.
4. Capture additions and package records into a separate Purpose OSTree commit.
Shared Core packages are requirements, not duplicated Purpose payload.
Layer payload stores machine configuration at `/usr/etc` (Core's layout):
package `/etc` files, including anything a Purpose asset package ships, are
merged there. A layer that left a root `/etc` would collide with the composed
machine configuration, and renaming `usr/etc` into it buried the Core defaults
as `/etc/etc` and lost `pacman.conf` (`mv` into an existing directory nests).
The layer asserts the invariant; composition merges defensively as well.
5. Compose fresh staging from Core plus the checked-out Purpose commit, without
invoking pacman. Validate snapshot, package requirements and every path's input
identity before merging. Reconstruct the package DB from unchanged Core records
and new Purpose package records.
6. Finalize the complete composition (GNOME caches, depmod, initramfs, hwdb), and
record both input layer commits in the image commit. Reuse Core locales.
`composer/layer_delta.py` implements this private filesystem adapter. Requirements
currently conservatively pin the Core package set, not a mandatory Core commit
field. Provenance records the actual Core
commit used. General dependency reassignment/removal, arbitrary overlays and a
stable package-index schema remain separate work. Source assets are recorded as
Purpose additions rather than rebuilding/replacing the Core `archipelago` package.
The supplied Core's binary is intentionally retained; a changed installed CLI
requires a new Core build, not a hidden replacement by Purpose.
The old GNOME-only patched Toolbx package cannot be added to the Core's frozen
package universe after the fact. This path resolves Toolbx from that universe
(stock `extra/toolbox`); any required custom package must be included when
preparing the common snapshot. The legacy `ARCHIPELAGO_TOOLBOX_PACKAGE` probe
injection was removed: it lived in the Core-only branch, so the layered path could
never use it and the variable was silently ignored.
Console handling follows D-109: Core and Container Runner keep the plain kernel
console with `getty@tty1`, desktops ship mesa and their finalizers point the
`autovt@.service` alias at `kmsconvt@.service` with `/etc/kmscon/kmscon.conf`.
The finalizer owns it because the Core-tree block in `build-iso.sh` only runs for
the `core` profile. The earlier copy of that setup sat in a `gnome-probe` guard
inside that block, so published desktops had `autovt@` pointing at getty.
Evidence: `reused-core.commit`, `purpose-layer.commit`, `purpose-transaction.log`,
`composition.txt`, plus immutable Purpose `metadata/delta.json`. Unit checks cover
no duplicate Core payload, rejection of snapshot/Core package changes and tampering.
Real GNOME composition/ISO acceptance is still required.
## Operational rules and failure handling
Build execution is on `root@yabloko`; terra remains the artifact storage,
signing and publication host. `ARCHIPELAGO_MIRROR_URL` selects build transport
(currently nw-sys), not a change to the installed OS mirror. Core payload, Purpose
payload and live ISO must retain `https://mirror.nw-sys.ru/archlinux/$repo/os/$arch`.
Purpose restores the Core mirrorlist before capture. Target sync databases remain
the frozen Core inputs regardless of transport.
Fix failures in the source adapter before continuing a run. One-off checkpoint
scripts are recovery evidence only; they are not a supported resume interface or
proof of unattended readiness. Keep durable systemd job results and logs, and
report the failing phase explicitly. Never publish a failed or unknown result.
Observed integration failures and permanent corrections:
| Failure | Source correction | Verification |
| --- | --- | --- |
| Missing `alpm` staging user | Run standard sysusers in the isolated build root | Real transaction progressed |
| libalpm cannot locate cache mount | Bind staging root and shared cache; retain CheckSpace | Real transaction completed |
| Account backup differs from Core | Restore primary and `*-` account databases | Real capture completed |
| Package inventory initializes repository trust/download user or cannot resolve relocated DB | Query through `arch-chroot` with `--config /dev/null --dbpath /usr/lib/archipelago/package-db -Q`; read only the local DB | Integration continuation pending |
| Copy loses setuid/setgid or capabilities | Apply ownership before mode/xattrs; verify copied identity | Privileged-mode regression passed; real composition rerun pending |
| Installed GNOME fails package integrity for two Core-owned configuration files | Keep Core bytes unchanged; provide separate GNOME configs, select them for composition and Host Extension initramfs; run self-check before image capture | Cycle 20261105T233849Z rejected; corrected full cycle pending |
| Pre-capture self-check loads runtime pacman trust/sandbox and sees checkout-local mtimes | Temporarily use local-DB-only pacman config in staging, normalize `/usr` timestamps to deployment epoch, restore runtime config before capture | Real staging self-check: 41 files, 0 altered; installed acceptance pending |
| GNOME Host Extension fails on PackageKit D-Bus notification in staging | Purpose supplies `/usr/etc/pacman.d/hooks/90-packagekit-refresh.hook -> /dev/null`, matching this profile's masked PackageKit daemon and Archipelago update adapter | Cycle 20261106T102335Z passed login/integrity then rejected nano; corrected Purpose acceptance pending |
Capture checks the copied object against the recorded source identity before
commit. Compose validates input identities and checks each copied output. Keep
the original transaction staging and layer tree until composition succeeds, so
a failure can be investigated against its source rather than repaired from
metadata. Recovery of the earlier run's mode/capabilities was a one-off repair;
the ordinary pipeline must preserve these attributes without such repair.
Still open: a supported, validated checkpoint/resume interface; complete
unattended end-to-end acceptance; publication/retention provenance for separate
Purpose commits. Do not describe these as implemented based on a resumed probe.
After the finalized image commit and provenance have been written successfully,
remove the disposable composition and Core checkout before ISO packaging. Keep
the repository, immutable Core input, logs and evidence. The first layered run
reached squashfs creation but ran out of disk space while writing the ISO because
these reproducible trees were still present. Resume packaging from archiso's
completed stages after freeing only those scratch copies; do not delete the live
root before its post-build self-check or remove unrelated host workloads.