statusview

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 46 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

View Source
const LaunchesHead = "launched here"

LaunchesHead heads the tree of what this session launched.

View Source
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 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

func InRoot(runs []*state.Run, root string) []*state.Run

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 NewStatusReader

func NewStatusReader(t *target.Target, now time.Time) (*statusReader, error)

func ReadOutcomes

func ReadOutcomes(store *lore.Store, storageRoot, task string) outcomes

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 RenderRows

func RenderRows(w io.Writer, rows []TaskRow, v RowView) error

RenderRows prints the rows as a task tree under the parent's heading.

func RunFact

func RunFact(label, value string, style lipgloss.Style) render.Fact

func RunRows

func RunRows(w io.Writer, r *state.Run, v RunView)

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

func SeriesOutcomes(store *lore.Store, storageRoot, task string, open bool) outcomes

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

func StageStyle(stage string) lipgloss.Style

StageStyle is the stage's look in the terminal.

func StatusText

func StatusText(ctx context.Context, dir, session, token string) (string, bool)

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

func (s *Shipment) AskPR(ctx context.Context, in taskStatusInput)

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.

func (*Shipment) Facts

func (s *Shipment) Facts(link bool) []render.Fact

Facts is the block's rows in the ship report's order, empty ones left out. link puts a terminal link on the file paths; --plain passes false, since writeReport links a path fact on any terminal.

func (*Shipment) PRLine added in v0.60.0

func (s *Shipment) PRLine() string

PRLine is the pr state row, `#128 open · checks red (lint)`; "" when the host was not asked.

type StatusView

type StatusView struct {
	Out, Warn   io.Writer
	JSON, Plain bool
}

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

func (row *TaskRow) GateColumn() string

GateColumn is the row's compact gates.

type Weight

type Weight int

Weight is how loud a stage is drawn: bold where it asks for you or for a next move, faint where it is past.

const (
	Plain Weight = iota
	Bold
	Faint
)

Jump to

Keyboard shortcuts

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