| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Singular.Registry.FoldAdmission
Description
Pull request 3 of #519 promotes the fold's window rule out of the command
line into the registry library, beside the within-batch rule the model
states. Both functions are pure over POSIX milliseconds: no clock, no
provider, no command line, no open datum. They mirror the model's names —
foldAdmission and batchConsumesCreated of @Singular.Model_ — so the
builder, the selection and the command line call one predicate each, and
the conformance unit suite checks the library against the model at the
boundary and one past it.
A request's deadline is its submission time plus the registry's processing
time, never the clock. A fold is admitted when its finite validity upper
bound, excluded as the ledger hands it to a script, is at or before the
deadline of every request it includes; equality admits. A batch that
terminates a key an earlier insertion of the same batch created is refused
token-missing: the termination must burn the active token from an input,
and the insertion delivers it to an output of the same transaction.
Synopsis
- data BatchEdge
- data AdmissionRefusal ref = AdmissionRefusal {
- refusalRef :: ref
- refusalSubmittedAt :: Integer
- refusalDeadline :: Integer
- refusalBound :: Integer
- data BatchConsumption ref key = BatchConsumption {
- consumptionRef :: ref
- consumptionKey :: key
- foldAdmission :: Integer -> Integer -> [(ref, Integer)] -> Maybe (AdmissionRefusal ref)
- batchConsumesCreated :: Eq key => [(ref, key, BatchEdge)] -> Maybe (BatchConsumption ref key)
- admissionReason :: String
- admissionSource :: String
- consumptionReason :: String
- consumptionSource :: String
- mintReason :: String
- mintSource :: String
Documentation
The edge a batched request takes, as far as the within-batch check reads it: an insertion creates the key's active holding, a termination burns one, any other edge is neither.
Constructors
| BatchInsert | |
| BatchTerminate | |
| BatchOther |
Instances
| Show BatchEdge Source # | |
Defined in Singular.Registry.FoldAdmission | |
| Eq BatchEdge Source # | |
Defined in Singular.Registry.FoldAdmission | |
data AdmissionRefusal ref Source #
Why a fold is not admitted: the first included request, in input
order, whose deadline the upper bound passes, with its submission time,
its deadline and the bound. The reason is admissionReason with source
admissionSource.
Constructors
| AdmissionRefusal | |
Fields
| |
Instances
| Show ref => Show (AdmissionRefusal ref) Source # | |
Defined in Singular.Registry.FoldAdmission Methods showsPrec :: Int -> AdmissionRefusal ref -> ShowS Source # show :: AdmissionRefusal ref -> String Source # showList :: [AdmissionRefusal ref] -> ShowS Source # | |
| Eq ref => Eq (AdmissionRefusal ref) Source # | |
Defined in Singular.Registry.FoldAdmission Methods (==) :: AdmissionRefusal ref -> AdmissionRefusal ref -> Bool Source # (/=) :: AdmissionRefusal ref -> AdmissionRefusal ref -> Bool Source # | |
data BatchConsumption ref key Source #
Why a batch consumes what it creates: the terminating request and the
key. The reason is consumptionReason with source consumptionSource.
Constructors
| BatchConsumption | |
Fields
| |
Instances
| (Show ref, Show key) => Show (BatchConsumption ref key) Source # | |
Defined in Singular.Registry.FoldAdmission Methods showsPrec :: Int -> BatchConsumption ref key -> ShowS Source # show :: BatchConsumption ref key -> String Source # showList :: [BatchConsumption ref key] -> ShowS Source # | |
| (Eq ref, Eq key) => Eq (BatchConsumption ref key) Source # | |
Defined in Singular.Registry.FoldAdmission Methods (==) :: BatchConsumption ref key -> BatchConsumption ref key -> Bool Source # (/=) :: BatchConsumption ref key -> BatchConsumption ref key -> Bool Source # | |
foldAdmission :: Integer -> Integer -> [(ref, Integer)] -> Maybe (AdmissionRefusal ref) Source #
The fold admission over POSIX milliseconds: the registry's processing time, the fold's finite excluded upper bound, and the included requests as output reference with submission time, in input order. Admits when the bound is at or before every request's deadline; otherwise refuses with the first request in input order whose deadline the bound passes.
batchConsumesCreated :: Eq key => [(ref, key, BatchEdge)] -> Maybe (BatchConsumption ref key) Source #
The within-batch check over the included requests in order, each as output reference with key and edge. Refuses with the terminating request and the key when a termination names a key an earlier insertion of the same batch created; anything else is the law's business, not this check's.
admissionReason :: String Source #
The model's refusal word for a fold outside its window, reported verbatim.
admissionSource :: String Source #
Where the window refusal comes from: the model, never processor policy.
consumptionReason :: String Source #
The model's refusal word for a batch that terminates a key it just inserted, reported verbatim.
consumptionSource :: String Source #
Where the within-batch refusal comes from: the model, never processor policy.
mintReason :: String Source #
The model's refusal word for a batch whose claimed mint differs from what its edges mint at any key, reported verbatim.
mintSource :: String Source #
Where the keyed-mint refusal comes from: the model, never processor policy.