Documentation
¶
Index ¶
- Variables
- type ApprovalDecision
- type ApprovalRecord
- type ApprovalState
- type ClaimRequest
- type EvidenceLink
- type FileStore
- func (s *FileStore) ClaimNext(ctx context.Context, claim ClaimRequest) (TaskNode, error)
- func (s *FileStore) ClaimTask(ctx context.Context, claim ClaimRequest) (TaskNode, error)
- func (s *FileStore) CreatePlan(ctx context.Context, plan PlanRef) (PlanRef, error)
- func (s *FileStore) CreateTask(ctx context.Context, task TaskNode) (TaskNode, error)
- func (s *FileStore) DecidePlan(ctx context.Context, planID string, decision ApprovalDecision) (PlanRef, error)
- func (s *FileStore) DecideTask(ctx context.Context, taskID string, decision ApprovalDecision) (TaskNode, error)
- func (s *FileStore) GetPlan(ctx context.Context, planID string) (PlanRef, error)
- func (s *FileStore) ListEvents(ctx context.Context, planID string) ([]TaskEvent, error)
- func (s *FileStore) ListPlans(ctx context.Context) ([]PlanRef, error)
- func (s *FileStore) ListTasks(ctx context.Context, planID string) ([]TaskNode, error)
- func (s *FileStore) SetClock(now func() time.Time)
- func (s *FileStore) UpdateTask(ctx context.Context, update TaskUpdate) (TaskNode, error)
- func (s *FileStore) UpdateTaskIfOwned(ctx context.Context, update GuardedTaskUpdate) (TaskNode, error)
- type GuardedTaskUpdate
- type PlanRef
- type Store
- type TaskEvent
- type TaskNode
- type TaskOwnerGuard
- type TaskStatus
- type TaskUpdate
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCorruptState = errors.New("task state corrupt") ErrDependencyCycle = errors.New("task dependency cycle") ErrInvalidApproval = errors.New("invalid plan approval") ErrInvalidTransition = errors.New("invalid task status transition") ErrInvalidOwner = errors.New("invalid task owner") ErrMissingDependency = errors.New("missing task dependency") ErrPlanExists = errors.New("plan already exists") ErrPlanNotFound = errors.New("plan not found") ErrTaskBlocked = errors.New("task blocked") ErrTaskExists = errors.New("task already exists") ErrTaskNotFound = errors.New("task not found") ErrTaskOwnerMismatch = errors.New("task owner mismatch") ErrTaskOwned = errors.New("task already owned") )
Functions ¶
This section is empty.
Types ¶
type ApprovalDecision ¶
type ApprovalDecision struct {
State ApprovalState `json:"state"`
Actor string `json:"actor,omitempty"`
Reason string `json:"reason,omitempty"`
DecidedAt time.Time `json:"decided_at,omitempty"`
}
type ApprovalRecord ¶
type ApprovalRecord struct {
State ApprovalState `json:"state"`
Actor string `json:"actor,omitempty"`
Reason string `json:"reason,omitempty"`
DecidedAt *time.Time `json:"decided_at,omitempty"`
}
type ApprovalState ¶
type ApprovalState string
const ( ApprovalPending ApprovalState = "pending" ApprovalApproved ApprovalState = "approved" ApprovalRejected ApprovalState = "rejected" )
type ClaimRequest ¶
type EvidenceLink ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
func NewFileStore ¶
func (*FileStore) CreatePlan ¶
func (*FileStore) CreateTask ¶
func (*FileStore) DecidePlan ¶
func (*FileStore) DecideTask ¶
func (*FileStore) ListEvents ¶
func (*FileStore) UpdateTask ¶
func (*FileStore) UpdateTaskIfOwned ¶
type GuardedTaskUpdate ¶
type GuardedTaskUpdate struct {
Guard TaskOwnerGuard
Update TaskUpdate
}
type Store ¶
type Store interface {
ListPlans(ctx context.Context) ([]PlanRef, error)
CreatePlan(ctx context.Context, plan PlanRef) (PlanRef, error)
GetPlan(ctx context.Context, planID string) (PlanRef, error)
DecidePlan(ctx context.Context, planID string, decision ApprovalDecision) (PlanRef, error)
ListTasks(ctx context.Context, planID string) ([]TaskNode, error)
CreateTask(ctx context.Context, task TaskNode) (TaskNode, error)
UpdateTask(ctx context.Context, update TaskUpdate) (TaskNode, error)
UpdateTaskIfOwned(ctx context.Context, update GuardedTaskUpdate) (TaskNode, error)
DecideTask(ctx context.Context, taskID string, decision ApprovalDecision) (TaskNode, error)
ClaimTask(ctx context.Context, claim ClaimRequest) (TaskNode, error)
ClaimNext(ctx context.Context, claim ClaimRequest) (TaskNode, error)
ListEvents(ctx context.Context, planID string) ([]TaskEvent, error)
}
type TaskNode ¶
type TaskNode struct {
ID string `json:"id"`
PlanID string `json:"plan_id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Status TaskStatus `json:"status"`
BlockedBy []string `json:"blocked_by,omitempty"`
Owner string `json:"owner,omitempty"`
AgentHint string `json:"agent_hint,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClaimedAt *time.Time `json:"claimed_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
Approval ApprovalRecord `json:"approval"`
Evidence []EvidenceLink `json:"evidence,omitempty"`
}
type TaskOwnerGuard ¶
type TaskOwnerGuard struct {
PlanID string
Owner string
Status TaskStatus
}
type TaskStatus ¶
type TaskStatus string
const ( TaskStatusPending TaskStatus = "pending" TaskStatusInProgress TaskStatus = "in_progress" TaskStatusCompleted TaskStatus = "completed" TaskStatusCancelled TaskStatus = "cancelled" )
type TaskUpdate ¶
type TaskUpdate struct {
ID string
Title string
Description string
Status TaskStatus
BlockedBy []string
Owner string
AgentHint string
Evidence []EvidenceLink
}
Click to show internal directories.
Click to hide internal directories.