Module artifacts

Module artifacts 

Source
Expand description

2026-09-26: The Metrale Engine home (ArtifactStore): the per-plugin artifact and per-benchmark run directories, plus write-if-changed assets and provisioning stamps.

Layout this module creates under the root:

  <root>/
    artifacts/<plugin-id>/     provisioned material (venvs, datasets, scripts)
    runs/<benchmark-id>/       run records (history.rs) and baselines (baseline.rs)

Owner: bench (artifacts). Invariants:

  • write_asset_bytes never rewrites a file whose bytes already match; an existing file it cannot read counts as different.

Structs§

ArtifactStore
2026-09-26: Handle to the artifact area: the resolved root directory.
MetraleHome
2026-09-26: A resolved Metrale Engine home and its provenance.
Stamp
2026-09-26: A provisioning stamp: a marker file whose contents identify the inputs that produced an artifact. is_current is true only when the file’s trimmed contents equal the expected value, so changed inputs make it stale.

Enums§

HomeFault
2026-09-26: Why a Metrale Engine home cannot be used.
HomeSource
2026-09-26: Where the Metrale Engine home came from. It matters because the signing identity lives under the home (<root>/identity/ed25519.pk8, gate::signing), so two homes sign as two signers.

Functions§

write_asset
2026-09-26: Write a compiled-in asset into dir, but only when the bytes differ, so a provisioned script always matches the binary that ships it and an unchanged file keeps its mtime.
write_asset_bytes
2026-09-26: write_asset for assets that are not text: the same compare-then-write contract, over bytes. The comparison reads bytes because read_to_string fails on non-UTF-8 files and would make every binary asset look changed.