ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Osv.Schema

Description

The advisory artifact contract shared by Pilot and its consumers. The epoch covers incompatible table shapes and incompatible meanings of stored values. Artifacts are rebuilt rather than migrated. Compatible additions preserve the epoch.

Synopsis

The artifact epoch

osvSchemaEpoch :: Int Source #

Advance for incompatible shape or stored-value semantics, not compatible additions.

osvDbFileName :: Text -> FilePath Source #

Keep a stable object key until the artifact's read contract changes.

The tables

rangesTableDdl :: Text Source #

The ranges table's canonical strict DDL. The writer owns indexes outside this read contract.

metaTableDdl :: Text Source #

The meta provenance table's canonical DDL, STRICT like rangesTableDdl.

data ColumnSpec Source #

A required column's enforced storage type and nullability.

Constructors

ColumnSpec 

Instances

Instances details
Show ColumnSpec Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

Eq ColumnSpec Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

data TableSpec Source #

A table the reader requires, with the columns its queries decode.

Constructors

TableSpec 

Instances

Instances details
Show TableSpec Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

Eq TableSpec Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

osvTableSpecs :: [TableSpec] Source #

Required strict tables and columns. Additional columns preserve reader compatibility.

The meta table

data MetaKey Source #

A key of the artifact's meta table, which holds one TEXT key/value row per key and carries the artifact's provenance.

Constructors

MetaPilotVersion

The Pilot application version that produced the artifact.

MetaEcosystem

The ecosystem Pilot compiled the artifact for (e.g. npm).

MetaBuiltAt

When the compilation finished, as an ISO-8601 UTC timestamp.

MetaSourceUrl

The advisory source's host:port identity. Older artifacts can carry a complete URL.

MetaEpssSourceUrl

The EPSS source's host:port identity. Older artifacts can carry a complete URL.

MetaOsvSource

The advisory source's credential-free URL, which identifies the export across runs where the host alone cannot.

MetaOsvLastModified

The Last-Modified the advisory export answered the fetch with.

MetaOsvNewestModified

The newest modified of the advisory records the artifact was compiled from.

MetaEpssSource

The EPSS feed's credential-free URL.

MetaEpssLastModified

The Last-Modified the EPSS feed answered the fetch with.

MetaEpssScoreDate

The score_date the EPSS feed declares for its scores.

MetaEpssModelVersion

The scoring model the EPSS feed declares.

MetaEpssStatus

The whole-feed enrichment outcome, an EpssStatus.

MetaRowCount

The number of advisory ranges the artifact holds.

Instances

Instances details
Generic MetaKey Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

Associated Types

type Rep MetaKey 
Instance details

Defined in Ecluse.Core.Osv.Schema

type Rep MetaKey = D1 ('MetaData "MetaKey" "Ecluse.Core.Osv.Schema" "ecluse-0.4.0-inplace-ecluse-core" 'False) (((C1 ('MetaCons "MetaPilotVersion" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MetaEcosystem" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaBuiltAt" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "MetaSourceUrl" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaEpssSourceUrl" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MetaOsvSource" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaOsvLastModified" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "MetaOsvNewestModified" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MetaEpssSource" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaEpssLastModified" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "MetaEpssScoreDate" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaEpssModelVersion" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MetaEpssStatus" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaRowCount" 'PrefixI 'False) (U1 :: Type -> Type)))))

Methods

from :: MetaKey -> Rep MetaKey x #

to :: Rep MetaKey x -> MetaKey #

Show MetaKey Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

Eq MetaKey Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

Methods

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

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

Universe MetaKey Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

Methods

universe :: [MetaKey] #

type Rep MetaKey Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

type Rep MetaKey = D1 ('MetaData "MetaKey" "Ecluse.Core.Osv.Schema" "ecluse-0.4.0-inplace-ecluse-core" 'False) (((C1 ('MetaCons "MetaPilotVersion" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MetaEcosystem" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaBuiltAt" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "MetaSourceUrl" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaEpssSourceUrl" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MetaOsvSource" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaOsvLastModified" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "MetaOsvNewestModified" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MetaEpssSource" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaEpssLastModified" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "MetaEpssScoreDate" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaEpssModelVersion" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MetaEpssStatus" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MetaRowCount" 'PrefixI 'False) (U1 :: Type -> Type)))))

renderMetaKey :: MetaKey -> Text Source #

The key's stored form in the meta table.

data EpssRequirement Source #

Whether an ecosystem's resolved policy depends on EPSS. Where it does, Pilot publishes nothing without enrichment and a reader refuses an artifact that lacks it.

Constructors

EpssOptional 
EpssRequired 

data EpssStatus Source #

The whole-feed enrichment outcome Pilot records under MetaEpssStatus.

Constructors

EnrichmentAvailable

The feed arrived and its scores joined, whether or not any advisory matched one.

EnrichmentUnavailable

The feed failed where the ecosystem does not require it, so no score joined.

Instances

Instances details
Show EpssStatus Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

Eq EpssStatus Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

renderEpssStatus :: EpssStatus -> Text Source #

The status's stored form.

data EpssEvidence Source #

Whether metadata establishes successful feed enrichment, independent of individual scores.

Instances

Instances details
Show EpssEvidence Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

Eq EpssEvidence Source # 
Instance details

Defined in Ecluse.Core.Osv.Schema

decodeEpssEvidence :: Maybe Text -> EpssEvidence Source #

Only the exact stored form of EnrichmentAvailable establishes enrichment.