ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Osv.Publication.Types

Description

The vocabulary of guarded advisory publication, shared by the compile that gathers a candidate's facts, the decision in Ecluse.Core.Osv.Publication, and the stored metadata in Ecluse.Core.Osv.Publication.Envelope.

Synopsis

Source evidence

data SourceIdentity Source #

A source's fixed-width identity: the SHA-256 of its credential-free URL.

sourceIdentityOf :: Text -> SourceIdentity Source #

Identify a source by its credential-free URL (credentialFreeUrl).

sourceIdentityHex :: SourceIdentity -> Text Source #

The identity's lowercase hex.

parseSourceIdentityHex :: Text -> Maybe SourceIdentity Source #

Read an identity back from its lowercase hex.

data SourceDigest Source #

The SHA-256 of one complete source response body, before Pilot decompresses it.

sourceDigestOf :: ContentDigest -> SourceDigest Source #

The digest of a fetch that read its source to the end (digestWhole).

sourceDigestHex :: SourceDigest -> Text Source #

The digest's lowercase hex.

parseSourceDigestHex :: Text -> Maybe SourceDigest Source #

Read a digest back from its lowercase hex.

data SourceMarker Source #

One source's snapshot. A digest proves equal bytes only, so only Last-Modified orders two snapshots.

Constructors

SourceMarker 

Fields

lastModifiedAllowance :: NominalDiffTime Source #

Five minutes: how far past the run's clock a source's Last-Modified may sit. It bounds input and never orders.

usableLastModified :: UTCTime -> Maybe UTCTime -> Maybe UTCTime Source #

A Last-Modified as ordering evidence. One later than the run's clock plus lastModifiedAllowance counts as missing.

Revisions

data PublicationNonce Source #

A fixed-width value inside each attempted artifact. An ETag follows content, so this gives every publication its own revision.

newPublicationNonce :: MonadIO m => m PublicationNonce Source #

A fresh nonce of 128 random bits.

renderPublicationNonce :: PublicationNonce -> Text Source #

The nonce's stored form: 32 lowercase hex digits.

parsePublicationNonce :: Text -> Maybe PublicationNonce Source #

Read a nonce back from its stored form.

newtype ObjectRevision Source #

An object store's revision of the stored artifact, its ETag as the store reported it.

Constructors

ObjectRevision Text 

What a publication compares

data CandidateFacts Source #

What one compile learned. It claims nothing about the stored predecessor.

Constructors

CandidateFacts 

Fields

data PublishedState Source #

The publication state an accepted artifact carries beside it in the store.

Constructors

PublishedState 

Fields

data Adjustment Source #

How a publication set the size baseline it records.

Constructors

InitialBaseline

The first publication under this object key, which starts the baseline at its own size.

OrdinaryBaseline

An ordinary publication, with no EPSS credit in force.

EpssOutageCredit

A publication measured with an EPSS outage credit in force.

OperatorRebaseline

An operator's one-shot rebaseline, which resets the baseline to this artifact's size.

Instances

Instances details
Generic Adjustment Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication.Types

Associated Types

type Rep Adjustment 
Instance details

Defined in Ecluse.Core.Osv.Publication.Types

type Rep Adjustment = D1 ('MetaData "Adjustment" "Ecluse.Core.Osv.Publication.Types" "ecluse-0.4.0-inplace-ecluse-core" 'False) ((C1 ('MetaCons "InitialBaseline" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OrdinaryBaseline" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "EpssOutageCredit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OperatorRebaseline" 'PrefixI 'False) (U1 :: Type -> Type)))
Show Adjustment Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication.Types

Eq Adjustment Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication.Types

Universe Adjustment Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication.Types

Methods

universe :: [Adjustment] #

type Rep Adjustment Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication.Types

type Rep Adjustment = D1 ('MetaData "Adjustment" "Ecluse.Core.Osv.Publication.Types" "ecluse-0.4.0-inplace-ecluse-core" 'False) ((C1 ('MetaCons "InitialBaseline" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OrdinaryBaseline" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "EpssOutageCredit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OperatorRebaseline" 'PrefixI 'False) (U1 :: Type -> Type)))

renderAdjustment :: Adjustment -> Text Source #

The adjustment's stored and logged spelling.

data EnvelopeFault Source #

Why the stored object's publication metadata cannot be read as a predecessor.

Constructors

EnvelopeMissing (NonEmpty Text)

The object carries none of these metadata keys.

EnvelopeUnsupported Text

The metadata names a publication version this build does not read.

EnvelopeMalformed Text

This key's value does not parse, or contradicts another key.

EnvelopeTooLarge Int

The metadata passes the store's size limit, in bytes.

renderEnvelopeFault :: EnvelopeFault -> Text Source #

The fault as an operator reads it.

data StoreObservation Source #

What one metadata-only read of the destination found.

Constructors

StoreAbsent

No object holds the key.

StorePresent ObjectRevision Integer (Either EnvelopeFault PublishedState)

An object holds the key, with its revision, its size in bytes, and its decoded metadata.

Policy

data Percent Source #

A share of a size, from 0 to 100 percent, held exactly.

Instances

Instances details
Show Percent Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication.Types

Eq Percent Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication.Types

Methods

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

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

Ord Percent Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication.Types

mkPercent :: Rational -> Maybe Percent Source #

A percentage from 0 to 100. Anything outside that range is Nothing.

unPercent :: Percent -> Rational Source #

The percentage as a share, so 2% is 2.

renderPercent :: Percent -> Text Source #

The percentage as an operator reads it.

data ShrinkPolicy Source #

The configured shrink limits a publication is held to.

Constructors

ShrinkPolicy 

Fields

  • spMaxShrink :: Percent

    How far below the effective baseline a publication may fall.

  • spEpssLossCap :: Percent

    The most an optional EPSS outage may credit, as a share of the previous artifact's size.

data BaselineCapability Source #

The size baseline a store can keep. A weaker store declares it, and an outage never selects it.

Constructors

DurableBaseline

The high-water size travels with each object, so no history read is needed.

PreviousObjectBaseline

Only the previous object's own size is known.

NoBaseline

No size is known, so no shrink check runs.

renderBaselineCapability :: BaselineCapability -> Text Source #

The capability as the posture line and the publication log read it.

data Rebaseline Source #

An operator's one-shot approval to reset the baseline, bound to the predecessor it names.

Constructors

Rebaseline 

Fields

Instances

Instances details
Show Rebaseline Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication.Types

Eq Rebaseline Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication.Types

epssBytesPerScoredRow :: Integer Source #

The bytes one scored range row adds over an unscored one, measured on the shipped table layout.