conformance
LicenseApache-2.0
Safe HaskellNone
LanguageGHC2021

Conformance.EvidencePage

Description

The conformance evidence page is a function of four inputs and nothing else: the requirement inventory (rows.json), the application model revision (conformance/model-revision), and one snapshot of run output for one stated code revision — the conformance run receipts and the backend contract suite's per-adapter results, copied from the CI runs that produced them.

No state is typed into the page. A requirement reads executed or partial only through effectiveState, from a receipt whose base is the snapshot's stated base; every other requirement is listed by its requirement text under the plan rows.json declares. A snapshot whose receipts or results name another base, were recorded on a dirty tree, name an unknown requirement, or report a contract case list that is not the same for every adapter is refused rather than rendered.

The documentation check renders the page again from the committed inputs and compares it byte for byte with the committed page and its speech companion; any difference fails the check.

Synopsis

Snapshot

data Snapshot Source #

Everything one snapshot directory holds.

Constructors

Snapshot 

Fields

Instances

Instances details
Show Snapshot Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

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

show :: Snapshot -> String Source #

showList :: [Snapshot] -> ShowS Source #

Eq Snapshot Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

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

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

data Source Source #

Where the snapshot's files were copied from: one CI run's artifact.

Constructors

Source 

Fields

Instances

Instances details
FromJSON Source Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

parseJSON :: Value -> Parser Source

parseJSONList :: Value -> Parser [Source]

omittedField :: Maybe Source

Show Source Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

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

show :: Source -> String Source #

showList :: [Source] -> ShowS Source #

Eq Source Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

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

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

data ContractResult Source #

One line of the contract suite's results file.

Constructors

ContractResult 

Fields

Instances

Instances details
FromJSON ContractResult Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

parseJSON :: Value -> Parser ContractResult

parseJSONList :: Value -> Parser [ContractResult]

omittedField :: Maybe ContractResult

Show ContractResult Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

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

show :: ContractResult -> String Source #

showList :: [ContractResult] -> ShowS Source #

Eq ContractResult Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

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

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

data ContractEvidence Source #

The evidence class of one contract-suite run. There is no public chain.

Instances

Instances details
FromJSON ContractEvidence Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

parseJSON :: Value -> Parser ContractEvidence

parseJSONList :: Value -> Parser [ContractEvidence]

omittedField :: Maybe ContractEvidence

Show ContractEvidence Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

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

show :: ContractEvidence -> String Source #

showList :: [ContractEvidence] -> ShowS Source #

Eq ContractEvidence Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

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

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

Ord ContractEvidence Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

compare :: ContractEvidence -> ContractEvidence -> Ordering Source #

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

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

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

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

max :: ContractEvidence -> ContractEvidence -> ContractEvidence Source #

min :: ContractEvidence -> ContractEvidence -> ContractEvidence Source #

data ContractOutcome Source #

One contract case's result on one adapter.

Instances

Instances details
Show ContractOutcome Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

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

show :: ContractOutcome -> String Source #

showList :: [ContractOutcome] -> ShowS Source #

Eq ContractOutcome Source # 
Instance details

Defined in Conformance.EvidencePage

Methods

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

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

loadSnapshot :: FilePath -> IO (Either String Snapshot) Source #

Read a snapshot directory: snapshot.json (the stated base and the CI runs the files were copied from), receipts/ (the conformance run's receipt artifact, as downloaded) and contract/ (the contract suite's results files, one JSON object per line).

Rendering

data RenderedPage Source #

The page and its speech companion, as the site publishes them.

Constructors

RenderedPage 

Fields

renderEvidencePage :: Text -> [Row] -> Snapshot -> Either String RenderedPage Source #

Render the evidence page, or refuse the snapshot naming why. The first argument is the application model revision.

The command

runEvidencePage :: FilePath -> Bool -> IO () Source #

Render the published evidence page from the repository at root: conformance/rows.json, conformance/model-revision and the snapshot conformanceevidencepage. With write the page and its (unstamped) speech companion are written. Otherwise the committed page must equal the rendering byte for byte and the committed speech must carry exactly the rendered sections, or the command exits non-zero naming the disagreement.