| License | Apache-2.0 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Conformance.Receipt
Description
A receipt is written by a run that actually executed a row,
recording the row id, the outcome, the transaction ids the chain
accepted or the refusal attribution, the measured execution units
and size, the base commit, and the node and blueprint identities.
list prints a row as executed iff a receipt for it exists and its
base matches the current tree; otherwise it prints the declared
plan. Receipts live under the run's own output directory — never in
the tracked tree — and list takes the directory as --receipts
or CONFORMANCE_RECEIPTS, defaulting to none.
Two venues need no node. blueprint-encoding-round-trip checks Haskell encodings against the
compiled blueprint's declared schemas read at run time
(blueprint-check); script-parameter-application checks parameter application in Haskell
(param-check). Both record mem/cpu zero — no script executed
— and txSize the measured serialized bytes, with no transactions.
Every other accepted row is a node-submit observation with
transactions and units from the running node.
One shape here is owned elsewhere and re-exported: the asset-movement
form of edge evidence — a policy, a name and a quantity with their JSON
encoding — lives in Conformance.Evidence.Asset and is re-exported by
this module unchanged, so the public import path a caller already uses
does not move.
Synopsis
- data Outcome
- data Verdict
- data UnmetRuling
- = ConsumerRequirementUnmet Text
- | NoModelCounterpart Text
- unmetRuling :: Text -> Maybe UnmetRuling
- unmetReading :: UnmetRuling -> Text
- data RefusalInfo = RefusalInfo {
- refusalScript :: !Text
- refusalReason :: !Text
- refusalPhase :: !Text
- refusalHashes :: ![Text]
- refusalBranch :: !(Maybe Text)
- refusalLimit :: !(Maybe Text)
- refusalReplay :: !(Maybe [ReplayEvidence])
- data ReplayEvidence = ReplayEvidence {
- replayDeployedHash :: Text
- replayTracedHash :: Maybe Text
- replayReason :: Maybe Text
- replayCause :: Maybe Text
- replayCaptureId :: Maybe Text
- data ReplayCorrespondence = ReplayCorrespondence {
- correspondenceSource :: Text
- correspondenceCompiler :: Text
- correspondenceFlags :: Text
- correspondenceDigest :: Text
- stepReplay :: [ReplayEvidence] -> Value -> Value
- storyCorrespondence :: Maybe ReplayCorrespondence -> [Value] -> Maybe ReplayCorrespondence
- data ConstructorStanding
- data ConstructorEvidence = ConstructorEvidence {
- ceConstructor :: !Text
- ceIndex :: !Integer
- ceStanding :: !ConstructorStanding
- ceEvidence :: !Text
- newtype PartialInfo = PartialInfo {}
- data DerivationOutcome
- data AssetEntry = AssetEntry {
- aePolicy :: !Text
- aeName :: !Text
- aeQuantity :: !Integer
- data DerivationEvidence = DerivationEvidence {
- deValidator :: !Text
- deArity :: !Integer
- deComputed :: !Text
- deReference :: !Text
- deReferenceSource :: !Text
- deOutcome :: !DerivationOutcome
- deVenue :: !Text
- derivationMatches :: Eq a => a -> a -> (a, Bool)
- data Receipt = Receipt {
- receiptRow :: !Text
- receiptOutcome :: !Outcome
- receiptVerdict :: !Verdict
- receiptTransactions :: ![Text]
- receiptRefusal :: !(Maybe RefusalInfo)
- receiptMem :: !(Maybe Integer)
- receiptCpu :: !(Maybe Integer)
- receiptTxSize :: !(Maybe Integer)
- receiptBase :: !Text
- receiptNode :: !Text
- receiptBlueprint :: !Text
- receiptVenue :: !Text
- receiptRejected :: !(Maybe Text)
- receiptDirty :: !Bool
- receiptPartial :: !(Maybe PartialInfo)
- receiptDerivation :: !(Maybe [DerivationEvidence])
- receiptSteps :: !(Maybe [Value])
- receiptReplayCorrespondence :: !(Maybe ReplayCorrespondence)
- declaredConstructors :: Text -> Maybe [(Text, Integer)]
- derivationVenue :: Text
- maxReceiptBytes :: Int
- maxLiveStepReasonChars :: Int
- checkReceiptSize :: Receipt -> Either String ()
- loadReceipts :: FilePath -> IO (Either String [Receipt])
- writeReceiptFile :: FilePath -> Receipt -> IO ()
- currentBase :: IO (Maybe Text)
Documentation
A row's observed outcome on the ledger.
Instances
| FromJSON Outcome Source # | |
Defined in Conformance.Receipt | |
| ToJSON Outcome Source # | |
| Show Outcome Source # | |
Defined in Conformance.Receipt | |
| Eq Outcome Source # | |
Defined in Conformance.Receipt | |
How a completed row stands against the behavioral models. The
chain outcome (Outcome) is a fact; the verdict compares it with
what the models require. Q-002 (story 2, escalated to the user)
decides which model is the behavioral authority where Singular's
Lean and the consumer's theorems disagree; a row whose observation
contradicts the consumer's theorem while Singular's Lean permits
it is HeldQ002 — recorded, published, and never read as a pass:
the run exits non-zero while any row is held.
Constructors
| AgreesWithModel | the observation is what the behavioral model requires (or the model constrains nothing here) |
| HeldQ002 | Singular's Lean and the consumer's theorem disagree and the chain sided with Singular's Lean: held pending the user ruling (Q-002, story 2) |
| DivergesFromLean | the chain contradicts Singular's Lean itself |
| ResolvedByRuling | a user ruling resolved the row's question; the observation is retained (as history or defect evidence) under the ruling, never read as a pass and never as conformance credit (A-001: historical-owner-change is resolved-by-ruling, not a fourth unresolved hold) |
| UnmetByRuling | an unmet consumer requirement, kept by operator ruling
2026-10-01 ("Keep as unmet requirement"): the consumer's
theorem (cardano-keri |
| Partial | the row executed its available legs but named constructors
stay unexercised, enumerated in |
Instances
| FromJSON Verdict Source # | |
Defined in Conformance.Receipt | |
| ToJSON Verdict Source # | |
| Bounded Verdict Source # | |
Defined in Conformance.Receipt | |
| Enum Verdict Source # | |
Defined in Conformance.Receipt Methods succ :: Verdict -> Verdict Source # pred :: Verdict -> Verdict Source # toEnum :: Int -> Verdict Source # fromEnum :: Verdict -> Int Source # enumFrom :: Verdict -> [Verdict] Source # enumFromThen :: Verdict -> Verdict -> [Verdict] Source # enumFromTo :: Verdict -> Verdict -> [Verdict] Source # enumFromThenTo :: Verdict -> Verdict -> Verdict -> [Verdict] Source # | |
| Show Verdict Source # | |
Defined in Conformance.Receipt | |
| Eq Verdict Source # | |
Defined in Conformance.Receipt | |
data UnmetRuling Source #
Why a row stands unmet-by-ruling: the two meanings the operator's
rulings give that one verdict, each with the issue that would close it.
Constructors
| ConsumerRequirementUnmet Text | the registry deliberately does not do what the consumer's theorem requires (ruling 2026-10-01); the alignment issue |
| NoModelCounterpart Text | the chain refuses and Lean has no counterpart to compare with (ruling 2026-10-02, "Narrow #287"); the model follow-up |
Instances
| Show UnmetRuling Source # | |
Defined in Conformance.Receipt Methods showsPrec :: Int -> UnmetRuling -> ShowS Source # show :: UnmetRuling -> String Source # showList :: [UnmetRuling] -> ShowS Source # | |
| Eq UnmetRuling Source # | |
Defined in Conformance.Receipt Methods (==) :: UnmetRuling -> UnmetRuling -> Bool Source # (/=) :: UnmetRuling -> UnmetRuling -> Bool Source # | |
unmetRuling :: Text -> Maybe UnmetRuling Source #
The ruling that keeps each unmet row unmet. A row recorded
unmet-by-ruling that is not listed has no stated meaning, and a reader
surface refuses to render it.
unmetReading :: UnmetRuling -> Text Source #
An unmet ruling in plain words, naming the issue that would close it.
data RefusalInfo Source #
The refusal attribution for a refused row: the scripts that
refused — one role, or several +-joined roles in ledger-reported
order when a malformed transaction trips two validators at once —
and the node's phase-2 reason verbatim.
Constructors
| RefusalInfo | |
Fields
| |
Instances
| FromJSON RefusalInfo Source # | |
Defined in Conformance.Receipt Methods parseJSON :: Value -> Parser RefusalInfo parseJSONList :: Value -> Parser [RefusalInfo] omittedField :: Maybe RefusalInfo | |
| ToJSON RefusalInfo Source # | |
Defined in Conformance.Receipt Methods toJSON :: RefusalInfo -> Value toEncoding :: RefusalInfo -> Encoding toJSONList :: [RefusalInfo] -> Value toEncodingList :: [RefusalInfo] -> Encoding omitField :: RefusalInfo -> Bool | |
| Show RefusalInfo Source # | |
Defined in Conformance.Receipt Methods showsPrec :: Int -> RefusalInfo -> ShowS Source # show :: RefusalInfo -> String Source # showList :: [RefusalInfo] -> ShowS Source # | |
| Eq RefusalInfo Source # | |
Defined in Conformance.Receipt Methods (==) :: RefusalInfo -> RefusalInfo -> Bool Source # (/=) :: RefusalInfo -> RefusalInfo -> Bool Source # | |
data ReplayEvidence Source #
One failing purpose's replay as a receipt carries it: the hash the node reported, the traced hash of the same parameters once the replay applied one, the reason it admitted or the cause it admits none — never both — and the capture it was replayed from.
Constructors
| ReplayEvidence | |
Fields
| |
Instances
| FromJSON ReplayEvidence Source # | |
Defined in Conformance.Replay Methods parseJSON :: Value -> Parser ReplayEvidence parseJSONList :: Value -> Parser [ReplayEvidence] omittedField :: Maybe ReplayEvidence | |
| ToJSON ReplayEvidence Source # | |
Defined in Conformance.Replay Methods toJSON :: ReplayEvidence -> Value toEncoding :: ReplayEvidence -> Encoding toJSONList :: [ReplayEvidence] -> Value toEncodingList :: [ReplayEvidence] -> Encoding omitField :: ReplayEvidence -> Bool | |
| Show ReplayEvidence Source # | |
Defined in Conformance.Replay Methods showsPrec :: Int -> ReplayEvidence -> ShowS Source # show :: ReplayEvidence -> String Source # showList :: [ReplayEvidence] -> ShowS Source # | |
| Eq ReplayEvidence Source # | |
Defined in Conformance.Replay Methods (==) :: ReplayEvidence -> ReplayEvidence -> Bool Source # (/=) :: ReplayEvidence -> ReplayEvidence -> Bool Source # | |
data ReplayCorrespondence Source #
The traced build a receipt's replay reasons rely on: its source, compiler and trace flags, and a digest of the untraced hashes it was held to.
Constructors
| ReplayCorrespondence | |
Fields
| |
Instances
| FromJSON ReplayCorrespondence Source # | |
Defined in Conformance.Replay Methods parseJSON :: Value -> Parser ReplayCorrespondence parseJSONList :: Value -> Parser [ReplayCorrespondence] omittedField :: Maybe ReplayCorrespondence | |
| ToJSON ReplayCorrespondence Source # | |
Defined in Conformance.Replay Methods toJSON :: ReplayCorrespondence -> Value toEncoding :: ReplayCorrespondence -> Encoding toJSONList :: [ReplayCorrespondence] -> Value toEncodingList :: [ReplayCorrespondence] -> Encoding omitField :: ReplayCorrespondence -> Bool | |
| Show ReplayCorrespondence Source # | |
Defined in Conformance.Replay Methods showsPrec :: Int -> ReplayCorrespondence -> ShowS Source # show :: ReplayCorrespondence -> String Source # showList :: [ReplayCorrespondence] -> ShowS Source # | |
| Eq ReplayCorrespondence Source # | |
Defined in Conformance.Replay Methods (==) :: ReplayCorrespondence -> ReplayCorrespondence -> Bool Source # (/=) :: ReplayCorrespondence -> ReplayCorrespondence -> Bool Source # | |
stepReplay :: [ReplayEvidence] -> Value -> Value Source #
A refused step's chain refusal with the replay of its failing purposes; unchanged when the replay recorded none.
storyCorrespondence :: Maybe ReplayCorrespondence -> [Value] -> Maybe ReplayCorrespondence Source #
The correspondence a story receipt carries: the session's, exactly when one of its steps carries a replay.
data ConstructorStanding Source #
Per-constructor standing inside a partial row's receipt (E18 §3/§4, NOTE-052): every constructor the row names is accounted — exercised accepts with transaction evidence, named residuals with reason and limit, pre-existing gaps with their gap evidence. No general framework: the declared constructor set per row is fixed below and the loader requires it exactly. StandingRefused exists for E18's future refusal witnesses; this bounded schema admits none — any refused entry fails closed (NOTE-055).
Constructors
| StandingAccepted | |
| StandingRefused | |
| StandingResidual | |
| StandingGap |
Instances
| FromJSON ConstructorStanding Source # | |
Defined in Conformance.Receipt Methods parseJSON :: Value -> Parser ConstructorStanding parseJSONList :: Value -> Parser [ConstructorStanding] omittedField :: Maybe ConstructorStanding | |
| ToJSON ConstructorStanding Source # | |
Defined in Conformance.Receipt Methods toJSON :: ConstructorStanding -> Value toEncoding :: ConstructorStanding -> Encoding toJSONList :: [ConstructorStanding] -> Value toEncodingList :: [ConstructorStanding] -> Encoding omitField :: ConstructorStanding -> Bool | |
| Show ConstructorStanding Source # | |
Defined in Conformance.Receipt Methods showsPrec :: Int -> ConstructorStanding -> ShowS Source # show :: ConstructorStanding -> String Source # showList :: [ConstructorStanding] -> ShowS Source # | |
| Eq ConstructorStanding Source # | |
Defined in Conformance.Receipt Methods (==) :: ConstructorStanding -> ConstructorStanding -> Bool Source # (/=) :: ConstructorStanding -> ConstructorStanding -> Bool Source # | |
data ConstructorEvidence Source #
Constructors
| ConstructorEvidence | |
Fields
| |
Instances
| FromJSON ConstructorEvidence Source # | |
Defined in Conformance.Receipt Methods parseJSON :: Value -> Parser ConstructorEvidence parseJSONList :: Value -> Parser [ConstructorEvidence] omittedField :: Maybe ConstructorEvidence | |
| ToJSON ConstructorEvidence Source # | |
Defined in Conformance.Receipt Methods toJSON :: ConstructorEvidence -> Value toEncoding :: ConstructorEvidence -> Encoding toJSONList :: [ConstructorEvidence] -> Value toEncodingList :: [ConstructorEvidence] -> Encoding omitField :: ConstructorEvidence -> Bool | |
| Show ConstructorEvidence Source # | |
Defined in Conformance.Receipt Methods showsPrec :: Int -> ConstructorEvidence -> ShowS Source # show :: ConstructorEvidence -> String Source # showList :: [ConstructorEvidence] -> ShowS Source # | |
| Eq ConstructorEvidence Source # | |
Defined in Conformance.Receipt Methods (==) :: ConstructorEvidence -> ConstructorEvidence -> Bool Source # (/=) :: ConstructorEvidence -> ConstructorEvidence -> Bool Source # | |
newtype PartialInfo Source #
Constructors
| PartialInfo | |
Fields | |
Instances
| FromJSON PartialInfo Source # | |
Defined in Conformance.Receipt Methods parseJSON :: Value -> Parser PartialInfo parseJSONList :: Value -> Parser [PartialInfo] omittedField :: Maybe PartialInfo | |
| ToJSON PartialInfo Source # | |
Defined in Conformance.Receipt Methods toJSON :: PartialInfo -> Value toEncoding :: PartialInfo -> Encoding toJSONList :: [PartialInfo] -> Value toEncodingList :: [PartialInfo] -> Encoding omitField :: PartialInfo -> Bool | |
| Show PartialInfo Source # | |
Defined in Conformance.Receipt Methods showsPrec :: Int -> PartialInfo -> ShowS Source # show :: PartialInfo -> String Source # showList :: [PartialInfo] -> ShowS Source # | |
| Eq PartialInfo Source # | |
Defined in Conformance.Receipt Methods (==) :: PartialInfo -> PartialInfo -> Bool Source # (/=) :: PartialInfo -> PartialInfo -> Bool Source # | |
data DerivationOutcome Source #
Off-chain identity-derivation evidence (applied-validator-identity, E18 venue): the deployed address derived through the PRODUCTION path against the ACTUAL observed chain address, per validator by declared arity. This is explicitly NOT phase-2 ledger evidence — the venue string is fixed and loader-enforced so no later reader can mistake it.
Constructors
| DerivMatch | |
| DerivDistinct | |
| DerivRefused |
Instances
data AssetEntry Source #
One asset movement, named by its policy and asset name.
The registry's token identity is (policy, key) and nothing else, so a
row about a keyed mint has to report both. A quantity alone cannot
distinguish "one token at this key" from "one token at some other key".
Constructors
| AssetEntry | |
Fields
| |
Instances
| FromJSON AssetEntry Source # | |
Defined in Conformance.Evidence.Asset Methods parseJSON :: Value -> Parser AssetEntry parseJSONList :: Value -> Parser [AssetEntry] omittedField :: Maybe AssetEntry | |
| ToJSON AssetEntry Source # | |
Defined in Conformance.Evidence.Asset Methods toJSON :: AssetEntry -> Value toEncoding :: AssetEntry -> Encoding toJSONList :: [AssetEntry] -> Value toEncodingList :: [AssetEntry] -> Encoding omitField :: AssetEntry -> Bool | |
| Show AssetEntry Source # | |
Defined in Conformance.Evidence.Asset Methods showsPrec :: Int -> AssetEntry -> ShowS Source # show :: AssetEntry -> String Source # showList :: [AssetEntry] -> ShowS Source # | |
| Eq AssetEntry Source # | |
Defined in Conformance.Evidence.Asset Methods (==) :: AssetEntry -> AssetEntry -> Bool Source # (/=) :: AssetEntry -> AssetEntry -> Bool Source # | |
data DerivationEvidence Source #
Constructors
| DerivationEvidence | |
Fields
| |
Instances
| FromJSON DerivationEvidence Source # | |
Defined in Conformance.Receipt Methods parseJSON :: Value -> Parser DerivationEvidence parseJSONList :: Value -> Parser [DerivationEvidence] omittedField :: Maybe DerivationEvidence | |
| ToJSON DerivationEvidence Source # | |
Defined in Conformance.Receipt Methods toJSON :: DerivationEvidence -> Value toEncoding :: DerivationEvidence -> Encoding toJSONList :: [DerivationEvidence] -> Value toEncodingList :: [DerivationEvidence] -> Encoding omitField :: DerivationEvidence -> Bool | |
| Show DerivationEvidence Source # | |
Defined in Conformance.Receipt Methods showsPrec :: Int -> DerivationEvidence -> ShowS Source # show :: DerivationEvidence -> String Source # showList :: [DerivationEvidence] -> ShowS Source # | |
| Eq DerivationEvidence Source # | |
Defined in Conformance.Receipt Methods (==) :: DerivationEvidence -> DerivationEvidence -> Bool Source # (/=) :: DerivationEvidence -> DerivationEvidence -> Bool Source # | |
derivationMatches :: Eq a => a -> a -> (a, Bool) Source #
The derivation decision (NOTE-067): compare the produced address against the reference and return both. Pure so the wiring is unit-testable and mutation-provable: replacing the comparison with True must make an observed-negative fail.
Evidence that a row executed. Accepted rows name the chain's
transaction ids and carry measurements; refused rows carry the
attribution and the submitted transaction's id under rejected
(empty transactions: nothing was accepted). receiptVenue
records where the refusal was observed: node-submit (a node
ruling on a submitted transaction) or ledger-eval (local ledger
evaluation only — never described as ledger execution).
receiptDirty records whether the running tree had uncommitted
changes: a receipt from a dirty tree is honest working evidence,
but only a clean-tree receipt names a commit that reproduces it.
Constructors
| Receipt | |
Fields
| |
Instances
| FromJSON Receipt Source # | |
Defined in Conformance.Receipt | |
| ToJSON Receipt Source # | |
| Show Receipt Source # | |
Defined in Conformance.Receipt | |
| Eq Receipt Source # | |
Defined in Conformance.Receipt | |
declaredConstructors :: Text -> Maybe [(Text, Integer)] Source #
The complete declared constructor set per partial-capable row (constructor name, wire index). The loader requires EVERY receipt for these rows to carry exactly this accounting: a receipt written before the schema has no accounting and resolves unknown or incomplete — never covered. Silence must not mean success. Per-constructor data determines full/partial truth, not the caller's verdict: green requires every entry accepted-or-refused; any residual or gap forces partial.
derivationVenue :: Text Source #
The fixed venue string for derivation evidence. The loader rejects any other venue: an identity check must not be readable as ledger evidence.
maxReceiptBytes :: Int Source #
Receipts stay readable: the insert-occupied-key refusal once embedded the whole
compiled validator (~30KB of base64) because show on the
evaluation context prints every script and cost model.
The bound is measured (#287): the largest live receipt, reject-and-retract-refund-controls's, is 12 563 bytes, and 15 214 with the traced replay of each of its nine failing purposes and the correspondence its reasons rely on; 18 432 leaves it a fifth of headroom.
maxLiveStepReasonChars :: Int Source #
Keep live node text readable inside each refusal step.
checkReceiptSize :: Receipt -> Either String () Source #
The size bound, purely: oversized receipts are an error naming the row and the byte count.
loadReceipts :: FilePath -> IO (Either String [Receipt]) Source #
Load every receipt-*.json in a directory. A malformed receipt,
an accepted row with no transactions or measurements, a refused row
with no attribution, a partial verdict without its constructor
accounting, a success verdict carrying partial constructors, or
two receipts for one row is an error naming the file: evidence
that does not parse is not evidence, and a guard that cannot fail
is not a guard.
writeReceiptFile :: FilePath -> Receipt -> IO () Source #
Write one receipt-ROW.json under the run's output directory.
Receipts over maxReceiptBytes fail the run: a receipt nobody
can open is weak evidence, and a size convention would quietly
break on a later row.
currentBase :: IO (Maybe Text) Source #
The current tree's base commit. Nothing when git cannot say
(no checkout, no git): receipts then match nothing and list
prints the declared plan with a warning.