phoebus_os/installer-rs/crates/phoebus-executor/src/lib.rs
Phoebus 297f3201ff
Some checks are pending
ci / test (push) Waiting to run
feat(sys): hardware-aware lane selection and new lanes
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

47 lines
1.1 KiB
Rust

//! Phoebus executor: privileged, deterministic system operations.
//!
//! Every external command goes through the `Exec` context, which centralises
//! logging, redaction and dry-run. Destructive operations require a
//! `DestructiveAuthorization` token produced only after explicit confirmation.
pub mod actions;
pub mod admin;
pub mod ai;
pub mod appimage;
pub mod auth;
pub mod boot;
pub mod chooser;
pub mod command;
pub mod desktop;
pub mod ebuild;
pub mod encryption;
pub mod error;
pub mod exec;
pub mod kernel;
pub mod live_nvidia;
pub mod log;
pub mod nix;
pub mod opencode;
pub mod opencode_client;
pub mod opencode_server;
pub mod portage;
pub mod probe;
pub mod rollback;
pub mod sandbox;
pub mod services;
pub mod snap;
pub mod snapshot;
pub mod stage3;
pub mod storage;
pub mod sys_runtime;
pub mod transaction;
pub mod update;
pub mod users;
pub use auth::{authorize, AutoConfirm, Confirmation, DenyConfirm, DestructiveAuthorization};
pub use command::{
CommandOutput, CommandSpec, NeverRunner, ProcessRunner, RealRunner, RecordingRunner,
};
pub use error::{ExecError, Result};
pub use exec::Exec;
pub use log::Logger;