Commit graph

146 commits

Author SHA1 Message Date
7124c8ed5c fix(nix): keep integration dirs traversable for all users 2026-09-28 00:49:35 -07:00
2261c5483c fix(ai): default opencode backend to Local adapter kind 2026-09-28 00:35:22 -07:00
2b8559f113 fix(install): match VDB name-version dirs in finalize verify 2026-09-27 17:22:55 -07:00
add7dfc873 fix(desktop): build seatd server for the systemd unit 2026-09-27 12:28:14 -07:00
233a3e2f7f fix(install): scope xapp closure USE deps 2026-09-27 05:36:27 -07:00
8a0dfdf965 fix(install): scope nemo introspection closure + mpv lua 2026-09-27 03:53:21 -07:00
0036529f51 fix(install): scope libxmlb introspection for nemo 2026-09-27 01:54:49 -07:00
f480c9c3b7 fix(install): correct matugen category to x11-misc 2026-09-26 23:52:59 -07:00
3abdc872e2 fix(install): select lua target for swayimg 2026-09-26 21:34:09 -07:00
6972511315 fix(install): keyword zsh itself for the plugin lane 2026-09-26 19:34:08 -07:00
ff104ddc49 fix(install): scoped keywords for zsh plugin lane 2026-09-26 18:59:53 -07:00
5ea4bb1885 fix(install): install login shell in base before users_configure 2026-09-26 18:17:34 -07:00
0aa31a36a0 fix(install): record reviewed Brave overlay pin 2026-09-26 16:46:09 -07:00
406f9b4b33 fix(nix): enumerate modern per-user profiles in sys list 2026-09-26 16:05:16 -07:00
9573f2e37a feat(desktop): seat management, thunderbird-bin fast default, AI timeout
Some checks failed
ci / test (push) Has been cancelled
P0 seat fix: sys-auth/seatd installed and enabled before greetd,
gui-libs/libseat with systemd+builtin+server USE, seat in default user
groups, greeter in video/input/render/seat, and a bounded 3 s seat wait
in phoebus-session-mango (LIBSEAT_BACKEND deliberately unset so every
compiled backend stays available).

P1 fast install: mail-client/thunderbird-bin replaces the source build
in workstation_packages; Thunderbird joins fast_default_deliveries and
SOURCE_CONVERSIONS (source target mail-client/thunderbird, honest
45-90 min estimate), the preference-neutrality guard covers it, and the
first-login welcome names it. All lanes and the mandatory-AI install
requirement are unchanged.

AI robustness: CurlTransport max-time 120 s -> 300 s default,
overrideable via PHOEBUS_AI_TIMEOUT (fail-closed parsing; zero refused)
for both direct and sandboxed sends.

Verified: cargo fmt --check, clippy --workspace --all-targets -- -D
warnings, cargo test --workspace 759/759 (was 757), bash -n on the
session script. Seat-VM reverification, thunderbird VM journeys, and
live CPU-inference proof are NotRun (no VM run this session).
2026-09-26 15:41:19 -07:00
5369a89b4b feat(shell): modernize default Zsh seed and login environment
Some checks are pending
ci / test (push) Waiting to run
Fixes the %F{ yellow } color bug (Phoebus Gold 214), drops the no-op
site-functions probe, puts fpath before a cached compinit (full audit at
most once per 24h), adds Kitty/application-mode keybindings, replaces
cross-tab SHARE_HISTORY with INC_APPEND_HISTORY, and adds a builtin
vcs_info git branch plus an exit-status prompt arrow. New ZSH_ZPROFILE
bridges /etc/profile (env-update paths, Nix/Flatpak profile.d) into Zsh
login sessions and adds ~/.local/bin to PATH. Seeding stays once-only;
root stays on Bash; /bin/sh untouched.

