milestone

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Overview

Package milestone implements sprint/release planning for cloop PM mode. Milestones group tasks into named releases or sprints with optional deadlines and provide AI-powered velocity forecasting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPlanPrompt

func BuildPlanPrompt(goal string, plan *pm.Plan, existing []*Milestone) string

BuildPlanPrompt creates a prompt asking the AI to organize tasks into milestones.

func NextID

func NextID(milestones []*Milestone) int

NextID returns one more than the highest existing milestone ID (minimum 1).

func SortByID

func SortByID(milestones []*Milestone)

SortByID sorts milestones by ID ascending.

Types

type ForecastResult

type ForecastResult struct {
	EstimatedDate *time.Time
	DaysRemaining int
	TasksPerDay   float64
	IsOnTrack     bool
	RiskLevel     string // "low" | "medium" | "high"
	Notes         string
}

ForecastResult holds an AI-powered completion prediction.

type Milestone

type Milestone struct {
	ID          int        `json:"id"`
	Name        string     `json:"name"`
	Description string     `json:"description,omitempty"`
	Deadline    *time.Time `json:"deadline,omitempty"`
	TaskIDs     []int      `json:"task_ids"`
	CreatedAt   time.Time  `json:"created_at"`
	CompletedAt *time.Time `json:"completed_at,omitempty"`
}

Milestone groups PM tasks into a named sprint or release.

func FindByName

func FindByName(milestones []*Milestone, name string) *Milestone

FindByName returns the first milestone matching name (case-insensitive prefix match).

func ParsePlan

func ParsePlan(output string, startID int) ([]*Milestone, error)

ParsePlan parses the AI output into a slice of Milestone structs. It handles JSON embedded in markdown code fences.

func Plan

func Plan(ctx context.Context, prov provider.Provider, goal string, plan *pm.Plan, existing []*Milestone, opts provider.Options) ([]*Milestone, error)

Plan calls the AI provider to generate a milestone plan from the current task list.

func (*Milestone) Forecast

func (m *Milestone) Forecast(plan *pm.Plan, sessionStart time.Time) ForecastResult

Forecast computes a completion forecast based on historical task velocity. createdAt is the session start time used to calculate elapsed time.

func (*Milestone) Progress

func (m *Milestone) Progress(plan *pm.Plan) Progress

Progress computes task completion stats for the milestone against the given plan. Tasks not found in the plan are ignored.

func (*Milestone) StatusLabel

func (m *Milestone) StatusLabel(plan *pm.Plan) string

StatusLabel returns a human-readable status considering deadline and progress.

type Progress

type Progress struct {
	Total      int
	Done       int
	InProgress int
	Failed     int
	Pending    int
	Skipped    int
	PctDone    float64 // 0.0-100.0
}

Progress holds computed stats for a milestone against a plan.

Jump to

Keyboard shortcuts

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