Skip to content

orchestrator: Compose boot-walk supervision from the board's BootWatch capability - #443

Merged
chrysh merged 2 commits into
OpenPRoT:mainfrom
9elements:boot-watch-composition
Aug 27, 2026
Merged

orchestrator: Compose boot-walk supervision from the board's BootWatch capability#443
chrysh merged 2 commits into
OpenPRoT:mainfrom
9elements:boot-watch-composition

Conversation

@chrysh

@chrysh chrysh commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What

Composes the BootWatch capability into the platform driver, closing the gap noted at the ReleaseReset executor: released devices are now supervised, and their boot outcomes come back as ComponentReady/Booted/Timeout events.

How

  • ReleaseReset arms the component's walk; AssertReset stops it, so a device put back in reset (recovery, isolation) can't produce a stale Timeout.
  • The new PlatformDriver::poll_boot_walks(now_millis) polls every watched walk and maps the first terminal verdict to its event: Complete becomes ComponentReady (Active) or Booted (Passive), Failed becomes Timeout regardless of cause — retry budgeting stays in the SM. A finished walk stops being watched, so each verdict is delivered once. While everything waits, the poll carries the earliest walk deadline as the run loop's next wake-up.
  • BootWatch gains arm(): a retry re-release starts a fresh walk, and since reset actuation has no clock, the attempt starts at the next poll's now_millis.
  • Board gains boot_watches and kinds (one per component, from the same table as the SM's chain).
  • The driver README still described take_event and NotImplemented, both gone; rewritten to the current execute/fail-closed shape.

Tests

Seven new driver tests: verdict-to-event mapping by kind, exactly-once delivery, earliest-deadline aggregation, watch gating on release/assert, fresh-walk re-arming, and two end-to-end runs through the SM (passive Booted settles in Ready; boot timeout fails closed while the recovery seam is uncomposed).

Known gap

The walk can report FailureCause::DeviceFatal, but the SM's event vocabulary only has Timeout, so fatal causes still spend retry budget. Short-circuiting those needs a new SM event — follow-up, not this PR.

@chrysh
chrysh force-pushed the boot-watch-composition branch 5 times, most recently from 38dbbfe to ea3ec22 Compare August 26, 2026 10:48
@chrysh
chrysh marked this pull request as ready for review August 26, 2026 10:51
…h capability

ReleaseReset arms the component's walk, AssertReset stops it, and the
new PlatformDriver::poll_boot_walks maps terminal verdicts to events:
Complete becomes ComponentReady (Active) or Booted (Passive), Failed
becomes Timeout regardless of cause — retry budgeting is the SM's. A
finished walk stops being watched, so each verdict is delivered once;
while everything waits, the poll carries the earliest walk deadline as
the run loop's next wake-up.

BootWatch gains arm(): a retry re-release starts a fresh walk, and
since reset actuation has no clock, the attempt starts at the next
poll's now_millis. The Board supplies one walk and one ComponentKind
per component, from the same table as the SM's chain.

The driver README still described take_event and NotImplemented, both
gone; rewritten to the current execute/fail-closed shape.

Signed-off-by: Christina Quast <christina.quast@9elements.com>
@chrysh
chrysh force-pushed the boot-watch-composition branch from ea3ec22 to bc24329 Compare August 26, 2026 10:54
Comment thread services/orchestrator/driver/src/driver.rs Outdated
@leongross

Copy link
Copy Markdown
Member

I would feel better if we could get rid of the index matchings, but as @chrysh already discussed, we will leave it like this until @FerralCoder finishes the config design.

Replace the ComponentId::new(idx as u8) call in poll_boot_walks with a
From<u8> conversion, per review. The const fn new stays for const
contexts (test constants).

Also assert N <= 256 at compile time in PlatformDriver::new: component
ids are u8, so a larger board would wrap them silently.

Signed-off-by: Christina Quast <christina.quast@9elements.com>
@chrysh
chrysh merged commit 403ce47 into OpenPRoT:main Aug 27, 2026
5 checks passed
@chrysh
chrysh deleted the boot-watch-composition branch August 27, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Downstream device boot monitoring

2 participants