{- | Descriptive current requirement names and the original names recorded in
historical receipts. This association changes naming only: the receipt's base,
verdict, measurements and evidence are still validated by the receipt loader.
-}
module Conformance.RowNames
    ( canonicalRowName
    , historicalRowNames
    ) where

import Data.Maybe (fromMaybe)
import Data.Text (Text)

-- | Resolve a historical receipt key; current and unknown names pass through.
canonicalRowName :: Text -> Text
canonicalRowName :: Text -> Text
canonicalRowName Text
name = Text -> Maybe Text -> Text
forall a. a -> Maybe a -> a
fromMaybe Text
name (Text -> [(Text, Text)] -> Maybe Text
forall a b. Eq a => a -> [(a, b)] -> Maybe b
lookup Text
name [(Text, Text)]
historicalRowNames)

-- | The complete, one-time association for the 46 published requirements.
historicalRowNames :: [(Text, Text)]
historicalRowNames :: [(Text, Text)]
historicalRowNames =
    [ (Text
"CA01", Text
"canonical-seed-identity")
    , (Text
"CA02", Text
"rival-seed-authentication")
    , (Text
"CA03", Text
"policy-address-only-authentication-control")
    , (Text
"CA04", Text
"applied-validator-identity")
    , (Text
"CA05", Text
"tokenless-output-authentication")
    , (Text
"CG01", Text
"insert-key")
    , (Text
"CG02", Text
"update-existing-key")
    , (Text
"CG03", Text
"delete-existing-key")
    , (Text
"CG04", Text
"reinsert-deleted-key")
    , (Text
"CG05", Text
"insert-occupied-key")
    , (Text
"CG06", Text
"retract-inside-window")
    , (Text
"CG07", Text
"retract-outside-window")
    , (Text
"CG08", Text
"reject-after-window")
    , (Text
"CG09", Text
"reject-before-deadline-consumer-requirement")
    , (Text
"CG10", Text
"fold-against-superseded-root")
    , (Text
"CG11", Text
"empty-fold")
    , (Text
"CG12", Text
"surplus-fold-actions")
    , (Text
"CG13", Text
"historical-owner-change")
    , (Text
"CG14", Text
"retired-stake-hook-with-withdrawal")
    , (Text
"CG15", Text
"retired-stake-hook-without-withdrawal")
    , (Text
"CG16", Text
"historical-owner-signed-sweep")
    , (Text
"CG17", Text
"historical-non-owner-sweep")
    , (Text
"CG18", Text
"historical-registry-termination")
    , (Text
"CG19", Text
"request-value-and-refund-routing")
    , (Text
"CG20", Text
"historical-permissionless-fold")
    , (Text
"CG21", Text
"register-active-key")
    , (Text
"CG22", Text
"retire-active-key")
    , (Text
"CG23", Text
"reject-and-retract-refund-controls")
    , (Text
"CG24", Text
"reject-inside-processing-and-retraction-windows")
    , (Text
"CS01", Text
"blueprint-encoding-round-trip")
    , (Text
"CS02", Text
"submitted-datum-byte-round-trip")
    , (Text
"CS03", Text
"update-redeemer-constructor-witnesses")
    , (Text
"CS04", Text
"wrong-redeemer-constructor-index")
    , (Text
"CS05", Text
"request-and-mint-constructor-witnesses")
    , (Text
"CS06", Text
"script-parameter-application")
    , (Text
"CS07", Text
"proof-step-constructor-witnesses")
    , (Text
"CS08", Text
"state-fields-chain-round-trip")
    , (Text
"CK01", Text
"resolve-active-registration")
    , (Text
"CK02", Text
"authenticate-representative-token")
    , (Text
"CK03", Text
"resolve-with-no-candidate")
    , (Text
"CK04", Text
"prevent-second-live-representative")
    , (Text
"CK05", Text
"resolve-pending-terminal-request")
    , (Text
"CK06", Text
"checkpoint-and-treasury-policy")
    , (Text
"CL01", Text
"execution-units-and-transaction-size")
    , (Text
"CL02", Text
"fold-batch-size-boundary")
    , (Text
"CL03", Text
"observed-toolchain-and-environment")
    ]