| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- osvSchemaEpoch :: Int
- osvDbFileName :: Text -> FilePath
- rangesTableDdl :: Text
- metaTableDdl :: Text
- data ColumnSpec = ColumnSpec {
- colName :: Text
- colDeclaredType :: Text
- colNotNull :: Bool
- data TableSpec = TableSpec {
- tableName :: Text
- tableColumns :: [ColumnSpec]
- osvTableSpecs :: [TableSpec]
- data MetaKey
- renderMetaKey :: MetaKey -> Text
- data EpssRequirement
- data EpssStatus
- renderEpssStatus :: EpssStatus -> Text
- data EpssEvidence
- decodeEpssEvidence :: Maybe Text -> EpssEvidence
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 | |
Fields
| |
Instances
| Show ColumnSpec Source # | |
Defined in Ecluse.Core.Osv.Schema Methods showsPrec :: Int -> ColumnSpec -> ShowS # show :: ColumnSpec -> String # showList :: [ColumnSpec] -> ShowS # | |
| Eq ColumnSpec Source # | |
Defined in Ecluse.Core.Osv.Schema | |
A table the reader requires, with the columns its queries decode.
Constructors
| TableSpec | |
Fields
| |
osvTableSpecs :: [TableSpec] Source #
Required strict tables and columns. Additional columns preserve reader compatibility.
The meta table
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. |
| 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 |
| MetaOsvNewestModified | The newest |
| MetaEpssSource | The EPSS feed's credential-free URL. |
| MetaEpssLastModified | The |
| MetaEpssScoreDate | The |
| MetaEpssModelVersion | The scoring model the EPSS feed declares. |
| MetaEpssStatus | The whole-feed enrichment outcome, an |
| MetaRowCount | The number of advisory ranges the artifact holds. |
Instances
| Generic MetaKey Source # | |||||
Defined in Ecluse.Core.Osv.Schema Associated Types
| |||||
| Show MetaKey Source # | |||||
| Eq MetaKey Source # | |||||
| Universe MetaKey Source # | |||||
Defined in Ecluse.Core.Osv.Schema | |||||
| type Rep MetaKey Source # | |||||
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 |
Instances
| Show EpssRequirement Source # | |
Defined in Ecluse.Core.Osv.Schema Methods showsPrec :: Int -> EpssRequirement -> ShowS # show :: EpssRequirement -> String # showList :: [EpssRequirement] -> ShowS # | |
| Eq EpssRequirement Source # | |
Defined in Ecluse.Core.Osv.Schema Methods (==) :: EpssRequirement -> EpssRequirement -> Bool # (/=) :: EpssRequirement -> EpssRequirement -> Bool # | |
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
| Show EpssStatus Source # | |
Defined in Ecluse.Core.Osv.Schema Methods showsPrec :: Int -> EpssStatus -> ShowS # show :: EpssStatus -> String # showList :: [EpssStatus] -> ShowS # | |
| Eq EpssStatus Source # | |
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.
Constructors
| EpssAvailable | |
| EpssNotEstablished |
Instances
| Show EpssEvidence Source # | |
Defined in Ecluse.Core.Osv.Schema Methods showsPrec :: Int -> EpssEvidence -> ShowS # show :: EpssEvidence -> String # showList :: [EpssEvidence] -> ShowS # | |
| Eq EpssEvidence Source # | |
Defined in Ecluse.Core.Osv.Schema | |
decodeEpssEvidence :: Maybe Text -> EpssEvidence Source #
Only the exact stored form of EnrichmentAvailable establishes enrichment.