Documentation
¶
Index ¶
- Constants
- type ConfigBlock
- type DB
- func (db *DB) Close() error
- func (db *DB) CreateBlock(name, blockType, content string) (int64, error)
- func (db *DB) CreateExperiment(exp *models.Experiment) (int64, error)
- func (db *DB) DeleteAllExperiments() error
- func (db *DB) DeleteBlock(id int64) error
- func (db *DB) DeleteExperiment(id int64) error
- func (db *DB) DeleteMessages(runID int64) error
- func (db *DB) DeleteToolUsage(runID int64) error
- func (db *DB) GetBlock(id int64) (*ConfigBlock, error)
- func (db *DB) GetExperimentByID(id int64) (*models.Experiment, error)
- func (db *DB) GetExperimentToolCounts(experimentID int64, filter string) (map[int64]map[string]int, error)
- func (db *DB) GetExperiments() ([]models.Experiment, error)
- func (db *DB) GetGlobalStats() (map[string]interface{}, error)
- func (db *DB) GetLintResults(runID int64) ([]models.LintIssue, error)
- func (db *DB) GetMessages(runID int64, limit, offset int) ([]models.Message, error)
- func (db *DB) GetRunByID(runID int64) (*models.RunResult, error)
- func (db *DB) GetRunFiles(runID int64) ([]*models.RunFile, error)
- func (db *DB) GetRunMetrics(runID int64) (*parser.AgentMetrics, error)
- func (db *DB) GetRunResults(expID int64, limit, offset int) ([]models.RunResult, error)
- func (db *DB) GetRunStdout(runID int64) (string, error)
- func (db *DB) GetTestResults(runID int64) ([]models.TestResult, error)
- func (db *DB) GetToolStats(experimentID int64, filter string) ([]models.ToolStatRow, error)
- func (db *DB) GetToolUsage(runID int64) ([]models.ToolUsage, error)
- func (db *DB) ListBlocks(blockType string) ([]ConfigBlock, error)
- func (db *DB) SaveLintResults(results []models.LintIssue) error
- func (db *DB) SaveMessage(m *models.Message) error
- func (db *DB) SaveRunEvent(runID int64, evtType string, payload any) error
- func (db *DB) SaveRunFile(f *models.RunFile) error
- func (db *DB) SaveRunResult(r *models.RunResult) (int64, error)
- func (db *DB) SaveRunTelemetry(t *RunTelemetry) error
- func (db *DB) SaveTestResults(results []models.TestResult) error
- func (db *DB) ToggleExperimentLock(id int64, locked bool) error
- func (db *DB) UpdateBlock(id int64, name, blockType, content string) error
- func (db *DB) UpdateExecutionControl(expID int64, control string) error
- func (db *DB) UpdateExperimentAIAnalysis(id int64, analysis string) error
- func (db *DB) UpdateExperimentAnnotations(experimentID int64, annotations string) error
- func (db *DB) UpdateExperimentDuration(experimentID int64, duration int64) error
- func (db *DB) UpdateExperimentError(experimentID int64, errMsg string) error
- func (db *DB) UpdateExperimentProgress(id int64, completed, total int) error
- func (db *DB) UpdateExperimentReport(experimentID int64, reportContent string) error
- func (db *DB) UpdateExperimentStatus(id int64, status string) error
- func (db *DB) UpdateRunLogs(runID int64, stdout, stderr string) error
- func (db *DB) UpdateRunStatus(id int64, status string) error
- func (db *DB) UpdateRunStatusAndReason(runID int64, status string, reason string) error
- func (db *DB) WithTransaction(fn func(tx *sql.Tx) error) error
- type RunTelemetry
Constants ¶
const ( ExperimentStatusRunning = "RUNNING" ExperimentStatusCompleted = "COMPLETED" ExperimentStatusAborted = "ABORTED" )
Experiment Statuses
const ( RunStatusQueued = "QUEUED" RunStatusRunning = "RUNNING" RunStatusCompleted = "COMPLETED" RunStatusAborted = "ABORTED" )
Run Statuses
const ( ReasonSuccess = "SUCCESS" ReasonFailedValidation = "FAILED (VALIDATION)" ReasonFailedLoop = "FAILED (LOOP)" ReasonFailedError = "FAILED (ERROR)" ReasonFailedTimeout = "FAILED (TIMEOUT)" )
Run Reasons
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigBlock ¶
type ConfigBlock struct {
ID int64 `json:"id"`
Name string `json:"name"`
Type string `json:"type"` // "agent", "system_prompt", "context", "settings", "mcp_server", "extension"
Content string `json:"content"`
}
ConfigBlock represents a reusable configuration component.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) CreateBlock ¶
CreateBlock creates a new configuration block.
func (*DB) CreateExperiment ¶
func (db *DB) CreateExperiment(exp *models.Experiment) (int64, error)
func (*DB) DeleteAllExperiments ¶
func (*DB) DeleteBlock ¶
DeleteBlock deletes a configuration block by ID.
func (*DB) DeleteExperiment ¶
func (*DB) DeleteMessages ¶
func (*DB) DeleteToolUsage ¶
func (*DB) GetBlock ¶
func (db *DB) GetBlock(id int64) (*ConfigBlock, error)
GetBlock retrieves a configuration block by ID.
func (*DB) GetExperimentByID ¶
func (db *DB) GetExperimentByID(id int64) (*models.Experiment, error)
GetExperimentByID fetches detailed experiment data and calculates real-time aggregated stats
func (*DB) GetExperimentToolCounts ¶
func (*DB) GetExperiments ¶
func (db *DB) GetExperiments() ([]models.Experiment, error)
GetExperiments fetches all experiments with summary stats
func (*DB) GetGlobalStats ¶
GetGlobalStats returns aggregate stats across all experiments
func (*DB) GetMessages ¶
func (*DB) GetRunByID ¶
GetRunByID fetches a single run result by ID
func (*DB) GetRunMetrics ¶
func (db *DB) GetRunMetrics(runID int64) (*parser.AgentMetrics, error)
GetRunMetrics calculates aggregated metrics purely from run_events. This ensures the DB event log is the Single Source of Truth.
func (*DB) GetRunResults ¶
GetRunResults fetches a list of runs with relevant metrics
func (*DB) GetTestResults ¶
func (db *DB) GetTestResults(runID int64) ([]models.TestResult, error)
func (*DB) GetToolStats ¶
func (*DB) ListBlocks ¶
func (db *DB) ListBlocks(blockType string) ([]ConfigBlock, error)
ListBlocks retrieves all configuration blocks, optionally filtered by type.
func (*DB) SaveRunEvent ¶
func (*DB) SaveRunTelemetry ¶
func (db *DB) SaveRunTelemetry(t *RunTelemetry) error
SaveRunTelemetry saves final run status and test/lint results. Note: Tools and Messages are now handled via run_events and views, so we don't save them here.
func (*DB) SaveTestResults ¶
func (db *DB) SaveTestResults(results []models.TestResult) error
func (*DB) UpdateBlock ¶
UpdateBlock updates an existing configuration block.