artifactkit

package
v0.2026323.437 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package artifactkit reads, verifies and materializes a charly PLUGIN ARTIFACT — an OCI image layout (an index → one manifest per platform → a metadata config blob plus the provider-binary, candy-manifest and `.providers` layers) that carries a precompiled provider so a consumer with no plugin source and no Go toolchain can serve it.

It sits on `storekit`: the artifact store IS a named OCI-layout store under the one cache root, and a materialized plugin is a VIEW hard-linked out of that store's own blobs — never a second copy. DESIGN puts both mechanisms in sdk (D-SDK-1) rather than in `spec`, which holds generated code and behaviour methods and no mechanism (D-SPEC-1).

WHAT THIS VERIFIES, and what it deliberately does not: it validates what the artifact DECLARES against what the artifact IS — content addresses, the artifact/config media types, the three layer roles, the config's platform against the descriptor that pointed at it, an absolute libc, and the required runtime-tool declaration. It does NOT negotiate a version: DESIGN §8 says there is no version negotiation and that compatibility is the validation of every message (D-PROTO-6), so `protocol` and `calver` are advisory diagnostics a caller may report and are never a gate. `served_schema_digest` is TRANSITIONAL — the served body is the only schema identity verifiable today, until DESIGN §8.1's CUE-module-as-data leg lands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostPlatform

func HostPlatform() string

HostPlatform is this runtime's platform in the image-spec `platform` vocabulary: GOOS, GOARCH, and the micro-architecture level the environment declares (GOAMD64 / GOARM64).

func ReadIndex

func ReadIndex(store *storekit.Store) (index, error)

ReadIndex parses a store's index.json.

func SelectArtifact

func SelectArtifact(idx index, selector, want string) (int, []string, error)

SelectArtifact picks the descriptor answering (selector, want). The selector is what makes a multi-artifact store unambiguous — a manifest digest names one artifact exactly, a tag names the release a caller asked for, and "" is legal only when the store holds exactly one, since otherwise "the first platform match" could serve a different plugin's bytes.

Types

type ArtifactRef

type ArtifactRef struct {
	// Digest is the per-platform MANIFEST digest (not the index digest: a store is an index,
	// and each entry is one platform's manifest).
	Digest string
	// Tag is the index descriptor's `org.opencontainers.image.ref.name`, when a pull recorded
	// one.
	Tag string
	// Platform is the descriptor's `os/arch[/variant]`.
	Platform string
}

ArtifactRef names one artifact a store holds.

func Artifacts

func Artifacts(store *storekit.Store) ([]ArtifactRef, error)

Artifacts lists what a store holds.

type Verified

type Verified struct {
	// ManifestDigest is the selected per-platform manifest's digest.
	ManifestDigest string
	// Platform is the selected descriptor's platform, and Platforms every platform the store
	// advertises — so a caller that cannot serve the request can name the alternatives.
	Platform  string
	Platforms []string
	// Metadata is the CUE-GENERATED spec.PluginArtifactMetadata. This package decodes into
	// that type rather than a struct of its own: a second hand-written shape would be a second
	// schema, and the two would drift.
	Metadata spec.PluginArtifactMetadata
	// LayerDigests maps a layer ROLE ("binary" | "manifest" | "providers") to its digest.
	LayerDigests map[string]string
}

Verified is the outcome of a successful verification: everything a caller needs to serve the binary, and what a log line should say.

func Verify

func Verify(store *storekit.Store, selector, want, venueLibc string) (*Verified, error)

Verify selects an artifact from the store and checks every declared fact a consumer can check BEFORE serving. venueLibc is the caller's venue knowledge (a native host cannot read its own libc from Go's build info, so a foreign-distro probe supplies it); "" skips the comparison and leaves the declared fact to be REPORTED, never silently ignored.

type View

type View struct {
	// Name is the provider's leaf name, taken from the metadata's MODULE — the plugin's
	// canonical candy ref leaf, so it is stable across however a project names the candy that
	// declares it (D-PLUG-4's declaration-driven resolution).
	Name string
	// Dir is the view directory inside the store tree, keyed by the manifest digest so two
	// platforms or releases never collide.
	Dir string
	// Binary, Providers and Manifest are the view's paths.
	Binary    string
	Providers string
	Manifest  string
	// Verified is the verification performed before anything was written.
	Verified *Verified
	// AllHardlinked is the measured result of "these files ARE the store's bytes".
	AllHardlinked bool
}

View is a materialized plugin: the files a loader reads, all hard-linked to the store's blobs.

func Materialize

func Materialize(store *storekit.Store, selector, want, venueLibc string) (*View, error)

Materialize verifies an artifact and creates its runtime VIEW as hardlinks to the store's own blobs. Nothing lands until verification has passed: a partially materialized plugin would be found by a LATER run and served without the check that rejected it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL