Expand description
Auto-heal for dead seats: the supervisor that brings a durable lead or worker back when its subprocess closes while it should be up.
Re-exportsΒ§
use std::collections::HashMap;πuse std::sync::Arc;πuse std::sync::Mutex;πuse std::sync::Weak;πuse std::time::Instant;πuse std::time::SystemTime;πuse forge_primitives::SessionSlot;πuse crate::Workspace;πuse crate::crons::IST_OFFSET_MINUTES;πuse crate::mcp::peers::types::MessageId;πuse crate::mcp::peers::types::WrappedKind;πuse crate::mcp::peers::types::WrappedPrompt;πuse crate::mcp::peers::types::seat_name;πuse crate::protocol::Command;πuse crate::workspace::DYNAMIC_WORKER_RESTART_NOTE;πuse policy::HealPolicy;πuse policy::SeatFacts;π
ModulesΒ§
- policy π
- When a dead seat earns a restart, and how long the next one waits.
StructsΒ§
- Healing π
- The auto-heal supervisor. One per workspace, built lazily the first time a death reaches it.
- Seat π
- The supervisorβs per-slot memory: deaths since the last stable run, when the current occupant connected, and a token that makes a superseded timer a no-op.
- Workspace
Restart π - The production restart: the workspaceβs own spawn paths, which are the ones the boot re-spawn and the cron wake already use.
TraitsΒ§
- Seat
Restart π - How the supervisor brings a seat back. Production dispatches through the workspace; a test records the call instead of spawning a child.
FunctionsΒ§
- attempt_
notice π - The notice one worker death earns: the instant, the diagnostic, the attempt and what it did. The seat is named the way an envelope names it, so the lead can address it back.
- clock_
text π - The instant as the notice spells it: IST first and UTC in parentheses, so the reader needs no arithmetic on either clock.
- escalation_
notice π - The notice a spent budget earns: the restarts are over and the seat stays down with the diagnostic that ended it.
- heal_
resume_ πkick - The kick a healβs worker resume carries.
- lead_
notice π - The command that carries a workerβs notice to its projectβs lead: the
same envelope path
agents__send_messageuses, so a delivery to a sleeping lead parks and lands on wake. - restart_
worker π - Resume one worker through the spawn its boot re-spawn uses: that path ensures the worktree it needs, so a missing one is re-created rather than refused.
- seat_
facts π - The facts eligibility is decided on, read from the workspaceβs current state at each death, so a live config reload applies.
Type AliasesΒ§
- Notify π
- How the supervisor tells a projectβs lead about a worker. Production dispatches a peer message; a test records the prose.