From cffb4f0401e2ece55dd8837cb4382f19c55e30e0 Mon Sep 17 00:00:00 2001 From: codebymarshall Date: Tue, 27 Oct 2026 20:59:29 +0000 Subject: [PATCH 1/6] feat(gnome-e2e): check GNOME OS guest prerequisites and record provenance before boot For suite: extensions the install step now runs scripts/guest_preflight.py over the mounted ostree deployment before the VM boots. It writes results/guest-provenance.json (image ref, podman-resolved digest, guest os-release incl. IMAGE_VERSION/GNOMEOS_COMMIT) and fails closed, as a provisioning error, when a lane prerequisite is missing. Run against the layer tree of gnomeos-nightly nightly.20261027.1 it passes every check except gnome-ponytail-daemon, which stock GNOME OS does not ship. The lane doc's static digest pin is gone: gnomeos-* tags carry quay.expires-after: 2w and the 2026-09-30 pin now returns MANIFEST_UNKNOWN. Provenance is resolved per run instead; the verified image inventory moves to a new gnomeos-guest-provenance reference. Refs #908 Hive-Run: projectbluefin/testsuite#908 Hive-Plan: issue #908 implementation plan, steps 1 and 4 (inventory, provenance, fail-closed infra errors) Hive-Spec: projectbluefin/testsuite#908#acceptance-provenance-and-fail-closed Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 Signed-off-by: codebymarshall --- .github/actions/gnome-e2e/action.yml | 21 ++ docs/skills/ci-ops/e2e-workflow/SKILL.md | 3 +- .../references/gnome-extensions-validation.md | 56 ++--- .../references/gnomeos-guest-provenance.md | 80 +++++++ scripts/guest_preflight.py | 202 ++++++++++++++++++ tests/unit/test_guest_preflight.py | 188 ++++++++++++++++ 6 files changed, 521 insertions(+), 29 deletions(-) create mode 100644 docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md create mode 100644 scripts/guest_preflight.py create mode 100644 tests/unit/test_guest_preflight.py diff --git a/.github/actions/gnome-e2e/action.yml b/.github/actions/gnome-e2e/action.yml index 9a39737f5..ba616dc37 100644 --- a/.github/actions/gnome-e2e/action.yml +++ b/.github/actions/gnome-e2e/action.yml @@ -12,6 +12,8 @@ # - Runner must have KVM enabled (ubuntu-latest on GHA has it) # - OCI image must be a bootc/ostree image (uses bootc install to-disk) # - gnome-ponytail-daemon must be baked into the OCI image +# (suite: extensions checks this and other prerequisites before boot via +# scripts/guest_preflight.py and records results/guest-provenance.json) # # Usage: # - uses: projectbluefin/testsuite/.github/actions/gnome-e2e@main @@ -131,6 +133,7 @@ runs: shell: bash env: GNOME_E2E_IMAGE: ${{ inputs.image }} + GNOME_E2E_SUITE: ${{ inputs.suite }} run: | fallocate -l 30G disk.raw @@ -185,6 +188,20 @@ runs: echo "GNOME_E2E_ROOT_UUID=${ROOT_UUID}" >> "$GITHUB_ENV" echo "GNOME_E2E_KVER=${KVER}" >> "$GITHUB_ENV" + # Extension-validation lane (#908): record which guest is under test and + # fail closed before boot when the image lacks a lane prerequisite + # (stock GNOME OS ships no gnome-ponytail-daemon). Cleanup below still + # runs; the step fails after it. + PREFLIGHT_RC=0 + if [[ "${GNOME_E2E_SUITE}" == "extensions" ]]; then + IMAGE_DIGEST=$(sudo podman image inspect --format '{{.Digest}}' "${GNOME_E2E_IMAGE}" 2>/dev/null || true) + mkdir -p results + sudo python3 _testsuite/scripts/guest_preflight.py "${D}" \ + --image-ref "${GNOME_E2E_IMAGE}" --image-digest "${IMAGE_DIGEST}" \ + --output results/guest-provenance.json || PREFLIGHT_RC=$? + sudo chown -R "$(id -u):$(id -g)" results + fi + EFI_PART="${LOOP}p2" sudo mkdir -p /mnt/efi sudo mount "${EFI_PART}" /mnt/efi @@ -243,6 +260,10 @@ runs: sudo podman rmi "${GNOME_E2E_IMAGE}" 2>/dev/null || true ls -lh disk.raw vmlinuz initramfs.img df -h . + if [[ ${PREFLIGHT_RC} -ne 0 ]]; then + echo "::error::Guest preflight failed (rc=${PREFLIGHT_RC}); see results/guest-provenance.json" + exit 1 + fi # ── Boot VM ─────────────────────────────────────────────────────────────── - name: Boot VM with QEMU + KVM diff --git a/docs/skills/ci-ops/e2e-workflow/SKILL.md b/docs/skills/ci-ops/e2e-workflow/SKILL.md index f60b519f7..14bf44ccf 100644 --- a/docs/skills/ci-ops/e2e-workflow/SKILL.md +++ b/docs/skills/ci-ops/e2e-workflow/SKILL.md @@ -155,7 +155,7 @@ the checkout's namespace package whatever `sys.path` says, forcing the fail-clos path. That load catches bare `Exception` on purpose — `exec_module` runs the module's top level, so a corrupted copy raises `SyntaxError` or anything else, and this reporting-only step must exit 0 rather than fail the job. -**Gate extension-validation run** follows `Summarise results` for `suite: extensions`: it loads the sibling results helper by file path and requires at least one passing scenario with no errors, while emitting a JSON report for either verdict. +**Gate extension-validation run** follows `Summarise results` for `suite: extensions`: it loads the sibling results helper by file path and requires at least one passing scenario with no errors, while emitting a JSON report for either verdict. Earlier, before boot, the install step runs `scripts/guest_preflight.py` over the mounted deployment: it writes `results/guest-provenance.json` (image ref, resolved digest, guest `os-release`) and fails closed when a prerequisite such as `gnome-ponytail-daemon` is missing. ## Sparse checkout is non-cone — every script must be listed explicitly @@ -497,3 +497,4 @@ Load these when you hit the specific topic: - [Installer suite assertions, and why an env-var gate made one unreachable.](references/installer-suite.md) - [Migration inputs `migration-target` / `extra-tags` and the startup_failure they cause when missing.](references/migration-inputs.md) - [GNOME OS guest lane for the developer extension-validation service and its mandatory gate.](references/gnome-extensions-validation.md) +- [GNOME OS image provenance (2-week tag expiry), verified guest inventory, and the extensions pre-boot preflight](references/gnomeos-guest-provenance.md) diff --git a/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md b/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md index d11d48693..6d531c1be 100644 --- a/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md +++ b/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md @@ -19,35 +19,29 @@ and exercised with a qecore/Behave input+AT-SPI scenario. > **No run has completed yet.** Do **not** claim GNOME OS extension validation as done until a > green run exists and its evidence is attached. -## Pinned provenance (do not float) +## Provenance, image inventory and pre-boot preflight -Base image `quay.io/gnome_infrastructure/gnome-build-meta:gnomeos-nightly`. The lane consumes the -**digest reference**, never the tag: +`gnomeos-*` tags and digests expire two weeks after push, so the lane resolves a digest per run +and the action records it, with the guest `os-release` identity, in +`results/guest-provenance.json`. Stock GNOME OS nightly carries every lane prerequisite except +`gnome-ponytail-daemon`, and `scripts/guest_preflight.py` fails `suite: extensions` closed on that +before boot. Evidence, commands and the full inventory: +[gnomeos-guest-provenance.md](gnomeos-guest-provenance.md). -| Tag | Digest | -|---|---| -| `gnomeos-nightly` (pinned for the lane) | `sha256:57eeef917d057e37d8d5824fab195ebf3b0ad49fc1ca191b7bc02b82418ed981` | -| `gnomeos-51` / `gnomeos-50` / `gnomeos-latest` | reference only | - -Resolved 2026-09-30; proves **existence**, not a successful boot with this action's provisioner. -Re-derive after any change with `skopeo inspect docker://…:gnomeos-nightly | jq -r '.Digest'`. - -## Guest inventory +## Provisioned surface The lane reuses the `gnome-e2e` provisioner (bootc/ostree → `bootc install to-disk` → QEMU/KVM -boot → GDM autologin → ponytail + qecore-headless), pointed at `gnomeos-nightly` instead of a -Bluefin/Dakota image. Provisioned surface: +boot → GDM autologin → ponytail + qecore-headless), pointed at a GNOME OS digest instead of a +Bluefin/Dakota image: -- GNOME OS nightly (pinned digest) as a bootc/ostree deployment, with kernel + initramfs - extracted from the deployment for direct QEMU boot +- GNOME OS as a bootc/ostree deployment, with kernel + initramfs extracted from the deployment + for direct QEMU boot - GDM autologin for the `bluefin-test` user; passwordless sudo for test automation - **real** GNOME Wayland session (Mutter) + AT-SPI bus (at-spi2-core) - `gnome-ponytail-daemon` (virtual input) driven by **qecore-headless** — **absent from stock - `gnomeos-nightly`**; required baked into the OCI image (`action.yml:14`) and no overlay - supplying it exists yet, so it is an input to the lane, not a lane output + GNOME OS**; the action expects it in the image (`action.yml` header) and no overlay supplying + it exists yet, so it is an input to the lane, not a lane output - SSH (port 2222 → 22) as `bluefin-test` for the harness to drive the guest -- No Fedora dnf/RPM assumption — GNOME OS has no package manager; tooling must ship in a test - overlay/sysext ## The four hive extensions @@ -78,20 +72,23 @@ behaviour features plus a cross-cutting `extension_lifecycle.feature`. `gnome-e2e` is not a boot-only action: the same invocation provisions the guest **and** runs `tests//features/` inside it under `qecore-headless` (`action.yml:384`). `suite` must therefore be set — it defaults to `smoke` (`action.yml:35-37`), which would boot GNOME OS and run -the **Bluefin** smoke suite, testing the wrong thing. Pass the **pinned digest**, not a tag: the +the **Bluefin** smoke suite, testing the wrong thing. Pass a **digest resolved at dispatch time**, not a tag: the action hands `inputs.image` verbatim to `podman pull` / `bootc install`. ```yaml - uses: ./.github/actions/gnome-e2e with: - # requires an image that carries gnome-ponytail-daemon (blocker 1 above) - image: quay.io/gnome_infrastructure/gnome-build-meta@sha256:57eeef917d057e37d8d5824fab195ebf3b0ad49fc1ca191b7bc02b82418ed981 + # requires an image that carries gnome-ponytail-daemon (blocker 1 above); + # a digest resolved at dispatch time — gnomeos-* digests expire after 2 weeks + image: quay.io/gnome_infrastructure/gnome-build-meta@${{ needs.resolve.outputs.digest }} suite: extensions # uses tests/extensions/ (landed with #914) ``` -The action runs `bootc install to-disk`, extracts kernel/initramfs, boots a KVM QEMU VM, waits for +The action runs `bootc install to-disk`, runs the guest preflight (fails here today on stock GNOME +OS: no `gnome-ponytail-daemon`), extracts kernel/initramfs, boots a KVM QEMU VM, waits for SSH then a live GNOME session, copies `tests/extensions` (plus `tests/shared`) into the guest, runs -behave there, and writes `results/` + `vm-serial.log` into the workspace. +behave there, and writes `results/` (including `guest-provenance.json`) + `vm-serial.log` into +the workspace. ### 2. Confirm a real session (canary) @@ -187,14 +184,17 @@ A host socket, key, or mount exposed to the guest desktop is a regression: stop ## Status -- [x] Official GNOME OS nightly pinned (digest above) -- [x] Guest inventory + four hive extensions documented +- [x] Provenance contract: digest resolved per run and recorded in + `results/guest-provenance.json` (static pins expire after 2 weeks) +- [x] Guest inventory verified against the image layers; four hive extensions documented +- [x] Pre-boot preflight (`scripts/guest_preflight.py`) fails closed on missing prerequisites - [x] Mandatory service gate implemented and unit-tested (`scripts/extension_validation.py`) - [x] Security posture recorded: guest-local, disposable credentials; no host reach - [x] Gate wired into the lane: `gnome-e2e` runs `scripts/extension_validation.py` as a mandatory step when `suite == 'extensions'` (#991). No repo workflow/recipe calls the action with `suite: extensions` yet — a consumer runs it directly. - [ ] Repeatable boot + load + run commands validated in the lab (**unverified**; - tests/extensions landed with #914; blocked on a `gnome-ponytail-daemon` overlay) + tests/extensions landed with #914; blocked on a `gnome-ponytail-daemon` overlay, which the + preflight now reports by name) - [ ] At least one green extension-validation run captured and attached - [ ] Lane closed diff --git a/docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md b/docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md new file mode 100644 index 000000000..6b18ce633 --- /dev/null +++ b/docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md @@ -0,0 +1,80 @@ +--- +name: gnomeos-guest-provenance +description: "GNOME OS image provenance (2-week tag expiry), verified guest inventory, and the extensions pre-boot preflight" +metadata: + type: reference + audience: agents + maturity: draft +--- +# GNOME OS guest provenance and preflight (#908) + +Companion to [gnome-extensions-validation.md](gnome-extensions-validation.md). Everything here +was checked against the published image's layers; **none of it proves a boot.** + +## Provenance: pin per run, not in this file + +Base image `quay.io/gnome_infrastructure/gnome-build-meta`, tag `gnomeos-nightly` (or +`gnomeos-51` / `gnomeos-50` for a stable branch). **Every `gnomeos-*` tag expires two weeks after +it is pushed** — the image config carries the label `quay.expires-after: 2w`, and the Quay tag API +shows each `gnomeos-nightly` revision with a 14-day `end_ts`. A digest copied into a doc or +workflow is unpullable within a fortnight: the `sha256:57eeef…ed981` pin recorded here on +2026-09-30 returned `MANIFEST_UNKNOWN` by 2026-10-27. Stable-branch tags move too (`gnomeos-51` +was re-pushed three times between 2026-10-25 and 2026-10-27). + +So the lane resolves the tag to a digest **at dispatch time**, pulls that digest, and the +`gnome-e2e` action records what it actually installed in `results/guest-provenance.json`: +the image reference, the digest podman resolved, and the guest's `os-release` identity +(`ID=org.gnome.os`, `IMAGE_VERSION`, `GNOMEOS_COMMIT`, the gnome-build-meta commit). That file, +not a doc table, is the provenance record. A long-lived pin would need a mirror into a registry +we control, which is lab infrastructure, not this repo. + +```bash +# resolve without pulling (Quay anonymous token) +TOKEN=$(curl -s "https://quay.io/v2/auth?service=quay.io&scope=repository:gnome_infrastructure/gnome-build-meta:pull" | jq -r .token) +curl -sI -H "Authorization: Bearer $TOKEN" \ + -H 'Accept: application/vnd.oci.image.manifest.v1+json' \ + https://quay.io/v2/gnome_infrastructure/gnome-build-meta/manifests/gnomeos-nightly \ + | grep -i docker-content-digest +# or: skopeo inspect docker://quay.io/gnome_infrastructure/gnome-build-meta:gnomeos-nightly | jq -r .Digest +``` + +## Guest inventory (verified against the image, not booted) + +Inventoried 2026-10-27 from `gnomeos-nightly` @ `sha256:9dd3a858…e824c` +(`IMAGE_VERSION=nightly.20261027.1`, `GNOMEOS_COMMIT=9c38eabc…`) by listing its four OCI layers +(Freedesktop SDK minimal + platform, GNOME SDK platform, GNOME OS) and running +`scripts/guest_preflight.py` over a skeleton of that tree. The image config sets +`containers.bootc=1`. + +| `gnome-e2e` step | Needs | GNOME OS nightly | +|---|---|---| +| `bootc install to-disk` | `bootc` in the image | `usr/bin/bootc`, `usr/lib/bootc/install/` ✅ (no `bootupd`; the action already tolerates that) | +| direct QEMU boot | kernel + initramfs in the deployment | `usr/lib/modules/7.3.0/{vmlinuz,initramfs.img}` ✅ | +| harness user | appendable `/etc/passwd`, `/bin/bash` | `etc/passwd` (system users only), `usr/bin/bash` ✅ | +| harness SSH | `sshd`, `sshd.service`, `scp`, `sftp-server` | ✅ (unit runs `ssh-keygen -A` itself) | +| harness admin | `sudo` | `usr/bin/sudo` + `etc/sudoers` ✅ | +| session | GDM, gnome-shell, Mutter, GJS | ✅ `etc/systemd/system/display-manager.service` → `gdm.service` | +| test stack install | `python3` + `ensurepip` | Python 3.14 with bundled pip wheel ✅ (no system pip) | +| AT-SPI | PyGObject, pyatspi, `at-spi-bus-launcher` | ✅ | +| virtual input | `uinput` module | `uinput.ko.zst` + `modules-load.d/uinput.conf` ✅ | +| virtual input | **`gnome-ponytail-daemon`** | **absent** ❌ | +| extensions | `gnome-extensions`, `gdbus` | ✅ | + +Not verifiable without a boot, so still open: whether GNOME OS's first-boot +`gnome-initial-setup` (`usr/libexec/gnome-initial-setup` is present) interferes with GDM +autologin of the injected `bluefin-test` user, and whether `bootc install to-disk` completes on +this image with `--bootloader systemd`. Record both from the first lab run's `vm-serial.log`. + +There is no package manager (no `dnf`/`rpm`); missing tooling must arrive in a test overlay or +sysext, recorded separately from the base digest. + +## Pre-boot preflight (`scripts/guest_preflight.py`) + +For `suite: extensions` the action runs the preflight over the mounted ostree deployment **before +the VM boots**. It writes `results/guest-provenance.json` and fails the job as a provisioning +error when any prerequisite above is missing (or the guest has no `os-release`). Today it fails +stock GNOME OS on exactly one item, `gnome-ponytail-daemon` — that is the correct, named failure +in place of a qecore error ten minutes later. It records `is_gnome_os` from `os-release` +`ID` but does not reject other images, so a Bluefin/Dakota extensions run stays possible and is +never labelled GNOME OS. Paths are checked with `lexists` and never resolved, so absolute guest +symlinks are not followed onto the host. diff --git a/scripts/guest_preflight.py b/scripts/guest_preflight.py new file mode 100644 index 000000000..7c55087fd --- /dev/null +++ b/scripts/guest_preflight.py @@ -0,0 +1,202 @@ +#!/usr/bin/env python3 +"""Pre-boot inventory and provenance gate for the extension-validation lane. + +The ``gnome-e2e`` action writes an OCI image to a raw disk with +``bootc install to-disk`` and then mounts the resulting ostree deployment to +configure it. For ``suite: extensions`` (issue #908) this script inspects that +mounted deployment *before* the VM boots and: + +* records guest provenance (image reference, resolved digest, ``os-release`` + identity such as GNOME OS ``IMAGE_VERSION`` / ``GNOMEOS_COMMIT``) so a run + states exactly which guest it tested; +* fails closed, as an infrastructure error, when a prerequisite the lane needs + is missing — most importantly ``gnome-ponytail-daemon``, which stock GNOME OS + does not ship and which qecore-headless needs for virtual input. + +Without this gate a missing prerequisite surfaces minutes later as a confusing +qecore/behave failure (or no results at all) instead of a named provisioning +error. Paths are checked with ``os.path.lexists`` and never resolved, so an +absolute symlink inside the guest tree is never followed onto the host. + +See ``docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md``. +""" +from __future__ import annotations + +import argparse +import json +import os +import sys +from pathlib import Path +from typing import Any + +GNOME_OS_ID = "org.gnome.os" + +# Each prerequisite is satisfied when ANY of its candidate patterns matches a +# path in the guest tree. Patterns are relative to the deployment root and may +# contain glob wildcards. Every entry maps to a concrete step of the gnome-e2e +# action: direct kernel boot, harness SSH/sudo provisioning, GDM autologin into +# a Wayland session, the in-guest pip install of the test stack, and the +# qecore-headless AT-SPI + virtual-input run. +REQUIREMENTS: dict[str, tuple[str, ...]] = { + "kernel": ("usr/lib/modules/*/vmlinuz",), + "initramfs": ("usr/lib/modules/*/initramfs.img",), + "sshd": ("usr/bin/sshd", "usr/sbin/sshd"), + "sshd.service": ("usr/lib/systemd/system/sshd.service",), + "sudo": ("usr/bin/sudo",), + "gdm": ("usr/bin/gdm", "usr/sbin/gdm"), + "gnome-shell": ("usr/bin/gnome-shell",), + "gnome-extensions": ("usr/bin/gnome-extensions",), + "gdbus": ("usr/bin/gdbus",), + "python3": ("usr/bin/python3",), + "python-ensurepip": ("usr/lib/python3*/ensurepip/__init__.py",), + "python-gi": ( + "usr/lib/python3*/site-packages/gi/__init__.py", + "usr/lib64/python3*/site-packages/gi/__init__.py", + ), + "at-spi-bus-launcher": ("usr/libexec/at-spi-bus-launcher",), + "uinput": ( + "usr/lib/modules/*/kernel/drivers/input/misc/uinput.ko*", + # built-in rather than a module: listed in modules.builtin instead + "usr/lib/modules/*/modules.builtin", + ), + "gnome-ponytail-daemon": ( + "usr/libexec/gnome-ponytail-daemon", + "usr/bin/gnome-ponytail-daemon", + ), +} + +OS_RELEASE_KEYS = ( + "NAME", + "ID", + "VERSION_ID", + "PRETTY_NAME", + "IMAGE_VERSION", + "GNOMEOS_COMMIT", +) + + +def _has_builtin_uinput(path: Path) -> bool: + try: + text = path.read_text(encoding="utf-8", errors="replace") + except OSError: + return False + return any(line.rstrip().endswith("/uinput.ko") for line in text.splitlines()) + + +def _matches(root: Path, pattern: str) -> list[str]: + """Return guest-relative paths matching *pattern*, without following links.""" + if not any(ch in pattern for ch in "*?["): + return [pattern] if os.path.lexists(root / pattern) else [] + found = [] + for path in sorted(root.glob(pattern)): + if pattern.endswith("modules.builtin") and not _has_builtin_uinput(path): + continue + found.append(path.relative_to(root).as_posix()) + return found + + +def check_requirements(root: Path) -> dict[str, list[str]]: + """Map each prerequisite name to the guest paths that satisfy it (empty = missing).""" + result: dict[str, list[str]] = {} + for name, patterns in REQUIREMENTS.items(): + hits: list[str] = [] + for pattern in patterns: + hits.extend(_matches(root, pattern)) + result[name] = hits + return result + + +def parse_os_release(text: str) -> dict[str, str]: + """Parse os-release(5) ``KEY=value`` lines, unquoting values.""" + data: dict[str, str] = {} + for raw in text.splitlines(): + line = raw.strip() + if not line or line.startswith("#") or "=" not in line: + continue + key, _, value = line.partition("=") + value = value.strip() + if len(value) >= 2 and value[0] == value[-1] and value[0] in "\"'": + value = value[1:-1] + data[key.strip()] = value + return data + + +def read_os_release(root: Path) -> dict[str, str]: + """Read the guest's os-release, preferring /usr/lib (etc/ is a symlink on GNOME OS).""" + for rel in ("usr/lib/os-release", "etc/os-release"): + path = root / rel + if path.is_file() and not path.is_symlink(): + return parse_os_release(path.read_text(encoding="utf-8", errors="replace")) + return {} + + +def build_report( + root: Path, image_ref: str = "", image_digest: str = "" +) -> dict[str, Any]: + """Build the provenance + prerequisite report for the guest tree at *root*.""" + os_release = read_os_release(root) + found = check_requirements(root) + missing = [name for name, hits in found.items() if not hits] + return { + "image_ref": image_ref, + "image_digest": image_digest, + "os_release": {k: os_release[k] for k in OS_RELEASE_KEYS if k in os_release}, + "is_gnome_os": os_release.get("ID") == GNOME_OS_ID, + "requirements": found, + "missing": missing, + "ok": bool(os_release) and not missing, + } + + +def format_report(report: dict[str, Any]) -> str: + lines = [ + f"image: {report['image_ref'] or '(not given)'}", + f"digest: {report['image_digest'] or '(not given)'}", + ] + osr = report["os_release"] + if osr: + lines.append( + "guest: " + + " ".join(f"{k}={v}" for k, v in osr.items() if k != "PRETTY_NAME") + ) + else: + lines.append("guest: os-release not found") + lines.append(f"GNOME OS: {'yes' if report['is_gnome_os'] else 'no'}") + for name, hits in report["requirements"].items(): + lines.append(f" {'ok ' if hits else 'MISSING'} {name}" + (f" ({hits[0]})" if hits else "")) + return "\n".join(lines) + + +def main(argv: list[str] | None = None) -> int: + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument("root", type=Path, help="mounted guest deployment root") + parser.add_argument("--image-ref", default="", help="image reference that was installed") + parser.add_argument("--image-digest", default="", help="resolved manifest digest of that image") + parser.add_argument("--output", type=Path, help="write the JSON report here") + args = parser.parse_args(argv) + + if not args.root.is_dir(): + print(f"::error::guest root {args.root} is not a directory", file=sys.stderr) + return 2 + + report = build_report(args.root, args.image_ref, args.image_digest) + print(format_report(report)) + if args.output: + args.output.parent.mkdir(parents=True, exist_ok=True) + args.output.write_text(json.dumps(report, indent=2) + "\n", encoding="utf-8") + + if not report["os_release"]: + print("::error::guest has no os-release; cannot record provenance. Failing closed.") + return 1 + if report["missing"]: + print( + "::error::guest image lacks extension-validation prerequisites: " + + ", ".join(report["missing"]) + + ". This is a provisioning error, not a test result. Failing closed." + ) + return 1 + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tests/unit/test_guest_preflight.py b/tests/unit/test_guest_preflight.py new file mode 100644 index 000000000..bbf1bb63b --- /dev/null +++ b/tests/unit/test_guest_preflight.py @@ -0,0 +1,188 @@ +"""Unit tests for :mod:`scripts.guest_preflight`. + +The extension-validation lane (issue #908) must fail closed, before boot, when +the guest image lacks a prerequisite, and must record which guest it tested. +The fixture tree mirrors the layout of the official GNOME OS nightly bootc +image (inventoried from ``nightly.20261027.1``), which ships everything except +``gnome-ponytail-daemon``. +""" +from __future__ import annotations + +import json +import os +from pathlib import Path + +import pytest + +from scripts.guest_preflight import ( + REQUIREMENTS, + build_report, + check_requirements, + main, + parse_os_release, +) + +GNOME_OS_RELEASE = """\ +NAME="GNOME OS" +VERSION="Nightly (Container Image)" +VERSION_ID="Nightly" +ID="org.gnome.os" +PRETTY_NAME="GNOME OS Nightly (Container Image)" +IMAGE_VERSION="nightly.20261027.1" +GNOMEOS_COMMIT="9c38eabcde1ed15f01f4250323ce6a8ab1b8a3da" +""" + +# Paths observed in the GNOME OS nightly image, one per prerequisite. +GNOME_OS_PATHS = [ + "usr/lib/modules/7.3.0/vmlinuz", + "usr/lib/modules/7.3.0/initramfs.img", + "usr/lib/modules/7.3.0/kernel/drivers/input/misc/uinput.ko.zst", + "usr/bin/sshd", + "usr/lib/systemd/system/sshd.service", + "usr/bin/sudo", + "usr/bin/gdm", + "usr/bin/gnome-shell", + "usr/bin/gnome-extensions", + "usr/bin/gdbus", + "usr/bin/python3", + "usr/lib/python3.14/ensurepip/__init__.py", + "usr/lib/python3.14/site-packages/gi/__init__.py", + "usr/libexec/at-spi-bus-launcher", +] + + +def _make_tree(root: Path, paths: list[str], os_release: str | None = GNOME_OS_RELEASE) -> Path: + for rel in paths: + p = root / rel + p.parent.mkdir(parents=True, exist_ok=True) + p.touch() + if os_release is not None: + (root / "usr/lib").mkdir(parents=True, exist_ok=True) + (root / "usr/lib/os-release").write_text(os_release) + (root / "etc").mkdir(exist_ok=True) + os.symlink("../usr/lib/os-release", root / "etc/os-release") + return root + + +@pytest.fixture +def stock_gnome_os(tmp_path: Path) -> Path: + return _make_tree(tmp_path, GNOME_OS_PATHS) + + +@pytest.fixture +def gnome_os_with_ponytail(stock_gnome_os: Path) -> Path: + (stock_gnome_os / "usr/libexec/gnome-ponytail-daemon").touch() + return stock_gnome_os + + +def test_stock_gnome_os_is_missing_only_ponytail(stock_gnome_os: Path) -> None: + report = build_report(stock_gnome_os) + assert report["missing"] == ["gnome-ponytail-daemon"] + assert report["ok"] is False + assert report["is_gnome_os"] is True + + +def test_complete_guest_passes_and_records_provenance(gnome_os_with_ponytail: Path) -> None: + report = build_report( + gnome_os_with_ponytail, + image_ref="quay.io/gnome_infrastructure/gnome-build-meta:gnomeos-nightly", + image_digest="sha256:abc", + ) + assert report["ok"] is True + assert report["missing"] == [] + assert report["image_digest"] == "sha256:abc" + assert report["os_release"]["IMAGE_VERSION"] == "nightly.20261027.1" + assert report["os_release"]["GNOMEOS_COMMIT"] == "9c38eabcde1ed15f01f4250323ce6a8ab1b8a3da" + assert "VERSION" not in report["os_release"] # only the provenance keys + + +def test_non_gnome_os_guest_is_recorded_not_relabelled(tmp_path: Path) -> None: + root = _make_tree( + tmp_path, + GNOME_OS_PATHS + ["usr/libexec/gnome-ponytail-daemon"], + os_release='NAME="Dakota"\nID=dakota\n', + ) + report = build_report(root) + assert report["ok"] is True + assert report["is_gnome_os"] is False + + +@pytest.mark.parametrize("name", sorted(REQUIREMENTS)) +def test_each_requirement_fails_closed_when_absent(tmp_path: Path, name: str) -> None: + full = GNOME_OS_PATHS + ["usr/libexec/gnome-ponytail-daemon"] + root = _make_tree(tmp_path, full) + for pattern in REQUIREMENTS[name]: + for hit in sorted(root.glob(pattern)): + hit.unlink() + assert name in build_report(root)["missing"] + + +def test_builtin_uinput_satisfies_requirement(tmp_path: Path) -> None: + paths = [p for p in GNOME_OS_PATHS if "uinput" not in p] + root = _make_tree(tmp_path, paths) + builtin = root / "usr/lib/modules/7.3.0/modules.builtin" + builtin.write_text("kernel/drivers/input/misc/uinput.ko\n") + assert check_requirements(root)["uinput"] == ["usr/lib/modules/7.3.0/modules.builtin"] + + +def test_modules_builtin_without_uinput_does_not_satisfy(tmp_path: Path) -> None: + paths = [p for p in GNOME_OS_PATHS if "uinput" not in p] + root = _make_tree(tmp_path, paths) + (root / "usr/lib/modules/7.3.0/modules.builtin").write_text("kernel/fs/ext4/ext4.ko\n") + assert check_requirements(root)["uinput"] == [] + + +def test_dangling_absolute_symlink_counts_and_is_not_followed(tmp_path: Path) -> None: + root = _make_tree(tmp_path, GNOME_OS_PATHS) + # Inside a mounted deployment, absolute links point at the guest's /, which + # on the host is a different tree. lexists() must accept them unresolved. + os.symlink("/usr/libexec/does-not-exist-on-host", root / "usr/libexec/gnome-ponytail-daemon") + assert check_requirements(root)["gnome-ponytail-daemon"] == ["usr/libexec/gnome-ponytail-daemon"] + + +def test_missing_os_release_fails_closed(tmp_path: Path) -> None: + root = _make_tree(tmp_path, GNOME_OS_PATHS + ["usr/libexec/gnome-ponytail-daemon"], os_release=None) + report = build_report(root) + assert report["ok"] is False + assert main([str(root)]) == 1 + + +def test_parse_os_release_unquotes_and_skips_comments() -> None: + parsed = parse_os_release('# comment\nID=org.gnome.os\nNAME="GNOME OS"\nX=\'y\'\n\nbogus\n') + assert parsed == {"ID": "org.gnome.os", "NAME": "GNOME OS", "X": "y"} + + +def test_main_writes_report_and_fails_closed_on_stock_gnome_os( + stock_gnome_os: Path, tmp_path: Path, capsys: pytest.CaptureFixture[str] +) -> None: + out = tmp_path / "results" / "guest-provenance.json" + rc = main([str(stock_gnome_os), "--image-ref", "img", "--image-digest", "sha256:d", "--output", str(out)]) + assert rc == 1 + data = json.loads(out.read_text()) + assert data["missing"] == ["gnome-ponytail-daemon"] + assert data["image_digest"] == "sha256:d" + assert "MISSING gnome-ponytail-daemon" in capsys.readouterr().out + + +def test_main_passes_complete_guest(gnome_os_with_ponytail: Path) -> None: + assert main([str(gnome_os_with_ponytail)]) == 0 + + +def test_main_rejects_non_directory_root(tmp_path: Path) -> None: + assert main([str(tmp_path / "nope")]) == 2 + + +ACTION = Path(__file__).parents[2] / ".github" / "actions" / "gnome-e2e" / "action.yml" + + +def test_action_runs_preflight_before_boot_for_extensions_only() -> None: + text = ACTION.read_text(encoding="utf-8") + install = text.partition("- name: Install OCI image and configure disk")[2].partition("\n - name:")[0] + assert install, "Install OCI image step not found in the gnome-e2e action" + assert "GNOME_E2E_SUITE: ${{ inputs.suite }}" in install + assert 'if [[ "${GNOME_E2E_SUITE}" == "extensions" ]]; then' in install + assert "_testsuite/scripts/guest_preflight.py" in install + assert "results/guest-provenance.json" in install + # the loop device and mounts are released before the step fails + assert install.index('sudo losetup -d "${LOOP}"') < install.index("PREFLIGHT_RC} -ne 0") + assert text.index("guest_preflight.py") < text.index("- name: Boot VM with QEMU + KVM") From 9ed29a7af1d570e6cc5b195665b30b74ba5f3d1a Mon Sep 17 00:00:00 2001 From: codebymarshall Date: Tue, 27 Oct 2026 22:55:39 +0000 Subject: [PATCH 2/6] docs(gnome-e2e): sketch the resolve job used by the extensions lane example The extensions-lane example referenced needs.resolve.outputs.digest without defining a resolve job. Sketch one in gnomeos-guest-provenance.md (resolving gnomeos-nightly with skopeo) and point at it from the example's comment, keeping gnome-extensions-validation.md within the 200-line reference limit enforced by validate_docs.py. Co-Authored-By: Claude Opus 5.5 Signed-off-by: codebymarshall --- .../references/gnome-extensions-validation.md | 2 +- .../references/gnomeos-guest-provenance.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md b/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md index 6d531c1be..e28a7d0a5 100644 --- a/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md +++ b/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md @@ -79,7 +79,7 @@ action hands `inputs.image` verbatim to `podman pull` / `bootc install`. - uses: ./.github/actions/gnome-e2e with: # requires an image that carries gnome-ponytail-daemon (blocker 1 above); - # a digest resolved at dispatch time — gnomeos-* digests expire after 2 weeks + # digest from a not-yet-written `resolve` job (sketch: gnomeos-guest-provenance.md); expires in 2 weeks image: quay.io/gnome_infrastructure/gnome-build-meta@${{ needs.resolve.outputs.digest }} suite: extensions # uses tests/extensions/ (landed with #914) ``` diff --git a/docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md b/docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md index 6b18ce633..2b6e0fec1 100644 --- a/docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md +++ b/docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md @@ -38,6 +38,24 @@ curl -sI -H "Authorization: Bearer $TOKEN" \ # or: skopeo inspect docker://quay.io/gnome_infrastructure/gnome-build-meta:gnomeos-nightly | jq -r .Digest ``` +### Resolving the digest in a workflow + +No workflow does this yet. A sketch of a `resolve` job whose output feeds the `gnome-e2e` +`image:` input (the e2e job declares `needs: resolve`): + +```yaml +jobs: + resolve: + runs-on: ubuntu-latest + outputs: + digest: ${{ steps.digest.outputs.digest }} + steps: + - id: digest + run: | + d=$(skopeo inspect docker://quay.io/gnome_infrastructure/gnome-build-meta:gnomeos-nightly | jq -r .Digest) + echo "digest=$d" >> "$GITHUB_OUTPUT" +``` + ## Guest inventory (verified against the image, not booted) Inventoried 2026-10-27 from `gnomeos-nightly` @ `sha256:9dd3a858…e824c` From f8238c5a8e7cd86c7d09b09792fa841bb1e6769d Mon Sep 17 00:00:00 2001 From: codebymarshall Date: Tue, 27 Oct 2026 23:38:10 +0000 Subject: [PATCH 3/6] docs(ci-ops): drop expired gnomeos digest pin; skip guest hits under escaping parent links fedora-version-targets.md still documented the static gnomeos-nightly digest this PR shows returns MANIFEST_UNKNOWN. Replace it with the resolve-per-run rule and link gnomeos-guest-provenance.md. guest_preflight's 'never resolved' claim held only for the final path component: lexists() and Path.glob() both traverse symlinked parent directories, so a guest usr/lib64 -> /usr/lib would be probed on the host. Discard hits whose parents resolve outside the guest tree, with tests for both the literal and glob paths. Co-Authored-By: Claude Opus 5.5 Signed-off-by: codebymarshall --- .../references/gnomeos-guest-provenance.md | 5 +++-- .../ops/references/fedora-version-targets.md | 16 ++++++-------- scripts/guest_preflight.py | 21 +++++++++++++++--- tests/unit/test_guest_preflight.py | 22 +++++++++++++++++++ 4 files changed, 50 insertions(+), 14 deletions(-) diff --git a/docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md b/docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md index 2b6e0fec1..5248ceafc 100644 --- a/docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md +++ b/docs/skills/ci-ops/e2e-workflow/references/gnomeos-guest-provenance.md @@ -94,5 +94,6 @@ error when any prerequisite above is missing (or the guest has no `os-release`). stock GNOME OS on exactly one item, `gnome-ponytail-daemon` — that is the correct, named failure in place of a qecore error ten minutes later. It records `is_gnome_os` from `os-release` `ID` but does not reject other images, so a Bluefin/Dakota extensions run stays possible and is -never labelled GNOME OS. Paths are checked with `lexists` and never resolved, so absolute guest -symlinks are not followed onto the host. +never labelled GNOME OS. The final path component is checked with `lexists` and never resolved, +and hits under a parent directory that resolves outside the guest tree are discarded, so +absolute guest symlinks are not followed onto the host. diff --git a/docs/skills/ci-ops/ops/references/fedora-version-targets.md b/docs/skills/ci-ops/ops/references/fedora-version-targets.md index c109c163f..113c5154d 100644 --- a/docs/skills/ci-ops/ops/references/fedora-version-targets.md +++ b/docs/skills/ci-ops/ops/references/fedora-version-targets.md @@ -17,7 +17,7 @@ Three Fedora versions appear in this repo. They are not interchangeable. | **`behave --dry-run` CI container** (`pr-validate.yml`) | `fedora:41` (pinned digest) | qecore/dogtail/GObject ABI target; PyGObject from Ubuntu breaks | | **Test runner image** (`container/Containerfile.runner`) | `fedora-minimal:latest` (rebuilt weekly) | Base for the runner container shipped to the VM | | **OS under test (gnomeos)** | `gnomeos-latest` (current Fedora / GNOME release) | `quay.io/gnome_infrastructure/gnome-build-meta` | -| **OS under test (extension-validation lane)** | `gnomeos-nightly` (pinned digest) | reproducible GNOME OS build for the developer extension validation lane (#908) | +| **OS under test (extension-validation lane)** | `gnomeos-nightly` (digest resolved per run; tags expire after 2 weeks) | GNOME OS build for the developer extension validation lane (#908); provenance recorded in `results/guest-provenance.json` | | **OS under test (Bluefin)** | Fedora 41 based (stable/gts/lts) | Do NOT test against F42 — Bluefin does not ship it | **Never use F42**: no Bluefin or Bazzite image is based on Fedora 42. @@ -49,15 +49,13 @@ one moving part in the lane: the base image digest. > `docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md` for the > open blockers. -**Pinned digest (do not float):** the lane passes this digest reference — not the -`gnomeos-nightly` tag — to the `gnome-e2e` action's `image` input. +**Resolve the digest at dispatch time:** `gnomeos-*` digests expire two weeks after push, so +no static pin is kept here. The lane resolves `gnomeos-nightly` to a digest per run and passes +that `@sha256:…` reference — not the tag — to the `gnome-e2e` action's `image` input; see +[gnomeos-guest-provenance.md](../../e2e-workflow/references/gnomeos-guest-provenance.md). -``` -quay.io/gnome_infrastructure/gnome-build-meta@sha256:57eeef917d057e37d8d5824fab195ebf3b0ad49fc1ca191b7bc02b82418ed981 -``` - -Sibling tags for reference only (not pinned for the lane): `gnomeos-51`, -`gnomeos-50`, `gnomeos-latest`. If the nightly digest changes, re-derive it with: +Sibling tags for reference only: `gnomeos-51`, `gnomeos-50`, `gnomeos-latest`. +Resolve the current nightly digest with: ```bash skopeo inspect docker://quay.io/gnome_infrastructure/gnome-build-meta:gnomeos-nightly \ diff --git a/scripts/guest_preflight.py b/scripts/guest_preflight.py index 7c55087fd..02eeabce2 100644 --- a/scripts/guest_preflight.py +++ b/scripts/guest_preflight.py @@ -15,8 +15,10 @@ Without this gate a missing prerequisite surfaces minutes later as a confusing qecore/behave failure (or no results at all) instead of a named provisioning -error. Paths are checked with ``os.path.lexists`` and never resolved, so an -absolute symlink inside the guest tree is never followed onto the host. +error. The final path component is checked with ``os.path.lexists`` and never +resolved, and a hit is discarded when any parent directory resolves outside the +guest tree, so an absolute symlink inside the guest is never followed onto the +host. See ``docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md``. """ @@ -83,12 +85,25 @@ def _has_builtin_uinput(path: Path) -> bool: return any(line.rstrip().endswith("/uinput.ko") for line in text.splitlines()) +def _parents_inside(root: Path, rel: Path) -> bool: + """True when every parent directory of *rel* resolves inside *root*. + + ``lexists`` and ``Path.glob`` both traverse symlinked parent directories, so + a guest ``usr/lib64 -> /usr/lib`` would otherwise be probed on the host. + """ + base = root.resolve() + return all((root / parent).resolve().is_relative_to(base) for parent in rel.parents) + + def _matches(root: Path, pattern: str) -> list[str]: """Return guest-relative paths matching *pattern*, without following links.""" if not any(ch in pattern for ch in "*?["): - return [pattern] if os.path.lexists(root / pattern) else [] + hit = os.path.lexists(root / pattern) and _parents_inside(root, Path(pattern)) + return [pattern] if hit else [] found = [] for path in sorted(root.glob(pattern)): + if not _parents_inside(root, path.relative_to(root)): + continue if pattern.endswith("modules.builtin") and not _has_builtin_uinput(path): continue found.append(path.relative_to(root).as_posix()) diff --git a/tests/unit/test_guest_preflight.py b/tests/unit/test_guest_preflight.py index bbf1bb63b..93362b9d3 100644 --- a/tests/unit/test_guest_preflight.py +++ b/tests/unit/test_guest_preflight.py @@ -140,6 +140,28 @@ def test_dangling_absolute_symlink_counts_and_is_not_followed(tmp_path: Path) -> assert check_requirements(root)["gnome-ponytail-daemon"] == ["usr/libexec/gnome-ponytail-daemon"] +@pytest.mark.parametrize( + ("link", "pattern_hit"), + [ + ("usr/lib64", "usr/lib64/python3.14/site-packages/gi/__init__.py"), + ("usr/libexec", "usr/libexec/gnome-ponytail-daemon"), + ], +) +def test_parent_symlink_escaping_guest_is_not_followed( + tmp_path: Path, link: str, pattern_hit: str +) -> None: + root = _make_tree(tmp_path / "guest", [p for p in GNOME_OS_PATHS if not p.startswith(link + "/")]) + host = tmp_path / "host" + target = host / Path(pattern_hit).relative_to(link) + target.parent.mkdir(parents=True) + target.write_text("") + if (root / link).exists(): + os.rename(root / link, tmp_path / "moved") + os.symlink(host, root / link) + hits = [h for hits in check_requirements(root).values() for h in hits] + assert pattern_hit not in hits + + def test_missing_os_release_fails_closed(tmp_path: Path) -> None: root = _make_tree(tmp_path, GNOME_OS_PATHS + ["usr/libexec/gnome-ponytail-daemon"], os_release=None) report = build_report(root) From 45b3b04cbc9eb6d6239e5c3079e6d5561a9285a8 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 01:19:02 -0400 Subject: [PATCH 4/6] fix(gnome-e2e): accept lib64 ensurepip and correct provenance status Fedora-based guests ship the stdlib under usr/lib64, so the preflight now accepts ensurepip there too, mirroring python-gi. The status list now separates per-run recording (done) from the digest resolve job (not yet). Hive-Fix-Attempt: 2/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .../e2e-workflow/references/gnome-extensions-validation.md | 4 +++- scripts/guest_preflight.py | 5 ++++- tests/unit/test_guest_preflight.py | 7 +++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md b/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md index 7f8d6d335..a175eaa42 100644 --- a/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md +++ b/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md @@ -184,8 +184,10 @@ A host socket, key, or mount exposed to the guest desktop is a regression: stop ## Status -- [x] Provenance contract: digest resolved per run and recorded in +- [x] Provenance contract: tested build recorded per run in `results/guest-provenance.json` (static pins expire after 2 weeks) +- [ ] Provenance contract: resolve job that pins the digest per run + (sketched in `gnomeos-guest-provenance.md`; no workflow does this yet) - [x] Guest inventory verified against the image layers; four hive extensions documented - [x] Pre-boot preflight (`scripts/guest_preflight.py`) fails closed on missing prerequisites - [x] Mandatory service gate implemented and unit-tested (`scripts/extension_validation.py`) diff --git a/scripts/guest_preflight.py b/scripts/guest_preflight.py index 02eeabce2..917081c16 100644 --- a/scripts/guest_preflight.py +++ b/scripts/guest_preflight.py @@ -50,7 +50,10 @@ "gnome-extensions": ("usr/bin/gnome-extensions",), "gdbus": ("usr/bin/gdbus",), "python3": ("usr/bin/python3",), - "python-ensurepip": ("usr/lib/python3*/ensurepip/__init__.py",), + "python-ensurepip": ( + "usr/lib/python3*/ensurepip/__init__.py", + "usr/lib64/python3*/ensurepip/__init__.py", + ), "python-gi": ( "usr/lib/python3*/site-packages/gi/__init__.py", "usr/lib64/python3*/site-packages/gi/__init__.py", diff --git a/tests/unit/test_guest_preflight.py b/tests/unit/test_guest_preflight.py index 93362b9d3..da4114edc 100644 --- a/tests/unit/test_guest_preflight.py +++ b/tests/unit/test_guest_preflight.py @@ -125,6 +125,13 @@ def test_builtin_uinput_satisfies_requirement(tmp_path: Path) -> None: assert check_requirements(root)["uinput"] == ["usr/lib/modules/7.3.0/modules.builtin"] +def test_lib64_ensurepip_satisfies_requirement(tmp_path: Path) -> None: + lib64 = "usr/lib64/python3.14/ensurepip/__init__.py" + paths = [p for p in GNOME_OS_PATHS if "ensurepip" not in p] + [lib64] + root = _make_tree(tmp_path, paths) + assert check_requirements(root)["python-ensurepip"] == [lib64] + + def test_modules_builtin_without_uinput_does_not_satisfy(tmp_path: Path) -> None: paths = [p for p in GNOME_OS_PATHS if "uinput" not in p] root = _make_tree(tmp_path, paths) From 920af3a2c5e68ad1a437b6867b9047ae3765fffe Mon Sep 17 00:00:00 2001 From: Danathar Date: Wed, 28 Oct 2026 07:14:20 -0400 Subject: [PATCH 5/6] docs(gnome-e2e): rewrap two paragraphs to keep the reference at 200 lines docs-validate failed on gnome-extensions-validation.md at 202 lines (the reference cap is 200). Rewrap the new provenance paragraph and the credentials bullet at 100 columns; the words are unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SnzFs53Qcer1xDySyxv1Vj Signed-off-by: Danathar --- .../references/gnome-extensions-validation.md | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md b/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md index a175eaa42..888d30070 100644 --- a/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md +++ b/docs/skills/ci-ops/e2e-workflow/references/gnome-extensions-validation.md @@ -22,11 +22,10 @@ and exercised with a qecore/Behave input+AT-SPI scenario. ## Provenance, image inventory and pre-boot preflight `gnomeos-*` tags and digests expire two weeks after push, so the lane resolves a digest per run -and the action records it, with the guest `os-release` identity, in -`results/guest-provenance.json`. Stock GNOME OS nightly carries every lane prerequisite except -`gnome-ponytail-daemon`, and `scripts/guest_preflight.py` fails `suite: extensions` closed on that -before boot. Evidence, commands and the full inventory: -[gnomeos-guest-provenance.md](gnomeos-guest-provenance.md). +and the action records it, with the guest `os-release` identity, in `results/guest-provenance.json`. +Stock GNOME OS nightly carries every lane prerequisite except `gnome-ponytail-daemon`, and +`scripts/guest_preflight.py` fails `suite: extensions` closed on that before boot. Evidence, +commands and the full inventory: [gnomeos-guest-provenance.md](gnomeos-guest-provenance.md). ## Provisioned surface @@ -173,12 +172,11 @@ and must never reach the host: - **No privileged host mounts** — the VM boots from a raw disk written by `bootc install`; the host filesystem is not writable from the guest. - **Credentials are guest-local and disposable** — the harness SSH key (`authorized_keys` in the - `bluefin-test` home, `action.yml:215`) and the `bluefin-test` autologin let the harness drive - the guest. Extension code runs in `gnome-shell` **as `bluefin-test`**, who also has - `NOPASSWD:ALL` sudo (`action.yml:224-226`), so extension code **can** read that key and escalate - **inside the guest**. Accepted: the key is generated per run, authorises nothing but this - throwaway VM, and grants no reach back to the host. Never reuse a long-lived or host-valid - credential here. + `bluefin-test` home, `action.yml:215`) and the `bluefin-test` autologin let the harness drive the + guest. Extension code runs in `gnome-shell` **as `bluefin-test`**, who also has `NOPASSWD:ALL` + sudo (`action.yml:224-226`), so extension code **can** read that key and escalate **inside the + guest**. Accepted: the key is generated per run, authorises nothing but this throwaway VM, and + grants no reach back to the host. Never reuse a long-lived or host-valid credential here. A host socket, key, or mount exposed to the guest desktop is a regression: stop and file an issue. From 4f768f8b54b5fb183df4a0ba47c6fceb8afd4b25 Mon Sep 17 00:00:00 2001 From: Danathar Date: Wed, 28 Oct 2026 07:24:42 -0400 Subject: [PATCH 6/6] docs(e2e-workflow): join one sentence to keep SKILL.md at 500 lines Merging main brought #1040's reference link next to this PR's, taking SKILL.md to 501 lines (cap 500). Join one two-line sentence; same words. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SnzFs53Qcer1xDySyxv1Vj Signed-off-by: Danathar --- docs/skills/ci-ops/e2e-workflow/SKILL.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/skills/ci-ops/e2e-workflow/SKILL.md b/docs/skills/ci-ops/e2e-workflow/SKILL.md index 06cfbfa4f..50b865a0e 100644 --- a/docs/skills/ci-ops/e2e-workflow/SKILL.md +++ b/docs/skills/ci-ops/e2e-workflow/SKILL.md @@ -103,8 +103,7 @@ protecting anything. ## Job-summary scenario counts come from `scripts/e2e_summary.py` -Never derive `passed` by subtraction. `passed = total - failed - skipped` is wrong -on two counts: +Never derive `passed` by subtraction. `passed = total - failed - skipped` is wrong on two counts: - `results.json` `elements` include **`background`** entries alongside `scenario` ones, so `len(elements)` overstates the scenario total.