Interface IApprovalStore
Persists approval decisions for audit and replay. Every call answered by
should land here so reviewers can correlate the
gate's verdict with the resulting tool call.
The optional exchange parameter on every method carries the route
pipeline's current exchange; REDB-backed implementations resolve a
per-exchange through
IRouteContext.GetRedbService(name, exchange) using the named-redb
hint stored in . In-memory implementations
ignore it.
Without an exchange a redb-backed implementation opens a redb scope of its own for the call. That scope joins an
ambient (a , a
route's .Transacted()) as every redb connection does, but not a transaction begun on the context's shared
IRedbService (ExecuteAtomicAsync, BeginTransaction), which it does not see: pass the exchange,
or use a TransactionScope, when the call must commit or roll back with that work. In-memory implementations
take part in no transaction.
public interface IApprovalStore
Methods
FindAsync(string, IExchange?, CancellationToken)
Looks up the previously-recorded decision for approvalId.
Task<ApprovalRecord?> FindAsync(string approvalId, IExchange? exchange = null, CancellationToken ct = default)
RecordAsync(ApprovalRequest, ApprovalDecision, IExchange?, CancellationToken)
Records a decision against the pending request.
Task RecordAsync(ApprovalRequest request, ApprovalDecision decision, IExchange? exchange = null, CancellationToken ct = default)