Expand description
Restart supervision for script subprocesses.
ScriptConfig::restart_policy / restart_delay_ms are accepted by the
config layer but the actual supervision happens in the frontend event loop,
which is the only place that can re-register a terminal observer and re-spawn
against a config index. This module owns the decision — a pure state
machine with no I/O — so it stays deterministic and unit-testable.
The orchestrator drives one ScriptRestartState per script slot:
- On a fresh process start, call
ScriptRestartState::on_started. - Each frame, poll the process; if it has exited, call
ScriptRestartState::on_exit(only when not already pending) to get the first reaction. - While a restart is pending, call
ScriptRestartState::pollto learn when the delay has elapsed.
Structs§
- Script
Restart State - Pure per-slot restart supervisor.
Enums§
- Restart
Action - What the supervisor wants the orchestrator to do this frame for one slot.
Constants§
- MAX_
RESTART_ ATTEMPTS - Maximum number of consecutive restart attempts before the supervisor gives up.
- RESTART_
GRACE - A process that survives this long before exiting resets the failure counter.