MCPcopy Create free account
hub / github.com/ByteYellow/AgentProvenance / attemptsForRun

Function attemptsForRun

internal/provenance/diff.go:290–311  ·  view source on GitHub ↗
(db *sql.DB, runID string)

Source from the content-addressed store, hash-verified

288}
289
290func attemptsForRun(db *sql.DB, runID string) ([]attemptFileView, error) {
291 rows, err := db.Query(`SELECT a.id, a.rollout_id, a.tool_call_id, a.snapshot_id, a.workspace_path,
292 a.strategy, a.command, a.status, a.is_winner, COALESCE(a.artifact_result, '')
293 FROM fork_attempts a JOIN rollouts r ON a.rollout_id = r.id
294 WHERE r.run_id = ?
295 ORDER BY a.created_at ASC`, runID)
296 if err != nil {
297 return nil, err
298 }
299 defer rows.Close()
300 var attempts []attemptFileView
301 for rows.Next() {
302 var item attemptFileView
303 var isWinner int
304 if err := rows.Scan(&item.AttemptID, &item.RolloutID, &item.ToolCallID, &item.SnapshotID, &item.WorkspacePath, &item.Strategy, &item.Command, &item.Status, &isWinner, &item.ArtifactRef); err != nil {
305 return nil, err
306 }
307 item.IsWinner = isWinner != 0
308 attempts = append(attempts, item)
309 }
310 return attempts, rows.Err()
311}
312
313func cleanRelativeFile(value string) (string, error) {
314 if strings.TrimSpace(value) == "" {

Callers 2

BuildDiffFileFunction · 0.85
BuildBlameFileFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected