phoebus_os/installer-rs/crates/phoebus-core/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

52 lines
1.7 KiB
Rust

//! Phoebus core: strongly-typed configuration, hardware/disk models, package
//! policy, validation, plan generation and target-root safety.
//!
//! Nothing in this crate executes external commands or touches disks.
pub mod action;
pub mod boot;
pub mod brand;
pub mod config;
pub mod disk;
pub mod effects;
pub mod emergelog;
pub mod error;
pub mod hardware;
pub mod nvidia;
pub mod nvidia_devices;
pub mod plan;
pub mod policy;
pub mod rollback;
pub mod secret;
pub mod selection;
pub mod snapshot;
pub mod system;
pub mod target;
pub mod transaction;
pub mod update;
pub mod validate;
pub use config::{
AiBackend, AiConfig, Bootloader, DesktopConfig, DesktopProfile, Encryption, EncryptionConfig,
Filesystem, InstallConfig, KernelConfig, KernelProfile, PackagePolicy, PackagesConfig,
Stage3Config, StorageConfig, SystemConfig, UserConfig,
};
pub use disk::{Disk, DiskKind, ProtectionReason};
pub use error::{CoreError, Result};
pub use hardware::{CpuInfo, FirmwareMode, GpuInfo, GpuVendor, HardwareReport, NetworkDevice};
pub use nvidia::{NvidiaDevice, NvidiaGeneration, NvidiaModuleFlavor, NvidiaPlan, NvidiaSupport};
pub use plan::{InstallPlan, InstallStep};
pub use policy::{
append_history, load_history, InstallMethod, PackageDecision, PackageDecisionReason,
PackagePolicyEngine, PolicyContext,
};
pub use secret::{Redactor, SecretString};
pub use selection::{
select, Backend, Candidate, Capability, HardwareFacts, Need, PackageKind, Preferences,
RejectReason, Rejected, SandboxLevel, Selection, SelectionError, UpdateReliability,
};
pub use target::TargetRoot;
pub use validate::{password_strength, validate_config, ValidationIssue};
/// Version string shared by the CLI and logs.
pub const VERSION: &str = env!("CARGO_PKG_VERSION");