Documentation
¶
Overview ¶
Package blocker detects blocked tasks and generates AI-powered resolution suggestions. A task is considered blocked if any of the following heuristics fire:
- It is in_progress and no artifact or checkpoint file has been touched in >30 min
- It has at least one failed dependency
- Any of its annotations contains the word "blocked"
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockReason ¶
type BlockReason string
BlockReason describes why a task was classified as blocked.
const ( BlockReasonStalled BlockReason = "stalled" // in_progress, no activity >30 min BlockReasonFailedDep BlockReason = "failed_dep" // a dependency task has failed BlockReasonAnnotation BlockReason = "annotation" // annotation explicitly mentions "blocked" )
type BlockerInfo ¶
type BlockerInfo struct {
TaskID int `json:"task_id"`
TaskTitle string `json:"task_title"`
Blocked bool `json:"blocked"`
Reasons []BlockReason `json:"reasons,omitempty"`
// StalledSince is set when BlockReasonStalled is detected.
StalledSince *time.Time `json:"stalled_since,omitempty"`
// FailedDeps contains the IDs of failed dependency tasks.
FailedDeps []int `json:"failed_deps,omitempty"`
}
BlockerInfo holds the detection results for a single task.
type BlockerReport ¶
type BlockerReport struct {
TaskID int `json:"task_id"`
TaskTitle string `json:"task_title"`
Detection *BlockerInfo `json:"detection"`
RootCause string `json:"root_cause"`
Actions []string `json:"actions"` // exactly 3 concrete unblocking steps
Recommendation string `json:"recommendation"` // "retry", "skip", or "reassign"
}
BlockerReport is the full AI-generated analysis for a blocked task.
func Analyze ¶
func Analyze(ctx context.Context, p provider.Provider, model string, timeout time.Duration, task *pm.Task, plan *pm.Plan, workDir string) (*BlockerReport, error)
Analyze calls the AI provider to produce a BlockerReport for the given task. The AI receives the task spec, detection reasons, failure/timeout history, and dependency statuses, then outputs root-cause + 3 unblocking actions + a retry/skip/reassign recommendation.
Click to show internal directories.
Click to hide internal directories.