pub struct RunReader { /* private fields */ }Expand description
Reader over one run directory.
Implementations§
Source§impl RunReader
impl RunReader
Sourcepub fn open(run_dir: impl AsRef<Path>) -> Result<Self>
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.
Sourcepub fn manifest(&self) -> Result<RunManifest>
pub fn manifest(&self) -> Result<RunManifest>
Parse manifest.json — the run’s immutable identity record.
Sourcepub fn status(&self) -> Result<RunStatus>
pub fn status(&self) -> Result<RunStatus>
Parse status.json — the latest state + heartbeat snapshot.
Sourcepub fn info(&self) -> Result<RunInfo>
pub fn info(&self) -> Result<RunInfo>
Listing entry for this run (state includes crash detection).
Sourcepub fn events(&self) -> Result<Vec<EventEnvelope>>
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.
Sourcepub fn node_timings(&self) -> Result<Vec<NodeSpan>>
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.
Sourcepub fn cache_activity(&self) -> Result<CacheActivity>
pub fn cache_activity(&self) -> Result<CacheActivity>
Cache hit/miss counts, total and per node.
Sourcepub fn metric_series(&self, name: Option<&str>) -> Result<Vec<MetricPoint>>
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.
Sourcepub fn health_flags(&self) -> Result<Vec<HealthFlagRecord>>
pub fn health_flags(&self) -> Result<Vec<HealthFlagRecord>>
All HealthFlag events with wall time.
Sourcepub fn agentic_activity(&self) -> Result<AgenticActivity>
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.
Sourcepub fn agentic_timeline(&self) -> Result<Vec<EffectSpan>>
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.
Sourcepub fn graph(&self) -> Result<Option<Graph>>
pub fn graph(&self) -> Result<Option<Graph>>
The graph this run executed (graph.json), if snapshotted.
Sourcepub fn overlay(&self) -> Result<GraphOverlay>
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.
Sourcepub fn to_mermaid(&self) -> Result<String>
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.
Sourcepub fn to_graphviz(&self) -> Result<String>
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.
Sourcepub fn to_svg(&self) -> Result<String>
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.
Sourcepub fn trial_timeline(&self) -> Result<Vec<TrialSpan>>
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.