Documentation
¶
Overview ¶
Package goal is the session goal: an objective wopr keeps working toward across turns, continuing automatically until an independent audit accepts the orchestrator's completion claim or a cap pauses it. It holds the state, its caps, and the texts the models read; the session runs the loop.
Index ¶
Constants ¶
const ( MetMarker = "GOAL MET" BlockedMarker = "GOAL BLOCKED" )
Claim markers: a line the orchestrator ends its reply with.
const EntryType = "wopr-goal-v1"
EntryType is the custom session entry type holding the goal.
const IdleTurns = 3
IdleTurns is how many automatic turns in a row without a tool call pause the goal: the model is talking, not working.
const MessageType = "goal"
MessageType is the custom message type of the goal's kickoff and continuation messages.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Caps ¶
type Caps struct {
Turns int `json:"turns"`
// Cost is the most non-free spend in dollars.
Cost float64 `json:"cost"`
// Time is the most active wall time.
Time time.Duration `json:"time"`
}
Caps bound one working window of a goal; resuming opens a new window.
func DefaultCaps ¶
func DefaultCaps() Caps
DefaultCaps are the caps a goal gets unless /goal overrides them.
type Claim ¶
type Claim struct {
// Kind is MetMarker, BlockedMarker, or "" for no claim.
Kind string
// Evidence is the text after the marker line, or the reply before it
// when nothing follows.
Evidence string
}
Claim is what the orchestrator's final reply says about the goal.
func ParseClaim ¶
ParseClaim finds the last marker line in a reply. A marker counts only on a line of its own (markdown emphasis and a trailing colon allowed), so prose that mentions it is not a claim.
type State ¶
type State struct {
Version int `json:"version"`
ID string `json:"id"`
Objective string `json:"objective"`
Status Status `json:"status"`
// Reason says why the goal is paused or done.
Reason string `json:"reason,omitempty"`
Caps Caps `json:"caps"`
// Turns, Spent, and Elapsed are this window's automatic turns, non-free
// spend, and active time.
Turns int `json:"turns"`
Spent float64 `json:"spent"`
Elapsed time.Duration `json:"elapsed"`
// TotalSpent is the spend across windows.
TotalSpent float64 `json:"totalSpent"`
// Idle counts automatic turns in a row without a tool call.
Idle int `json:"idle,omitempty"`
// Audits counts completion audits; Feedback is the last failed one's.
Audits int `json:"audits,omitempty"`
Feedback string `json:"feedback,omitempty"`
// Audited identifies the last claim audited, so a claim is audited once.
Audited string `json:"audited,omitempty"`
// Started is when the goal was set.
Started time.Time `json:"started"`
// Tasks are the background tasks started while the goal was active.
Tasks []string `json:"tasks,omitempty"`
}
State is the persisted goal.
func (State) AuditBrief ¶
AuditBrief is the auditor subagent's brief: the goal and the orchestrator's claim, which it must check against the working tree.
func (State) Continuation ¶
Continuation is the message of an automatic turn.
type Step ¶
type Step struct {
// Message, when set, is the next automatic turn's message.
Message *agent.AgentMessage
// Wait reports background tasks of the goal still running; delivering
// their results settles another run, which asks again.
Wait bool
// Event is "done" or "paused" when the goal just changed that way, and
// Text says why.
Event, Text string
}
Step is what a frontend does after a run settles.