Skip to content

orchestrator: Let Platform::execute return a follow-up event - #419

Open
chrysh wants to merge 3 commits into
OpenPRoT:mainfrom
9elements:platform-event-return
Open

orchestrator: Let Platform::execute return a follow-up event#419
chrysh wants to merge 3 commits into
OpenPRoT:mainfrom
9elements:platform-event-return

Conversation

@chrysh

@chrysh chrysh commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

TL;DR: @rusty1968 Should the orchestrator SM have a que to get the events back, or should each shell implement their own queue?

An executor that learns something synchronously — a verification verdict — has no way to feed it back through Platform::execute, so every shell needs its own event queue drained between dispatches.

execute now returns Result<Option<Event>, EffectError>: the driver queues a returned event and settles it in the same run, so one dispatch runs to quiescence. The internal pending queue pops as it settles, so it bounds in-flight events instead of a run's total length; a queue overflow injects EffectFailed and latches Locked — the same fail-closed rule as a failed effect. At most one event per effect; results that arrive later (boot progress, timer expiry) stay outside events.

Breaking change to the Platform seam. The shell (#418) currently works around the gap with a shell-side queue and drops it once this lands.

An executor that learns something synchronously — a verification
verdict — had no way to feed it back; every shell needed its own queue,
drained between dispatches. execute now returns
Result<Option<Event>, EffectError>: the driver queues the returned
event and settles it in the same run, so one dispatch runs to
quiescence. The pending queue pops as it settles, bounding it by
in-flight events instead of a run's length; overflow injects
EffectFailed and latches Locked — the same fail-closed rule as a
failed effect.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Christina Quast <christina.quast@9elements.com>
@chrysh
chrysh force-pushed the platform-event-return branch from 246c9b7 to 61610d8 Compare August 14, 2026 17:13
A failed effect with a full pending queue silently dropped the
EffectFailed push: failed stayed set, nothing latched, and the run
settled as if the actuation had succeeded. Fold both failure paths into
one latch() helper: evict the newest queued event if the queue is full,
and push the latch to the *front*, so it settles next and queued
feedback drains into Locked instead of actuating hardware after a
failure. Document that returned events must quiesce.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Christina Quast <christina.quast@9elements.com>
@chrysh
chrysh requested a review from rusty1968 August 15, 2026 09:29
@chrysh
chrysh marked this pull request as ready for review August 15, 2026 09:29
PR OpenPRoT#357 renamed the effect-executing layer to platform driver; the SM
doc comments still said shell. Wording only.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Christina Quast <christina.quast@9elements.com>
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.

1 participant