mission

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxWorkers     int    `json:"max_workers"`
	WorkerModel    string `json:"worker_model"`
	ValidatorModel string `json:"validator_model"`
	RepoDir        string `json:"repo_dir"`
	BaseBranch     string `json:"base_branch"`
	AutonomyLevel  int    `json:"autonomy_level"`
	SkipValidation bool   `json:"skip_validation"`
}

Config controls mission orchestration behavior.

type Feature

type Feature struct {
	ID               string        `json:"id"`
	Description      string        `json:"description"`
	ExpectedBehavior string        `json:"expected_behavior"`
	Branch           string        `json:"branch"`
	WorkerSessionID  string        `json:"worker_session_id,omitempty"`
	Status           FeatureStatus `json:"status"`
	Handoff          *Handoff      `json:"handoff,omitempty"`
	StartedAt        time.Time     `json:"started_at,omitempty"`
	CompletedAt      time.Time     `json:"completed_at,omitempty"`
}

Feature is a discrete unit of work assigned to a worker.

type FeatureStatus

type FeatureStatus string

FeatureStatus tracks individual feature progress.

const (
	FeaturePending    FeatureStatus = "pending"
	FeatureInProgress FeatureStatus = "in_progress"
	FeatureCompleted  FeatureStatus = "completed"
	FeatureFailed     FeatureStatus = "failed"
)

type Handoff

type Handoff struct {
	CommitID     string   `json:"commit_id,omitempty"`
	RepoPath     string   `json:"repo_path,omitempty"`
	Summary      string   `json:"summary"`
	FilesChanged []string `json:"files_changed,omitempty"`
	TestsPassed  bool     `json:"tests_passed"`
}

Handoff is the structured report a worker produces upon completion.

type Mission

type Mission struct {
	ID          string    `json:"id"`
	Prompt      string    `json:"prompt"`
	Dir         string    `json:"dir"`
	Features    []Feature `json:"features"`
	Status      Status    `json:"status"`
	StartedAt   time.Time `json:"started_at"`
	CompletedAt time.Time `json:"completed_at,omitempty"`
	Config      Config    `json:"config"`
	// contains filtered or unexported fields
}

Mission represents a multi-agent orchestration run.

func New

func New(prompt string, cfg Config) *Mission

New creates a new mission from a prompt and configuration.

func (*Mission) Plan

func (m *Mission) Plan(ctx context.Context, planFn PlanFunc) error

func (*Mission) Run

func (m *Mission) Run(ctx context.Context, workerFn WorkerFunc) error

Run executes all features in parallel using workerFn.

func (*Mission) Summary

func (m *Mission) Summary() string

Summary returns a human-readable summary of the mission.

type PlanFunc

type PlanFunc func(ctx context.Context, prompt string) ([]Feature, error)

Plan decomposes the mission prompt into features. planFn is called with the prompt and should return a list of features.

type Status

type Status string

Status represents the mission lifecycle.

const (
	StatusPlanning   Status = "planning"
	StatusRunning    Status = "running"
	StatusValidating Status = "validating"
	StatusCompleted  Status = "completed"
	StatusFailed     Status = "failed"
)

type WorkerFunc

type WorkerFunc func(ctx context.Context, feature *Feature, missionDir string, cfg Config) (*Handoff, error)

WorkerFunc is the function type that the orchestrator calls for each feature. It receives the feature and mission dir, and returns a handoff or error.

func EngineWorker

func EngineWorker(provider, model, systemPrompt string) WorkerFunc

EngineWorker returns a WorkerFunc that runs an actual engine session in an isolated git worktree for each feature.

Jump to

Keyboard shortcuts

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