conformance
LicenseApache-2.0
Safe HaskellNone
LanguageGHC2021

Conformance.Rows

Description

The complete consumer-row inventory from rows.json: id, group, requirement, source, expected outcome and declared plan. list prints it; validateInventory enforces the denominator — 48 rows, 47 owned — so a truncated inventory fails loudly instead of printing a smaller-but-plausible table.

executed is not a value rows.json can carry: the declared field is the coverage plan (uncovered, bound-elsewhere, out-of-scope) and the parser rejects executed. A row prints as executed only when effectiveState finds a matching run receipt (see Conformance.Receipt).

Synopsis

Documentation

data Row Source #

One consumer conformance row.

Constructors

Row 

Fields

Instances

Instances details
FromJSON Row Source # 
Instance details

Defined in Conformance.Rows

Methods

parseJSON :: Value -> Parser Row

parseJSONList :: Value -> Parser [Row]

omittedField :: Maybe Row

Show Row Source # 
Instance details

Defined in Conformance.Rows

Methods

showsPrec :: Int -> Row -> ShowS Source #

show :: Row -> String Source #

showList :: [Row] -> ShowS Source #

Eq Row Source # 
Instance details

Defined in Conformance.Rows

Methods

(==) :: Row -> Row -> Bool Source #

(/=) :: Row -> Row -> Bool Source #

Ord Row Source # 
Instance details

Defined in Conformance.Rows

Methods

compare :: Row -> Row -> Ordering Source #

(<) :: Row -> Row -> Bool Source #

(<=) :: Row -> Row -> Bool Source #

(>) :: Row -> Row -> Bool Source #

(>=) :: Row -> Row -> Bool Source #

max :: Row -> Row -> Row Source #

min :: Row -> Row -> Row Source #

data RowState Source #

A row's declared coverage plan. executed is unrepresentable here by construction: only a run receipt can establish it.

Instances

Instances details
FromJSON RowState Source # 
Instance details

Defined in Conformance.Rows

Methods

parseJSON :: Value -> Parser RowState

parseJSONList :: Value -> Parser [RowState]

omittedField :: Maybe RowState

Show RowState Source # 
Instance details

Defined in Conformance.Rows

Methods

showsPrec :: Int -> RowState -> ShowS Source #

show :: RowState -> String Source #

showList :: [RowState] -> ShowS Source #

Eq RowState Source # 
Instance details

Defined in Conformance.Rows

Methods

(==) :: RowState -> RowState -> Bool Source #

(/=) :: RowState -> RowState -> Bool Source #

Ord RowState Source # 
Instance details

Defined in Conformance.Rows

Methods

compare :: RowState -> RowState -> Ordering Source #

(<) :: RowState -> RowState -> Bool Source #

(<=) :: RowState -> RowState -> Bool Source #

(>) :: RowState -> RowState -> Bool Source #

(>=) :: RowState -> RowState -> Bool Source #

max :: RowState -> RowState -> RowState Source #

min :: RowState -> RowState -> RowState Source #

data ShownState Source #

What list prints for a row: executed iff a receipt for it exists, matches the current base and agrees with the model; partial for a partial receipt; the verdict a receipt recorded when it is neither (a held, divergent or ruled-on run is never a pass); else the declared plan.

Instances

Instances details
Show ShownState Source # 
Instance details

Defined in Conformance.Rows

Methods

showsPrec :: Int -> ShownState -> ShowS Source #

show :: ShownState -> String Source #

showList :: [ShownState] -> ShowS Source #

Eq ShownState Source # 
Instance details

Defined in Conformance.Rows

Methods

(==) :: ShownState -> ShownState -> Bool Source #

(/=) :: ShownState -> ShownState -> Bool Source #

expectedRowCount :: Int Source #

Total rows in rows.json: the 47 owned consumer rows (including historical-permissionless-fold, the F-002 permissionless-folder regression, register-active-key, #173's insertActive fold and its two refusal fixtures, retire-active-key, #177's updateTerminal retirement and its two refusal fixtures, reject-and-retract-refund-controls, issue #258's reject and retract with their tampered refunds, and reject-inside-processing-and-retraction-windows, issue #320's early rejection in two windows) plus checkpoint-and-treasury-policy, cardano-keri's checkpoint policy, recorded as out-of-scope so the boundary is visible instead of forgotten. The original broader retirement requirement stays present; permanent-retire-active-key is a separate requirement.

ownedDenominator :: Int Source #

Rows Singular owns and must eventually evidence. Out-of-scope rows (checkpoint-and-treasury-policy) are carried for the boundary, never counted.

loadRows :: FilePath -> IO (Either String [Row]) Source #

Load and validate the inventory file.

validateInventory :: [Row] -> Either String [Row] Source #

Enforce the denominator: exactly expectedRowCount rows of which exactly ownedDenominator are owned, unique ids, non-empty groups. A count over a silently shortened set is a lower bound wearing the denominator's name, so short is an error, not a smaller table.

renderInventory :: Text -> [Receipt] -> [Row] -> Text Source #

Render the full inventory table plus the state summary. The summary counts effective states and names the owned denominator with the out-of-scope rows excluded from it.