pub struct InsideLegReport {
pub state: InsideLegState,
pub seq: u64,
pub reason: Option<String>,
pub received_at: String,
pub ttl_ms: Option<u64>,
}Expand description
The stored form of one inside-leg report (contract v2: X2). The wire payload
the daemon receives is {session_id, seq, state, reason?, ttl_ms?}; the
daemon adds received_at and stores the rest here on the RegistryEntry.
seq is per-session_id monotonic so a reordered/duplicate report can be
dropped (seq <= last_seq); ttl_ms bounds how long the badge stays live
before it ages to unknown. NOTE (E3.1 scope): this struct is the storage
CONTRACT only – the seq-drop, TTL-aging, and 3-tier authority BEHAVIOUR that
consume these fields land in E3.2/E3.3. Mirrored in Python’s AgentEntry
(inside_leg: Optional[dict], a lossless passthrough) so a row round-trips
across the mixed-language registry (X3 / ab-b946b59c).
Fields§
§state: InsideLegState§seq: u64§reason: Option<String>§received_at: String§ttl_ms: Option<u64>Implementations§
Source§impl InsideLegReport
impl InsideLegReport
Sourcepub fn is_live_at(&self, now_secs: u64) -> bool
pub fn is_live_at(&self, now_secs: u64) -> bool
True when this report is still authoritative at now_secs (epoch
seconds), the TTL half of the 3-tier authority lattice (inside-out E3.3,
AC-X2-2). A report with no ttl_ms never ages out on its own – it is
cleared only by the ordered exit teardown, a done, or a newer report.
A report WITH a ttl expires once received_at + ttl_ms has passed, so a
working whose inside-leg process died (PTY still alive, exit-override
never fires) cannot pin a permanent stale badge. A received_at that
does not parse fails CLOSED (treated as expired -> the scraper takes
over), never as live: a corrupt stamp must not be the thing that pins a
forever-working.
Sourcepub fn received_within(&self, now_secs: u64, window_secs: u64) -> bool
pub fn received_within(&self, now_secs: u64, window_secs: u64) -> bool
True when received_at is within window_secs of now_secs – a plain
recency test (distinct from is_live_at, which never ages a report that
carries no ttl_ms). Used as the “provably live” signal that stops an
ask/mail routing miss from false-orphaning a live worker (x-c393). An
unparseable stamp fails CLOSED (not recent), so a corrupt row can never
shield a dead session from orphaning.
Trait Implementations§
Source§impl Clone for InsideLegReport
impl Clone for InsideLegReport
Source§fn clone(&self) -> InsideLegReport
fn clone(&self) -> InsideLegReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more