history

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentStats

type AgentStats struct {
	TotalExecutions int
	SuccessCount    int
	FailureCount    int
	SuccessRate     float64
	AverageDuration time.Duration
}

AgentStats contains statistics for a specific agent

type ExecutionRecord

type ExecutionRecord struct {
	ID            string    `json:"id"`
	AgentName     string    `json:"agent_name"`
	Worktree      string    `json:"worktree"`
	Status        string    `json:"status"` // "completed", "failed"
	StartTime     time.Time `json:"start_time"`
	EndTime       time.Time `json:"end_time"`
	Duration      int64     `json:"duration_ms"`
	Error         string    `json:"error,omitempty"`
	StepsExecuted int       `json:"steps_executed,omitempty"`
	Commits       []string  `json:"commits,omitempty"`
	PRUrl         string    `json:"pr_url,omitempty"`
}

ExecutionRecord represents a single agent execution

type History

type History struct {
	Records []ExecutionRecord `json:"records"`
	// contains filtered or unexported fields
}

History manages execution history

func Load

func Load(worktreeDir string) (*History, error)

Load loads history from worktrees/.history.json

func (*History) Clear

func (h *History) Clear() error

Clear removes all records

func (*History) Query

func (h *History) Query(agentName string, status string, limit int) []ExecutionRecord

Query filters records

func (*History) Record

func (h *History) Record(record ExecutionRecord) error

Record adds an execution record

func (*History) Save

func (h *History) Save() error

Save persists history atomically

func (*History) Stats

func (h *History) Stats() HistoryStats

Stats returns aggregate statistics

type HistoryStats

type HistoryStats struct {
	TotalExecutions int
	SuccessRate     float64
	AverageDuration time.Duration
	ByAgent         map[string]AgentStats
}

HistoryStats contains aggregate statistics

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL