runplan

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: 16 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 runplan resolves what a run will do: the flow a task ships on, the pace that tunes it and the agent profile each step runs on.

Index

Constants

View Source
const AgentFlagOrigin = "--agent"

AgentFlagOrigin is the origin of a profile a command line gave.

View Source
const AgentKeyFlag = "--agent"

AgentKeyFlag holds a run's profile in the map: a key no file can declare (CheckAgentKey refuses it), laid over `default` segment by segment, so `--agent low` keeps the map's model.

View Source
const LocalFlow = "local"

LocalFlow is the flow --local selects on start and drive; finish's --local (leave the PR open) and a never-pushed branch's merge here are unrelated.

View Source
const PaceOriginDefault = "default"

PaceOriginDefault marks medium taken because nothing named a pace; start and drive record only a typed --pace, so it never reaches a branch.

Variables

This section is empty.

Functions

func ClaudeDefaultModel

func ClaudeDefaultModel(path string) string

ClaudeDefaultModel is the "model" key of the settings file at path, or "" when the file, the key or the path is missing. It only names the fallback in a warning, so nothing it fails on is an error.

func ClaudeSettingsPath

func ClaudeSettingsPath() string

ClaudeSettingsPath is the user's claude settings file, under CLAUDE_CONFIG_DIR when set.

func PaceFlag

func PaceFlag() cli.Flag

func ProfileFlag

func ProfileFlag(agent, model string) (string, error)

ProfileFlag is the profile a command line names: --agent as given, or --model, which reads a model only, never an effort word.

func RecordedPace

func RecordedPace(ctx context.Context, main, branch string) (string, error)

RecordedPace is the pace start or drive recorded on branch, "" for none.

func RecordedProfile

func RecordedProfile(ctx context.Context, main, branch string) (agentctl.Profile, error)

RecordedProfile is the profile a branch records under f10-agent, the zero profile when it records none.

func ResolveRun

func ResolveRun(ctx context.Context, eff *facts.Effective, in RunInput) (*resolvedRun, error)

ResolveRun picks the run's pace: the flag, else the branch's record, else the default a layer names, else medium. A pace no layer declares fails with the list.

func WriteFlows

func WriteFlows(w io.Writer, v FlowView) error

Types

type AgentEntry

type AgentEntry struct {
	Key    string `json:"key"`
	Value  string `json:"value"`
	Origin string `json:"origin"`
}

An AgentEntry is one key of the merged map with where it came from.

type AgentMap

type AgentMap map[string]AgentEntry

AgentMap is the merged map, by key.

func AgentMapOf

func AgentMapOf(eff *facts.Effective) AgentMap

AgentMapOf is the map facts merged, each key with its layer.

func (AgentMap) KindsScoped

func (m AgentMap) KindsScoped(step string) []string

KindsScoped lists the task kinds the map scopes step by, sorted.

func (AgentMap) ProfileFor

func (m AgentMap) ProfileFor(step, kind string) resolvedProfile

ProfileFor is the profile step runs on for a task of kind ("" for any). Every value went through the vocabulary when it was read, so a parse error here is a programming error, not the user's.

func (AgentMap) With

func (m AgentMap) With(value, origin string) AgentMap

With is m with a run's profile on top: the flag, a drive task's own suffix, or the branch's record. A later one lays over an earlier one segment by segment, so `FT-1:low --agent sonnet` runs sonnet at low.

func (AgentMap) WithBranch

func (m AgentMap) WithBranch(ctx context.Context, main, branch string) (AgentMap, error)

WithBranch lays the profile a branch records under the run, so a step's subagent runs on what the task agent was started on; nothing recorded leaves m as it is.

type FlowRow

type FlowRow struct {
	Name     string          `json:"name"`
	Entries  []string        `json:"entries"`          // as declared, labels cut
	Labels   []string        `json:"labels,omitempty"` // each entry's display label by index; nil when none has one
	Run      []string        `json:"run,omitempty"`    // what runs under the pace
	Selected []string        `json:"selectedBy"`
	Resolved *facts.Resolved `json:"resolved,omitempty"` // the entries under the pace; nil when nothing changes them, or the pace breaks the flow
	Broken   string          `json:"broken,omitempty"`   // why the pace does not resolve on this flow
}

type FlowView

type FlowView struct {
	Pace       string            `json:"pace,omitempty"`
	PaceOrigin string            `json:"paceOrigin,omitempty"`
	Ceiling    string            `json:"ceiling,omitempty"` // the cap on the pace, or why it does not apply
	Flows      []FlowRow         `json:"flows"`
	FlowByArea map[string]string `json:"flowByArea,omitempty"`
}

func PacedFlowsView

func PacedFlowsView(eff *facts.Effective, set *facts.PaceSet, pace runPace) FlowView

PacedFlowsView is every flow with its entries under pace; a flow the pace breaks keeps its declared entries and says why.

type RunInput

type RunInput struct {
	Pace    string // --pace; "" for none typed
	Profile string // --agent or --model; "" for none typed
	Main    string // the main checkout, where branch records live
	Branch  string // the branch whose records the run reads; "" for none
}

RunInput is what a run adds over the facts.

type ShipFlow

type ShipFlow struct {
	Name     string
	Planless bool
	ByArea   bool
	Pace     string // the pace it runs at, "" for none
	Finish   string // the pace's finish for a run ending at a PR: on, off, or "" for none
}

A ShipFlow is the flow a started task ships through. ByArea is no flow named on a project declaring flow_by_area: ship picks the flow from the task's area, so it is told none and nothing is recorded on the branch.

func PacedFlow

func PacedFlow(eff *facts.Effective, pace, name string) (ShipFlow, error)

PacedFlow is the named flow under pace: an entry the pace skips does not run, so `plan: off` makes the flow planless. "" is no pace, the flow as declared.

func (ShipFlow) Finishes

func (f ShipFlow) Finishes() bool

Finishes says whether drive ends the task with finish: the pace's word when it has one, else on, so a drive merges what it ships.

func (ShipFlow) Label

func (f ShipFlow) Label() string

func (ShipFlow) Plans

func (f ShipFlow) Plans() bool

func (ShipFlow) Recorded

func (f ShipFlow) Recorded() string

func (ShipFlow) Word

func (f ShipFlow) Word() string

Jump to

Keyboard shortcuts

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