prioritize

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package prioritize provides AI-powered task reprioritization for cloop PM mode. It analyzes the current task plan, dependency graph, blockers, and risk factors, then uses an AI provider to suggest an optimal new priority ordering.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(plan *pm.Plan, result *Result) int

Apply updates task priorities in the plan based on suggestions. Returns the number of tasks updated.

func BuildPrompt

func BuildPrompt(goal string, plan *pm.Plan) string

BuildPrompt creates the reprioritization prompt.

Types

type Result

type Result struct {
	Suggestions []Suggestion `json:"suggestions"`
	Summary     string       `json:"summary"`
	GeneratedAt time.Time
}

Result is the full AI reprioritization output.

func Generate

func Generate(ctx context.Context, p provider.Provider, goal string, plan *pm.Plan, model string, timeout time.Duration) (*Result, error)

Generate calls the AI provider to produce reprioritization suggestions.

func Parse

func Parse(output string) (*Result, error)

Parse extracts a Result from the AI's JSON response.

type Suggestion

type Suggestion struct {
	TaskID      int    `json:"task_id"`
	NewPriority int    `json:"new_priority"`
	Reason      string `json:"reason"`
}

Suggestion holds a recommended priority for a single task.

Jump to

Keyboard shortcuts

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