ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Osv.Publication

Description

Whether Pilot may replace the stored advisory artifact with a new compile.

Pilot writes only over the object revision it observed. It orders OSV and EPSS separately, each by source identity, Last-Modified, and complete-stream digest, so an older run cannot replace newer data. A new artifact may shrink only a bounded share below the durable size baseline, so a damaged feed cannot replace good coverage. An operator's direct write bypasses these checks and is the rollback authority. Ecluse.Core.Osv.Publication.Envelope carries the stored state.

Synopsis

The vocabulary

The decision

data PublicationRequest Source #

One publication attempt: the compile's facts, the artifact's size, and its nonce.

data Precondition Source #

The condition the store must hold for the write to land.

Constructors

CreateOnly

Write only if no object holds the key.

ReplaceRevision ObjectRevision

Write only over this exact revision.

Instances

Instances details
Show Precondition Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication

Eq Precondition Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication

data PublicationPlan Source #

An accepted publication: the write's precondition, the state it records, and how it was ordered.

Constructors

PublicationPlan 

Fields

data SourceOrder Source #

How one source's snapshot relates to the stored artifact's.

Constructors

FreshScope

No marker from this source identity was stored, so the snapshot starts its ordering.

OrderedForward

The source declared a later Last-Modified.

EqualSnapshot

The same Last-Modified and the same bytes, so the publication refreshes.

IdenticalBytes

The same bytes without comparable timestamps. The stored Last-Modified carries forward.

Instances

Instances details
Show SourceOrder Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication

Eq SourceOrder Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication

renderSourceOrder :: SourceOrder -> Text Source #

The order as the publication log reads it.

data OrderRefusal Source #

Why one source's snapshot cannot replace the stored one.

Constructors

OlderSnapshot UTCTime UTCTime

The candidate's Last-Modified is older than the stored one, both carried.

AmbiguousSnapshot UTCTime

The same Last-Modified with different bytes, so nothing orders them.

UnorderedSnapshot

Different bytes with no timestamp pair to order them.

Instances

Instances details
Show OrderRefusal Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication

Eq OrderRefusal Source # 
Instance details

Defined in Ecluse.Core.Osv.Publication

data ShrinkReading Source #

The size comparison a refused shrink failed, all in bytes.

data PublicationRefusal Source #

Why Pilot will not replace the stored artifact. Consumers keep the stored one.

Constructors

PredecessorUnreadable EnvelopeFault

The stored object's publication metadata is missing or unreadable.

PredecessorOutOfScope Text Int

The stored metadata names another ecosystem or schema epoch, both carried.

SourceOutOfOrder ProvenanceSource OrderRefusal

One source's snapshot is not ordered after the stored one.

ShrinkPastBaseline ShrinkReading

The artifact shrank past the baseline's allowance.

RebaselineMismatch ObjectRevision (Maybe ObjectRevision)

The rebaseline names a revision the store does not hold. Nothing is an empty store.

planPublication :: ShrinkPolicy -> BaselineCapability -> PublicationRequest -> StoreObservation -> Either PublicationRefusal PublicationPlan Source #

Decide one attempt against one observation. A rebaseline replaces only the shrink allowance, never the ordering.

renderPublicationRefusal :: PublicationRefusal -> Text Source #

The refusal as an operator reads it, ending with what stays in place.