Verified: cargo fmt --check, clippy --workspace --all-targets -- -D
warnings, cargo test --workspace 757/757, zsh -n on both files plus an
interactive startup smoke test on host zsh 5.9. Installed-session
behavior awaits the disposable VM.
2026-09-26 15:31:10 -07:00
e747baf3a1 feat(install): fast prebuilt defaults with user-controlled source builds
Some checks are pending
ci / test (push) Waiting to run
2026-09-26 14:36:38 -07:00
ccc868b762 feat(workstation): Mango apps, Zsh, cursor, ccache, AI handoff, startup check, assistant themes
Some checks are pending
ci / test (push) Waiting to run
2026-09-26 10:08:47 -07:00
11c0ee0014 fix(security): fixed trust anchor, executable release gates, strengthened rollback
Some checks are pending
ci / test (push) Waiting to run
2026-09-25 20:48:07 -07:00
95e0d05344 fix(core): reject unimplemented secureboot/uki at validation
The installed boot path is plain unsigned BLS. kernel.uki=true and
kernel.secureboot=true are now rejected by validate_config (which the
CLI, TUI and GUI bridge all share) with errors naming the limitation.
The plan preview reports the real BLS path unconditionally and never
renders the requested flags as active. Golden plan updated; parsing,
validation and rendering regressions added.
2026-09-25 19:49:41 -07:00
216267064c fix(executor): fail closed on every stage3 verification failure
The unpinned stage3 path warned and continued when the DIGESTS download
failed, when no SHA-512 entry matched, when gpg or the Gentoo release key
was missing, when the key import failed, and when gpg could not start.
All of these now stop the install before extraction, as do a bad
signature and a hash mismatch. The pinned path requires a valid 64-hex
pin (placeholder refused) before any network use. require_tools covers
gpg/sha256sum/sha512sum and stage_install checks them first.

16 regression tests cover every failure branch (nonzero exit and
cannot-start for hash, probe, import and verify) plus both positive
paths.
2026-09-25 19:49:37 -07:00
2dd48d1fe8 refactor(installer): split gui_bridge.rs into protocol/bridge/tests modules
Move the 2763-line typed GUI bridge into focused modules with no UI or
wire-format change: mod.rs keeps the docs and re-exports so
gui_bridge::{Bridge, run_stdio, PROTOCOL_VERSION} paths are unchanged;
protocol.rs holds protocol version 1, the request/secret types, the JSON
progress observer, the disk-change phase, and the newline-delimited JSON
writer; bridge.rs holds the single Bridge owning the installer, request
dispatch, installation support, secret handling, and progress events;
tests.rs holds the regression suite verbatim. Items shared across the
boundary are pub(super) with explicit imports; no glob re-exports and no
service.rs-style leftover file.

cargo fmt clean; cargo clippy --workspace --all-targets -- -D warnings
clean; cargo test --workspace passes (692 passed, 0 failed, identical
to the pre-split baseline).
2026-09-25 18:40:01 -07:00
1bf31c5a72 refactor(installer): split service.rs into mod/plan/validation/execution/tests
Move the 4218-line shared service layer into focused modules with no
behavior change: mod.rs keeps the plan types, render, and shared helpers
with explicit re-exports so every phoebus_installer::service::* path,
the serialized plan format, approval digests, replay protection, and
privileged validation behavior are unchanged; plan.rs holds PlanStore
and the planning APIs; validation.rs holds seals, digests, and the
privileged validation boundary; execution.rs holds validated elevated
execution; tests.rs holds the regression suite verbatim. Sibling-private
helpers (constrain_action, plan_integrity, reviewed_steps,
validate_effect_bindings, ServiceConfirm) are pub(super) with explicit
imports; no glob re-exports.

cargo fmt clean; cargo clippy --workspace --all-targets -- -D warnings
clean; cargo test --workspace passes (692 passed, 0 failed, identical
to the pre-split baseline; plan_golden and adversarial digest tests
unchanged).
2026-09-25 18:34:36 -07:00
e69bfb9aef refactor(executor): box ExecError command details, clear Clippy -D warnings gate
Box the CommandFailure payload so ExecError shrinks 128 -> 96 bytes and
Result<T, ExecError> passes result_large_err without per-site boxing.
Preserve the display text, redacted stdout/stderr capture, and the stderr
tail used for update failures; update the constructor and every match
site. Add regression tests for the error text, captured output, and the
96-byte size bound.

