flowrun

package
v1.137.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package flowrun draws one run of a script on the flow graph of the version it executed (#1907): which cards the run reached, the audited calls each made and how long they took, what each wrote, and the card the run failed at. Calls are attributed by their call site (internal/scriptcallsite), which the graph records on each card and the run records on each call.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Call

type Call struct {
	CallSite      []string
	Tool          string
	DurationMS    int64
	Success       bool
	Error         string
	ResponseChars int
}

Call is one audited tool call a run made, as the overlay reads it.

type NodeRun

type NodeRun struct {
	// Calls is the audited tool calls attributed to the card, and DurationMS
	// their total time. ResponseChars is the size of what they answered.
	Calls         int   `json:"calls"`
	DurationMS    int64 `json:"duration_ms"`
	ResponseChars int   `json:"response_chars"`
	// Outputs, Rows and Bytes are what the card wrote, from the run's outputs.
	Outputs int `json:"outputs"`
	Rows    int `json:"rows"`
	// FailedCalls counts the card's calls that did not succeed, which a run
	// can outlive: a rate-limited call is refused and made again. The last
	// one's message is LastError.
	FailedCalls int    `json:"failed_calls"`
	LastError   string `json:"last_error,omitempty"`
	// Reached is true when the run made the card's call at least once.
	Reached bool `json:"reached"`
	// Failed is true on the card the run failed at, with Error its message.
	Failed bool   `json:"failed"`
	Error  string `json:"error,omitempty"`
}

NodeRun is what one card did in one run.

type OtherCall

type OtherCall struct {
	Tool       string   `json:"tool"`
	DurationMS int64    `json:"duration_ms"`
	Success    bool     `json:"success"`
	Error      string   `json:"error,omitempty"`
	CallSite   []string `json:"call_site,omitempty"`
}

OtherCall is an audited call the diagram has no card for: a tool the source computes, a call a run made before call sites were recorded, or a call from a lambda.

type Overlay

type Overlay struct {
	Nodes map[string]NodeRun `json:"nodes"`
	// Other lists the audited calls no card made, so the calls on the diagram
	// and Other always add up to the run's audited calls.
	Other []OtherCall `json:"other_calls"`
	// Calls is the run's audited tool calls, every one of them.
	Calls int `json:"calls"`
	// FailedNode is the card the run failed at, empty when it did not fail at
	// a platform call (or did not fail).
	FailedNode string `json:"failed_node,omitempty"`
}

Overlay is one run drawn on its version's graph (#1907).

func Draw

func Draw(g scriptflow.Graph, calls []Call, facts RunFacts) Overlay

Draw attributes a run's audited calls, outputs and failure to the cards of its version's graph.

type RunFacts

type RunFacts struct {
	Status string
	Cause  string
	// Error is the run's failure text: a script failure's backtrace, which
	// names where it failed.
	Error      string
	Outputs    []script.RunOutput
	StateSaved bool
	HasResult  bool
}

RunFacts is what the run record says about how the run went.

Jump to

Keyboard shortcuts

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