Documentation
¶
Overview ¶
Package forecast provides AI-powered project completion forecasting for cloop. It computes velocity-based completion dates with confidence intervals, renders an ASCII burn-down chart, and streams an AI narrative forecast.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForecastPrompt ¶
ForecastPrompt builds the AI prompt for a detailed completion forecast.
Types ¶
type Forecast ¶
type Forecast struct {
Goal string
GeneratedAt time.Time
// Task counts
TotalTasks int
DoneTasks int
SkippedTasks int
FailedTasks int
PendingTasks int
BlockedTasks int
InProgressTasks int
// Velocity metrics (time-based: tasks/day)
BaseVelocityPerDay float64 // tasks/day (baseline)
AvgTaskDuration time.Duration
ProjectStartDate time.Time
// Velocity metrics (minute-based: actual vs estimated)
VelocityRatio float64 // sum(actual_minutes)/sum(estimated_minutes); 1.0 if no data
AvgEstimatedMinutes float64 // average EstimatedMinutes across all tasks with estimates
MinuteDataPoints int // number of tasks with both estimated and actual minutes
// Scenarios
Optimistic Scenario
Expected Scenario
Pessimistic Scenario
// Historical burn-down data (one point per completed task, chronological)
BurnPoints []BurnPoint
// Per-task schedule projections for remaining work
TaskWindows []TaskWindow
// AI-generated narrative
AIText string
}
Forecast holds the full forecasting output.
func Build ¶
func Build(s *state.ProjectState) *Forecast
Build computes a Forecast from the current project state. No AI call is made here.
func (*Forecast) BurndownChart ¶
BurndownChart renders an ASCII burn-down chart (width × height characters).
func (*Forecast) CompletionPct ¶
CompletionPct returns percent of tasks finished (done + skipped).
func (*Forecast) GanttTable ¶
GanttTable renders the per-task schedule projection as an ASCII table.
type Scenario ¶
type Scenario struct {
Label string
VelocityFactor float64 // multiplier applied to baseline velocity
DaysRemaining float64 // -1 = cannot compute
CompletionDate time.Time
Confidence string // "high" | "medium" | "low"
}
Scenario represents one completion estimate (optimistic / expected / pessimistic).
type TaskWindow ¶
type TaskWindow struct {
TaskID int `json:"task_id"`
Title string `json:"title"`
Status string `json:"status"`
Priority int `json:"priority"`
EstimatedMinutes int `json:"estimated_minutes"`
AdjustedMinutes int `json:"adjusted_minutes"` // estimated * VelocityRatio
ProjectedStart time.Time `json:"projected_start"`
ProjectedEnd time.Time `json:"projected_end"`
}
TaskWindow holds per-task schedule projection for the Gantt table.