MimirAnalytics.Capture (mimir_analytics v0.8.1)

Copy Markdown View Source

Session-finish capture: writes {"meta": ..., "result": ...} as a one-line JSONL file into a sessions spool directory. Explicit call from the step-runner / eval harness rather than a telemetry attachment. Takes plain maps; structs must be Jason-encoded to maps by the caller.

Each call writes its own file and publishes it by rename: the line is written to a dot-prefixed temporary sibling, which is then renamed to session-<UTC date>-<random>.jsonl. A visible file is therefore complete and never changes afterwards, which is the spool's write protocol (see mix mimir_analytics.ingest).

Summary

Functions

write(result, meta, dir)

@spec write(map(), map(), Path.t()) :: {:ok, Path.t()}