SECTION 09 / INTERNALS
Architecture
Two socket faces
The agent socket exposes the OpenSSH agent protocol. A sibling control socket exposes registration and status operations to the CLI. Keeping control messages out of the agent protocol makes both boundaries smaller and easier to test.
Functional core
Candidate ordering, identity deduplication, key-to-agent routing, promotion, and failure transitions are deterministic values. The core describes the next effect; it does not open sockets or read time.
Imperative shell
The Tokio-based shell accepts connections, applies bounded timeouts, interprets core effects, and translates I/O failures into explicit domain outcomes. Upstream tasks are isolated so one broken socket does not poison the listener.
State lifecycle
- Configuration establishes static candidates.
- Discovery and control registration add ephemeral candidates.
- Identity results build a deduplicated routing view.
- Successful signatures promote candidates in memory.
- Service restart safely reconstructs state; no secret or key data is persisted.
Decision records
The architecture is constrained by published records for the functional core boundary, signing failover policy,Home Manager integration, and release state machine. Revisit them when upstream protocol behavior or the runtime model changes.