Documentation
¶
Overview ¶
Package progress projects each harness session into one session_progress row — the assignment, agent, phase, turn, queue depth, tool calls, commits ahead, changed files, model, last activity and last note — and folds the session's event log into the readable lines a tail follows. Both csf status and csf tail read this one projection: status renders the row as a table, tail renders the lines, and neither reads the log a second way.
A session here is a virtual session: one assignment the harness runs. It resolves to the real session — the executor conversation that carries the server-side prompt cache — through the router's table under <state>/routing, so two virtual sessions shown on one conversation are sharing that cache.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fold ¶
Fold applies one event log record to a row and returns the row with the lines the record adds. It is pure: a record folds to the same row and the same lines every time. The row's Agent names every line it yields, so a caller sets it from the run record before folding.
func ParseKinds ¶
ParseKinds reads a comma-separated kind list into the set of kinds to show. An empty list means every kind.
func Work ¶
Work fills the fields of a row that need the session's working tree rather than its run directory: the commits its branch is ahead of its base and the files it has changed but not committed. A session with no worktree yet, or one whose git commands fail, keeps zero counts, so status shows a session it cannot read rather than failing.
Types ¶
type Followed ¶
Followed is one session's row after its event log is folded from an offset, the lines the fold added, and the offset to read from next.
type Kind ¶
type Kind string
Kind is the kind of one tail line.
const ( // KindTurn is a turn starting, ending or a message sent to a session. KindTurn Kind = "turn" // KindTool is one tool call the session made. KindTool Kind = "tool" // KindGate is a session gate's decision. KindGate Kind = "gate" // KindMerge is a pull request moving: marked ready, a merge starting or a // merge landing. KindMerge Kind = "merge" // KindError is a failure a record reported. KindError Kind = "error" )
The kinds a line carries, one per kind of thing a session does.
type Line ¶
Line is one line of the tail: when it happened, the agent that wrote it, which kind it is and what it says. It renders as the brief's render line "{time} {agent} {kind} {text}".
type Phase ¶
type Phase string
Phase is a session's phase as this projection reads it from the state directory. The state directory records a run's whole event log and the end its runner wrote, so this reads a run between turns as open and a turn in flight as running; the phases only the running host holds — starting and canceling — are the host's to report, through csf list.
const ( // PhaseRunning is a run between a turn's request and its finish. PhaseRunning Phase = "running" // PhaseOpen is a run with no turn in flight. PhaseOpen Phase = "open" // PhaseClosed is a run whose turn executor closed. PhaseClosed Phase = "closed" // PhaseCanceled is a run that was canceled. PhaseCanceled Phase = "canceled" // PhaseFailed is a run that failed. PhaseFailed Phase = "failed" )
type Progress ¶
type Progress struct {
Assignment string
Agent string
Phase Phase
Turn int
Queued int
ToolCalls int
CommitsAhead int
ChangedFiles int
Model string
LastActivity time.Time
LastNote string
// contains filtered or unexported fields
}
Progress is one row of the session_progress relation: what one session is doing, read from its run directory. It is the one projection both csf status and csf tail read.
type Projection ¶
Projection is every session's row and every tail line the state directory folds to, in the order each verb reads them.
func ReadAllLines ¶
func ReadAllLines(files iofs.IFiles) (Projection, error)
ReadAllLines projects every session in the granted state directory and collects every tail line it folds, ordered by time then assignment. It is the read csf tail makes; Work fills the rows' git fields, which need a process, and the lines' agents are already set.