pub struct ActiveSeat {
pub node: String,
pub started_at: Timestamp,
pub timeout_secs: u64,
pub attempt: usize,
pub task: Option<String>,
pub command: Option<String>,
pub index: Option<usize>,
pub total: Option<usize>,
}Expand description
A seat currently mid-answer: a prompt was sent and no reply has landed yet.
This is not the whole story of “is it alive” — a daemon killed mid-wave
leaves its last wave’s entries here forever, since nothing ran to clear
them. A reader must cross-check a live daemon’s heartbeat
(daemon::is_working_on) before trusting one of these as “still running”
rather than “abandoned”. RunState::clear_active is what keeps that
leftover from surviving into the next attempt at this run: execute calls
it before doing anything else, so a resumed run never carries a stale
entry into its own report before the next wave repopulates it.
Deliberately carries no agent id: an implementer’s agent is no secret, but
a judge or reviewer seat is blind (SeatState::key is keyed by seat, never
agent, for exactly this reason), and this struct has no way to tell which
kind of seat it describes. The seat key alone — already in the map this
lives under — is what every caller needs to say which seat is running.
The same map also carries entries for shell-command work that runs
outside any seat — verify.e2e, verify.gate — keyed by the task’s own
name ("e2e", "gate") rather than a seat key. Self::task is Some
only for those; it is how a reader tells the two kinds of entry apart
without a second map, a second route, or a second SSE reason to poll for
— see RunState::seats_active / RunState::tasks_active for the
accessors that split them back apart. A task entry is exactly as blind as
a seat entry: no agent runs it, so there is nothing to leak, and
Self::command carries only the shell command being run, never
anything about who is running it.
Fields§
§node: StringNode the seat is answering for, e.g. implement, judge, review.
For a task entry, the node the command list runs under (verify,
gate).
started_at: TimestampWhen this attempt — or, for a task entry, this one command — was
started. A task entry’s timer resets at every command boundary,
because verify.e2e / verify.gate apply their timeout per command,
not once across the whole list — see RunState::task_command.
timeout_secs: u64The wall-clock budget for this attempt (a seat) or this one command (a task entry).
attempt: usize0 for the first ask, N for the Nth nudge or resume. For a task entry,
0 for the first pass over the command list, N for the Nth retry (see
run_e2e_with_retry’s build/link retry).
task: Option<String>None for a seat; Some("e2e") / Some("gate") for a running
command-list task. This is the type tag that lets both kinds of entry
share one map without a task ever being mistaken for a (blind) seat —
see this struct’s own doc. Omitted from JSON when absent (the common,
seat case), rather than written out as a literal null on every one
of a run’s seat entries.
command: Option<String>The command currently running, task entries only. Never set on a seat entry — a seat has no command, only a prompt, and a prompt is not safe to show mid-run (see this struct’s blindness note).
index: Option<usize>1-based position of Self::command within the task’s command list.
total: Option<usize>Number of commands in the task’s list.
Implementations§
Source§impl ActiveSeat
impl ActiveSeat
Sourcepub fn elapsed_secs(&self, now: Timestamp) -> i64
pub fn elapsed_secs(&self, now: Timestamp) -> i64
Seconds since this attempt was sent.
Sourcepub fn remaining_secs(&self, now: Timestamp) -> i64
pub fn remaining_secs(&self, now: Timestamp) -> i64
Seconds left before this attempt’s own timeout fires, floored at zero rather than going negative once the CLI has overrun its budget.
Trait Implementations§
Source§impl Clone for ActiveSeat
impl Clone for ActiveSeat
Source§impl Debug for ActiveSeat
impl Debug for ActiveSeat
Source§impl<'de> Deserialize<'de> for ActiveSeat
impl<'de> Deserialize<'de> for ActiveSeat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ActiveSeat
impl RefUnwindSafe for ActiveSeat
impl Send for ActiveSeat
impl Sync for ActiveSeat
impl Unpin for ActiveSeat
impl UnsafeUnpin for ActiveSeat
impl UnwindSafe for ActiveSeat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more