# `MimirAnalytics.Mappers.GatewayExport`
[🔗](https://github.com/cash-mckeeman/mimir/blob/mimir_analytics-v0.8.1/mimir_analytics/lib/mimir_analytics/mappers/gateway_export.ex#L1)

Gateway JSONL buffer files → `model_calls` + `routing_decisions` + `events_raw`.
Line kinds: "request_log", "routing_decision" — written by
`MimirAnalytics.Ingest.GatewayPull` from the gateway Observability API;
the fixture is the contract, wherever the bytes came from.

`request_log` lines carry `turn_events` as `%{"events" => [...]}` — the map
the gateway's request-log writer persists, not a bare array. Each entry is
either a CloudEvents v1.0 envelope or a pre-envelope
event/`routing_decision` map; both map one-for-one into `events_raw`, with
the envelope's `id`/`source`/`type`/`time` in the `ce_*` and `ts` columns
and NULL there for history.

# `resolve_run_ids`

```elixir
@spec resolve_run_ids(MimirAnalytics.Store.t()) :: :ok
```

Resolve model_calls.run_id by (workflow_id, step_id) against runs.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