Resolve the remaining Clippy warnings without blanket allows: a type
alias for the snap-entry tuple in actions.rs, a CommandRecord params
struct for Logger::command in log.rs, and DiskPhase variant renames in
gui_bridge.rs. cargo clippy --workspace --all-targets -- -D warnings is
clean; cargo test --workspace passes (692 tests).
2026-09-25 18:26:08 -07:00
7c5d4c5ca6 fix(sys): make Snap first-use setup reviewable and VM-tested
Some checks are pending
ci / test (push) Waiting to run
2026-09-25 18:07:13 -07:00
3bdeb08f76 fix(sys): exact Flatpak commit binding, non-destructive cleanup previews, reverse deps; record VM evidence
Some checks are pending
ci / test (push) Waiting to run
2026-09-25 16:18:26 -07:00
ec1f7c5b0b fix(sys): safe cleanup previews, exact Flatpak/Snap update transactions, and correct reverse dependencies 2026-09-25 11:24:53 -07:00
bab5f413ed fix(sys): aggregate cleanup intents into plan binding; record VM acceptance and defect evidence
Some checks are pending
ci / test (push) Waiting to run
2026-09-25 05:35:08 -07:00
58e0f70879 fix(sys): close host/target, revalidation, update-effect and inspection defects in the package catalogue 2026-09-25 03:51:02 -07:00
05d7075341 feat(sys): complete the package-management interface (search/list/info/updates/maintenance)
Some checks are pending
ci / test (push) Waiting to run
2026-09-25 03:11:18 -07:00
b579633ab1 fix(install,admin): use the legacy sys probe at finalize and keep personal preferences out of the system transaction log
Some checks are pending
ci / test (push) Waiting to run
2026-09-24 21:23:47 -07:00
fa39f773f0 fix(admin): bind per-step reviewed effects into the canonical approval digest
Some checks are pending
ci / test (push) Waiting to run
2026-09-24 20:43:33 -07:00
34f5311d37 fix(admin): recompute canonical digest at the privileged boundary, stabilize the approval identity, and own personal writes
Some checks are pending
ci / test (push) Waiting to run
2026-09-24 19:48:27 -07:00
0be301009b fix(admin): anchor approval in a broker ledger, user-own settings, and carry reviewed effects
Some checks are pending
ci / test (push) Waiting to run
2026-09-24 19:14:16 -07:00
a2c039f224 test(admin): cover credential loading, no-model guidance, and broker uid gate
Some checks are pending
ci / test (push) Waiting to run
2026-09-24 18:03:31 -07:00
3b84b8c99d fix(admin): harden privileged plan boundary, GUI review, AI-first removal, and conversation privacy
Some checks are pending
ci / test (push) Waiting to run
2026-09-24 18:01:13 -07:00
7ebb616c99 feat(ai,desktop): unify administration layer, provision QML, and add conversation continuity
Some checks are pending
ci / test (push) Waiting to run
Unifies AI-first administration across the CLI (sys) and desktop GUI
(phoebus-assistant) through a shared service layer, fixes installed
desktop QML asset provisioning, adds Polkit elevation, and introduces
contextual conversation continuity.

- Extract phoebus_installer::service shared by CLI and desktop assistant bridge:
  - Reviewable plan staging (PreparedPlan) with SHA-256 cryptographic digests,
    15-minute TTL expiration, and replay prevention (PlanStore).
  - Pre-mutation system state revalidation binding execution strictly to the reviewed plan.
  - Honest recommendations displaying genuine provenance and unmeasured compile times.
  - Two-phase transaction logging (begin before mutation, finish with verification).
- Provision installed desktop assets and Polkit policy in phoebus-executor::desktop:
  - Added gui-apps/quickshell to canonical Mango desktop packages.
  - Embed 13 QML and policy files into target root under /usr/share/phoebus/assistant/.
  - Installed Polkit policy (club.phoebus.sys.policy) allowing unprivileged users to
    authenticate mutating plans via pkexec without blanket passwordless sudo.
