Single-process, in-memory implementation of the three Authority contracts (implementation.md §3.2). It exists for three reasons: executable reference semantics for the contracts, unit tests without Postgres, and single-node development. Not for production multi-node use — it is itself a SPOF with none of Postgres's durability.
Lease and leadership expiry are judged on Fief.Seam read in this
process, so under simulation the arbiter's clock is virtual and steppable —
and may be skewed against per-node virtual clocks (design §6.4). Test seams
(undocumented, test-substrate only):
:sim_clockstart opt — binds a simulation clock (aFief.Sim.ManualClockor aFief.Sim.Scheduler.clock/3handle) as the arbiter's clock.set_unreachable/3— makes node-scoped operations return{:error, :unreachable}for one node (or:all), simulating an arbiter that cannot be reached without expiring anything.try_lead/3/leader/1— leadership storage primitives with monotonic term issuance; the notify-loopFief.Leadershipadapter (M3) campaigns through these.
Summary
Functions
Returns a specification to start this module under a supervisor.
Current leader per Fief.Leadership.leader/1 semantics.
Simulate arbiter unreachability for node_id (or :all). Test substrate.
Campaign for leadership. Grants (with a fresh monotonic term) if the seat is
empty or expired; renews (same term) if node_id already holds it; otherwise
{:error, {:held, holder, term}}.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Current leader per Fief.Leadership.leader/1 semantics.
Simulate arbiter unreachability for node_id (or :all). Test substrate.
Campaign for leadership. Grants (with a fresh monotonic term) if the seat is
empty or expired; renews (same term) if node_id already holds it; otherwise
{:error, {:held, holder, term}}.