urgency

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package urgency computes a weighted urgency score for tasks. Scores are a polynomial sum of configurable coefficients applied to task attributes. Higher scores indicate more urgent tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Components

func Components(task *taskkit.Task, w Weights, now time.Time) []taskkit.UrgencyComponent

Components returns the non-zero urgency terms for a task, suitable for rendering a breakdown table. Only terms whose weight * coefficient != 0 are included.

func Score

func Score(task *taskkit.Task, w Weights, now time.Time) float64

Score computes the urgency score for task at the given reference time using w. now is injected so callers and tests can use a fixed clock.

func ScoreAll

func ScoreAll(tasks []*taskkit.Task, w Weights, now time.Time) []*taskkit.Task

ScoreAll populates the Urgency field on each task in place and returns the same slice. Callers are responsible for sorting if desired.

Types

type Weights

type Weights struct {
	Age       float64 `yaml:"age"`
	AgeNorm   float64 `yaml:"age_norm"`
	Blocked   float64 `yaml:"blocked"`
	Blocking  float64 `yaml:"blocking"`
	Deadline  float64 `yaml:"deadline"`
	Scheduled float64 `yaml:"scheduled"`
	Tags      float64 `yaml:"tags"`
	Waiting   float64 `yaml:"waiting"`
}

Weights holds the urgency scoring coefficients. Defaults for all fields are defined in config/default.yaml.

Jump to

Keyboard shortcuts

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