- Eliminate startup freeze and polling in phoebus-assistant:
  - Multi-source update queries moved to on-demand tab switching.
  - Handshake timer reduced to one-shot 100ms with fast deterministic check.
- Add phoebus_installer::conversation:
  - Bounded 10-turn history with credential redaction.
  - Contextual follow-up resolution for comparisons, backend switching, and confirmation.
- Implement unified cross-source removal (plan_removal) preserving user data by default.
- Verified: all 486 workspace tests pass, release and crt-static builds succeed,
  and 23/23 VM acceptance cases pass (PASS=23 FAIL=0).
2026-09-24 17:21:16 -07:00
f30b99d272 feat(admin): implement AI-first administration across CLI and desktop GUI
Some checks are pending
ci / test (push) Waiting to run
- Default natural-language and conversational routing for sys install, sys please install, and sys ask through shared AI workflow
- Constrain AI candidate evaluation when source flags are supplied without bypassing the model
- Enforce explicit --legacy flag for deterministic administration; legacy install without a source flag refuses execution and offers choices
- Audit --action and --action-file entry points to require --legacy or --broker
- Provide truthful guidance on absent or failing AI models without silent mutation or unverified fallback
- Implement package correctness safeguards: Nix attribute evaluation probe, Portage binary check with source compile abort guard, cross-source installed application tracking, and data preservation on removal
- Provide Quickshell desktop assistant (phoebus-assistant) backed by stdio JSON-RPC bridge (sys --assistant-bridge) and desktop integration
- Implement unified multi-source update checking across all package lanes
- Implement quiet proactive assistance monitor with alert deduplication and snoozing
- Expand acceptance suite in installer/tests/vm/sys-acceptance.sh to 22 cases (22/22 PASS)
2026-09-24 16:38:38 -07:00
fe8de3904b refactor(desktop): unify desktop stack on Mango + DarkMaterial and excise standalone dwl
Some checks are pending
ci / test (push) Waiting to run
- Excised standalone dwl packages: gui-wm/dwl, waybar, wofi, mako, swaybg, swayidle, swaylock
- Removed standalone dwl session and helper assets: PHOEBUS_SESSION_SCRIPT, PHOEBUS_MENU_SCRIPT, PHOEBUS_LOCK_SCRIPT, PHOEBUS_IDLE_SCRIPT, WAYBAR_CONFIG, WAYBAR_STYLE, phoebus-dwl.desktop
- Consolidated DesktopProfile enum to Mango (default) and None (headless), rejecting legacy dwl configurations
- PHOEBUS_MANGO_SESSION_SCRIPT (/usr/local/bin/phoebus-session-mango) fails visibly/diagnostically on error without silent fallback
- Provided /usr/local/bin/phoebus-session as a direct wrapper to phoebus-session-mango
- Live ISO emitted assets reduced from 24 to 17 and verified clean
2026-09-24 15:49:15 -07:00
b5dd264681 feat(gui): verify full graphical install, fix greetd TOML, and automate ISO freshness
Some checks are pending
ci / test (push) Waiting to run
2026-09-24 11:42:16 -07:00
dedaa4bc48 fix: defects found by the VM install journey
- chooser: keep the plain Portage install atom and record the version
  separately. emerge rejects a bare versioned atom (app-misc/hello-2.12.3), so
  resolve/split now produce app-misc/hello + version 2.12.3.
- effects: parse emerge --unmerge --pretend output (it does not use the
  [ebuild] form), so sys remove has a concrete plan instead of being refused as
  unestablished.
- action: reject unknown fields on internally tagged unit variants
  (deny_unknown_fields does not cover them), closing a fail-closed gap.
- transaction: fsync the log so a completed outcome survives power loss and is
  not later read as an interrupted operation.
