Agent
detent-agent exists so that a host needs one connection to the authority, not
one per process, and so that processes that can’t link C++ still get fast,
local reads.
With --managed managed.json the agent receives snapshots and deltas from the
authority or a relay over verified TLS and
publishes immutable generations, described in
Delivery and Local Images. detent get and
the C++ managed source read those generations. Without --managed (or
managed_path in agent.json) the agent exits with no source configured.
| Managed agent | |
|---|---|
| Upstream | Authority or relay, TLS, bearer token |
| Local state | generation_dir (selected plus immutable generations) |
| Build | DETENT_BUILD_MANAGED_AGENT=ON (default) |
| First start | --initialize-managed once on an empty directory |
Design
Section titled “Design”Readers pin a generation through a lease file and read bytes nobody will ever modify, so a reader never races a writer. See Delivery and Local Images.
Lifecycle
Section titled “Lifecycle”detent getstarts a user agent on demand and waits for its first generation. System agents are started only by the service manager.- The agent holds a lock on
agent.pid;--statusreads it without starting anything. - SIGTERM drains logs and exits cleanly.
- If the upstream disappears, the agent keeps the last selected generation and keeps retrying.