ReductionBounds.RpcServerContract (ReductionBounds v0.1.0)

Copy Markdown View Source

Declares a unary integer RPC handler and its separate server frame.

assume/4 leaves the handler bound as an explicit assumption. reuse/3 replays an integer cost derivation against current Core and instantiates its declarative cost contract; saved verification flags are never evidence. Both require :server_work. The frame describes the assumed server mailbox and reply envelope, independently of the checked client mailbox.

Frame keys are :message_size, :reply_size, :initial_messages, :arrivals, :inspections, :pattern_attempts, and :guard_attempts. These scope the supplied receive/send rates; they are not checked against server execution. The request payload is the modeled handler argument. Connecting that association, the handler identity and reply encoding to source is deferred.

Summary

Functions

assume(target, input, bound, frame)

@spec assume(tuple(), ReductionBounds.IntegerSize.t(), non_neg_integer(), map()) ::
  {:ok, map()} | {:error, term()}

reuse(bound, frame, options \\ [])

@spec reuse(map(), map(), keyword()) :: {:ok, map()} | {:error, term()}