Skip to main content

RunReader

Struct RunReader 

Source
pub struct RunReader { /* private fields */ }
Expand description

Reader over one run directory.

Implementations§

Source§

impl RunReader

Source

pub fn open(run_dir: impl AsRef<Path>) -> Result<Self>

Open a run directory. Fails only if the manifest is missing or unreadable — everything else is tolerated per-file.

Source

pub fn dir(&self) -> &Path

The run directory this reader was opened on.

Source

pub fn manifest(&self) -> Result<RunManifest>

Parse manifest.json — the run’s immutable identity record.

Source

pub fn status(&self) -> Result<RunStatus>

Parse status.json — the latest state + heartbeat snapshot.

Source

pub fn info(&self) -> Result<RunInfo>

Listing entry for this run (state includes crash detection).

Source

pub fn events(&self) -> Result<Vec<EventEnvelope>>

All parseable event envelopes, in log order. Torn or unknown lines are skipped; seq gaps let a consumer detect the skips.

Source

pub fn node_timings(&self) -> Result<Vec<NodeSpan>>

Per-node execution spans in event order — the gantt/overlay substrate. Cache hits are standalone spans (a hit node never starts); an unclosed span means the run died mid-node.

Source

pub fn cache_activity(&self) -> Result<CacheActivity>

Cache hit/miss counts, total and per node.

Source

pub fn metric_series(&self, name: Option<&str>) -> Result<Vec<MetricPoint>>

Metric time series, optionally filtered by name. Reads the flat metrics.jsonl tee; falls back to deriving the same points from events.jsonl when the tee is absent.

Source

pub fn health_flags(&self) -> Result<Vec<HealthFlagRecord>>

All HealthFlag events with wall time.

Source

pub fn agentic_activity(&self) -> Result<AgenticActivity>

Agent-level activity, aggregated per step node.

Accounting rule: AgentStepCompleted totals are authoritative (they are cumulative — a resumed run re-counts its replayed effects). A Suspended cost stands in only until a later completion for the same node supersedes it, and turn counts seen on the wire (AgentTurnStarted) are used only for nodes that died without any accounting event at all.

Source

pub fn agentic_timeline(&self) -> Result<Vec<EffectSpan>>

Per-effect execution spans in event order — the gantt substrate for agent runs. Concurrent same-label effects within a turn are matched first-in-first-out, which is the order the driver reports completions in.

Source

pub fn graph(&self) -> Result<Option<Graph>>

The graph this run executed (graph.json), if snapshotted.

Source

pub fn overlay(&self) -> Result<GraphOverlay>

Fold this run’s node spans and health flags into a rendering overlay: status + total duration + cache tier per node, ×N when a node ran more than once, deduplicated flags.

Source

pub fn to_mermaid(&self) -> Result<String>

Mermaid rendering of the run’s graph, annotated with this run’s overlay. Errors if the run has no graph.json snapshot.

Source

pub fn to_graphviz(&self) -> Result<String>

Graphviz rendering of the run’s graph, annotated with this run’s overlay. Errors if the run has no graph.json snapshot.

Source

pub fn to_svg(&self) -> Result<String>

Self-contained SVG rendering of the run’s graph with this run’s overlay — no JavaScript, safe for notebook/report embedding. Errors if the run has no graph.json snapshot.

Source

pub fn study(&self) -> Result<Option<Study>>

The study attached to this run, if any.

Source

pub fn trial_timeline(&self) -> Result<Vec<TrialSpan>>

Trial lifetimes from study.json (empty for non-study runs) — the timeline/gantt substrate for HPO charts.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

The receiver as &dyn Any, ready for downcast_ref.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more