complexity

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 complexity implements AI-powered T-shirt size complexity estimation for PM tasks. It rates each task with a T-shirt size (XS/S/M/L/XL) and corresponding Fibonacci story points (1/2/3/5/8/13) based on description, dependencies, codebase context, and similar completed tasks from history.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidSize

func IsValidSize(s string) bool

IsValidSize returns true if s is a known T-shirt size.

func PointsForSize

func PointsForSize(size string) int

PointsForSize returns the Fibonacci story points for a given T-shirt size. Returns 0 for unknown sizes.

func SelectCalibrationSamples

func SelectCalibrationSamples(plan *pm.Plan, maxN int) []pm.Task

SelectCalibrationSamples picks up to maxN completed tasks that are most relevant as calibration examples. It prefers tasks with known story points, then tasks with actuals, then by recency.

Types

type ComplexityEstimate

type ComplexityEstimate struct {
	TaskID       int      `json:"task_id"`
	TaskTitle    string   `json:"task_title"`
	Size         string   `json:"size"`          // XS/S/M/L/XL
	StoryPoints  int      `json:"story_points"`  // 1/2/3/5/8/13 Fibonacci
	Rationale    string   `json:"rationale"`     // 2-3 sentence explanation
	Confidence   string   `json:"confidence"`    // low/medium/high
	SimilarTasks []string `json:"similar_tasks"` // completed task titles used as calibration
}

ComplexityEstimate holds the AI-generated complexity assessment for a single task.

func Estimate

func Estimate(ctx context.Context, prov provider.Provider, model string, task *pm.Task, plan *pm.Plan, completedSamples []pm.Task) (*ComplexityEstimate, error)

Estimate calls the AI to produce a complexity estimate for the given task. completedSamples are used as calibration anchors (pass SelectCalibrationSamples result).

Jump to

Keyboard shortcuts

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