Documentation
¶
Overview ¶
Package task provides task management via Beads.
Index ¶
- Variables
- type AcceptanceCriterion
- type BeadsIssue
- type BeadsTracker
- func (t *BeadsTracker) Add(ctx context.Context, title, goal string, criteria []AcceptanceCriterion, ...) (string, error)
- func (t *BeadsTracker) AddDependency(ctx context.Context, taskID, dependsOnID string) error
- func (t *BeadsTracker) AddEpic(ctx context.Context, title, goal string) (string, error)
- func (t *BeadsTracker) AddFeature(ctx context.Context, epicID, title, goal string) (string, error)
- func (t *BeadsTracker) AddFollowUp(ctx context.Context, parentID, title, goal string, ...) (string, error)
- func (t *BeadsTracker) AddLabel(ctx context.Context, id string, label string) error
- func (t *BeadsTracker) AddRelatedLink(ctx context.Context, id1, id2 string) error
- func (t *BeadsTracker) AddTaskDetailed(ctx context.Context, parentID, title, goal string, ...) (string, error)
- func (t *BeadsTracker) Children(ctx context.Context, parentID string) ([]Task, error)
- func (t *BeadsTracker) CloseWithReason(ctx context.Context, id string, reason string) error
- func (t *BeadsTracker) Delete(ctx context.Context, id string) error
- func (t *BeadsTracker) LeafTasks(ctx context.Context) ([]Task, error)
- func (t *BeadsTracker) List(ctx context.Context, status *string) ([]Task, error)
- func (t *BeadsTracker) ListBlockedDependents(ctx context.Context, id string) ([]Task, error)
- func (t *BeadsTracker) ListFeatures(ctx context.Context, epicID string) ([]Task, error)
- func (t *BeadsTracker) MarkDone(ctx context.Context, id string) error
- func (t *BeadsTracker) MarkStatus(ctx context.Context, id string, status string) error
- func (t *BeadsTracker) RemoveLabel(ctx context.Context, id string, label string) error
- func (t *BeadsTracker) SetAssignee(ctx context.Context, id string, assignee string) error
- func (t *BeadsTracker) SetNotes(ctx context.Context, id string, notes string) error
- func (t *BeadsTracker) SetRun(ctx context.Context, id string, runID string) error
- func (t *BeadsTracker) Task(ctx context.Context, id string) (Task, error)
- func (t *BeadsTracker) Update(ctx context.Context, id string, title, goal string) error
- func (t *BeadsTracker) UpdateWorkflowState(ctx context.Context, id string, state string) error
- type SelectionPolicy
- type Task
- type Tracker
Constants ¶
This section is empty.
Variables ¶
var Module = fx.Module("task", fx.Provide( func() *BeadsTracker { return NewBeadsTracker("") }, ), )
Module is the Fx module for task management.
Functions ¶
This section is empty.
Types ¶
type AcceptanceCriterion ¶
type AcceptanceCriterion struct {
ID string `json:"id"`
Text string `json:"text"`
VerifyHints []string `json:"verify_hints,omitempty"`
}
AcceptanceCriterion describes a single acceptance criterion for a task.
type BeadsIssue ¶
type BeadsIssue struct {
ID string `json:"id"`
Type string `json:"type"`
IssueType string `json:"issue_type"`
ParentID string `json:"parent,omitempty"`
Title string `json:"title"`
Description string `json:"description"`
AcceptanceCriteria string `json:"acceptance_criteria"`
Status string `json:"status"` // open, in_progress, closed, etc.
Priority int `json:"priority"`
Assignee string `json:"assignee"`
Owner string `json:"owner"`
Labels []string `json:"labels"`
Notes string `json:"notes"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
ExternalRef string `json:"external_ref,omitempty"`
}
BeadsIssue represents the JSON structure of a beads issue.
type BeadsTracker ¶
type BeadsTracker struct {
// Optional: path to bd executable. If empty, uses "bd" from PATH.
BinPath string
// Optional: working directory used for bd execution. If empty, uses ".".
WorkingDir string
}
BeadsTracker implements Tracker using the beads CLI tool.
func NewBeadsTracker ¶
func NewBeadsTracker(binPath string) *BeadsTracker
NewBeadsTracker creates a new beads tracker.
func (*BeadsTracker) Add ¶
func (t *BeadsTracker) Add(ctx context.Context, title, goal string, criteria []AcceptanceCriterion, runID *string) (string, error)
Add creates a task via bd create.
func (*BeadsTracker) AddDependency ¶
func (t *BeadsTracker) AddDependency(ctx context.Context, taskID, dependsOnID string) error
AddDependency adds a dependency.
func (*BeadsTracker) AddFeature ¶
AddFeature creates a feature via bd create with parent epic.
func (*BeadsTracker) AddFollowUp ¶
func (t *BeadsTracker) AddFollowUp(ctx context.Context, parentID, title, goal string, criteria []AcceptanceCriterion) (string, error)
AddFollowUp creates a follow-up task with parent context.
func (*BeadsTracker) AddRelatedLink ¶
func (t *BeadsTracker) AddRelatedLink(ctx context.Context, id1, id2 string) error
AddRelatedLink creates a bidirectional relates_to link between two issues.
func (*BeadsTracker) AddTaskDetailed ¶
func (t *BeadsTracker) AddTaskDetailed( ctx context.Context, parentID, title, goal string, criteria []AcceptanceCriterion, runID *string, ) (string, error)
AddTaskDetailed creates a task via bd create and optionally sets its parent.
func (*BeadsTracker) CloseWithReason ¶
CloseWithReason closes a task with an explicit close reason.
func (*BeadsTracker) Delete ¶
func (t *BeadsTracker) Delete(ctx context.Context, id string) error
Delete deletes a task.
func (*BeadsTracker) LeafTasks ¶
func (t *BeadsTracker) LeafTasks(ctx context.Context) ([]Task, error)
LeafTasks returns ready tasks.
func (*BeadsTracker) ListBlockedDependents ¶
ListBlockedDependents returns issues that depend on the given issue.
func (*BeadsTracker) ListFeatures ¶
ListFeatures lists features for a given epic.
func (*BeadsTracker) MarkDone ¶
func (t *BeadsTracker) MarkDone(ctx context.Context, id string) error
MarkDone marks a task as done (closed) and removes workflow labels.
func (*BeadsTracker) MarkStatus ¶
MarkStatus updates task status.
func (*BeadsTracker) RemoveLabel ¶
RemoveLabel removes a label from a task.
func (*BeadsTracker) SetAssignee ¶
SetAssignee updates the assignee field of a task.
func (*BeadsTracker) UpdateWorkflowState ¶
UpdateWorkflowState updates the granular workflow state using labels.
type SelectionPolicy ¶
SelectionPolicy defines how the orchestrator chooses the next issue.
type Task ¶
type Task struct {
ID string
Type string // task, epic, feature
ParentID string
Title string
Goal string
Criteria []AcceptanceCriterion
Status string
RunID *string
Priority int
Assignee string
Owner string
Labels []string
Notes string
CreatedAt string
UpdatedAt string
}
Task describes a task record.
func SelectNextReady ¶
func SelectNextReady(ctx context.Context, tracker Tracker, ready []Task, policy SelectionPolicy) (Task, string, error)
SelectNextReady chooses the next issue from a ready list and returns a selection reason.
type Tracker ¶
type Tracker interface {
Add(ctx context.Context, title, goal string, criteria []AcceptanceCriterion, runID *string) (string, error)
AddEpic(ctx context.Context, title, goal string) (string, error)
AddFeature(ctx context.Context, epicID, title, goal string) (string, error)
List(ctx context.Context, status *string) ([]Task, error)
ListFeatures(ctx context.Context, epicID string) ([]Task, error)
Children(ctx context.Context, parentID string) ([]Task, error)
Task(ctx context.Context, id string) (Task, error)
MarkDone(ctx context.Context, id string) error
MarkStatus(ctx context.Context, id string, status string) error
Update(ctx context.Context, id string, title, goal string) error
Delete(ctx context.Context, id string) error
SetRun(ctx context.Context, id string, runID string) error
AddDependency(ctx context.Context, taskID, dependsOnID string) error
LeafTasks(ctx context.Context) ([]Task, error)
UpdateWorkflowState(ctx context.Context, id string, state string) error
AddLabel(ctx context.Context, id string, label string) error
RemoveLabel(ctx context.Context, id string, label string) error
SetAssignee(ctx context.Context, id string, assignee string) error
SetNotes(ctx context.Context, id string, notes string) error
CloseWithReason(ctx context.Context, id string, reason string) error
AddRelatedLink(ctx context.Context, id1, id2 string) error
ListBlockedDependents(ctx context.Context, id string) ([]Task, error)
AddFollowUp(ctx context.Context, parentID, title, goal string, criteria []AcceptanceCriterion) (string, error)
}
Tracker defines the interface for task management.