Documentation
¶
Overview ¶
Package selfimprove implements the cloop self-improve meta-command. It collects execution telemetry (metrics, task stats, prompt stats, checkpoint data) and the cloop source tree, then asks the AI to identify performance bottlenecks, missing error handling, and UX gaps with concrete file:line citations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPrompt ¶
BuildPrompt constructs the AI prompt for self-improvement analysis.
Types ¶
type Suggestion ¶
type Suggestion struct {
Rank int `json:"rank"`
Category string `json:"category"` // "performance"|"error_handling"|"ux"|"reliability"|"testing"
Title string `json:"title"`
Description string `json:"description"`
FileCitation string `json:"file_citation"` // "pkg/foo/bar.go:42" or "pkg/foo/"
Impact string `json:"impact"` // "high"|"medium"|"low"
Effort string `json:"effort"` // "small"|"medium"|"large"
}
Suggestion is a concrete improvement recommendation with a source location.
type Telemetry ¶
type Telemetry struct {
MetricsSummary *metrics.Summary
AggStats *taskstats.AggregateStats
PromptStats promptstats.Summary
CheckpointExists bool
CheckpointTaskID int
SourceFileTree string // compact listing of .go source files
}
Telemetry holds all gathered runtime signals used to build the prompt.
func CollectTelemetry ¶
func CollectTelemetry(s *state.ProjectState, workDir, sourceDir, model string) *Telemetry
CollectTelemetry gathers runtime telemetry from the project working directory. The state is loaded by the caller and passed in. workDir is the project root. sourceDir is the root of the cloop source tree (may be empty to skip source scanning).