Versions in this module Expand all Collapse all v1 v1.2.2 Jan 27, 2026 Changes in this version + const BridgeTimeout + const DefaultBridgeURL + var ErrBenchmarkFailed = errors.New("benchmark execution failed") + var ErrConverged = errors.New("loop converged - improvements are below threshold") + var ErrDirtyWorkTree = errors.New("git working tree is dirty - commit or stash changes first") + var ErrInvalidBenchmarkType = errors.New("invalid benchmark type - supported: locomo") + var ErrLoopAlreadyRunning = errors.New("an autonomous loop is already running") + var ErrMaxIterationsReached = errors.New("maximum iterations reached") + var ErrNoImprovement = errors.New("no improvement after multiple iterations") + var ErrNoLoopRunning = errors.New("no autonomous loop is currently running") + var ErrPythonBridgeNotAvailable = errors.New(...) + var ErrRunAlreadyRunning = errors.New("a benchmark run is already in progress") + var ErrRunNotFound = errors.New("benchmark run not found") + func CommitChanges(repoPath, message string) (string, error) + func ComparisonToJSON(comp *Comparison) (string, error) + func CreateBenchmarkBranch(repoPath, branchName string) error + func DefaultCatalogDir() string + func FormatComparison(comp *Comparison) string + func FormatResults(results *RunResults) string + func GenerateImprovementSuggestions(results *RunResults) []string + func GetCommitMessage(repoPath, commitHash string) (string, error) + func RequireCleanWorkTree(repoPath string) error + func ResultsToJSON(results *RunResults) (string, error) + func RevertToCommit(repoPath, commitHash string) error + func SwitchBranch(repoPath, branchName string) error + type BridgeRunRequest struct + BenchmarkType string + Categories []string + MaxQuestions int + RandomSample bool + RunID string + Seed *int + Verbose bool + type BridgeRunResponse struct + Error string + Results struct{ ... } + Success bool + type Catalog struct + func NewCatalog(baseDir string) *Catalog + func (c *Catalog) CleanOldRuns(daysToKeep int) (int, error) + func (c *Catalog) EnsureDirectories() error + func (c *Catalog) GetBest() (*CatalogedRun, error) + func (c *Catalog) GetRunByCommit(commitHash string) (*CatalogedRun, error) + func (c *Catalog) ListRuns(limit int) ([]*CatalogedRun, error) + func (c *Catalog) SaveComparison(comp *Comparison) (string, error) + func (c *Catalog) SaveRun(results *RunResults) (string, error) + func (c *Catalog) UpdateBest(results *RunResults) error + type CatalogedRun struct + ByCategory map[string]CategoryScores + Comparison *ComparisonInfo + Config RunConfig + DurationSec float64 + Git GitState + IsBest bool + Overall OverallScores + RunID string + Timestamp time.Time + type CategoryScores struct + BLEU1Score float64 + Category string + CorrectCount int + F1Score float64 + LLMJudgeAccuracy float64 + TotalQuestions int + func AnalyzeWeakCategories(results *RunResults) []CategoryScores + type Comparison struct + CategoryDiffs map[string]ScoreDiff + ChangedQuestions []QuestionComparison + Improvements []string + OverallDiff ScoreDiff + Regressions []string + RunA string + RunB string + func CompareRuns(runA, runB *RunResults) *Comparison + type ComparisonInfo struct + BaselineAccuracy float64 + BaselineRunID string + Improvement float64 + type CostEstimation struct + CostPerQuestionUSD float64 + InputCostUSD float64 + OutputCostUSD float64 + TotalCostUSD float64 + type GitState struct + Branch string + CommitHash string + Dirty bool + ShortHash string + func CaptureGitState(repoPath string) (*GitState, error) + type LatencyStats struct + MaxSeconds float64 + MeanSeconds float64 + MedianSeconds float64 + MinSeconds float64 + P95Seconds float64 + P99Seconds float64 + StdDevSeconds float64 + type LoopConfig struct + ConvergenceThreshold float64 + MaxIterations int + MinImprovementThreshold float64 + TimeoutMinutes int + func DefaultLoopConfig() *LoopConfig + type LoopManager struct + func NewLoopManager(service *Service, db *database.Database) *LoopManager + func (m *LoopManager) GetState() *LoopState + func (m *LoopManager) IsRunning() bool + func (m *LoopManager) StartLoop(ctx context.Context, config *LoopConfig) (*LoopState, error) + func (m *LoopManager) StopLoop() error + type LoopState struct + BaselineScore float64 + BestRunID string + BestScore float64 + CurrentIteration int + CurrentScore float64 + ElapsedMinutes float64 + ID string + LastChange string + MaxIterations int + StartedAt time.Time + Status LoopStatus + StopReason string + type LoopStatus string + const LoopCompleted + const LoopFailed + const LoopRunning + const LoopStopped + type OverallScores struct + BLEU1Score float64 + F1Score float64 + LLMJudgeAccuracy float64 + TotalCorrect int + TotalQuestions int + type Progress struct + CompletedCount int + CurrentQuestion string + ElapsedSecs float64 + EstimatedRemaining float64 + PercentComplete float64 + RunID string + Status RunStatus + TotalQuestions int + type QuestionComparison struct + Category string + Improved bool + NowCorrect bool + QuestionID string + Regressed bool + WasCorrect bool + type QuestionResult struct + BLEU1Score float64 + Category string + ContextLength int + F1Score float64 + GeneratedAnswer string + GenerationTimeMs int + GoldAnswer string + LLMJudgeLabel int + MemoriesUsed int + QuestionID string + QuestionText string + RetrievalTimeMs int + func IdentifyFailedQuestions(results *RunResults) []QuestionResult + type RunConfig struct + Async bool + BenchmarkType string + ChangeDesc string + MaxQuestions int + QuestionTypes []string + RandomSample bool + Seed *int + TopK int + UseSummaries bool + Verbose bool + func DefaultRunConfig() *RunConfig + func (c *RunConfig) ToJSON() string + type RunResults struct + ByCategory map[string]CategoryScores + CompletedAt *time.Time + Config RunConfig + Cost *CostEstimation + DurationSecs float64 + ErrorMessage string + Git GitState + Latency *LatencyStats + Overall OverallScores + Questions []QuestionResult + RunID string + StartedAt time.Time + Status RunStatus + Tokens *TokenStats + type RunStatus string + const StatusCancelled + const StatusCompleted + const StatusFailed + const StatusPending + const StatusRunning + type Runner struct + func NewRunner(repoPath string) *Runner + func (r *Runner) Cancel(ctx context.Context, runID string) error + func (r *Runner) CheckBridge() error + func (r *Runner) GetProgress(ctx context.Context, runID string) (*Progress, error) + func (r *Runner) Run(ctx context.Context, config *RunConfig) (*RunResults, error) + func (r *Runner) SetBridgeURL(url string) + type ScoreDiff struct + After float64 + Before float64 + Diff float64 + Improved bool + PercentChange float64 + type Service struct + func NewService(db *database.Database, repoPath string) *Service + func (s *Service) CancelRun(ctx context.Context) error + func (s *Service) CheckBridge() error + func (s *Service) Compare(runIDA, runIDB string) (*Comparison, error) + func (s *Service) GetActiveRunID() string + func (s *Service) GetBestRun(benchmarkType string) (*database.BenchmarkRun, error) + func (s *Service) GetLoopState() *LoopState + func (s *Service) GetProgress(ctx context.Context) (*Progress, error) + func (s *Service) GetResults(runID string) (*RunResults, error) + func (s *Service) GetRun(runID string) (*database.BenchmarkRun, error) + func (s *Service) IsLoopRunning() bool + func (s *Service) IsRunning() bool + func (s *Service) ListRuns(filters *database.BenchmarkRunFilters) ([]*database.BenchmarkRun, error) + func (s *Service) Run(ctx context.Context, config *RunConfig) (*RunResults, error) + func (s *Service) SetBridgeURL(url string) + func (s *Service) StartLoop(ctx context.Context, config *LoopConfig) (*LoopState, error) + func (s *Service) StopLoop() error + type TokenStats struct + MeanInput float64 + MeanOutput float64 + Total int + TotalInput int + TotalOutput int