pastruns

package
v0.7.20-dev.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package pastruns reads the runs a person has made from their output folders: every folder directly under an output directory (./agentry-out by default) that holds a result.json, read as the run's envelope, with its timing from the receipts' meta.json. Nothing here changes a folder.

Index

Constants

View Source
const DefaultDir = "agentry-out"

DefaultDir is where agentry run writes when --out is not given, relative to the working folder.

Variables

This section is empty.

Functions

This section is empty.

Types

type Run

type Run struct {
	// Dir is the run's output folder, as given (relative when the output
	// directory was).
	Dir string `json:"dir"`
	// RunID, Ref, Status, ExitCode and ExitClass are the envelope's; the
	// class's words come from the exit-class table.
	RunID            string `json:"runId"`
	Ref              string `json:"ref"`
	Status           string `json:"status"`
	ExitCode         int    `json:"exitCode"`
	ExitClass        string `json:"exitClass"`
	ExitClassMeaning string `json:"exitClassMeaning"`
	RetryLikelyHelps bool   `json:"retryLikelyHelps"`
	// Error is the envelope's error, on a failed run.
	Error string `json:"error,omitempty"`
	// Started and Ended are from the receipts' meta.json; when it is
	// missing, both are the time result.json was written.
	Started time.Time `json:"started"`
	Ended   time.Time `json:"ended"`
	// WallMS is the run's measured duration, from the envelope's usage.
	WallMS int64 `json:"wallMs"`
	// Deliverables are the run's deliverables by path, as the envelope lists
	// them; empty for a run that failed or listed none.
	Deliverables []string `json:"deliverables,omitempty"`
}

Run is one past run as its folder records it.

func Find

func Find(dir, name string) (Run, error)

Find is the folder the name means: a run folder's path as given, or the name of a folder under dir, or a run id (whole or its first characters) of a run under dir. One match is answered; none, or more than one, is an error that says so.

func List

func List(dir string) ([]Run, error)

List reads the runs under dir, newest first. A folder without a result.json, or with one that is not an envelope, is not a run and is left out. A dir that does not exist lists nothing and is no error: the person has made no run from here.

func Read

func Read(dir string) (Run, error)

Read is the run in one folder, or an error saying why the folder is not a run.

func (Run) Outcome

func (r Run) Outcome() string

Outcome is the run's outcome in one word: the class name, or ok.

Jump to

Keyboard shortcuts

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