Expand description
File-based tracking backend: run directories under .soma/runs/.
JsonlEventSink is the lossless event consumer wired into
EventBus; LocalTracker owns one
run directory (manifest, status, logs). See
docs/src/content/docs/design/tracking.md for the on-disk layout.
Structs§
- Agent
Node Activity - One step node’s share of the run’s agentic work. Spawned instances
appear under their own hierarchical ids (
parent/label). - Agentic
Activity - Agent-level activity for one run, aggregated from the step events
(
AgentTurnStarted,EffectCompleted,ToolCalled,Suspended,AgentStepCompleted, …). Emptyby_nodemeans the run had no agent steps — or predates their telemetry. - Cache
Activity - Per-run cache effectiveness, reconstructed from hit/miss events.
- Effect
Span - One effect’s execution inside a step — the gantt substrate for
agent runs, the per-effect analogue of
NodeSpan. An unclosed span (outcome: "running") means the run died mid-effect. - Health
Flag Record - One
HealthFlagevent with its wall time. - Jsonl
Event Sink - Writes every event as one JSON line to
events.jsonl, teeing metric-bearing events (TrialMetric,MetricReported) into a flatmetrics.jsonlfor cheap time-series reads. - Local
Tracker - A run directory under
<root>/runs/<run_id>/. - Metric
Point - One line of
metrics.jsonl(also derivable from events). - Node
Cache Counts - One node’s share of
CacheActivity. - Node
Span - One execution span of a node, in event order. A node appears once per execution (re-runs and stream chunks produce separate spans).
- RunInfo
- Listing entry for one run: manifest identity plus derived liveness.
- RunReader
- Reader over one run directory.
- Trial
Span - One trial’s lifetime, from
study.json.
Constants§
- PARENT_
ENV - Environment override for the parent run id.
- STALE_
HEARTBEAT_ SECS - A
Runningstatus whose heartbeat is older than this is reported as crashed: the process died without finalizing.
Functions§
- advance_
head - Advance HEAD after a run finished successfully.
- checkout
- Point HEAD at an existing run so the next run branches from it.
- clear_
head - Detach HEAD: the next run starts a new line. Absent HEAD is fine.
- collect_
git_ info - Best-effort git context via subprocess; all-
Noneoutside a repo. - head_
path - Path of the HEAD file for a tracking root (
.soma/HEAD). - list_
runs - All runs under
<root>/runs/, newest first. Directories without a readable manifest are skipped. - load_
manifest - Read a run’s manifest.
- load_
status - Read a run’s status file.
- read_
head - The run id in
.soma/HEAD, if any. An unreadable, empty or whitespace-only HEAD reads as absent — never as an error, because a broken pointer must not stop a run from starting. - resolve_
parent - Resolve the parent run for a run about to start.
- resolve_
parent_ from - The precedence rule, with its inputs injected — the testable core.
- run_
exists - Whether
<root>/runs/<run_id>/manifest.jsonexists. - summarize
- Fold a run directory into a
RunSummary. - write_
head - Point HEAD at
run_id, atomically (write to a temp file, then rename) so a crash mid-write leaves the previous pointer intact rather than a truncated one.