Skip to main content

Crate deputy_core

Crate deputy_core 

Source
Expand description

§deputy-core

Domain types, the dependency-artifact state machine, and the trait contracts every other Deputy crate depends on. This crate performs no I/O — it is the stable interface layer described in docs/ARCHITECTURE.md §5, so implementations and tests depend on contracts rather than on each other.

Structs§

ArtifactRef
A handle to a stored artifact: its ecosystem plus its content address.
ContentHash
The content address of an artifact: the hash of its canonical bytes. An artifact’s identity is this value — see docs/STORAGE.md §1. Renders as sha256:<lower-hex>.
DepName
A dependency’s package name within its ecosystem.
DepRef
A reference to a specific dependency at a specific version within an ecosystem.
Finding
A single issue raised by a scanner against an artifact.
Pin
A DepRef bound to the exact content hash we expect to download — the pin that makes acquisition tamper-evident (docs/PIPELINE.md §2).
RepoId
A repository within a connected source.
SourceId
A connected source-provider account (e.g. a linked GitHub account).
Version
A resolved, exact dependency version (not a range).

Enums§

ArtifactState
The lifecycle state of a single dependency artifact as it moves through the pipeline. The allowed transitions encode docs/PIPELINE.md §7 and are enforced by ArtifactState::transition. Every edge is, additionally, mID-gated at the API layer.
EcosystemId
A supported dependency ecosystem. Cargo is the first beachhead (docs/ARCHITECTURE.md §7); npm/PyPI/Go follow via the DepEcosystem trait.
Error
The error surface shared across Deputy. Kept small and #[non_exhaustive] so new variants can be added without a breaking change.
HashAlgo
Hash algorithm used for content addressing. SHA-256 today; the enum exists so the on-disk address format (<algo>:<hex>) can evolve without ambiguity.
ScanVerdict
The outcome of scanning an artifact. Only ScanVerdict::Clean is promotable (docs/PIPELINE.md §5).
Severity
Severity of a scanner finding.
StoreKind
Which store a content-addressed artifact lives in. The dirty store is staging; the prod store is the trusted, append-only golden set (docs/ARCHITECTURE.md §4).

Traits§

ArtifactStore
Content-addressed artifact storage. The address is the hash of the bytes (ecosystem is a higher-level annotation, not part of storage). Implementations seal every artifact at rest with AES-256-GCM under a per-artifact subkey (docs/STORAGE.md §2).
DepEcosystem
An acquirable dependency ecosystem. Cargo is the first implementor; npm/PyPI/Go follow without pipeline-core changes (docs/PIPELINE.md §0).
MetadataStore
Encrypted metadata: scan verdicts, promotion receipts, and graph annotations (docs/STORAGE.md §4).

Type Aliases§

Result
Convenience alias for fallible Deputy operations.