Documentation
¶
Overview ¶
Package statusview reads where tasks and runs stand and renders it: the status reader, the gates of each run, the stage of each task and the shipment a run left.
Index ¶
- Constants
- func BareStatus(ctx context.Context, v StatusView, dir string, scoped bool, sid string, ...) (bool, error)
- func FinishedIn(ctx context.Context, t *target.Target, refs []ref.Ref) map[string]bool
- func FinishedShipFiles(root, id string) ([]verdictPath, []reviewPath)
- func InRoot(runs []*state.Run, root string) []*state.Run
- func NewStatusReader(t *target.Target, now time.Time) (*statusReader, error)
- func ReadOutcomes(store *lore.Store, storageRoot, task string) outcomes
- func Render(v StatusView, rep Report) error
- func RenderRows(w io.Writer, rows []TaskRow, v RowView) error
- func RunFact(label, value string, style lipgloss.Style) render.Fact
- func RunRows(w io.Writer, r *state.Run, v RunView)
- func SeriesOutcomes(store *lore.Store, storageRoot, task string, open bool) outcomes
- func ShipFiles(root, id string) ([]verdictPath, []reviewPath)
- func StageLooks() map[string]look
- func StageStyle(stage string) lipgloss.Style
- func StatusText(ctx context.Context, dir, session, token string) (string, bool)
- func TaskRefsFor(t *target.Target, ctx context.Context, refs []ref.Ref, md, fresh bool, ...) map[string]ledger.TaskRef
- type Report
- type RowView
- type RunJSON
- type RunView
- type Shipment
- type StatusView
- type TaskRow
- type Weight
Constants ¶
const ( ReportLine = "line" // a sentence alone: no run to show ReportRuns = "runs" // runs, each with its task's gates ReportRows = "rows" // a parent's subtasks, or what a session launched ReportFallback = "fallback" // a task no live run is about ReportFinished = "finished" // a task finished and gone )
The shapes a status takes, one per Report.
const (
GateOff = "not in this flow"
)
Gate states. A plain step also takes a run's stop status (failed, blocked, partial) on the step it stopped at.
const LaunchesHead = "launched here"
LaunchesHead heads the tree of what this session launched.
const (
StageDone = "done"
)
Stages, as `status <parent>` names them, one per row.
Variables ¶
This section is empty.
Functions ¶
func BareStatus ¶
func BareStatus(ctx context.Context, v StatusView, dir string, scoped bool, sid string, all bool) (bool, error)
BareStatus is what `status` with no task id prints, and whether it printed a question a driven agent waits on.
func FinishedIn ¶ added in v0.62.0
FinishedIn is which of refs the ledger records a standing finish for: a local read, so a closed task is marked with no tracker call. A ledger that cannot be read finishes nothing.
func FinishedShipFiles ¶ added in v0.60.0
func FinishedShipFiles(root, id string) ([]verdictPath, []reviewPath)
FinishedShipFiles is ShipFiles for a finished task: f10 finish moved its findings to the archive, so the rounds are the newest closed series', and the verdicts those written since the series before it closed. Rounds still in the live directory are the last PR's, closed without f10 finish.
func InRoot ¶
InRoot keeps the runs recorded against root. The hook stores git's toplevel and the layout package stores the physical path, so both sides are compared in physical form.
func ReadOutcomes ¶
ReadOutcomes reads lore first when store is set, and the findings and verdict files for whatever lore holds nothing of: runs from before the steps wrote lore. A nil store reads the files alone.
func Render ¶ added in v0.62.0
func Render(v StatusView, rep Report) error
Render prints rep under v's flags, as the status call that read it would.
func RenderRows ¶
RenderRows prints the rows as a task tree under the parent's heading.
func RunRows ¶
RunRows prints one run in the headless colon-less shape; every run block without a facts head, `f10 state show` included, prints through it.
func SeriesOutcomes ¶
SeriesOutcomes reads the open series of a task with a branch, so a follow-up PR never shows the first one's gates; a task with no branch left reads the newest series lore holds, its open one being empty.
func ShipFiles ¶
func ShipFiles(root, id string) ([]verdictPath, []reviewPath)
ShipFiles is the task's verdict and findings files. Verdicts from before the open series are an earlier PR's, dropped as the judge row drops them.
func StageLooks ¶
func StageLooks() map[string]look
StageLooks is the palette by stage, a copy, for the board's page.
func StageStyle ¶
StageStyle is the stage's look in the terminal.
func StatusText ¶
StatusText is what `f10 status --plain` prints for session in dir, bare or for token, and whether the model must take the turn: the output holds a question to relay, or token names no task, so it is the skill's to read.
func TaskRefsFor ¶
func TaskRefsFor(t *target.Target, ctx context.Context, refs []ref.Ref, md, fresh bool, warn io.Writer, ) map[string]ledger.TaskRef
TaskRefsFor asks the tracker only for a task the ledger lacks (or lacks a url for, with md), or for every task with fresh; a tracker that cannot answer leaves the task out, with a note on warn.
Types ¶
type Report ¶ added in v0.62.0
type Report struct {
Kind string `json:"kind,omitempty"`
Line string `json:"line,omitempty"`
Runs []RunJSON `json:"runs,omitempty"`
// Headed is true when the runs share their task's shipment, printed
// once above them; ShowRoot when they are listed across checkouts
Headed bool `json:"headed,omitempty"`
ShowRoot bool `json:"show_root,omitempty"`
Rows []TaskRow `json:"rows,omitempty"`
Parent string `json:"parent,omitempty"` // the rows' head
Fallback *fallback `json:"fallback,omitempty"`
Finished *finished `json:"finished,omitempty"`
// Asks is true when what shows holds a question a driven agent waits on
Asks bool `json:"asks,omitempty"`
}
A Report is what one status call shows, read in full before anything prints, so the daemon reads it and the client prints it as one call in process would. Kind is empty when a guessed task showed nothing.
type RowView ¶
type RowView struct {
Parent string // the parent's id, heading its children; "" for a task alone
Width int // 0: no limit
Term bool
Plain bool
}
RowView is how task rows print; plain is cut to a width and carries no urls, since a model reads it and runs `f10 task open --link` for one.
type RunJSON ¶
type RunJSON struct {
*state.Run
Agent string `json:"agent,omitempty"`
Gates []gate `json:"gates,omitempty"`
// the task's files and facts, repeated per run as the agent is; the
// files predate the shipment and repeat what it holds
Verdicts []verdictPath `json:"verdicts,omitempty"`
Reviews []reviewPath `json:"reviews,omitempty"`
Shipment *Shipment `json:"shipment,omitempty"`
}
RunJSON is a run as --json prints it, a task's gates beside the state's own keys.
type RunView ¶
type RunView struct {
Gates []gate
ShowRoot bool // listing runs: for one session the root is the directory you are in
Agent string // the profile the task's branch records, "" for the kind's default
Now time.Time
Limit int
Headed bool // a shipment block above holds the task and url rows
}
RunView is how one run block prints.
type Shipment ¶
type Shipment struct {
Task string `json:"task"`
Title string `json:"title,omitempty"`
URL string `json:"url,omitempty"`
Branch string `json:"branch,omitempty"`
PR string `json:"pr,omitempty"`
PRState string `json:"pr_state,omitempty"` // when the host was asked
// Checks is an open PR's head checks, when the host answered in time
Checks *forge.HeadChecks `json:"checks,omitempty"`
Commit string `json:"commit,omitempty"`
Plan string `json:"plan,omitempty"`
Handoff string `json:"handoff,omitempty"`
Demo string `json:"demo,omitempty"`
Verdicts []verdictPath `json:"verdicts,omitempty"`
Reviews []reviewPath `json:"reviews,omitempty"`
// contains filtered or unexported fields
}
Shipment is the facts block a ship report opens with, reprinted from what f10 holds locally; only a pushed task with no PR recorded asks the host. --json carries it whole under `shipment`.
func (*Shipment) AskPR ¶
AskPR reads the branch's PR from the host, once, and an open one's checks last: a PR the host does not know leaves the ledger's url standing, and a checks read that fails or runs out of time leaves the row without them.
type StatusView ¶
StatusView is where a status prints and how: the flags it honours.
type TaskRow ¶
type TaskRow struct {
ID string `json:"id"`
Title string `json:"title"`
URL string `json:"url,omitempty"`
Depth int `json:"depth"`
After string `json:"after,omitempty"`
Stage string `json:"stage"`
Step string `json:"step,omitempty"`
PR string `json:"pr,omitempty"`
PRState string `json:"pr_state,omitempty"`
Checks string `json:"checks,omitempty"` // an open PR's head rollup: green, red or pending
Note string `json:"note,omitempty"`
Next string `json:"next,omitempty"`
Ask string `json:"ask,omitempty"`
Gates []gate `json:"gates,omitempty"`
}
A TaskRow is one task as `status <parent>` lists it, and the shape its --json prints. A finished task with no branch left prints one alone.
func (*TaskRow) Finish ¶
func (row *TaskRow) Finish(f lookaround.TaskFacts, baseDone bool)
Finish settles the row's stage and the lines printed under it.
func (*TaskRow) GateColumn ¶
GateColumn is the row's compact gates.