Conversation
|
The questions are answered by #473 |
|
Suggest extending the contract so an implementor can signal exhaustion distinctly, e.g.: enum RestoreOutcome {
Restored,
SourcesExhausted,
}
fn restore(&mut self, attempt: u8) -> Result<RestoreOutcome, Self::Error>;so |
One managed device's restore mechanism: rewrite the active image from the board-configured recovery source. Ok means the mechanism completed, not that the image is good - judging the restored image stays with the verifier on the re-walk, so a restore can never forge a verdict. Errors are actuation faults only and are treated fail-closed. restore takes the attempt count from Effect::RecoverComponent so an implementor holding several sources can pick a different one each try. A count kept by the device would drift, because it never sees which attempt succeeded. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christina Quast <christina.quast@9elements.com>
Source exhaustion is a verdict, not a fault: it travels on the Ok side as RestoreOutcome::SourceExhausted so the platform driver can report Event::RecoveryUnavailable and the component is gated per policy, instead of the whole platform locking. Matches the verdict-vs-error contract in OpenPRoT#473. Assisted-by: Claude:claude-opus-4-6 Signed-off-by: Christina Quast <christina.quast@9elements.com>
55e23bd to
54debc4
Compare
The
Recoverycapability trait: rewrite one managed device's active image fromits board-configured recovery source. This is the seam
Effect::RecoverComponentneeds, which currently falls through toErr(EffectError)in the platform driver.restorereturnsResult<RestoreOutcome, Self::Error>:Ok(Restored)means the mechanism completed, not that the image is good.Judging the restored image stays with the verifier on the re-walk, so a
restore can never forge a verdict.
Ok(SourceExhausted)means no untried source remains. The orchestratorgates the component per its failure policy immediately, without waiting for
the retry cap. This is a clean, known condition, not a fault.
Erris an actuation fault only (source unreachable, write failed). Theorchestrator treats these fail-closed.
restoretakes theattemptcount straight from the effect, so an implementorholding several sources can pick a different one each try (slot A on 0, slot B
on 1, golden on 2). A count kept by the device would drift, because it never
sees which attempt succeeded.
Trait only: no driver executor, no
BoardCapabilitieschange, no board wiring.Those come in a follow-up.
The source-exhaustion question from #382 is resolved: exhaustion travels on the
Okside asRestoreOutcome::SourceExhausted, so the platform driver reportsEvent::RecoveryUnavailableand the component is gated per policy instead ofthe whole platform locking. Matches the verdict-vs-error contract in #473.
Related: #48.