workflow

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitOK           = 0
	ExitUsage        = 2
	ExitNeedsInput   = 3
	ExitReviewNeeded = 4
	ExitAction       = 5
	ExitInFlight     = 6
	ExitExhausted    = 7
)
View Source
const MaxRounds = 5

Variables

This section is empty.

Functions

func ExitCode

func ExitCode(err error) int

func RuntimeSnapshot

func RuntimeSnapshot(provider string, p config.Provider) task.RuntimeSnapshot

RuntimeSnapshot converts validated provider configuration to durable, non-secret routing metadata. CLI discovery and workflow creation share this conversion so fresh, resume, and model-list calls use the same route.

Types

type CapabilityContext

type CapabilityContext struct {
	Note             string
	SkillDirectories []string
}

type Error

type Error struct {
	Code      string
	Message   string
	Retryable bool
	TaskID    string
	ExitCode  int
	Cause     error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Result

type Result struct {
	State  task.State
	Status string
}

type Service

type Service struct {
	RepoRoot string
	Store    *task.Store
	Config   config.Config
	Adapters map[string]runner.Adapter
	// ModelCachePath is explicit so library users and tests never inherit the
	// process owner's cache accidentally. An empty path disables caching.
	ModelCachePath string
	Capabilities   func(provider string, role runner.Role, taskText string) CapabilityContext
	Diagnostic     func(string)
	Observe        func(string) ([]task.FileEntry, error)
	Capture        func([]task.FileEntry, string, string) ([]task.FileEntry, error)
	WritePlan      func(string, string) error
	Now            func() time.Time
	Token          func() string
	ProcessID      func() int
	ProcessAlive   func(int) bool
}

func New

func New(repoRoot string, cfg config.Config, adapters map[string]runner.Adapter) *Service

func (*Service) AnswerImplement

func (s *Service) AnswerImplement(ctx context.Context, id, answer string) (Result, error)

func (*Service) AnswerPlan

func (s *Service) AnswerPlan(ctx context.Context, id, answer string) (Result, error)

func (*Service) Graph

func (s *Service) Graph(id string) (WorkGraph, error)

Graph returns live scheduling state for a planner-produced DAG. It never starts workers; the host orchestrator remains responsible for concurrency.

func (*Service) Implement

func (s *Service) Implement(ctx context.Context, id, rawScope string) (Result, error)

func (*Service) List

func (s *Service) List() ([]task.State, error)

func (*Service) Retry

func (s *Service) Retry(ctx context.Context, id string) (Result, error)

func (*Service) ReviewCode

func (s *Service) ReviewCode(ctx context.Context, id string) (Result, error)

func (*Service) ReviewIntegration

func (s *Service) ReviewIntegration(ctx context.Context, parentID string) (Result, error)

ReviewIntegration performs the one-time deep review after every DAG node has passed its task-local review. Findings are handed to one fresh integration implementer session, while subsequent fix/review rounds resume the same integration implementer and reviewer sessions.

func (*Service) ReviewPlan

func (s *Service) ReviewPlan(ctx context.Context, id string) (Result, error)

func (*Service) StartPlan

func (s *Service) StartPlan(ctx context.Context, text, id string) (Result, error)

func (*Service) StartWork

func (s *Service) StartWork(parentID, unitID string) (Result, error)

StartWork materializes one ready DAG node as an independently resumable task. Independent nodes therefore have independent provider sessions and task locks while sharing the same checkout.

func (*Service) Status

func (s *Service) Status(id string) (task.State, error)

type WorkGraph

type WorkGraph struct {
	TaskID string     `json:"task_id"`
	Phase  string     `json:"phase"`
	Waves  [][]string `json:"waves"`
	Ready  []string   `json:"ready"`
	Nodes  []WorkNode `json:"nodes"`
}

type WorkNode

type WorkNode struct {
	task.WorkUnit
	TaskID    string   `json:"task_id"`
	Status    string   `json:"status"`
	Ready     bool     `json:"ready"`
	BlockedBy []string `json:"blocked_by,omitempty"`
}

Jump to

Keyboard shortcuts

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