summaryrefslogtreecommitdiff
path: root/internal/task/task.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-09 03:59:51 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-09 03:59:51 +0000
commit0fc0c1e6ee0f106da7b91da7847c163936128051 (patch)
treeeb4c137070c0b3e8d8ffe956645a41cc89ab2a8e /internal/task/task.go
parentad00e1865c19afd40c8d159dbb55668ed6b51b12 (diff)
style: gofmt executor.go, executor_test.go, task.go
Pre-existing gofmt debt on all three files (confirmed dirty before this session's nested-subtask-completion commit too, not a regression) -- cleaned up while already touching these files.
Diffstat (limited to 'internal/task/task.go')
-rw-r--r--internal/task/task.go65
1 files changed, 32 insertions, 33 deletions
diff --git a/internal/task/task.go b/internal/task/task.go
index a95107a..3745e94 100644
--- a/internal/task/task.go
+++ b/internal/task/task.go
@@ -7,14 +7,14 @@ import (
type State string
const (
- StatePending State = "PENDING"
- StateQueued State = "QUEUED"
- StateRunning State = "RUNNING"
- StateReady State = "READY"
- StateCompleted State = "COMPLETED"
- StateFailed State = "FAILED"
- StateTimedOut State = "TIMED_OUT"
- StateCancelled State = "CANCELLED"
+ StatePending State = "PENDING"
+ StateQueued State = "QUEUED"
+ StateRunning State = "RUNNING"
+ StateReady State = "READY"
+ StateCompleted State = "COMPLETED"
+ StateFailed State = "FAILED"
+ StateTimedOut State = "TIMED_OUT"
+ StateCancelled State = "CANCELLED"
StateBudgetExceeded State = "BUDGET_EXCEEDED"
StateBlocked State = "BLOCKED"
)
@@ -28,8 +28,8 @@ const (
)
type AgentConfig struct {
- Type string `yaml:"type" json:"type"`
- Model string `yaml:"model" json:"model"`
+ Type string `yaml:"type" json:"type"`
+ Model string `yaml:"model" json:"model"`
// Role, when non-empty, names an internal/role.RoleConfig to dispatch
// through: internal/executor.Pool.execute() resolves tier 0 of the
// active role_configs row's EscalationLadder for the initial dispatch
@@ -37,7 +37,7 @@ type AgentConfig struct {
// walks the ladder on failure (retry-then-escalate). Tasks with
// Role == "" (every existing YAML/chatbot task shape) are completely
// unaffected — this is purely additive.
- Role string `yaml:"role,omitempty" json:"role,omitempty"`
+ Role string `yaml:"role,omitempty" json:"role,omitempty"`
ContextFiles []string `yaml:"context_files" json:"context_files"`
Instructions string `yaml:"instructions" json:"instructions"`
ContainerImage string `yaml:"container_image" json:"container_image"`
@@ -56,7 +56,6 @@ type AgentConfig struct {
MaxTokens int `yaml:"max_tokens,omitempty" json:"max_tokens,omitempty"`
}
-
type RetryConfig struct {
MaxAttempts int `yaml:"max_attempts" json:"max_attempts"`
Backoff string `yaml:"backoff" json:"backoff"` // "linear", "exponential"
@@ -84,34 +83,34 @@ type Interaction struct {
}
type Task struct {
- ID string `yaml:"id" json:"id"`
- ParentTaskID string `yaml:"parent_task_id" json:"parent_task_id"`
- Name string `yaml:"name" json:"name"`
- Description string `yaml:"description" json:"description"`
- Project string `yaml:"project" json:"project"` // Human-readable project name
+ ID string `yaml:"id" json:"id"`
+ ParentTaskID string `yaml:"parent_task_id" json:"parent_task_id"`
+ Name string `yaml:"name" json:"name"`
+ Description string `yaml:"description" json:"description"`
+ Project string `yaml:"project" json:"project"` // Human-readable project name
RepositoryURL string `yaml:"repository_url" json:"repository_url"`
- Agent AgentConfig `yaml:"agent" json:"agent"`
- Timeout Duration `yaml:"timeout" json:"timeout"`
- Retry RetryConfig `yaml:"retry" json:"retry"`
- Priority Priority `yaml:"priority" json:"priority"`
- Tags []string `yaml:"tags" json:"tags"`
- DependsOn []string `yaml:"depends_on" json:"depends_on"`
+ Agent AgentConfig `yaml:"agent" json:"agent"`
+ Timeout Duration `yaml:"timeout" json:"timeout"`
+ Retry RetryConfig `yaml:"retry" json:"retry"`
+ Priority Priority `yaml:"priority" json:"priority"`
+ Tags []string `yaml:"tags" json:"tags"`
+ DependsOn []string `yaml:"depends_on" json:"depends_on"`
// AcceptanceCriteria, when non-empty, states what this task's work must
// satisfy — set by a decomposing parent via spawn_subtask's
// acceptance_criteria parameter (mirrors story.Story.AcceptanceCriteria
// exactly). Unused by execution itself; a later phase's arbitrated-review
// generalization reads it when evaluating this task's work, falling back
// to the enclosing story's own AcceptanceCriteria when empty.
- AcceptanceCriteria []string `yaml:"acceptance_criteria" json:"acceptance_criteria"`
- BranchName string `yaml:"-" json:"branch_name,omitempty"`
- State State `yaml:"-" json:"state"`
- RejectionComment string `yaml:"-" json:"rejection_comment,omitempty"`
- QuestionJSON string `yaml:"-" json:"question,omitempty"`
- ElaborationInput string `yaml:"-" json:"elaboration_input,omitempty"`
- Summary string `yaml:"-" json:"summary,omitempty"`
- Interactions []Interaction `yaml:"-" json:"interactions,omitempty"`
- CreatedAt time.Time `yaml:"-" json:"created_at"`
- UpdatedAt time.Time `yaml:"-" json:"updated_at"`
+ AcceptanceCriteria []string `yaml:"acceptance_criteria" json:"acceptance_criteria"`
+ BranchName string `yaml:"-" json:"branch_name,omitempty"`
+ State State `yaml:"-" json:"state"`
+ RejectionComment string `yaml:"-" json:"rejection_comment,omitempty"`
+ QuestionJSON string `yaml:"-" json:"question,omitempty"`
+ ElaborationInput string `yaml:"-" json:"elaboration_input,omitempty"`
+ Summary string `yaml:"-" json:"summary,omitempty"`
+ Interactions []Interaction `yaml:"-" json:"interactions,omitempty"`
+ CreatedAt time.Time `yaml:"-" json:"created_at"`
+ UpdatedAt time.Time `yaml:"-" json:"updated_at"`
// NeedsReview is set by internal/scheduler.Scheduler when it resumes a
// BLOCKED role-typed task past its ask_user-timeout with a system-authored
// fallback answer rather than a real human answer — a flag for a human to