artifacts

package
v0.56.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package artifacts builds the copy of a run's output directory that CI uploads as the run artifact (ADR 0161).

The runner leaves output/ untouched so eval-measure and post-scripts read the full run. Prepare then copies what the resolved level allows into a separate directory, and only that directory is uploaded:

  • all: everything in output/.
  • metadata: only metrics.json, eval-measurements.jsonl and run-telemetry.jsonl from the top of each host run directory, with content-capture attributes and events and the pre-script skip reason stripped from the telemetry copy, and skip explanations replaced in the measurements copy. Every other file stays out.
  • none: nothing.

Index

Constants

View Source
const MetricsFile = "metrics.json"

MetricsFile is the behavioral metrics file the runner writes at the top of each run directory.

View Source
const RemovedSkipExplanation = "skipped; explanation removed from the run artifact"

RemovedSkipExplanation replaces the explanation of every skip row in the eval-measurements.jsonl that CI uploads.

Variables

This section is empty.

Functions

func MetadataFiles

func MetadataFiles() []string

MetadataFiles is the metadata-level allowlist: the run-level files a metadata artifact may hold. A file added to output/ later stays out until this list names it.

func Prepare

func Prepare(outputDir, artifactDir, level string) error

Prepare copies what level allows from outputDir into artifactDir, which is emptied first. On error, artifactDir is emptied again so a partial copy is never uploaded. A missing outputDir copies nothing.

func ResetArtifactDir

func ResetArtifactDir(outputDir, artifactDir string) error

ResetArtifactDir empties artifactDir (creating it when absent), so a failed resolution or copy leaves nothing to upload. It refuses an artifactDir that overlaps outputDir.

func StripMeasurements

func StripMeasurements(data []byte) ([]byte, error)

StripMeasurements returns a copy of an eval-measurements.jsonl file (one evalmeasure.EvaluationResult per line) in which every skip row's explanation is replaced with RemovedSkipExplanation. The trace_fitness and run_health scorers append the pre-script's free-text skip reason to the explanation of their skip rows; the rows are found by label, not by their text, because a measurement manifest can rename either scorer.

Every row is decoded and re-encoded: it keeps the same fields and values (numbers exactly, HTML characters unescaped), but key order and spacing may differ from the input. A skip row without an explanation gets none. Blank lines are dropped. A record that is not a JSON object with a string label is an error, so the caller leaves the file out instead of publishing it unchanged.

func StripTelemetry

func StripTelemetry(data []byte) ([]byte, error)

StripTelemetry returns a copy of a run-telemetry.jsonl file (one OTLP JSON TracesData per line) with every content-capture attribute and event, span status messages, exception text and the pre-script skip reason removed. Blank lines are dropped. Any record that is not valid JSON or does not have the TracesData shape is an error, so the caller leaves the file out instead of publishing it unstripped.

Types

This section is empty.

Jump to

Keyboard shortcuts

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