# req_managed_agents_host v0.1.0 - Table of Contents

> Durable single-node session host for req_managed_agents: crash-survivable, idle-detachable hosted sessions keyed by an external id.

## Pages

- [req_managed_agents_host](readme.md)
- [Changelog](changelog.md)
- [LICENSE](license.md)

## Modules

- [ReqManagedAgents.Host](ReqManagedAgents.Host.md): Durable single-node session host over `req_managed_agents`.
- [ReqManagedAgents.Host.Config](ReqManagedAgents.Host.Config.md): Resolved, validated host configuration. The struct threaded through the host; not raw opts.
- [ReqManagedAgents.Host.Locator](ReqManagedAgents.Host.Locator.md): Durable `external_id -> upstream identity` map over a `Store`. Reads and writes
`Locator.Record` rows; translates the store's `:miss` (and any non-`Record`
value found in a shared store) to the caller-facing `:error`.

- [ReqManagedAgents.Host.Locator.Record](ReqManagedAgents.Host.Locator.Record.md): Durable session-locator row: external id -> upstream identity. A pointer, not an event ledger.
- [ReqManagedAgents.Host.SessionServer](ReqManagedAgents.Host.SessionServer.md): Per-external-id GenServer driving one turn at a time through `ReqManagedAgents.Session.run/2`.
- [ReqManagedAgents.Host.SessionSupervisor](ReqManagedAgents.Host.SessionSupervisor.md): `DynamicSupervisor` holding one live `SessionServer` per external id. Crash-isolated:
killing one server never affects a sibling. `start_or_get/2` is the sole entry point —
it starts a fresh server or hands back the pid of one already registered under the same
external id, resolving the race where two callers both call it concurrently for the same id.

- [ReqManagedAgents.Host.Store](ReqManagedAgents.Host.Store.md): Pluggable persistence for the session `Locator`. Mirrors RMA's `Provisioner.Store`
ETS/File pattern one layer up: live-session locator rows, not provisioning digests.
A store is referenced as `{module(), keyword()}`; `ref/1` resolves the opts to the
concrete handle the other callbacks take.

- [ReqManagedAgents.Host.Store.DETS](ReqManagedAgents.Host.Store.DETS.md): File-backed `Store` implementation using OTP's `:dets`. The table is
reopened from the same path on every `start_link/1`, so locator rows
survive a BEAM restart. A corrupt or unreadable file is logged and
replaced with a fresh, empty table (mirrors RMA's `Provisioner.Store.File`
corrupt-file handling) — a lost locator row just means the next lookup
falls back to provisioning, not a crash.

- [ReqManagedAgents.Host.Store.ETS](ReqManagedAgents.Host.Store.ETS.md): Default `Store` implementation: a named public ETS `:set` table, owned by a
tiny GenServer so the table outlives any individual caller. Process-local —
empty in every fresh OS process, gone when the owner stops.

