next

package
v0.0.0-...-5f22abe Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package next scores and ranks actionable tasks to recommend what to work on.

Tasks are scored based on priority, critical-path position, downstream impact, and effort. Only tasks whose dependencies are satisfied are considered.

Index

Constants

View Source
const (
	ScorePriorityCritical = 40
	ScorePriorityHigh     = 30
	ScorePriorityMedium   = 20
	ScorePriorityLow      = 10
	ScoreCriticalPath     = 15
	ScorePerDownstream    = 3
	ScoreDownstreamMax    = 15
	ScoreEffortSmall      = 5
	ScoreEffortMedium     = 2
)

Scoring constants

Variables

This section is empty.

Functions

func BuildChildrenMap

func BuildChildrenMap(tasks []*model.Task) map[string][]*model.Task

BuildChildrenMap creates a map from parent task ID to its child tasks.

func BuildTaskMap

func BuildTaskMap(tasks []*model.Task) map[string]*model.Task

BuildTaskMap creates a map of task ID to task.

func CalculateCriticalPathTasks

func CalculateCriticalPathTasks(tasks []*model.Task, taskMap map[string]*model.Task) map[string]bool

CalculateCriticalPathTasks identifies tasks on the critical path.

func ComputeDownstreamInfo

func ComputeDownstreamInfo(tasks []*model.Task) map[string]DownstreamInfo

ComputeDownstreamInfo computes downstream counts and max priority for each task.

func HasIncompleteChildren

func HasIncompleteChildren(task *model.Task, childrenMap map[string][]*model.Task) bool

HasIncompleteChildren returns true if the task has any children that are not resolved.

func HasUnmetDependencies

func HasUnmetDependencies(task *model.Task, taskMap map[string]*model.Task) bool

HasUnmetDependencies checks if any dependency is not completed.

func IsActionable

func IsActionable(task *model.Task, taskMap map[string]*model.Task, childrenMap map[string][]*model.Task) bool

IsActionable returns true if the task is pending/in-progress with all deps completed and no incomplete children.

func ScoreTask

func ScoreTask(
	task *model.Task,
	criticalPath map[string]bool,
	downstreamInfo map[string]DownstreamInfo,
) (int, []string)

ScoreTask computes a score and reason list for an actionable task.

Types

type DownstreamInfo

type DownstreamInfo struct {
	Count       int
	MaxPriority model.Priority
}

DownstreamInfo holds both the count and max priority of downstream tasks.

type Options

type Options struct {
	Limit         int
	Filters       []string
	QuickWins     bool
	Critical      bool
	Scope         string
	ScopeExact    bool
	ArchivedTasks []*model.Task
}

Options controls recommendation behaviour.

type Recommendation

type Recommendation struct {
	Rank            int      `json:"rank" yaml:"rank"`
	ID              string   `json:"id" yaml:"id"`
	Title           string   `json:"title" yaml:"title"`
	FilePath        string   `json:"file_path" yaml:"file_path"`
	Status          string   `json:"status" yaml:"status"`
	Priority        string   `json:"priority" yaml:"priority"`
	Effort          string   `json:"effort,omitempty" yaml:"effort,omitempty"`
	Score           int      `json:"score" yaml:"score"`
	Reasons         []string `json:"reasons" yaml:"reasons"`
	DownstreamCount int      `json:"downstream_count" yaml:"downstream_count"`
	OnCriticalPath  bool     `json:"on_critical_path" yaml:"on_critical_path"`
}

Recommendation represents a scored task recommendation.

func Recommend

func Recommend(tasks []*model.Task, opts Options) ([]Recommendation, error)

Recommend scores and ranks actionable tasks, returning the top recommendations.

Jump to

Keyboard shortcuts

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