- serial-driver: import re at module level (do_boot used it unqualified).
2026-09-23 21:40:42 -07:00
b4729e443d test(install): verify the explicit Portage plan end to end
Add an executor test: resolve an explicit --portage plan, confirm verification
fails before the merge and succeeds once the VDB entry exists, so success is
never claimed from a zero exit alone.
2026-09-23 20:32:24 -07:00
f9e39925b4 feat(install): AI-first sys install workflow
Implement the shared installation workflow (ADR 0013). sys install, sys ask
install and the explicit backend flags all use one path: identify -> evidence
-> AI investigation -> deterministic validation/effects -> review -> approval
-> execute -> verify -> history.

- phoebus-ai::install: bounded, multi-turn investigation. The model may request
  typed read-only evidence (discover_candidates, inspect_candidate,
  check_backend, inspect_installation), ask one bounded question about intent,
  and must return a structured InstallProposal. Turn/request/size limits and
  repeated-request detection bound it; a rejected proposal is revised.
- phoebus-core: add the four read-only investigation actions and strict
  validators; add a transaction id; backend/kind wire names now match as_str.
- phoebus-executor::install: resolve_explicit (no model, no fallback),
  resolve_deterministic and resolve_with_ai; validate_proposal re-resolves the
  candidate against real metadata, rejects fabrication/ambiguity/staleness/
  duplicates, maps it to the existing broker action, and binds approval to a
  digest; revalidate + verify_installed. chooser gains per-lane friendly-name
  resolution and structured evidence.
- transaction::begin/finish record an in-progress transaction before mutation.
- sys: --portage/--flatpak/--nix/--snap/--appimage/--ebuild (mutually
  exclusive) bypass the model; an unqualified install consults the model and,
  with none, prints the deterministic selection and installs nothing.
- The installer persists /etc/phoebus/install.toml; sys loads it and adds free
  space, Wayland, usable lanes, saved preferences and recovery capability to
  the bounded facts.
- Docs: ADR 0013, docs/SYS.md install sections and cases 23-31, CHANGELOG,
  STATUS, HANDOFF, ROADMAP. New live-VM workflow check script.

Host gates pass: fmt, clippy (no new warnings), workspace tests, make test.
VM: verified the workflow CLI and read-only investigation on the reference
LiveGUI ISO; a full target install journey is running (see HANDOFF).
2026-09-23 20:30:13 -07:00
8be9bb6444 fix(installer): detect the BLS kernel layout in target verification
Some checks are pending
ci / test (push) Waiting to run
The installed-target check scanned only the top level of /boot and /efi for
vmlinuz/kernel. With layout=bls, kernel-install places the kernel as
<boot>/<machine-id>/<version>/linux, so a correct install would have been
rejected. Scan the tree (bounded, without following symlinks) for linux/vmlinuz/
kernel, and accept a BLS entry that names a kernel.
2026-09-23 18:41:41 -07:00
a6ed363745 test(selection): cover divergent machines and the extended prompt
Some checks are pending
ci / test (push) Waiting to run
- add policy tests for missing hardware information, limited storage choosing
  the smaller candidate, and the same application resolving to Portage binary,
  source or Flatpak depending on the machine, preference and sandbox
  requirement.
- drop the always-on strong-sandbox bonus to a mild +3 so GUI apps are not
  effectively routed to Flatpak by category (ADR 0006 revision intent).
- keep the assistant prompt and a plan-acceptance test in sync with the
  extended action schema (choose_package, set_package_preference, snap_*,
  appimage_acquire, custom_ebuild_prepare).
2026-09-23 18:38:59 -07:00
297f3201ff feat(sys): hardware-aware lane selection and new lanes
Some checks are pending
ci / test (push) Waiting to run
Replace the fixed category routing (ADR 0006) with a shared, inspectable,
hardware- and preference-aware selection policy over resolved candidates from
Portage (source/binary/vendor), Nix, Flatpak, Snap, AppImage and the Phoebus
overlay. The policy keeps base components under Portage, separates hard
constraints from preferences, honours and persists explicit choices, errors
instead of silently switching lanes, and reuses an already-installed lane.

