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
- func ClaudeDefaultModel(path string) string
- func ClaudeSettingsPath() string
- func PaceFlag() cli.Flag
- func ProfileFlag(agent, model string) (string, error)
- func RecordedPace(ctx context.Context, main, branch string) (string, error)
- func RecordedProfile(ctx context.Context, main, branch string) (agentctl.Profile, error)
- func ResolveRun(ctx context.Context, eff *facts.Effective, in RunInput) (*resolvedRun, error)
- func WriteFlows(w io.Writer, v FlowView) error
- type AgentEntry
- type AgentMap
- type FlowRow
- type FlowView
- type RunInput
- type ShipFlow
Constants ¶
const AgentFlagOrigin = "--agent"
AgentFlagOrigin is the origin of a profile a command line gave.
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.
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.
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 ¶
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 ProfileFlag ¶
ProfileFlag is the profile a command line names: --agent as given, or --model, which reads a model only, never an effort word.
func RecordedPace ¶
RecordedPace is the pace start or drive recorded on branch, "" for none.
func RecordedProfile ¶
RecordedProfile is the profile a branch records under f10-agent, the zero profile when it records none.
func ResolveRun ¶
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.
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 ¶
AgentMapOf is the map facts merged, each key with its layer.
func (AgentMap) KindsScoped ¶
KindsScoped lists the task kinds the map scopes step by, sorted.
func (AgentMap) ProfileFor ¶
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.
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 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
Finishes bool // drive ends the task with finish: the flow ends in it and the pace runs it
Mixed bool // ByArea only: some flows the map can pick finish and some do not
NoFinish bool // the declared flow ends at a PR with no finish entry, so drive stops at ship
}
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.