Skip to content

[feature/patina-boot] patina_boot: Refactor to trait-based boot orchestration design#1333

Draft
kat-perez wants to merge 4 commits intoOpenDevicePartnership:feature/patina-bootfrom
kat-perez:boot-orchestrator-trait
Draft

[feature/patina-boot] patina_boot: Refactor to trait-based boot orchestration design#1333
kat-perez wants to merge 4 commits intoOpenDevicePartnership:feature/patina-bootfrom
kat-perez:boot-orchestrator-trait

Conversation

@kat-perez
Copy link
Contributor

@kat-perez kat-perez commented Feb 20, 2026

Description

Refactor patina_boot from a component-based design to a trait-based design per the updated boot orchestration RFC.

Old design: BootOrchestrator and ConsoleDiscovery were standalone Patina #[component]s that each independently implemented boot logic.

New design:

  • BootOrchestrator: Plain Rust trait defining the boot flow interface
  • BootDispatcher: Single Patina #[component] that installs the BDS architectural protocol and delegates to Box<dyn BootOrchestrator>
  • SimpleBootManager: Default trait implementation under impls/, constructed via from_options(BootOptions) or from_config(SimpleBootConfig)

Also adds SimpleBootConfig for platforms with fixed primary/secondary boot topologies, and updates doc references throughout.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

  • cargo build -p patina_boot
  • cargo test -p patina_boot — 39 tests pass (config + helpers)
  • cargo clippy -p patina_boot — zero warnings

Integration Instructions

Replace component registration:

// Before:
add.component(BootOrchestrator);

// After:
add.component(BootDispatcher::new(SimpleBootManager::from_options(
    BootOptions::new()
        .with_device(nvme_path())
        .with_hotkey(0x16)
        .with_hotkey_device(usb_path()),
)));

// Or with SimpleBootConfig for fixed primary/secondary:
add.component(BootDispatcher::new(SimpleBootManager::from_config(
    SimpleBootConfig::new(nvme_path(), usb_path())
        .with_hotkey(0x16),
)));

// Or with a custom orchestrator:
add.component(BootDispatcher::new(MyCustomOrchestrator::new()));

@github-actions github-actions bot added impact:non-functional Does not have a functional impact impact:breaking-change Requires integration attention impact:testing Affects testing labels Feb 20, 2026
@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

❌ Patch coverage is 95.36424% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
components/patina_boot/src/boot_dispatcher.rs 46.15% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

Introduces BootOrchestrator trait, BootDispatcher component, and
SimpleBootManager implementation. Updates config types and helper
functions with SimpleBootConfig for fixed primary/secondary topologies.
@kat-perez kat-perez force-pushed the boot-orchestrator-trait branch from 73a3dd8 to a1525e3 Compare February 23, 2026 18:54
@kat-perez kat-perez self-assigned this Feb 25, 2026
Remove explicit `(crate::BootOrchestrator)` link target that rustdoc
flags as redundant since the label resolves to the same destination.
…d SimpleBootConfig::default

Increase patch coverage above 80% by testing previously uncovered
constructor paths: from_options, from_config (with/without hotkey,
with failure handler), and the Default impl for SimpleBootConfig.
@kat-perez kat-perez removed the impact:breaking-change Requires integration attention label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:non-functional Does not have a functional impact impact:testing Affects testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant