From 5dc73d7a5b2ab8cdf27ded5386600f3af4a5ab14 Mon Sep 17 00:00:00 2001 From: Michael Hughes Date: Wed, 30 Sep 2026 22:14:34 -0700 Subject: [PATCH 1/3] Complete candidate network audio and PAM screen-lock paths --- docs/os/DESKTOP_OPERATION.md | 103 ++++++++++++++++++ docs/os/HARDWARE_QUALIFICATION.md | 6 +- docs/os/RELEASE_CONTRACT.md | 2 + packaging/arch/phishell/PKGBUILD | 13 ++- packaging/linux/build-linux.sh | 2 +- packaging/linux/packages.x86_64 | 2 +- packaging/linux/prepare_profile.py | 7 +- packaging/linux/session/audio-session.conf | 2 + packaging/linux/session/phios-audio.target | 5 + packaging/linux/session/phios-lock | 9 ++ packaging/linux/session/phios-lock.desktop | 8 ++ packaging/linux/session/phios-network.desktop | 8 ++ .../linux/session/phios-policykit.service | 13 +++ packaging/linux/session/phios-session.target | 2 +- packaging/linux/session/wayfire.ini | 8 +- packaging/linux/tests/desktop_probe.py | 70 ++++++++++++ packaging/linux/tests/installed_probe.py | 5 +- packaging/linux/tests/qemu_desktop.py | 64 +++++++++++ packaging/linux/tests/qemu_install.py | 18 ++- packaging/linux/tests/qemu_preview.py | 19 +++- tests/test_linux_release_foundation.py | 6 + 21 files changed, 355 insertions(+), 17 deletions(-) create mode 100644 docs/os/DESKTOP_OPERATION.md create mode 100644 packaging/linux/session/audio-session.conf create mode 100644 packaging/linux/session/phios-audio.target create mode 100755 packaging/linux/session/phios-lock create mode 100644 packaging/linux/session/phios-lock.desktop create mode 100644 packaging/linux/session/phios-network.desktop create mode 100644 packaging/linux/session/phios-policykit.service create mode 100644 packaging/linux/tests/desktop_probe.py create mode 100644 packaging/linux/tests/qemu_desktop.py diff --git a/docs/os/DESKTOP_OPERATION.md b/docs/os/DESKTOP_OPERATION.md new file mode 100644 index 00000000..ffa33da8 --- /dev/null +++ b/docs/os/DESKTOP_OPERATION.md @@ -0,0 +1,103 @@ +# Experimental desktop operation + +The candidate adds NetworkManager, a user PipeWire/WirePlumber audio stack, +Wayfire session locking and a non-root graphical PolicyKit authentication agent. +These are ordinary Linux desktop/administration paths. They do not create PhiOS +operator decisions, bindings or leases and do not authorize an agent or browser +to perform a general desktop effect. The restricted installed proof broker and +its UID separation remain described in LINUX_PROOF_WORKFLOW.md. + +## Open, lock and end the session + +| Action | Current path | +| --- | --- | +| PhiOS terminal | Super+Enter | +| Ordinary Linux terminal | Super+Alt+Enter | +| Application launcher | Super+Space | +| PhiShell window | Super+P | +| Lock current Wayfire session | Super+L or the `Lock PhiOS session` launcher entry | +| Network settings | Super+N or the `Network settings` launcher entry | +| Logout | Close/end Wayfire; the supervised session target stops | + +`phios-lock` runs the packaged swaylock under the current non-root Wayfire +session. Wayfire's session-lock plugin supplies the protocol; swaylock waits for +the compositor's locked acknowledgement before its daemonizing caller returns. +Unlock uses the current account's ordinary PAM password. The volatile live +password is public `phios`; installed users keep the fresh password they chose. +Root/headless invocation is refused. Automatic idle/suspend locking is not +enabled by this candidate; lock explicitly before a suspend test. No protection +against arbitrary root or malicious same-UID administrator code is inferred. + +For deliberate ordinary administration, use the terminal's normal +password-authenticated sudo account on an installed system. The live account +retains only its narrow maintenance sudo commands. The graphical PolicyKit agent +uses the distribution's existing policies and PAM; it changes no policy to make +the live user an administrator or to bypass an authentication request. Its startup +is tested separately from any future specific graphical administration operation. + +## Wired and wireless configuration + +NetworkManager owns wired and Wi-Fi address/DNS configuration; systemd-resolved +provides the resolver. A second networkd/iwd configuration owner is not enabled. +NetworkManager's HTTP connectivity URL polling is explicitly disabled. Connect +a wired cable and inspect `nmcli device status`. The terminal interface is +`nmtui`; account or system-wide changes may require normal administrator +authentication. A driver/radio must actually exist before Wi-Fi can work. + +For a user-private Wi-Fi connection from the real desktop terminal: + +```sh +nmcli device wifi list +nmcli --ask device wifi connect 'YOUR_SSID' private yes +``` + +Replace the SSID. `--ask` prompts for credentials instead of placing a password +in arguments/history. Connection files belong to NetworkManager's protected +system store with their selected user permissions; they are outside PhiOS's +data-only backup. The live overlay is volatile. Matched root checkpoints include +installed system configuration, so a deliberate root restore also restores its +network profiles. Record hardware/DHCP/DNS results without publishing personal +SSID, passwords, MAC/IP details or private connection files. + +## User audio + +`phios-audio.target` starts PipeWire, its PulseAudio compatibility server, +WirePlumber and their sockets as the desktop user. The session stops these units +on logout and starts them again on reauthentication. No root audio daemon or +automatic microphone recording is added. Inspect actual devices/streams with +`wpctl status`; adjust the observed default output with `wpctl`, for example: + +```sh +wpctl set-volume @DEFAULT_AUDIO_SINK@ 50% +wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +``` + +An unavailable output/microphone remains unavailable. Actual playback/capture, +device choice, mute/volume, HDMI/USB and suspend/resume on the named physical +machine are separate hardware tests. + +## Candidate qualification scope + +The new exact normal live gate attaches only a restricted QEMU user-network +Ethernet device on the documentation range `192.0.2.0/24`, without port forwarding, +and an emulated HDA device with a null audio backend. It checks actual DHCP +address/gateway/DNS configuration, non-root service/process ownership and actual +PCM playback through the emulated ALSA sink. This does not test Internet DNS, +Wi-Fi association, physical speakers/microphones or a GPU driver. + +The external QMP test invokes the actual Super+L binding, observes the lock, +tries a wrong password, then unlocks with the real public disposable PAM +credential. The installed lane repeats with the installer-created account's +fresh test password. Tests preserve lock/refusal/unlock screenshots, exact +source/ISO and serial evidence. The installed/update/recovery VM retains no NIC, +host disk, host audio device or shared folders. + +This added qualification is pending actual CI. Earlier passed ISO hashes remain +valid only for their recorded earlier scope; do not claim these new features +qualified until their actual new artifact receipt passes. Physical hardware, +final signed transition and distribution delivery remain open. + +Upstream references: [Wayfire configuration](https://github.com/WayfireWM/wayfire/blob/master/wayfire.ini), +[swaylock](https://github.com/swaywm/swaylock), +[NetworkManager/nmcli](https://www.networkmanager.dev/docs/api/latest/nmcli.html), +[WirePlumber](https://pipewire.pages.freedesktop.org/wireplumber/daemon/running.html). diff --git a/docs/os/HARDWARE_QUALIFICATION.md b/docs/os/HARDWARE_QUALIFICATION.md index 78ff90f7..2f4fd422 100644 --- a/docs/os/HARDWARE_QUALIFICATION.md +++ b/docs/os/HARDWARE_QUALIFICATION.md @@ -52,8 +52,10 @@ All compatibility results remain `not tested` until actual observations exist. Record pass/fail/not available with evidence for resolution/rendering and multiple displays; keyboard/mouse/keymap; wired networking and Wi-Fi association, DHCP/DNS; audio playback/recording; sleep/resume; shutdown/restart; and storage -visibility. Record missing drivers and services honestly. Audio/session locking -and Wi-Fi configuration are not currently qualified product features. A blank +visibility. Record missing drivers and services honestly. The later desktop +candidate adds NetworkManager, user audio and manual PAM locking; its new +software/VM scope is recorded in DESKTOP_OPERATION.md. Physical audio and Wi-Fi +remain unqualified until actual observations exist. A blank audio-card count or successful PCI enumeration is not audio/GPU compatibility. Resolve observed blockers, build a new exact candidate and repeat affected tests before moving to installation. diff --git a/docs/os/RELEASE_CONTRACT.md b/docs/os/RELEASE_CONTRACT.md index 04e7ba92..7322cab6 100644 --- a/docs/os/RELEASE_CONTRACT.md +++ b/docs/os/RELEASE_CONTRACT.md @@ -13,6 +13,8 @@ Python package versions and OS versions are independent. OS tags start with - Local observation of host, services, processes, devices and native packages. - A non-root Wayfire session, Chromium application window, Waybar and terminal. - Supervised user services with bounded loopback ports and private state umask. +- Candidate NetworkManager wired/Wi-Fi configuration, user audio and manual + PAM screen locking; exact new qualification is described in DESKTOP_OPERATION.md. - Optional governed history when an operator supplies an enabled memory config. - Curiosity projection access, with consequential persistence approval held. diff --git a/packaging/arch/phishell/PKGBUILD b/packaging/arch/phishell/PKGBUILD index c7ad6d2b..54c9a58e 100644 --- a/packaging/arch/phishell/PKGBUILD +++ b/packaging/arch/phishell/PKGBUILD @@ -1,11 +1,13 @@ pkgname=phishell pkgver=0.16.0 -pkgrel=1 +pkgrel=2 pkgdesc='PhiShell browser interface and local observation transport' arch=('any') url='https://github.com/MichaelWave369/PhiOS' license=('MIT') -depends=('nodejs' 'phios' 'wayfire' 'waybar' 'wofi' 'foot' 'chromium' 'ttf-dejavu') +depends=('nodejs' 'phios' 'wayfire' 'waybar' 'wofi' 'foot' 'chromium' 'ttf-dejavu' + 'pipewire' 'pipewire-audio' 'pipewire-pulse' 'pipewire-alsa' 'wireplumber' 'swaylock' + 'lxqt-policykit' 'qt6-wayland') makedepends=('npm') source=('phios-source.tar.gz') sha256sums=("${PHIOS_SOURCE_SHA256:?hashed source archive required}") @@ -25,11 +27,18 @@ package() { install -Dm644 LICENSE "$pkgdir/usr/share/licenses/phishell/LICENSE" install -Dm755 packaging/linux/session/phios-session "$pkgdir/usr/bin/phios-session" install -Dm755 packaging/linux/session/phios-open-shell "$pkgdir/usr/bin/phios-open-shell" + install -Dm755 packaging/linux/session/phios-lock "$pkgdir/usr/bin/phios-lock" install -Dm755 packaging/linux/session/phios-session-ready "$pkgdir/usr/lib/phishell/session-ready" install -Dm644 packaging/linux/session/phios.desktop "$pkgdir/usr/share/wayland-sessions/phios.desktop" for unit in packaging/linux/session/*.service packaging/linux/session/*.target; do install -Dm644 "$unit" "$pkgdir/usr/lib/systemd/user/${unit##*/}" done + for unit in pipewire.service pipewire-pulse.service wireplumber.service pipewire.socket pipewire-pulse.socket; do + install -Dm644 packaging/linux/session/audio-session.conf \ + "$pkgdir/usr/lib/systemd/user/$unit.d/50-phios-session.conf" + done + install -Dm644 packaging/linux/session/phios-lock.desktop "$pkgdir/usr/share/applications/phios-lock.desktop" + install -Dm644 packaging/linux/session/phios-network.desktop "$pkgdir/usr/share/applications/phios-network.desktop" install -Dm644 packaging/linux/session/wayfire.ini "$pkgdir/etc/xdg/phios/wayfire.ini" install -Dm644 packaging/linux/session/waybar.json "$pkgdir/etc/xdg/phios/waybar.json" } diff --git a/packaging/linux/build-linux.sh b/packaging/linux/build-linux.sh index 4a3291bd..4751c059 100755 --- a/packaging/linux/build-linux.sh +++ b/packaging/linux/build-linux.sh @@ -12,7 +12,7 @@ cat > /etc/pacman.d/mirrorlist <&2; exit 1; } [[ -n ${PHIOS_SOURCE_COMMIT:-} ]] || { echo 'PHIOS_SOURCE_COMMIT is required.' >&2; exit 1; } [[ $(git -c safe.directory="$repo" -C "$repo" rev-parse HEAD) == "$PHIOS_SOURCE_COMMIT" ]] || { echo 'Source commit mismatch.' >&2; exit 1; } diff --git a/packaging/linux/packages.x86_64 b/packaging/linux/packages.x86_64 index 89c607aa..def08e31 100644 --- a/packaging/linux/packages.x86_64 +++ b/packaging/linux/packages.x86_64 @@ -12,7 +12,7 @@ systemd-sysvcompat mesa greetd greetd-tuigreet -iwd +networkmanager curl gptfdisk dosfstools diff --git a/packaging/linux/prepare_profile.py b/packaging/linux/prepare_profile.py index f1784daa..50635ae5 100644 --- a/packaging/linux/prepare_profile.py +++ b/packaging/linux/prepare_profile.py @@ -128,10 +128,13 @@ def write(name: str, content: str) -> None: "install -m644 /usr/share/phios/preview-os-release /etc/os-release\n") write("usr/share/phios/preview-os-release", f'NAME="PhiOS Linux Preview"\nID=phios\nID_LIKE=arch\n' f'PRETTY_NAME="PhiOS Linux {version} Development Preview"\nVERSION_ID="{version}"\n') - write("etc/systemd/network/20-wired.network", "[Match]\nName=en* eth*\n[Network]\nDHCP=yes\n") + # One owner supplies both wired and Wi-Fi address/DNS configuration. + # Keep connectivity URL polling disabled in this local-first preview. + write("etc/NetworkManager/conf.d/10-phios.conf", "[main]\ndns=systemd-resolved\n" + "[connectivity]\nenabled=false\nuri=\ninterval=0\n") wants = root / "etc/systemd/system/multi-user.target.wants" wants.mkdir(parents=True) - for name in ["systemd-networkd.service", "systemd-resolved.service", "iwd.service"]: + for name in ["NetworkManager.service", "systemd-resolved.service"]: (wants / name).symlink_to(f"/usr/lib/systemd/system/{name}") graphical = root / "etc/systemd/system/graphical.target.wants" graphical.mkdir(parents=True) diff --git a/packaging/linux/session/audio-session.conf b/packaging/linux/session/audio-session.conf new file mode 100644 index 00000000..5c1658a2 --- /dev/null +++ b/packaging/linux/session/audio-session.conf @@ -0,0 +1,2 @@ +[Unit] +PartOf=phios-audio.target diff --git a/packaging/linux/session/phios-audio.target b/packaging/linux/session/phios-audio.target new file mode 100644 index 00000000..16cce7e7 --- /dev/null +++ b/packaging/linux/session/phios-audio.target @@ -0,0 +1,5 @@ +[Unit] +Description=PhiOS user audio session +PartOf=phios-session.target +Wants=pipewire.service pipewire-pulse.service wireplumber.service pipewire.socket pipewire-pulse.socket +After=pipewire.service pipewire-pulse.service wireplumber.service diff --git a/packaging/linux/session/phios-lock b/packaging/linux/session/phios-lock new file mode 100755 index 00000000..d1f6196b --- /dev/null +++ b/packaging/linux/session/phios-lock @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euo pipefail +if [[ $EUID -eq 0 || -z ${WAYLAND_DISPLAY:-} || -z ${XDG_RUNTIME_DIR:-} ]]; then + echo 'Open screen locking from the non-root Wayfire session.' >&2 + exit 1 +fi +# Daemonization returns only after the compositor reports that it is locked. +# PAM requests the current user's password on the lock screen, never via argv. +exec /usr/bin/swaylock --daemonize --ignore-empty-password --color 111318 diff --git a/packaging/linux/session/phios-lock.desktop b/packaging/linux/session/phios-lock.desktop new file mode 100644 index 00000000..8c47f8e5 --- /dev/null +++ b/packaging/linux/session/phios-lock.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=Lock PhiOS session +Comment=Lock the current Wayfire session using its normal PAM password +Exec=phios-lock +Icon=system-lock-screen +Terminal=false +Categories=System; diff --git a/packaging/linux/session/phios-network.desktop b/packaging/linux/session/phios-network.desktop new file mode 100644 index 00000000..411df90e --- /dev/null +++ b/packaging/linux/session/phios-network.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=Network settings +Comment=Manage wired and Wi-Fi connections using NetworkManager +Exec=foot nmtui +Icon=network-wireless +Terminal=false +Categories=Settings;Network; diff --git a/packaging/linux/session/phios-policykit.service b/packaging/linux/session/phios-policykit.service new file mode 100644 index 00000000..60c19c63 --- /dev/null +++ b/packaging/linux/session/phios-policykit.service @@ -0,0 +1,13 @@ +[Unit] +Description=PhiOS graphical Linux administration authentication agent +PartOf=phios-session.target +StartLimitIntervalSec=60 +StartLimitBurst=3 + +[Service] +Type=exec +ExecStart=/usr/bin/lxqt-policykit-agent +Environment=QT_QPA_PLATFORM=wayland +Restart=on-failure +RestartSec=2 +UMask=0077 diff --git a/packaging/linux/session/phios-session.target b/packaging/linux/session/phios-session.target index b1e3e439..f494fd5f 100644 --- a/packaging/linux/session/phios-session.target +++ b/packaging/linux/session/phios-session.target @@ -1,3 +1,3 @@ [Unit] Description=PhiOS graphical session services -Wants=phios-observer.service phios-curiosity-reader.service phios-history-reader.service phios-browser.service phios-waybar.service +Wants=phios-observer.service phios-curiosity-reader.service phios-history-reader.service phios-browser.service phios-waybar.service phios-audio.target phios-policykit.service diff --git a/packaging/linux/session/wayfire.ini b/packaging/linux/session/wayfire.ini index 14ef17a1..96ce6866 100644 --- a/packaging/linux/session/wayfire.ini +++ b/packaging/linux/session/wayfire.ini @@ -1,6 +1,6 @@ # Wayfire 0.11 public configuration options. [core] -plugins = autostart command decoration move resize place grid vswitch wm-actions +plugins = autostart command decoration move resize place grid vswitch wm-actions session-lock vwidth = 3 vheight = 3 close_top_view = KEY_Q | KEY_F4 @@ -12,10 +12,16 @@ phios = /usr/lib/phishell/session-ready [command] binding_terminal = KEY_ENTER command_terminal = foot phi +binding_linux_terminal = KEY_ENTER +command_linux_terminal = foot binding_launcher = KEY_SPACE command_launcher = wofi --show drun binding_shell = KEY_P command_shell = phios-open-shell +binding_lock = KEY_L +command_lock = phios-lock +binding_network = KEY_N +command_network = foot nmtui [move] activate = BTN_LEFT diff --git a/packaging/linux/tests/desktop_probe.py b/packaging/linux/tests/desktop_probe.py new file mode 100644 index 00000000..bc840e5a --- /dev/null +++ b/packaging/linux/tests/desktop_probe.py @@ -0,0 +1,70 @@ +"""External ordinary-user desktop probe; never installed into the ISO.""" +from __future__ import annotations + +import json +import os +import struct +import subprocess +import tempfile +import time +import wave +from pathlib import Path + + +def desktop_services(source: str, *, wired: bool = False) -> dict: + assert os.getuid() == 1000 and os.geteuid() == 1000 + assert Path('/usr/share/phios/source-commit').read_text().strip() == source + units = ['phios-audio.target', 'pipewire.service', 'pipewire-pulse.service', 'wireplumber.service', 'phios-policykit.service'] + for _ in range(60): + active = subprocess.run(['systemctl', '--user', 'is-active', '--quiet', *units]).returncode == 0 + graph = json.loads(subprocess.check_output(['pw-dump'], text=True, timeout=10)) if active else [] + devices = [item for item in graph if item.get('type') == 'PipeWire:Interface:Device' and + item.get('info', {}).get('props', {}).get('device.api') == 'alsa'] + sinks = [item for item in graph if item.get('type') == 'PipeWire:Interface:Node' and + item.get('info', {}).get('props', {}).get('media.class') == 'Audio/Sink' and + item.get('info', {}).get('props', {}).get('factory.name') == 'api.alsa.pcm.sink'] + if active and devices and sinks: + break + time.sleep(1) + else: + subprocess.run(['journalctl', '--user', '--no-pager', '-n', '60', '-u', 'pipewire', '-u', 'wireplumber']) + raise RuntimeError('user audio session did not expose the actual emulated ALSA device/sink') + for name in ['pipewire', 'pipewire-pulse', 'wireplumber']: + subprocess.run(['pgrep', '-u', '1000', '-x', name], check=True, stdout=subprocess.DEVNULL) + agent_pid = subprocess.check_output(['systemctl', '--user', 'show', 'phios-policykit.service', + '--property=MainPID', '--value'], text=True).strip() + assert agent_pid.isdigit() and int(agent_pid) > 0 + status = (Path('/proc') / agent_pid / 'status').read_text().splitlines() + assert next(line for line in status if line.startswith('Uid:')).split()[1:] == ['1000'] * 4 + # The VM has a synthetic HDA device with a QEMU null backend, not host audio. + # Play actual PCM frames through the selected ALSA sink; hearing/capture is + # a separate physical test and is never inferred from this return code. + with tempfile.TemporaryDirectory(prefix='phios-audio-probe-') as temporary: + path = Path(temporary) / 'probe.wav' + with wave.open(str(path), 'wb') as stream: + stream.setnchannels(1) + stream.setsampwidth(2) + stream.setframerate(48000) + stream.writeframes(b''.join(struct.pack(' None: +def probe(source: str, phase: int, *, signed_update: bool = False, desktop_check=None) -> None: root = Path.home() / ".local/state/phios" assert os.getuid() == 1000 assert Path("/usr/share/phios/source-commit").read_text().strip() == source @@ -68,6 +68,9 @@ def probe(source: str, phase: int, *, signed_update: bool = False) -> None: "-u", "phios-curiosity-reader.service", "-u", "phios-observer.service"], timeout=15) raise RuntimeError("installed graphical login did not start the complete supervised desktop") time.sleep(2) # Preserve a rendered application screenshot after process readiness. + if desktop_check is None: + raise RuntimeError('external desktop service verifier is required') + desktop_check(source) boot_id = Path("/proc/sys/kernel/random/boot_id").read_text().strip().replace("-", "") print("PHIOS_INSTALLED_CHECK_OK:" + json.dumps({"source_commit": source, "phase": phase, "boot_id": boot_id, "record_sha256": record.record_sha256}), flush=True) diff --git a/packaging/linux/tests/qemu_desktop.py b/packaging/linux/tests/qemu_desktop.py new file mode 100644 index 00000000..23fb2a9d --- /dev/null +++ b/packaging/linux/tests/qemu_desktop.py @@ -0,0 +1,64 @@ +"""External QMP screen-lock test using the guest's real shortcut and PAM.""" +from __future__ import annotations + +import json +import re +import secrets +import time +from pathlib import Path +from typing import Callable + +from qemu_boot import capture_display, qmp_request + + +def qualify_lock(qmp: Path, output: Path, *, source: str, password: str, label: str, + program: Callable[[str], None], wait: Callable[[str], re.Match[str]]) -> dict: + if not re.fullmatch('[a-z0-9-]+', password): + raise ValueError('only the public disposable test password is accepted by this key driver') + + def state(locked: bool) -> dict: + nonce = secrets.token_hex(8) + marker = 'PHIOS_LOCK_STATE_' + nonce + ':' + program("import os,json,subprocess,time\nfrom pathlib import Path\n" + "assert os.getuid()==1000\n" + f"expected={locked!r}\n" + "for _ in range(30):\n" + " active=subprocess.run(['pgrep','-u','1000','-x','swaylock'],capture_output=True).returncode==0\n" + " if active==expected: break\n" + " time.sleep(1)\n" + "else: raise RuntimeError('real session lock/PAM state did not match')\n" + f"print({marker!r}+json.dumps({{'locked':active,'uid':os.getuid()," + "'source_commit':Path('/usr/share/phios/source-commit').read_text().strip()," + "'boot_id':Path('/proc/sys/kernel/random/boot_id').read_text().strip().replace('-','')}),flush=True)\n") + result = json.loads(wait(re.escape(marker) + r'(\{[^\r\n]+\})')[1]) + if result['locked'] is not locked or result['uid'] != 1000 or result['source_commit'] != source: + raise RuntimeError('screen-lock identity/state differs') + return result + + def keys(value: str) -> None: + for key in [*value, 'ret']: + code = 'minus' if key == '-' else key + qmp_request(qmp, {'execute': 'send-key', 'arguments': { + 'keys': [{'type': 'qcode', 'data': code}], 'hold-time': 80}}) + time.sleep(0.12) + + state(False) + qmp_request(qmp, {'execute': 'send-key', 'arguments': { + 'keys': [{'type': 'qcode', 'data': key} for key in ['meta_l', 'l']], 'hold-time': 80}}) + locked = state(True) + capture_display(qmp, output, name=f'screen-{label}-locked') + keys('wrong-lock-password') + time.sleep(5) # Allow the actual PAM refusal/delay before another attempt. + state(True) + capture_display(qmp, output, name=f'screen-{label}-wrong-password') + qmp_request(qmp, {'execute': 'send-key', 'arguments': { + 'keys': [{'type': 'qcode', 'data': key} for key in ['ctrl', 'u']], 'hold-time': 80}}) + time.sleep(0.2) + keys(password) + unlocked = state(False) + capture_display(qmp, output, name=f'screen-{label}-unlocked') + if locked['boot_id'] != unlocked['boot_id']: + raise RuntimeError('unlock required an unexpected reboot') + return {'source_commit': source, 'boot_id': unlocked['boot_id'], 'uid': 1000, + 'actual_super_l_shortcut': True, 'wrong_password_held': True, + 'correct_pam_password_unlocked': True, 'release_ready': False} diff --git a/packaging/linux/tests/qemu_install.py b/packaging/linux/tests/qemu_install.py index addc3882..f1f28cb1 100644 --- a/packaging/linux/tests/qemu_install.py +++ b/packaging/linux/tests/qemu_install.py @@ -14,6 +14,7 @@ from typing import Any from qemu_boot import capture_display, enter_live_login, qmp_request +from qemu_desktop import qualify_lock PASSWORD = "phios-qa-only-2026" # Same public ephemeral test credential as live fixture. @@ -187,7 +188,9 @@ def qualify(iso: Path, source: str, output: Path, *, recovery: bool = False, sig "-drive", f"if=pflash,format=raw,file={variables}", "-drive", f"file={disk},if=none,id=target,format=qcow2", "-device", "virtio-blk-pci,drive=target,serial=PHIOS_CI_BLANK,bootindex=2", - "-nic", "none", "-vga", "none", "-device", "virtio-vga", + "-nic", "none", '-audiodev', 'none,id=previewaudio', + '-device', 'intel-hda', '-device', 'hda-duplex,audiodev=previewaudio', + "-vga", "none", "-device", "virtio-vga", "-display", "none", "-monitor", "none"] if signed_update: if not recovery: @@ -290,7 +293,9 @@ def wait_for(pattern: str) -> re.Match[str]: time.sleep(1) send_text(qmp, PASSWORD) program = Path(__file__).with_name("installed_probe.py").read_text() + \ - f"\nprobe({source!r}, {phase}, signed_update={signed_update!r})\n" + f"\nprobe({source!r}, {phase}, signed_update={signed_update!r}, desktop_check=desktop_services)\n" + program = Path(__file__).with_name('desktop_probe.py').read_text() + '\n' + \ + program.replace('from __future__ import annotations\n', '') if Path(__file__).with_name('proof_smoke.py').exists(): program = Path(__file__).with_name('proof_smoke.py').read_text() + \ (f'\nproof_workflow({source!r})\n' if phase == 1 else f'\nhistorical_proof({source!r})\n') + \ @@ -323,6 +328,15 @@ def wait_for(pattern: str) -> re.Match[str]: receipt['linux_governed_workflow_qualified'] = True receipt["boot_ids"].append(details["boot_id"]) receipt["record_sha256"] = details["record_sha256"] + audio = re.search(r'PHIOS_DESKTOP_SERVICES_OK:(\{[^\r\n]+\})', text) + if audio is None: + raise RuntimeError('actual installed audio/network service evidence missing') + receipt.setdefault('desktop_service_boots', []).append(json.loads(audio[1])) + if phase == 1: + def desktop_program(value: str) -> None: + channel.sendall(("python - <<'PHIOS_DESKTOP_PROBE'\n" + value + '\nPHIOS_DESKTOP_PROBE\n').encode()) + receipt['installed_screen_lock'] = qualify_lock(qmp, output, source=source, + password=PASSWORD, label='installed', program=desktop_program, wait=wait_for) capture_display(qmp, output, name=f"screen-installed-{phase}") if recovery and phase == 2: # Test-only administration through normal sudo diff --git a/packaging/linux/tests/qemu_preview.py b/packaging/linux/tests/qemu_preview.py index be87b0fa..be60d60f 100644 --- a/packaging/linux/tests/qemu_preview.py +++ b/packaging/linux/tests/qemu_preview.py @@ -15,6 +15,7 @@ from qemu_boot import capture_display, enter_live_login, qmp_request from qemu_install import stop +from qemu_desktop import qualify_lock PROBE = ''' import json,os,subprocess,time,urllib.request @@ -83,7 +84,8 @@ def pid(): reachable=True except OSError: reachable=False - if not active and not reachable: break + audio_active=subprocess.run(args+['is-active','--quiet','phios-audio.target'],capture_output=True).returncode==0 + if not active and not reachable and not audio_active: break time.sleep(1) else: raise RuntimeError('logout did not stop the supervised session') @@ -104,14 +106,18 @@ def qualify(iso: Path, source: str, output: Path) -> None: 'host' if accelerator == 'kvm' else 'max', '-m', '4096', '-smp', '2', '-drive', 'if=pflash,format=raw,readonly=on,file=/usr/share/OVMF/OVMF_CODE_4M.fd', '-drive', 'if=pflash,format=raw,file=' + str(variables), '-cdrom', str(iso.resolve()), '-boot', 'd', - '-nic', 'none', '-vga', 'none', '-device', 'virtio-vga', '-display', 'none', '-monitor', 'none', + '-netdev', 'user,id=previewnet,restrict=on,net=192.0.2.0/24,dhcpstart=192.0.2.15,dns=192.0.2.3,host=192.0.2.2', + '-device', 'virtio-net-pci,netdev=previewnet', '-audiodev', 'none,id=previewaudio', + '-device', 'intel-hda', '-device', 'hda-duplex,audiodev=previewaudio', + '-vga', 'none', '-device', 'virtio-vga', '-display', 'none', '-monitor', 'none', '-serial', f'unix:{serial},server=on,wait=off', '-qmp', f'unix:{qmp},server=on,wait=off'] with iso.open('rb') as handle: iso_hash = hashlib.file_digest(handle, 'sha256').hexdigest() receipt: dict[str, Any] = {'schema_version': 'phios.fixture-free-live-evidence.v1', 'source_commit': source, 'iso_sha256': iso_hash, 'command': command, 'accelerator': accelerator, 'boots': [], 'fixture_free_qualified': False, 'hardware_qualified': False, 'release_ready': False, - 'public_volatile_credentials': True, 'test_code_injected_into_image': False} + 'public_volatile_credentials': True, 'test_code_injected_into_image': False, + 'restricted_virtual_ethernet': True, 'external_network_forwarding': False, 'host_audio_attached': False} with (output / 'qemu.log').open('w') as log: process = subprocess.Popen(command, stdout=log, stderr=subprocess.STDOUT) try: @@ -167,11 +173,16 @@ def program(value: str) -> None: channel.sendall(b'phios\n') time.sleep(2) text = '' - program(f'SOURCE={source!r}\nSTAGE="first"\n' + PROBE) + desktop = Path(__file__).with_name('desktop_probe.py').read_text().replace('from __future__ import annotations\n', '') + program(f'SOURCE={source!r}\nSTAGE="first"\n' + desktop + f'\ndesktop_services({source!r}, wired=True)\n' + PROBE) first = json.loads(wait(r'PHIOS_PREVIEW_OK:(\{[^\r\n]+\})')[1]) assert first['source_commit'] == source and first['stage'] == 'first' + desktop_result = json.loads(wait(r'PHIOS_DESKTOP_SERVICES_OK:(\{[^\r\n]+\})')[1]) + receipt.setdefault('desktop_service_boots', []).append(desktop_result) time.sleep(2) capture_display(qmp, output, name=f'screen-{boot}-first') + receipt.setdefault('screen_lock_boots', []).append(qualify_lock(qmp, output, source=source, + password='phios', label=f'live-{boot}', program=program, wait=wait)) text = '' program(LIFECYCLE) lifecycle = json.loads(wait(r'PHIOS_PREVIEW_LOGOUT_OK:(\{[^\r\n]+\})')[1]) diff --git a/tests/test_linux_release_foundation.py b/tests/test_linux_release_foundation.py index a8d468e9..fc186058 100644 --- a/tests/test_linux_release_foundation.py +++ b/tests/test_linux_release_foundation.py @@ -45,6 +45,12 @@ def test_profile_drops_root_autologin_and_keeps_required_boot_inputs(tmp_path: P assert (destination / "airootfs/etc/systemd/system/systemd-firstboot.service").readlink() == Path("/dev/null") assert (destination / "airootfs/etc/localtime").readlink() == Path("/usr/share/zoneinfo/UTC") assert (destination / "airootfs/etc/vconsole.conf").read_text() == "KEYMAP=us\n" + wants = destination / 'airootfs/etc/systemd/system/multi-user.target.wants' + assert (wants / 'NetworkManager.service').is_symlink() + assert not (wants / 'systemd-networkd.service').exists() + assert not (wants / 'iwd.service').exists() + network = (destination / 'airootfs/etc/NetworkManager/conf.d/10-phios.conf').read_text() + assert 'dns=systemd-resolved' in network and 'enabled=false' in network and 'interval=0' in network for name, text in inputs.items(): assert (upstream / name).read_text() == text with pytest.raises(ValueError, match="refusing to overwrite"): From cda880f273a7d68afdd95670e2555c4f766884f6 Mon Sep 17 00:00:00 2001 From: Michael Hughes Date: Wed, 30 Sep 2026 22:51:09 -0700 Subject: [PATCH 2/3] fix(os): qualify restricted DHCP and preserve desktop failure --- docs/os/DESKTOP_OPERATION.md | 24 ++- docs/os/RELEASE_HANDOFF.md | 10 +- docs/os/evidence/desktop-attempts.json | 83 +++++++++ .../evidence/qualification-gate-5a1431f4.json | 171 ++++++++++++++++++ packaging/linux/tests/desktop_probe.py | 21 ++- packaging/linux/tests/qemu_preview.py | 6 +- 6 files changed, 300 insertions(+), 15 deletions(-) create mode 100644 docs/os/evidence/desktop-attempts.json create mode 100644 docs/os/evidence/qualification-gate-5a1431f4.json diff --git a/docs/os/DESKTOP_OPERATION.md b/docs/os/DESKTOP_OPERATION.md index ffa33da8..6984deac 100644 --- a/docs/os/DESKTOP_OPERATION.md +++ b/docs/os/DESKTOP_OPERATION.md @@ -17,7 +17,8 @@ its UID separation remain described in LINUX_PROOF_WORKFLOW.md. | PhiShell window | Super+P | | Lock current Wayfire session | Super+L or the `Lock PhiOS session` launcher entry | | Network settings | Super+N or the `Network settings` launcher entry | -| Logout | Close/end Wayfire; the supervised session target stops | +| Logout | From the ordinary desktop terminal, `loginctl terminate-session "$XDG_SESSION_ID"`; the supervised session target stops | +| Restart / shutdown | `systemctl reboot` / `systemctl poweroff`, under ordinary logind/PolicyKit permission | `phios-lock` runs the packaged swaylock under the current non-root Wayfire session. Wayfire's session-lock plugin supplies the protocol; swaylock waits for @@ -25,7 +26,9 @@ the compositor's locked acknowledgement before its daemonizing caller returns. Unlock uses the current account's ordinary PAM password. The volatile live password is public `phios`; installed users keep the fresh password they chose. Root/headless invocation is refused. Automatic idle/suspend locking is not -enabled by this candidate; lock explicitly before a suspend test. No protection +enabled by this candidate; lock explicitly before a suspend test with +`phios-lock && systemctl suspend`, then observe the actual resume/unlock. +Suspend remains a physical hardware gate. No protection against arbitrary root or malicious same-UID administrator code is inferred. For deliberate ordinary administration, use the terminal's normal @@ -80,8 +83,9 @@ machine are separate hardware tests. The new exact normal live gate attaches only a restricted QEMU user-network Ethernet device on the documentation range `192.0.2.0/24`, without port forwarding, -and an emulated HDA device with a null audio backend. It checks actual DHCP -address/gateway/DNS configuration, non-root service/process ownership and actual +and an emulated HDA device with a null audio backend. It checks the actual DHCP +address/server and the absence of an IPv4 gateway/DNS advertisement in this +restricted network, non-root service/process ownership and actual PCM playback through the emulated ALSA sink. This does not test Internet DNS, Wi-Fi association, physical speakers/microphones or a GPU driver. @@ -92,7 +96,14 @@ fresh test password. Tests preserve lock/refusal/unlock screenshots, exact source/ISO and serial evidence. The installed/update/recovery VM retains no NIC, host disk, host audio device or shared folders. -This added qualification is pending actual CI. Earlier passed ISO hashes remain +The first normal attempt rejected the probe's incorrect expectation of gateway +and DNS DHCP options. libslirp deliberately omits both in restricted mode; the +corrected probe requires their absence and the actual lease/server. The failed +image/source, serial log and screenshot hashes are retained in +`evidence/desktop-attempts.json`. The installed signed QA lane passed its added +audio and PAM lock checks, but that does not qualify the failed normal image. + +The complete added qualification is pending actual CI. Earlier passed ISO hashes remain valid only for their recorded earlier scope; do not claim these new features qualified until their actual new artifact receipt passes. Physical hardware, final signed transition and distribution delivery remain open. @@ -100,4 +111,5 @@ final signed transition and distribution delivery remain open. Upstream references: [Wayfire configuration](https://github.com/WayfireWM/wayfire/blob/master/wayfire.ini), [swaylock](https://github.com/swaywm/swaylock), [NetworkManager/nmcli](https://www.networkmanager.dev/docs/api/latest/nmcli.html), -[WirePlumber](https://pipewire.pages.freedesktop.org/wireplumber/daemon/running.html). +[WirePlumber](https://pipewire.pages.freedesktop.org/wireplumber/daemon/running.html), +[libslirp DHCP implementation](https://qemu.googlesource.com/libslirp/+/refs/heads/master/src/bootp.c). diff --git a/docs/os/RELEASE_HANDOFF.md b/docs/os/RELEASE_HANDOFF.md index 3a42a7d7..a8a80022 100644 --- a/docs/os/RELEASE_HANDOFF.md +++ b/docs/os/RELEASE_HANDOFF.md @@ -43,9 +43,15 @@ Review and merge only in stack order after assessing each stated boundary: | [275](https://github.com/MichaelWave369/PhiOS/pull/275) | Exact inventories, notices, SBOM/provenance and normal live-image gate | | [276](https://github.com/MichaelWave369/PhiOS/pull/276) | Restricted Linux proof broker, hardware handoff and bundled frontend inventory | | [277](https://github.com/MichaelWave369/PhiOS/pull/277) | Exact normal-image installed/recovery gate and explicit serial password login | +| [278](https://github.com/MichaelWave369/PhiOS/pull/278) | Always-reported same-source `release-gate` and reusable qualification jobs | +| [279](https://github.com/MichaelWave369/PhiOS/pull/279) | NetworkManager, user audio, manual PAM locking and their actual desktop probes | -Review the follow-on always-reported qualification gate after this stack; its -normal and QA jobs reuse the existing exact-image procedures. See +The aggregate gate passed all nine jobs in run 36816117488 for source +`5a1431f4758029a9c04abfb5471351e9abf88a3f`, with 2,279 Python tests passed and +six existing optional skips. Its actual normal and signed QA scopes and exact +hashes are in `evidence/qualification-gate-5a1431f4.json`. The later desktop +candidate has a different source/artifact and its own pending qualification. +The aggregate normal and QA jobs reuse the existing exact-image procedures. See BUILD_AND_QUALIFY.md for the `release-gate` required-status handoff. Review source and tests, not just a green check. Main and OS release-tag protection still require maintainer configuration. Keep publication separate from the diff --git a/docs/os/evidence/desktop-attempts.json b/docs/os/evidence/desktop-attempts.json new file mode 100644 index 00000000..7fa78f79 --- /dev/null +++ b/docs/os/evidence/desktop-attempts.json @@ -0,0 +1,83 @@ +{ + "attempts": [ + { + "actual_guest_error": "restricted virtual Ethernet did not receive exact DHCP address/gateway/DNS configuration", + "compact_checksum_payloads_verified": [ + "builder-image.json", + "builder-packages.txt", + "fixture-inventory.json", + "image-packages.txt", + "javascript-bundled-packages.json", + "javascript-packages.json", + "native-packages.json", + "provenance.json", + "python-packages.json", + "release.json", + "sbom.cdx.json", + "source-archive-sha256.txt", + "source-commit.txt", + "source-review.json", + "third-party-notices.json" + ], + "evidence_archive_sha256": "beb6b807aab21268b313ab16d4c87ece8acbd197755096746136dd99c8c3180d", + "evidence_artifact_id": 11143486098, + "evidence_files": { + "PhiOS/PhiOS/dist/fixture-free/SHA256SUMS": "9131d7681b9afe0e89d768cbcf04447d188aaffea7c35db663bdeab058b58909", + "PhiOS/PhiOS/dist/fixture-free/build.log": "be279f0d32c20e1764674758984ac42a6667f4ab155fc1ba7883278b2ad603fb", + "PhiOS/PhiOS/dist/fixture-free/builder-image.json": "bde5aff2d12494b6d1d9fc4979d0b85ba84f2b8613e32592f607a8be28be75d5", + "PhiOS/PhiOS/dist/fixture-free/builder-packages.txt": "374d8ffd2ec34f22d8ef7f28110927eef7d17586faba2954e1906a2c5229c35f", + "PhiOS/PhiOS/dist/fixture-free/fixture-inventory.json": "14ce1577031ab6cc9b29967bc57b054661ce36d3a5ec0ada86a0bba9ddc9627e", + "PhiOS/PhiOS/dist/fixture-free/image-packages.txt": "742b3c4ce23cb82cdc8eb10f95152fc1b39422bdf9dd4532b66693d2fa92b202", + "PhiOS/PhiOS/dist/fixture-free/javascript-bundled-packages.json": "04402e02c14a791ffc99968668594c1943081f1f7237a36e8b440dd0d896bf1f", + "PhiOS/PhiOS/dist/fixture-free/javascript-packages.json": "a9026fc707306f7fb2ffb952b884197a66ccc3def539f90f938e8c4b7e4e0582", + "PhiOS/PhiOS/dist/fixture-free/mkarchiso.log": "4c92e2985abb0192291c5d3e686105d2b07f169823dd72bc9a763eb0dd89ef4f", + "PhiOS/PhiOS/dist/fixture-free/native-packages.json": "c4512631417cb2abe68bad762536a4f6feeab4da38af48644de488fc1a78f057", + "PhiOS/PhiOS/dist/fixture-free/provenance.json": "64d2f01fd4269c749f49c41fc20d638f82c321a74da3b7ad98176364ae4cc655", + "PhiOS/PhiOS/dist/fixture-free/python-packages.json": "ef6655e03b4fd5a1bac84e505582a2b14bef22d7f45ee034f9339bffa61b8f7e", + "PhiOS/PhiOS/dist/fixture-free/release.json": "0d5499ce8f252637d7a1d6a8bdedeb8aef9829307893e348f3c1bf0795b91a75", + "PhiOS/PhiOS/dist/fixture-free/sbom.cdx.json": "2d08a3d9a6700401ef4eec5c23a1f9a9d230335c3371d79fdc49c18766869638", + "PhiOS/PhiOS/dist/fixture-free/source-archive-sha256.txt": "eaf2f7b867da61feb8a20479acdde6ab6c8e292023557ca0ce061eb98fd28d7c", + "PhiOS/PhiOS/dist/fixture-free/source-commit.txt": "bda5090c07a832f2b1461815a7f709b704d81f9040f4c3292765e3ccb6ce3404", + "PhiOS/PhiOS/dist/fixture-free/source-review.json": "e36d4fe555e3d15c73ba0e9826682228dbf9d87c9e5f99bf0ea686f993d417df", + "PhiOS/PhiOS/dist/fixture-free/third-party-notices.json": "840a10e3dac4ffac473e0f68ba6d078c85ddf1e4120518fa598d1876fe3cc71f", + "_temp/phios-preview/preview-evidence.json": "9598837cee4c62f950998a92364249fd565af31fee933d8249b188a4ab6c7c32", + "_temp/phios-preview/qemu.log": "8b7b90f1a933779d1b1bf072091c730c259ef12a92f551f43ffea63c0a06c701", + "_temp/phios-preview/screen.png": "ed1682dd47ec6f913ee7ebc4c0f7843c4bd99d05315cac94e10f304cf58f942c", + "_temp/phios-preview/serial.log": "341e0fc53dd2bec5e0ebb7e9ac452e93e67ded8d7d6aff24e2754b02684f39ea" + }, + "failure": "External live probe incorrectly expected DHCP gateway/DNS options from restricted libslirp. Upstream deliberately omits both; require exact lease/server and absence of gateway/DNS advertisement. Shell OSC prompt metadata preceded the guest Traceback, so the newline-prefixed host detector missed it and reported a timeout; detect the unprefixed exception and disable Python color in the external probe. No production network isolation or mandatory qualification is relaxed.", + "hardware_qualified": false, + "image_artifact_id": 11143011854, + "image_built": true, + "iso_sha256": "66abc718e7a96f9fdc4cd0d6a835bfcc26c1aae332978491528d94858beafc38", + "job_id": 110229803799, + "large_payloads_redownloaded_and_verified_locally": false, + "normal_installed_qualified": false, + "normal_live_qualified": false, + "observed": [ + "normal non-root PAM login", + "user audio service/ALSA sink/PCM checks returned before DHCP rejection", + "non-root PolicyKit agent startup/ownership checks returned before DHCP rejection", + "actual desktop rendered in preserved failure screenshot" + ], + "release_gate_job_id": 110235250413, + "release_gate_result": "failure", + "release_ready": false, + "reported_error": "normal PAM/desktop qualification timed out", + "reviewed_branch_head": "5dc73d7a5b2ab8cdf27ded5386600f3af4a5ab14", + "separate_qa_does_not_qualify_normal_image": true, + "separate_qa_iso_sha256": "d27e9ea0215e4c353ea908ae287e8a429c4e5f6846cbda0ddfeea224fe715185", + "separate_qa_job_id": 110229803728, + "separate_qa_result": "success", + "separate_qa_scope": [ + "installed audio on three distinct no-ISO PAM/desktop boots", + "actual Super+L binding, wrong-password hold and correct-password PAM unlock", + "signed package/refusal/interruption/matched root+EFI recovery and governed Linux proof" + ], + "source_commit": "83259a24a82a72d279abc4e6f873a07f428817c9", + "tested_source_tree": "a8fc9083997f74975eccdbea37267990b033bd3d", + "workflow_run": 36818833863 + } + ], + "schema_version": "phios.desktop-attempts.v1" +} diff --git a/docs/os/evidence/qualification-gate-5a1431f4.json b/docs/os/evidence/qualification-gate-5a1431f4.json new file mode 100644 index 00000000..bcc85af2 --- /dev/null +++ b/docs/os/evidence/qualification-gate-5a1431f4.json @@ -0,0 +1,171 @@ +{ + "actual_job_results": { + "changes": "success", + "normal-image / fixture-free-candidate": "success", + "phishell / build": "success", + "python-tests / installed-artifact": "success", + "python-tests / ledger-reports": "success", + "python-tests / memory-vector": "success", + "python-tests / test": "success", + "qa-image / live-image": "success", + "release-gate": "success" + }, + "actual_maintainer_signed_transition_qualified": false, + "artifact_expiry": "2026-10-08", + "hardware_qualified": false, + "images": { + "fixture-free": { + "boot_ids": [ + "94116ff083d04325a48641ef7f4c820f", + "60457827002c4e1698dd59c684418eeb", + "036c837f072a404d967523325ddbd4cc" + ], + "evidence_archive_sha256": "7f01bcd279d9ef325e9d03c374c7a3cb7fd4cb46db7ceb89e231dd597fed7614", + "evidence_artifact_id": 11142385019, + "evidence_files": { + "PhiOS/PhiOS/dist/fixture-free/SHA256SUMS": "c95b948360c2cb6e56b7db1d7518a86467df64496960cb4564bf74afd548ba17", + "PhiOS/PhiOS/dist/fixture-free/build.log": "3521dc587ab04a94e266f40d984e902001dbba8c0ed9b86946530c7ca6b86fb4", + "PhiOS/PhiOS/dist/fixture-free/builder-image.json": "c2cadefbff7ce8c115f5cf099818a7302bf6132627e3b616177cc7e3ca40f377", + "PhiOS/PhiOS/dist/fixture-free/builder-packages.txt": "9c8e376a83e3ebbad5078dbb9fc5cc12ecd15ad57c4fa933466bad26dd09a291", + "PhiOS/PhiOS/dist/fixture-free/fixture-inventory.json": "14ce1577031ab6cc9b29967bc57b054661ce36d3a5ec0ada86a0bba9ddc9627e", + "PhiOS/PhiOS/dist/fixture-free/image-packages.txt": "f2c4bf4ca37189cec44b2fb77826e39e2528df2011ff23b94000e3408a4ad93c", + "PhiOS/PhiOS/dist/fixture-free/javascript-bundled-packages.json": "04402e02c14a791ffc99968668594c1943081f1f7237a36e8b440dd0d896bf1f", + "PhiOS/PhiOS/dist/fixture-free/javascript-packages.json": "a9026fc707306f7fb2ffb952b884197a66ccc3def539f90f938e8c4b7e4e0582", + "PhiOS/PhiOS/dist/fixture-free/mkarchiso.log": "ed3023c67353e36793b5337211fa22878320b806a7c4d20bb634b610e6568845", + "PhiOS/PhiOS/dist/fixture-free/native-packages.json": "d46a645d7bb0bc2438e6c4c9c8ca9326e70d6954779e0bd725671663d9aaea3b", + "PhiOS/PhiOS/dist/fixture-free/provenance.json": "ef1b2de74330bdf210ba1cfc407262680fd452f2a0a990d8a5ed3c9407b0cf31", + "PhiOS/PhiOS/dist/fixture-free/python-packages.json": "ef6655e03b4fd5a1bac84e505582a2b14bef22d7f45ee034f9339bffa61b8f7e", + "PhiOS/PhiOS/dist/fixture-free/release.json": "0d5499ce8f252637d7a1d6a8bdedeb8aef9829307893e348f3c1bf0795b91a75", + "PhiOS/PhiOS/dist/fixture-free/sbom.cdx.json": "68526345f9e4d4503ff4ea0b7855e474188580c47c1c3b81daefe57c24a745f6", + "PhiOS/PhiOS/dist/fixture-free/source-archive-sha256.txt": "1355dd2b65364a50bb567bc0c1af172bf2f4ea54a16b96368f0ff38f0733f097", + "PhiOS/PhiOS/dist/fixture-free/source-commit.txt": "eb43fc4d3ab53e56118c52f056e6ebaef2d9dac5d9c2cd4843308ed1b7aa6d2d", + "PhiOS/PhiOS/dist/fixture-free/source-review.json": "2e463c8917b28fd8dd42f5f30fc40b8653ac75eed44c364ae88638319a772097", + "PhiOS/PhiOS/dist/fixture-free/third-party-notices.json": "5427cd9b367f04e2bc89be5ffc4454d2f2d4a1b480bd049551d10a2c15f478cf", + "_temp/phios-normal-installed/failed-boot-qemu.log": "5fbf889470e27f179720fae8b5698f1626e456ffa295326adc12d3d89b13dc5a", + "_temp/phios-normal-installed/failed-boot-serial.log": "6fe5d1ad11bcdac88e1f3422a1ecc42afac1d784ddcc7ea674974c37fcf0cca8", + "_temp/phios-normal-installed/installed-1-qemu.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "_temp/phios-normal-installed/installed-1-serial.log": "88bda2b35ffb1e47b5d3d752ca049041cc722ff59d1d07db48173b8eae65c85a", + "_temp/phios-normal-installed/installed-2-qemu.log": "5fbf889470e27f179720fae8b5698f1626e456ffa295326adc12d3d89b13dc5a", + "_temp/phios-normal-installed/installed-2-serial.log": "eee63649d87844c7a3e32a521b8fdff143792c62e1f77ca8f1ecc9166c59ed18", + "_temp/phios-normal-installed/installed-3-qemu.log": "5fbf889470e27f179720fae8b5698f1626e456ffa295326adc12d3d89b13dc5a", + "_temp/phios-normal-installed/installed-3-serial.log": "71ee28fb6cd1bf6646df742d86d72df5c80e8357fe1b6dfa8d0b6b2aa7e026bb", + "_temp/phios-normal-installed/installed-evidence.json": "15a8e3917e2180130278e316c721f49976ae011fcd37e5574d1a0e37ba0ebbff", + "_temp/phios-normal-installed/normal-install-live-qemu.log": "5fbf889470e27f179720fae8b5698f1626e456ffa295326adc12d3d89b13dc5a", + "_temp/phios-normal-installed/normal-install-live-serial.log": "707f78767b8fd769b0712b02ded35d2882125008e81f5feef6a9a8e1d13a1323", + "_temp/phios-normal-installed/normal-restore-live-qemu.log": "5fbf889470e27f179720fae8b5698f1626e456ffa295326adc12d3d89b13dc5a", + "_temp/phios-normal-installed/normal-restore-live-serial.log": "ccdd86820c8bc6d3a2378c80d9468419e4d38ef8280776cd79db6a09ced4ebf1", + "_temp/phios-normal-installed/screen-failed-boot.png": "fa9c0e12d578182e0df1d4cc0b864b675b4f786546e27c6d67ef8f8045fd3334", + "_temp/phios-normal-installed/screen-installed-1-greeter.png": "f83a37571994ca7274939836bf77a47904c689fb6d38bb8587a11f2432aeba0e", + "_temp/phios-normal-installed/screen-installed-1.png": "c6ebd659a5428c24fb9c72d8e6fb8dc38d77aedbbd5d5c6e24b9a92d973034d0", + "_temp/phios-normal-installed/screen-installed-2-greeter.png": "7ac572d1e19f89901e98628f8aabb11ca2507db1eb09b91123c0276cdbc0a9cc", + "_temp/phios-normal-installed/screen-installed-2.png": "e42d43a591ee6b5259b003d05b61caf2c567b473c5179f60318c393047310981", + "_temp/phios-normal-installed/screen-installed-3-greeter.png": "7ac572d1e19f89901e98628f8aabb11ca2507db1eb09b91123c0276cdbc0a9cc", + "_temp/phios-normal-installed/screen-installed-3.png": "e310314c2848d9901eb9586a12a3f5178f64bcc17a3af8a66603b7b17035a661", + "_temp/phios-normal-installed/screen-normal-install-live.png": "527186390ec2bc1dda8081004f832ae433e993034d483bab414eeb3fddb2aaaa", + "_temp/phios-normal-installed/screen-normal-restore-live.png": "05037adaa0394388d17b617db0606bdde0df9ecc65cb82746f5fc7172886c09b", + "_temp/phios-preview/preview-evidence.json": "7a95cd27f6a20cb305b1a4a88eefb1ed3a59bbc784c1e605a2bb5613b994b81e", + "_temp/phios-preview/qemu.log": "928b7c7a217c94779d8adce0b55555f2677002e653cbd02c8e3186f2ba90ad4a", + "_temp/phios-preview/screen-1-first.png": "bb3d3110e1bb54b8b4e53ad0a7b2673486812ed7642be816b7488a3badc110b9", + "_temp/phios-preview/screen-1-reauthenticated.png": "fcc70ef0687744d9fe989895df1625d05ed8d7beb3a095952ca6fe6747fcead3", + "_temp/phios-preview/screen-2-first.png": "104a0f098d52a2eeead570ec9e515cd0a9eb3ddfc27f6f8d28c5c4f7c9ff50ce", + "_temp/phios-preview/screen-2-reauthenticated.png": "b2a84152607bdbb91f42fc223ad9a8cc876a7ff74844f504532eeea119d80efd", + "_temp/phios-preview/screen.png": "b2a84152607bdbb91f42fc223ad9a8cc876a7ff74844f504532eeea119d80efd", + "_temp/phios-preview/serial.log": "49efdc085e59c66bef0f7e5b8d1dc5449ec766a3c46b0a697395fbcacac62c04" + }, + "fixture_free_installed_qualified": true, + "image_artifact_id": 11141254782, + "iso_sha256": "875f867310afc172124e7c5fa063b24b808099a4bd8e25843be65db681fc0cd0", + "linux_governed_workflow_qualified": true, + "sbom_components": 441, + "signed_package_application_qualified": false, + "source_archive_sha256": "897628d3b061f467c085d03a078cbdf89011888722ab1456d2a8959be026a9fc", + "whole_os_recovery_passed": true + }, + "linux": { + "boot_ids": [ + "f7b3725c7db04a1dbede23ca3bb60cb8", + "2cace2fca4124c32b6e39ef9bae07b11", + "3420d73921304d418bfbc6f9d0ffcb3a" + ], + "evidence_archive_sha256": "9b7d43b7ed1bb030c268d1658a00c7ae46087076afa9ffc7ba99f225af1f683f", + "evidence_artifact_id": 11141931796, + "evidence_files": { + "PhiOS/PhiOS/dist/linux/SHA256SUMS": "b62387969608a080a1c7b1d2243a9115539d6f4e0e581aabb356cd054534191a", + "PhiOS/PhiOS/dist/linux/build.log": "04610e3d6e496aed0037ec80722db880b6f37f017d9be1e8df52411e5c60a854", + "PhiOS/PhiOS/dist/linux/builder-image.json": "642f93358f651b0c82cbd01a641f22ca0788e90863c5db4b2c761ae6a30476e4", + "PhiOS/PhiOS/dist/linux/builder-packages.txt": "9c8e376a83e3ebbad5078dbb9fc5cc12ecd15ad57c4fa933466bad26dd09a291", + "PhiOS/PhiOS/dist/linux/fixture-inventory.json": "2ebf26541ddaa6d1e239b1a3be944946f18e8d08e78837065d11eed7921d7a60", + "PhiOS/PhiOS/dist/linux/image-packages.txt": "dd6faf936234848a574c0d3125da4eddabaa33b8f02998bc7be070250d3e29f9", + "PhiOS/PhiOS/dist/linux/javascript-bundled-packages.json": "04402e02c14a791ffc99968668594c1943081f1f7237a36e8b440dd0d896bf1f", + "PhiOS/PhiOS/dist/linux/javascript-packages.json": "a9026fc707306f7fb2ffb952b884197a66ccc3def539f90f938e8c4b7e4e0582", + "PhiOS/PhiOS/dist/linux/mkarchiso.log": "9ba3b9184ffec6875bd214771c42b02f6d17f679e28fb9384a2560b737ae8553", + "PhiOS/PhiOS/dist/linux/native-packages.json": "1c4d627f63b0efd69216b8f0bb196a9f2d3f1351fc43843f5384ad85b33a4434", + "PhiOS/PhiOS/dist/linux/provenance.json": "af19fe0ffb0ab785d5934cb78ad70cb1412c513017344d3df102bfbd0b714af4", + "PhiOS/PhiOS/dist/linux/python-packages.json": "ef6655e03b4fd5a1bac84e505582a2b14bef22d7f45ee034f9339bffa61b8f7e", + "PhiOS/PhiOS/dist/linux/release.json": "0d5499ce8f252637d7a1d6a8bdedeb8aef9829307893e348f3c1bf0795b91a75", + "PhiOS/PhiOS/dist/linux/sbom.cdx.json": "d420441f1fde7bca20189460ef0cacb6764585a4522b615aa3464fb91a7b0182", + "PhiOS/PhiOS/dist/linux/source-archive-sha256.txt": "1355dd2b65364a50bb567bc0c1af172bf2f4ea54a16b96368f0ff38f0733f097", + "PhiOS/PhiOS/dist/linux/source-commit.txt": "eb43fc4d3ab53e56118c52f056e6ebaef2d9dac5d9c2cd4843308ed1b7aa6d2d", + "PhiOS/PhiOS/dist/linux/source-review.json": "67c315821702df44f86cfd21c8218be8aded943d79144226f2812eeb7f2c0d7b", + "PhiOS/PhiOS/dist/linux/third-party-notices.json": "5427cd9b367f04e2bc89be5ffc4454d2f2d4a1b480bd049551d10a2c15f478cf", + "_temp/phios-boot/boot-evidence.json": "d3033f275c816a5cd76d160a5c6e049c7d9bb6aea9c6a27930ebad833b0d3d65", + "_temp/phios-boot/qemu.log": "e01fdd77d03ccd4437dd37a73e9daf5fe3659332a0094e1551234b15c82b2bab", + "_temp/phios-boot/screen-first.png": "a2a52056502c7e160150e349f7fab038c78fe78de21b162c5ece1eab1cc7f902", + "_temp/phios-boot/screen.png": "eeca173ba9b5409d3e4f2474fb46b4c0f49120b63e6e9d202fdb435c9396a99f", + "_temp/phios-boot/serial.log": "7078d3903b44ebf04af135f583b7593f5ea21caf81cc461e3d1f6df087b39319", + "_temp/phios-installed/failed-boot-qemu.log": "2b49c797697893d0c1a2d44d639a74b258b1870cd2c86ddc32db5a535e29c30a", + "_temp/phios-installed/failed-boot-serial.log": "c9ab564bbb14595342d72b9a04b0de46428bbab813260df174cda489d04e85e0", + "_temp/phios-installed/install-live-qemu.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "_temp/phios-installed/install-live-serial.log": "6c33c150b1f3bf9fcc0e0ec0ab9141820f7419c5ad71f661affcb0cd55472009", + "_temp/phios-installed/installed-1-qemu.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "_temp/phios-installed/installed-1-serial.log": "76732be7ae91cc5e11429d206beaac72138806d6a0b67530e531723f8fd271e0", + "_temp/phios-installed/installed-2-qemu.log": "2b49c797697893d0c1a2d44d639a74b258b1870cd2c86ddc32db5a535e29c30a", + "_temp/phios-installed/installed-2-serial.log": "6a67814d3fe6aad65e5d5be476429637fbafc01370dc309c8258c2a9caf7a62c", + "_temp/phios-installed/installed-3-qemu.log": "2b49c797697893d0c1a2d44d639a74b258b1870cd2c86ddc32db5a535e29c30a", + "_temp/phios-installed/installed-3-serial.log": "b27dbb8f04d46f7a1ef47827bf88691f473078cca2451d6128e8068398873c9e", + "_temp/phios-installed/installed-evidence.json": "1a70b4f48a50951d4f41daf16f45e51c411776642c73b1964e7ae9164b876847", + "_temp/phios-installed/interrupted-resume-live-qemu.log": "2b49c797697893d0c1a2d44d639a74b258b1870cd2c86ddc32db5a535e29c30a", + "_temp/phios-installed/interrupted-resume-live-serial.log": "db83b9c8695251b02d45de9a413c3429cb8b9c0cf49c74e5e74dd470bbf2a1b5", + "_temp/phios-installed/recovery-live-qemu.log": "2b49c797697893d0c1a2d44d639a74b258b1870cd2c86ddc32db5a535e29c30a", + "_temp/phios-installed/recovery-live-serial.log": "b71ded13415d6b429dce59576d7207a8d4a13400a3a208fef6ce4e4887df724a", + "_temp/phios-installed/screen-failed-boot.png": "cb47acbf16d5547d800e433840075d7c2472a1d9fcafcac6ce5cef8cc210a381", + "_temp/phios-installed/screen-install-live.png": "a9630dde996c4767c33e3268970cebafe82897017c42f31a72e632c65daa08e5", + "_temp/phios-installed/screen-installed-1-greeter.png": "f83a37571994ca7274939836bf77a47904c689fb6d38bb8587a11f2432aeba0e", + "_temp/phios-installed/screen-installed-1.png": "be207000735ec55c508eba714da1871bf844775307d833045b322a2bbfb61c93", + "_temp/phios-installed/screen-installed-2-greeter.png": "f83a37571994ca7274939836bf77a47904c689fb6d38bb8587a11f2432aeba0e", + "_temp/phios-installed/screen-installed-2.png": "7cbfe87f5c058b411cb296a4db4130b04180d938db6c9577dda2385581459158", + "_temp/phios-installed/screen-installed-3-greeter.png": "7ac572d1e19f89901e98628f8aabb11ca2507db1eb09b91123c0276cdbc0a9cc", + "_temp/phios-installed/screen-installed-3.png": "70788bdb9bfe2464f75126529b780fe637979a6cf3785f3d87ea3d39fc7e1063", + "_temp/phios-installed/screen-interrupted-resume-live.png": "b7af29929490f8fb3429f4d87cbeb8dce1eca2248ba0304390c0aaeb747a25f8", + "_temp/phios-installed/screen-recovery-live.png": "2dc9ee6b09239b3aa3dca17a063824d3b3d51b87e28a86fb73f015d1bb473c99" + }, + "fixture_free_installed_qualified": false, + "image_artifact_id": 11142136278, + "iso_sha256": "a80c74b2a58560ff6d725a2195ce4d3cfd388c2e6433ab0e5b6141ad67ef4730", + "linux_governed_workflow_qualified": true, + "sbom_components": 442, + "signed_package_application_qualified": true, + "source_archive_sha256": "897628d3b061f467c085d03a078cbdf89011888722ab1456d2a8959be026a9fc", + "whole_os_recovery_passed": true + } + }, + "license_source_compliance_reviewed": false, + "ordinary_ci_existing_skips": 6, + "ordinary_ci_passed": 2279, + "publication_authority": false, + "release_gate_job_id": 110225078875, + "release_ready": false, + "repository_protection_configured": false, + "required_jobs_skipped": false, + "required_scope": { + "normal_image": true, + "python": true, + "qa_image": true, + "ui": true + }, + "reviewed_branch_head": "ee441f5db4ac015512ae9caaeed7c29dfd24bac7", + "schema_version": "phios.ci-qualification-summary.v1", + "source_commit": "5a1431f4758029a9c04abfb5471351e9abf88a3f", + "tested_source_tree": "6217ef309e8d5843d6b84366d18123c452ceb4e8", + "workflow_run": 36816117488 +} diff --git a/packaging/linux/tests/desktop_probe.py b/packaging/linux/tests/desktop_probe.py index bc840e5a..bf09dfb1 100644 --- a/packaging/linux/tests/desktop_probe.py +++ b/packaging/linux/tests/desktop_probe.py @@ -53,18 +53,29 @@ def desktop_services(source: str, *, wired: bool = False) -> dict: 'host_audio_attached': False, 'wired_dhcp_observed': False, 'wifi_radio_qualified': False, 'physical_audio_qualified': False, 'release_ready': False} if wired: + network = {} for _ in range(60): rows = subprocess.check_output(['nmcli', '-t', '-f', 'DEVICE,TYPE,STATE', 'device'], text=True).splitlines() - ethernet = [row.split(':')[0] for row in rows if ':ethernet:connected' in row] + ethernet = [row.split(':')[0] for row in rows if row.split(':')[1:] == ['ethernet', 'connected']] if len(ethernet) == 1: - values = subprocess.check_output(['nmcli', '-g', 'IP4.ADDRESS,IP4.GATEWAY,IP4.DNS', - 'device', 'show', ethernet[0]], text=True).splitlines() - if values == ['192.0.2.15/24', '192.0.2.2', '192.0.2.3']: + network = {field: subprocess.check_output(['nmcli', '-g', field, 'device', 'show', ethernet[0]], + text=True).strip().splitlines() + for field in ['IP4.ADDRESS', 'IP4.GATEWAY', 'IP4.DNS', 'DHCP4.OPTION']} + # libslirp's restricted BOOTP/DHCP server intentionally omits + # RFC1533_GATEWAY and RFC1533_DNS. Require that isolation and + # the actual lease/server, rather than expecting NAT settings. + if (network['IP4.ADDRESS'] == ['192.0.2.15/24'] and not network['IP4.GATEWAY'] + and not network['IP4.DNS'] + and network['DHCP4.OPTION'].count('dhcp_server_identifier = 192.0.2.2') == 1): break time.sleep(1) else: - raise RuntimeError('restricted virtual Ethernet did not receive exact DHCP address/gateway/DNS configuration') + raise RuntimeError('restricted virtual Ethernet lease/isolation mismatch: ' + json.dumps(network)) observed['wired_dhcp_observed'] = True + observed['restricted_dhcp_address'] = network['IP4.ADDRESS'][0] + observed['restricted_dhcp_server'] = '192.0.2.2' + observed['restricted_ipv4_default_route'] = False + observed['restricted_ipv4_dns_advertised'] = False observed['virtual_network_scope'] = 'QEMU restricted user network 192.0.2.0/24; no forwarding' print('PHIOS_DESKTOP_SERVICES_OK:' + json.dumps(observed), flush=True) return observed diff --git a/packaging/linux/tests/qemu_preview.py b/packaging/linux/tests/qemu_preview.py index be60d60f..2ded97bf 100644 --- a/packaging/linux/tests/qemu_preview.py +++ b/packaging/linux/tests/qemu_preview.py @@ -148,7 +148,7 @@ def wait(pattern: str) -> re.Match[str]: transcript.write(data) transcript.flush() text += data.decode(errors='replace') - if '\nTraceback (most recent call last):' in text: + if 'Traceback (most recent call last)' in text: # Preserve the actual guest exception before shutting down. drain_until = time.monotonic() + 3 while time.monotonic() < drain_until: @@ -164,7 +164,9 @@ def wait(pattern: str) -> re.Match[str]: raise RuntimeError('normal PAM/desktop qualification timed out') def program(value: str) -> None: - channel.sendall(("python - <<'PHIOS_NORMAL_PROBE'\n" + value + '\nPHIOS_NORMAL_PROBE\n').encode()) + if max(map(len, value.splitlines()), default=0) >= 4096: + raise ValueError('guest program exceeds canonical terminal line bound') + channel.sendall(("PYTHON_COLORS=0 python -u - <<'PHIOS_NORMAL_PROBE'\n" + value + '\nPHIOS_NORMAL_PROBE\n').encode()) for boot in [1, 2]: wait(r'login: ') From 9c98475274442595c59370113b9c1e0dee595ec9 Mon Sep 17 00:00:00 2001 From: Michael Hughes Date: Wed, 30 Sep 2026 23:06:51 -0700 Subject: [PATCH 3/3] fix(os): parse captured DHCP options and qualify all session units --- docs/os/DESKTOP_OPERATION.md | 7 ++ docs/os/RELEASE_ARTIFACTS.md | 8 +- docs/os/RELEASE_HANDOFF.md | 8 ++ docs/os/evidence/desktop-attempts.json | 75 +++++++++++++++++++ packaging/linux/tests/desktop_probe.py | 19 +++-- packaging/linux/tests/qemu_preview.py | 20 +++-- .../fixtures/os_desktop/restricted-nmcli.json | 10 +++ tests/test_os_desktop_probe_v01.py | 48 ++++++++++++ 8 files changed, 182 insertions(+), 13 deletions(-) create mode 100644 tests/fixtures/os_desktop/restricted-nmcli.json create mode 100644 tests/test_os_desktop_probe_v01.py diff --git a/docs/os/DESKTOP_OPERATION.md b/docs/os/DESKTOP_OPERATION.md index 6984deac..4f0774ae 100644 --- a/docs/os/DESKTOP_OPERATION.md +++ b/docs/os/DESKTOP_OPERATION.md @@ -102,6 +102,13 @@ corrected probe requires their absence and the actual lease/server. The failed image/source, serial log and screenshot hashes are retained in `evidence/desktop-attempts.json`. The installed signed QA lane passed its added audio and PAM lock checks, but that does not qualify the failed normal image. +The second normal attempt captured the correct lease and isolation, then failed +because nmcli joined its DHCP options on one line. The corrected parser accepts +the observed joined/line forms while retaining exact unique server identity; +captured-output regression tests reject static, wrong, duplicate and forwarding +configurations. Service checks require each named unit individually; the live +lifecycle requires all session/audio/socket units inactive at logout and repeats +actual service/audio/network checks after graphical reauthentication. The complete added qualification is pending actual CI. Earlier passed ISO hashes remain valid only for their recorded earlier scope; do not claim these new features diff --git a/docs/os/RELEASE_ARTIFACTS.md b/docs/os/RELEASE_ARTIFACTS.md index 2d8f7896..1114cd61 100644 --- a/docs/os/RELEASE_ARTIFACTS.md +++ b/docs/os/RELEASE_ARTIFACTS.md @@ -12,8 +12,10 @@ actual image paths and refuses a mismatch with the requested fixture scope. The normal volatile `phios`/`phios` account remains the documented live login; that public live account does not become an installed user/password. -The external VM harness uses only the finished ISO and fresh OVMF variables, -with no target disk, network or shared folders. It logs in through normal +The external normal live VM harness uses only the finished ISO and fresh OVMF +variables, without a target disk or shared folders. Its added desktop gate uses +restricted virtual Ethernet with no external forwarding and synthetic HDA with +a null audio backend; no host audio is attached. It logs in through normal serial PAM using that public live account, observes the actual non-root Wayfire/Chromium/HTTP services, tests an observer restart, logs out, enters the same account at the real greetd keyboard/PAM prompt and checks the restarted @@ -23,6 +25,8 @@ into the image. Logs/screenshots and the exact ISO/source hash are retained. The separate exact normal-image installed lane described below adds bounded installation/data/recovery/Linux proof evidence for that same ISO. Real hardware and the future final signed update transition remain additional release gates. +The installed/recovery lanes retain no NIC or shared folders. See +DESKTOP_OPERATION.md for the precise DHCP, user-audio and PAM-lock scope. ## Artifact inventory diff --git a/docs/os/RELEASE_HANDOFF.md b/docs/os/RELEASE_HANDOFF.md index a8a80022..ae5d5a0d 100644 --- a/docs/os/RELEASE_HANDOFF.md +++ b/docs/os/RELEASE_HANDOFF.md @@ -58,6 +58,14 @@ still require maintainer configuration. Keep publication separate from the existing Python `v*`/PyPI workflow. Evidence never promotes an adapter, enrolls a signing identity or grants execution/publication authority. +Repository protection was rechecked on 2026-10-01. Main still points to +`dad7a7d7cd53874926ad366f19d3fc0fa6b99a49`; its branch response reports no +required checks. The sole active branch ruleset `protec` (13863077) contains +deletion/non-fast-forward rules and no required status or review rule. Configure +the reviewed `release-gate` requirement and main/OS-tag release protections +through maintainer administration before merging/publishing. This candidate +does not claim those settings were applied. + ## Remaining work in order 1. **Observe the supplied Skytech on the exact normal live media.** Follow diff --git a/docs/os/evidence/desktop-attempts.json b/docs/os/evidence/desktop-attempts.json index 7fa78f79..c36e1f8a 100644 --- a/docs/os/evidence/desktop-attempts.json +++ b/docs/os/evidence/desktop-attempts.json @@ -77,6 +77,81 @@ "source_commit": "83259a24a82a72d279abc4e6f873a07f428817c9", "tested_source_tree": "a8fc9083997f74975eccdbea37267990b033bd3d", "workflow_run": 36818833863 + }, + { + "evidence_archive_sha256": "8e54545d7cff97db3a2889534d6fc76eefdf6a8880402ddfb89f65460d1accf3", + "evidence_artifact_id": 11143976856, + "evidence_files": { + "PhiOS/PhiOS/dist/linux/build.log": "a3d6820c9f8f66574db37d784b331e0605aa2c9e063404a44109d51ed55796ab", + "PhiOS/PhiOS/dist/linux/builder-image.json": "3fcc731f1842caf946f756ba362033255ade51cff5ae5d1abddd7dbe2d65dff6" + }, + "failure": "Arch archive transfers stalled below pacman minimum speed for uvicorn, vulkan-icd-loader signature and spdlog. Pacman refused the transaction and the builder exited nonzero before producing an ISO. The always-run display conversion additionally failed because QEMU/Pillow setup was never reached; both evidence uploads still succeeded. Retry only the failed same-source jobs; keep signed pinned inputs and all assertions.", + "image_built": false, + "job_id": 110238876766, + "phase": "signed_pinned_arch_builder_download", + "qa_image_qualified": false, + "release_gate_job_id": 110240951871, + "release_gate_result": "failure", + "release_ready": false, + "reviewed_branch_head": "cda880f273a7d68afdd95670e2555c4f766884f6", + "run_attempt": 1, + "source_commit": "afe3795528e11107eeafbb74088c255cd97f356f", + "tested_source_tree": "49571965ef7717c427d049b2a4e01ae3941b4fb4", + "workflow_run": 36821774229 + }, + { + "actual_network_capture": { + "DHCP4.OPTION": [ + "dhcp_client_identifier = 01\\:52\\:54\\:00\\:12\\:34\\:56 | dhcp_lease_time = 86400 | dhcp_server_identifier = 192.0.2.2 | expiry = 1790920696 | ip_address = 192.0.2.15 | next_server = 192.0.2.2 | requested_broadcast_address = 1 | requested_domain_name = 1 | requested_domain_name_servers = 1 | requested_domain_search = 1 | requested_host_name = 1 | requested_interface_mtu = 1 | requested_ms_classless_static_routes = 1 | requested_nis_domain = 1 | requested_nis_servers = 1 | requested_ntp_servers = 1 | requested_rfc3442_classless_static_routes = 1 | requested_root_path = 1 | requested_routers = 1 | requested_static_routes = 1 | requested_subnet_mask = 1 | requested_time_offset = 1 | requested_wpad = 1 | subnet_mask = 255.255.255.0" + ], + "IP4.ADDRESS": [ + "192.0.2.15/24" + ], + "IP4.DNS": [], + "IP4.GATEWAY": [] + }, + "evidence_archive_sha256": "2d2e06f84c0018f5e811584814eaa9916fa8a868439ffb3fa9b425b34cb07581", + "evidence_artifact_id": 11142998500, + "evidence_files": { + "PhiOS/PhiOS/dist/fixture-free/SHA256SUMS": "0c4e780a4b37f979ee915bdc91bd2bb4e7c4b7ee2a6ac5c67e953a19b7df5538", + "PhiOS/PhiOS/dist/fixture-free/build.log": "4c77cff2c1db5b96492b567095eb0c99a2f2c3d343aae969a15be06c464b6897", + "PhiOS/PhiOS/dist/fixture-free/builder-image.json": "a11a8a03b44daf3a1e6ca96d563def4a236f01fb35140dd4d229ad49176001ce", + "PhiOS/PhiOS/dist/fixture-free/builder-packages.txt": "374d8ffd2ec34f22d8ef7f28110927eef7d17586faba2954e1906a2c5229c35f", + "PhiOS/PhiOS/dist/fixture-free/fixture-inventory.json": "14ce1577031ab6cc9b29967bc57b054661ce36d3a5ec0ada86a0bba9ddc9627e", + "PhiOS/PhiOS/dist/fixture-free/image-packages.txt": "742b3c4ce23cb82cdc8eb10f95152fc1b39422bdf9dd4532b66693d2fa92b202", + "PhiOS/PhiOS/dist/fixture-free/javascript-bundled-packages.json": "04402e02c14a791ffc99968668594c1943081f1f7237a36e8b440dd0d896bf1f", + "PhiOS/PhiOS/dist/fixture-free/javascript-packages.json": "a9026fc707306f7fb2ffb952b884197a66ccc3def539f90f938e8c4b7e4e0582", + "PhiOS/PhiOS/dist/fixture-free/mkarchiso.log": "c0bd1bec93c442f3e95e85e9dc2461325e89eeea36b177fc1d7091dd3cc76018", + "PhiOS/PhiOS/dist/fixture-free/native-packages.json": "464a726110ee270a9a237a1b758137d425cb83e1e65ee6f9d2db9023bc9f86f1", + "PhiOS/PhiOS/dist/fixture-free/provenance.json": "46f81f32a80012c4c571bc9a8b2935677dc2f784cb5c3f53373d7aedc48f75e6", + "PhiOS/PhiOS/dist/fixture-free/python-packages.json": "ef6655e03b4fd5a1bac84e505582a2b14bef22d7f45ee034f9339bffa61b8f7e", + "PhiOS/PhiOS/dist/fixture-free/release.json": "0d5499ce8f252637d7a1d6a8bdedeb8aef9829307893e348f3c1bf0795b91a75", + "PhiOS/PhiOS/dist/fixture-free/sbom.cdx.json": "9cbf7086bb3545b3541cad2ca649af5ffc7cafdc849ba0bb4708c638851eb13b", + "PhiOS/PhiOS/dist/fixture-free/source-archive-sha256.txt": "7755b1db23a1052ff8b2165151cd14fd7ffe653592c1a5964299dc09e82c595e", + "PhiOS/PhiOS/dist/fixture-free/source-commit.txt": "f4f56dc35aaf63f31c440e9885fcbcbf53a819ddc4c62e708b9920b686260543", + "PhiOS/PhiOS/dist/fixture-free/source-review.json": "e49eb757dd811267a88e3d09b637c24b550e08aadfe674cc05aebd816fa6a972", + "PhiOS/PhiOS/dist/fixture-free/third-party-notices.json": "840a10e3dac4ffac473e0f68ba6d078c85ddf1e4120518fa598d1876fe3cc71f", + "_temp/phios-preview/preview-evidence.json": "0687f88e4aa349d220b0f5c37b0d6164731ec80ea105f8761d1a97110d7d10e8", + "_temp/phios-preview/qemu.log": "a7186e646536fd7526e73c107126ab08199a744baea9a78e5e4dc44ce79d58ae", + "_temp/phios-preview/screen.png": "22cea81cdd83da53b78a4186a04dbe315d75c395ac316673f3dbded190c0bc67", + "_temp/phios-preview/serial.log": "b21a9026e686adcbde033102c03d09a9c5da19df0220ab7fcdf7f236cc782636" + }, + "failure": "The actual restricted lease/address/server and absent gateway/DNS were correct. nmcli get-values joined the array-valued DHCP4.OPTION with pipes on one line, while the external probe assumed one option per line. Parse both observed array formats, retain exact DHCP-server uniqueness and gateway/DNS isolation checks, and regress the captured output plus static/wrong/ambiguous/forwarding refusals. The fixed guest exception detector correctly failed promptly; installation was skipped.", + "image_artifact_id": 11143427981, + "image_built": true, + "iso_sha256": "776ef8cc2ec673f27e1a3ce0d50eb70c1a2d4eb16e5e0e873e56739a9975203c", + "job_id": 110238876821, + "normal_installed_qualified": false, + "normal_live_qualified": false, + "release_gate_job_id": 110240951871, + "release_gate_result": "failure", + "release_ready": false, + "reported_error": "normal-user preview probe failed; see preserved serial log", + "reviewed_branch_head": "cda880f273a7d68afdd95670e2555c4f766884f6", + "run_attempt": 1, + "source_commit": "afe3795528e11107eeafbb74088c255cd97f356f", + "tested_source_tree": "49571965ef7717c427d049b2a4e01ae3941b4fb4", + "workflow_run": 36821774229 } ], "schema_version": "phios.desktop-attempts.v1" diff --git a/packaging/linux/tests/desktop_probe.py b/packaging/linux/tests/desktop_probe.py index bf09dfb1..fe6bb8bb 100644 --- a/packaging/linux/tests/desktop_probe.py +++ b/packaging/linux/tests/desktop_probe.py @@ -11,12 +11,22 @@ from pathlib import Path +def restricted_dhcp_lease(network: dict) -> bool: + # nmcli get-values emits array-valued DHCP options either as lines or as + # one " | "-joined value. Parse the actual array before checking identity. + options = [option for row in network['DHCP4.OPTION'] for option in row.split(' | ')] + return (network['IP4.ADDRESS'] == ['192.0.2.15/24'] and not network['IP4.GATEWAY'] + and not network['IP4.DNS'] + and options.count('dhcp_server_identifier = 192.0.2.2') == 1) + + def desktop_services(source: str, *, wired: bool = False) -> dict: assert os.getuid() == 1000 and os.geteuid() == 1000 assert Path('/usr/share/phios/source-commit').read_text().strip() == source units = ['phios-audio.target', 'pipewire.service', 'pipewire-pulse.service', 'wireplumber.service', 'phios-policykit.service'] for _ in range(60): - active = subprocess.run(['systemctl', '--user', 'is-active', '--quiet', *units]).returncode == 0 + active = all(subprocess.run(['systemctl', '--user', 'is-active', '--quiet', unit]).returncode == 0 + for unit in units) graph = json.loads(subprocess.check_output(['pw-dump'], text=True, timeout=10)) if active else [] devices = [item for item in graph if item.get('type') == 'PipeWire:Interface:Device' and item.get('info', {}).get('props', {}).get('device.api') == 'alsa'] @@ -47,7 +57,8 @@ def desktop_services(source: str, *, wired: bool = False) -> dict: stream.setframerate(48000) stream.writeframes(b''.join(struct.pack(' dict: # libslirp's restricted BOOTP/DHCP server intentionally omits # RFC1533_GATEWAY and RFC1533_DNS. Require that isolation and # the actual lease/server, rather than expecting NAT settings. - if (network['IP4.ADDRESS'] == ['192.0.2.15/24'] and not network['IP4.GATEWAY'] - and not network['IP4.DNS'] - and network['DHCP4.OPTION'].count('dhcp_server_identifier = 192.0.2.2') == 1): + if restricted_dhcp_lease(network): break time.sleep(1) else: diff --git a/packaging/linux/tests/qemu_preview.py b/packaging/linux/tests/qemu_preview.py index 2ded97bf..22db233e 100644 --- a/packaging/linux/tests/qemu_preview.py +++ b/packaging/linux/tests/qemu_preview.py @@ -77,20 +77,24 @@ def pid(): else: raise RuntimeError('observer restart failed') subprocess.run(['pkill','-TERM','-u',str(os.getuid()),'-x','wayfire'],check=True) +units=['phios-session.target','phios-observer.service','phios-browser.service','phios-waybar.service', + 'phios-curiosity-reader.service','phios-history-reader.service','phios-policykit.service','phios-audio.target', + 'pipewire.service','pipewire-pulse.service','wireplumber.service','pipewire.socket','pipewire-pulse.socket'] for _ in range(30): - active=subprocess.run(args+['is-active','--quiet','phios-session.target'],capture_output=True).returncode==0 + states={unit:subprocess.check_output(args+['show',unit,'--property=ActiveState','--value'],text=True).strip() + for unit in units} try: urllib.request.urlopen('http://127.0.0.1:3969/api/v1/health',timeout=2).close() reachable=True except OSError: reachable=False - audio_active=subprocess.run(args+['is-active','--quiet','phios-audio.target'],capture_output=True).returncode==0 - if not active and not reachable and not audio_active: break + if all(state=='inactive' for state in states.values()) and not reachable: break time.sleep(1) else: - raise RuntimeError('logout did not stop the supervised session') + raise RuntimeError('logout did not stop the supervised session: '+json.dumps(states)) boot=Path('/proc/sys/kernel/random/boot_id').read_text().strip().replace('-','') -print('PHIOS_PREVIEW_LOGOUT_OK:'+json.dumps({'boot_id':boot,'old_observer_pid':previous,'new_observer_pid':current}),flush=True) +print('PHIOS_PREVIEW_LOGOUT_OK:'+json.dumps({'boot_id':boot,'old_observer_pid':previous,'new_observer_pid':current, + 'all_session_units_inactive':True,'stopped_session_units':units}),flush=True) ''' @@ -180,6 +184,7 @@ def program(value: str) -> None: first = json.loads(wait(r'PHIOS_PREVIEW_OK:(\{[^\r\n]+\})')[1]) assert first['source_commit'] == source and first['stage'] == 'first' desktop_result = json.loads(wait(r'PHIOS_DESKTOP_SERVICES_OK:(\{[^\r\n]+\})')[1]) + desktop_result.update({'boot_id': first['boot_id'], 'stage': 'first'}) receipt.setdefault('desktop_service_boots', []).append(desktop_result) time.sleep(2) capture_display(qmp, output, name=f'screen-{boot}-first') @@ -191,9 +196,12 @@ def program(value: str) -> None: assert lifecycle['boot_id'] == first['boot_id'] enter_live_login(qmp) text = '' - program(f'SOURCE={source!r}\nSTAGE="reauthenticated"\n' + PROBE) + program(f'SOURCE={source!r}\nSTAGE="reauthenticated"\n' + desktop + f'\ndesktop_services({source!r}, wired=True)\n' + PROBE) second = json.loads(wait(r'PHIOS_PREVIEW_OK:(\{[^\r\n]+\})')[1]) assert second['boot_id'] == first['boot_id'] and second['stage'] == 'reauthenticated' + restarted_desktop = json.loads(wait(r'PHIOS_DESKTOP_SERVICES_OK:(\{[^\r\n]+\})')[1]) + restarted_desktop.update({'boot_id': second['boot_id'], 'stage': 'reauthenticated'}) + receipt['desktop_service_boots'].append(restarted_desktop) time.sleep(2) capture_display(qmp, output, name=f'screen-{boot}-reauthenticated') receipt['boots'].append({'first': first, 'lifecycle': lifecycle, 'reauthenticated': second}) diff --git a/tests/fixtures/os_desktop/restricted-nmcli.json b/tests/fixtures/os_desktop/restricted-nmcli.json new file mode 100644 index 00000000..79c969be --- /dev/null +++ b/tests/fixtures/os_desktop/restricted-nmcli.json @@ -0,0 +1,10 @@ +{ + "DHCP4.OPTION": [ + "dhcp_client_identifier = 01\\:52\\:54\\:00\\:12\\:34\\:56 | dhcp_lease_time = 86400 | dhcp_server_identifier = 192.0.2.2 | expiry = 1790920696 | ip_address = 192.0.2.15 | next_server = 192.0.2.2 | requested_broadcast_address = 1 | requested_domain_name = 1 | requested_domain_name_servers = 1 | requested_domain_search = 1 | requested_host_name = 1 | requested_interface_mtu = 1 | requested_ms_classless_static_routes = 1 | requested_nis_domain = 1 | requested_nis_servers = 1 | requested_ntp_servers = 1 | requested_rfc3442_classless_static_routes = 1 | requested_root_path = 1 | requested_routers = 1 | requested_static_routes = 1 | requested_subnet_mask = 1 | requested_time_offset = 1 | requested_wpad = 1 | subnet_mask = 255.255.255.0" + ], + "IP4.ADDRESS": [ + "192.0.2.15/24" + ], + "IP4.DNS": [], + "IP4.GATEWAY": [] +} diff --git a/tests/test_os_desktop_probe_v01.py b/tests/test_os_desktop_probe_v01.py new file mode 100644 index 00000000..7e5f572a --- /dev/null +++ b/tests/test_os_desktop_probe_v01.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +import copy +import importlib.util +import json +from pathlib import Path + +import pytest + +REPO = Path(__file__).parents[1] +SPEC = importlib.util.spec_from_file_location('desktop_probe', REPO / 'packaging/linux/tests/desktop_probe.py') +assert SPEC is not None and SPEC.loader is not None +probe = importlib.util.module_from_spec(SPEC) +SPEC.loader.exec_module(probe) + + +def captured_network() -> dict: + return json.loads((REPO / 'tests/fixtures/os_desktop/restricted-nmcli.json').read_text()) + + +def test_actual_restricted_nmcli_capture_is_a_dhcp_lease(): + assert probe.restricted_dhcp_lease(captured_network()) + + +def test_line_separated_options_retain_the_same_lease(): + network = captured_network() + network['DHCP4.OPTION'] = network['DHCP4.OPTION'][0].split(' | ') + assert probe.restricted_dhcp_lease(network) + + +@pytest.mark.parametrize('change', ['wrong_address', 'default_gateway', 'dns_advertised', + 'wrong_server', 'duplicate_server', 'no_dhcp']) +def test_static_ambiguous_or_forwarding_configuration_never_qualifies(change): + network = copy.deepcopy(captured_network()) + if change == 'wrong_address': + network['IP4.ADDRESS'] = ['192.0.2.16/24'] + elif change == 'default_gateway': + network['IP4.GATEWAY'] = ['192.0.2.2'] + elif change == 'dns_advertised': + network['IP4.DNS'] = ['192.0.2.3'] + elif change == 'wrong_server': + network['DHCP4.OPTION'][0] = network['DHCP4.OPTION'][0].replace( + 'dhcp_server_identifier = 192.0.2.2', 'dhcp_server_identifier = 192.0.2.9') + elif change == 'duplicate_server': + network['DHCP4.OPTION'][0] += ' | dhcp_server_identifier = 192.0.2.2' + else: + network['DHCP4.OPTION'] = [] + assert not probe.restricted_dhcp_lease(network)