Runtime-shared fail-closed fences for OAuth response transitions.
Durable store transitions remain authoritative. Each secret-free transition
has its own :persistent_term key, so publishing it is atomic and does not
depend on a process that can restart between a server response and durable
persistence. Admission reads one runtime snapshot and conservatively erases
only fences satisfied by a strictly newer grant. Identities are opaque
digests; token, principal, and endpoint values are never retained.
Summary
Types
@type fence() :: {:rejected_generation, non_neg_integer()} | {:scope_requirement, non_neg_integer(), MapSet.t(binary())}
@type identity() :: binary()
Functions
@spec admit(identity(), non_neg_integer(), MapSet.t(binary())) :: :ok | {:error, :authorization_required}
@spec identity( PtcRunner.Kernel.MCPOAuth.Store.t(), PtcRunner.Kernel.MCPOAuth.GrantKey.t() ) :: identity()