plan

package
v0.1.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 4 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 plan is the lead's plan: a DAG of subtasks, each for one model. The lead keeps the full plan; it publishes a compact copy (without specs) as the halo.plan artifact on the run's root task, which is how the TUI sees it.

Index

Constants

View Source
const (
	Pending  = "pending"  // waiting for approval or dependencies
	Running  = "running"  // a worker has it
	Asking   = "asking"   // its worker asked the lead something
	Ready    = "ready"    // the worker finished; the lead decides what next
	Review   = "review"   // the reviewer has it
	Changes  = "changes"  // the reviewer asked for changes
	Done     = "done"     // merged into the run's branch
	Failed   = "failed"   // the worker failed; escalate or retry
	Conflict = "conflict" // merging failed
)

Statuses of a subtask.

View Source
const ArtifactName = "halo.plan"

ArtifactName names the artifact that carries the plan on the root task.

Variables

View Source
var Ladder = []string{"haiku", "sonnet", "opus"}

Ladder orders the models from cheapest to strongest.

Functions

func Next

func Next(model string) (string, bool)

Next returns the model one step up the ladder.

func ParseTag

func ParseTag(s string) string

ParseTag returns the subtask ID at the start of s ("[S3] ..."), or "".

func Tag

func Tag(id string) string

Tag is the prefix of a delegated message, "[S3] ", which lets anyone reading the activity log tie a task to its subtask.

Types

type Plan

type Plan struct {
	Goal     string `json:"goal"`
	Branch   string `json:"branch,omitempty"`
	Approved bool   `json:"approved,omitempty"`
	// MergedInto is the base branch the run branch was merged into.
	MergedInto string     `json:"merged_into,omitempty"`
	Subtasks   []*Subtask `json:"subtasks"`
}

Plan is a run's plan.

func (*Plan) DepsDone

func (p *Plan) DepsDone(s *Subtask) bool

DepsDone reports whether all of s's dependencies are done.

func (*Plan) Get

func (p *Plan) Get(id string) *Subtask

Get returns the subtask with id, or nil.

func (*Plan) Public

func (p *Plan) Public() *Plan

Public returns a copy without specs and acceptance criteria, small enough for an activity entry (Lagrange keeps 4 KB of an artifact).

func (*Plan) Validate

func (p *Plan) Validate(models []string) error

Validate checks IDs, dependencies, models and cycles.

type Subtask

type Subtask struct {
	ID         string   `json:"id"`
	Title      string   `json:"title"`
	Model      string   `json:"model"`
	Deps       []string `json:"deps,omitempty"`
	Spec       string   `json:"spec,omitempty"`
	Acceptance string   `json:"acceptance,omitempty"`

	Status    string `json:"status"`
	Worker    string `json:"worker,omitempty"`
	Task      string `json:"task,omitempty"`
	Round     int    `json:"round,omitempty"`     // review rounds so far
	Attempts  int    `json:"attempts,omitempty"`  // dispatches so far, escalations included
	Escalated bool   `json:"escalated,omitempty"` // moved up the ladder at least once
	StartedAt int64  `json:"startedAt,omitempty"` // unix ms
	EndedAt   int64  `json:"endedAt,omitempty"`   // unix ms
	Note      string `json:"note,omitempty"`      // the latest outcome, one line
}

Subtask is one piece of the plan.

Jump to

Keyboard shortcuts

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