artifact

package
v0.5.58 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package artifact writes local run artifact bundles.

Index

Constants

View Source
const (
	RunJSON                       = "run.json"
	PromptFile                    = "prompt.txt"
	TranscriptFile                = "transcript.txt"
	StdoutFile                    = "stdout.txt"
	StderrFile                    = "stderr.txt"
	ToolCallsFile                 = "tool-calls.json"
	TimelineFile                  = "timeline.json"
	VerifierFile                  = "verifier.json"
	FailureAutopsyFile            = "failure-autopsy.json"
	RunErrorFile                  = "run-error.json"
	RunEventsFile                 = "run-events.json"
	RunReviewFile                 = "run_review.json"
	ScorecardFile                 = "scorecard.json"
	ChaosFile                     = "chaos.json"
	ChaosLogFile                  = "chaos.log"
	EvidenceDir                   = "evidence"
	HostedTranscript              = "transcript"
	HostedToolCalls               = "tool_calls"
	HostedTimeline                = "timeline"
	HostedFailureAutopsy          = "failure_autopsy"
	HostedRunError                = "run_error"
	HostedRunEvents               = "run_events"
	HostedRunReview               = "run_review"
	HostedScenarioPatchPreview    = "scenario_patch_preview"
	HostedScenarioPatchValidation = "scenario_patch_validation"
	HostedScorecard               = "scorecard"
	ContentTypeJSON               = "application/json"
	ContentTypeText               = "text/plain"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RunBundle

type RunBundle struct {
	RunID          string            `json:"run_id"`
	ScenarioID     string            `json:"scenario_id"`
	Adapter        string            `json:"adapter"`
	StartTime      time.Time         `json:"start_time"`
	EndTime        time.Time         `json:"end_time"`
	ExitCode       int               `json:"exit_code"`
	Passed         bool              `json:"passed"`
	Prompt         string            `json:"prompt,omitempty"`
	Transcript     string            `json:"transcript,omitempty"`
	Stdout         string            `json:"stdout,omitempty"`
	Stderr         string            `json:"stderr,omitempty"`
	ToolCalls      json.RawMessage   `json:"tool_calls,omitempty"`
	Timeline       json.RawMessage   `json:"timeline,omitempty"`
	Checks         json.RawMessage   `json:"checks,omitempty"`
	Autopsy        json.RawMessage   `json:"autopsy,omitempty"`
	Scorecard      json.RawMessage   `json:"scorecard,omitempty"`
	RunError       json.RawMessage   `json:"run_error,omitempty"`
	RunEvents      json.RawMessage   `json:"run_events,omitempty"`
	ChaosEnabled   bool              `json:"chaos_enabled,omitempty"`
	ChaosMode      string            `json:"chaos_mode,omitempty"`
	ChaosStepCount int               `json:"chaos_step_count,omitempty"`
	ChaosTimeline  json.RawMessage   `json:"chaos_timeline,omitempty"`
	ChaosLog       string            `json:"-"`
	Metadata       map[string]string `json:"metadata,omitempty"`
}

RunBundle holds all data for a single benchmark run.

type WriteOutput

type WriteOutput struct {
	Path string
}

WriteOutput is the result of writing an artifact bundle.

type Writer

type Writer struct {
	BaseDir string
}

Writer writes run artifact bundles to a base directory.

func NewWriter

func NewWriter(baseDir string) *Writer

NewWriter creates a Writer that writes bundles under baseDir.

func (*Writer) Write

func (w *Writer) Write(bundle RunBundle) (*WriteOutput, error)

Write creates a run artifact directory and writes all bundle files.

Jump to

Keyboard shortcuts

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