- phoebus-core::selection: the pure policy (16 tests: base-system, low-memory
  vs high-core, sandbox requirement, GPU/arch/storage rejection, explicit
  preference, unavailable backend, reproducibility, render).
- phoebus-executor::chooser: resolves real metadata and hardware facts.
- phoebus-executor::{snap,appimage,ebuild}: new lanes. Snap detects daemon and
  confinement and installs app-containers/snapd through Portage; AppImage
  adopts images with a pinned SHA-256, checks the ELF architecture without
  executing, integrates a desktop entry and preserves user data on removal; the
  custom ebuild overlay binds approval to the ebuild content digest and builds
  through Portage's sandbox.
- Typed actions choose_package / set_package_preference / snap_* / appimage_* /
  custom_ebuild_* with strict validators; the assistant prompt and schema are
  reconciled (no category routing; custom ebuilds are untrusted).
- Installed sys: the installer locates the trusted static binary, copies it to
  /usr/local/bin/sys and proves it runs in the target chroot before the
  recovery snapshot, failing closed if absent; the VM harness fetches sys.
- docs/SYS.md: command/action reference and acceptance matrix; ADR 0006 revised.

Host gates pass: fmt, clippy (no new warnings), workspace tests, make test,
release and static sys builds. VM lane journeys remain pending (see HANDOFF).
2026-09-23 18:35:26 -07:00
4265aefacd fix(live): scope the live privilege policy to the typed brokers
The live user had NOPASSWD: ALL for the graphical broker. Replace it with
an emitted, visudo-validated policy that grants unattended escalation only
to /usr/local/bin/phoebus-installer, /usr/local/bin/sys and the systemctl
power actions; no ALL, no sh -c and no wildcard. The recovery console is
preserved: it logs in with the live-only password and authenticates sudo.
build.sh installs the asset, validates it with visudo and refuses any
unscoped policy. The GUI harness stages its preseed config with the
password-authenticated sudo over a 0600 file instead of bare install, and
the read-only greetd check no longer needs sudo.
2026-09-23 06:22:19 -07:00
12f264a0e9 fix(nvidia): install the driver before forcing it into the initramfs
The installer wrote dracut force_drivers naming nvidia modules during the
first kernel build, before the driver package existed, so the initial
kernel/initramfs build could not resolve them. Only the NVIDIA install
stage installs the driver and regenerates the initramfs.

- dracut_conf() no longer emits the NVIDIA fragment; the modprobe policy
  is still written before the kernel.
- write_nvidia_dracut_conf() writes it in the NVIDIA stage, after emerge
  and before kernel-install add-all.
- verify_nvidia_modules() proves the driver actually built modules for a
  kernel and fails the install otherwise; it returns the resolved version
  from var/db/pkg so the record carries the real version, kernel and
  module names rather than a 'current' label.
- The update path verifies the rebuilt modules before reporting success;
  previous kernels and module trees are left in place.
2026-09-23 06:13:14 -07:00
33b0b1df77 style: cargo fmt the nvidia changes 2026-09-23 06:10:21 -07:00
5103b57be9 test(nvidia): make the live payload gate prove compatibility
The verifier accepted one-byte placeholder modules, a caller-supplied
version/flavor, any NVIDIA firmware file and a nouveau blacklist that
happened to exist somewhere. It now establishes what it claims:

- reject placeholder modules and userspace libraries (size floor);
- require every module to be registered in the live kernel's modules.dep;
- normalise the dpkg revision and require the userspace libnvidia-glcore
  and firmware directory versions to match the bundled driver;
- infer the module flavor from the on-disk naming and reject a
  contradiction;
- require the exact etc/modprobe.d/phoebus-nvidia.conf with nouveau
  blacklist and nvidia_drm modeset, not any blacklist;
- keep every filesystem read rooted inside the build root.

Negative tests cover placeholders, version mismatches, a stale
modules.dep, a contradictory flavor and a missing final config.
2026-09-23 06:09:54 -07:00