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 ¶
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 ¶
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 ¶
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.