diff --git a/internal/cmd/refinery.go b/internal/cmd/refinery.go index 5ce3dcb1..8534582c 100644 --- a/internal/cmd/refinery.go +++ b/internal/cmd/refinery.go @@ -277,12 +277,6 @@ func runRefineryStatus(cmd *cobra.Command, args []string) error { fmt.Printf(" Last merge: %s\n", ref.LastMergeAt.Format("2006-01-02 15:04:05")) } - fmt.Printf("\n %s\n", style.Bold.Render("Statistics:")) - fmt.Printf(" Merged today: %d\n", ref.Stats.TodayMerged) - fmt.Printf(" Failed today: %d\n", ref.Stats.TodayFailed) - fmt.Printf(" Total merged: %d\n", ref.Stats.TotalMerged) - fmt.Printf(" Total failed: %d\n", ref.Stats.TotalFailed) - return nil } diff --git a/internal/cmd/witness.go b/internal/cmd/witness.go index e96bab55..1ea7c23c 100644 --- a/internal/cmd/witness.go +++ b/internal/cmd/witness.go @@ -259,10 +259,6 @@ func runWitnessStatus(cmd *cobra.Command, args []string) error { fmt.Printf(" Started: %s\n", w.StartedAt.Format("2006-01-02 15:04:05")) } - if w.LastCheckAt != nil { - fmt.Printf(" Last check: %s\n", w.LastCheckAt.Format("2006-01-02 15:04:05")) - } - // Show monitored polecats fmt.Printf("\n %s\n", style.Bold.Render("Monitored Polecats:")) if len(w.MonitoredPolecats) == 0 { @@ -273,13 +269,6 @@ func runWitnessStatus(cmd *cobra.Command, args []string) error { } } - fmt.Printf("\n %s\n", style.Bold.Render("Statistics:")) - fmt.Printf(" Checks today: %d\n", w.Stats.TodayChecks) - fmt.Printf(" Nudges today: %d\n", w.Stats.TodayNudges) - fmt.Printf(" Total checks: %d\n", w.Stats.TotalChecks) - fmt.Printf(" Total nudges: %d\n", w.Stats.TotalNudges) - fmt.Printf(" Total escalations: %d\n", w.Stats.TotalEscalations) - return nil } diff --git a/internal/refinery/manager.go b/internal/refinery/manager.go index cd82899e..098d918c 100644 --- a/internal/refinery/manager.go +++ b/internal/refinery/manager.go @@ -492,7 +492,7 @@ func (m *Manager) ProcessMR(mr *MergeRequest) MergeResult { return result } -// completeMR marks an MR as complete and updates stats. +// completeMR marks an MR as complete. // For success, pass closeReason (e.g., CloseReasonMerged). // For failures that should return to open, pass empty closeReason. func (m *Manager) completeMR(mr *MergeRequest, closeReason CloseReason, errMsg string) { @@ -512,16 +512,9 @@ func (m *Manager) completeMR(mr *MergeRequest, closeReason CloseReason, errMsg s switch closeReason { case CloseReasonMerged: ref.LastMergeAt = &now - ref.Stats.TotalMerged++ - ref.Stats.TodayMerged++ case CloseReasonSuperseded: - ref.Stats.TotalSkipped++ // Emit merge_skipped event _ = events.LogFeed(events.TypeMergeSkipped, actor, events.MergePayload(mr.ID, mr.Worker, mr.Branch, "superseded")) - default: - // Other close reasons (rejected, conflict) count as failed - ref.Stats.TotalFailed++ - ref.Stats.TodayFailed++ } } else { // Reopen the MR for rework (in_progress → open) @@ -529,8 +522,6 @@ func (m *Manager) completeMR(mr *MergeRequest, closeReason CloseReason, errMsg s // Log error but continue fmt.Fprintf(m.output, "Warning: failed to reopen MR: %v\n", err) } - ref.Stats.TotalFailed++ - ref.Stats.TodayFailed++ } _ = m.saveState(ref) // non-fatal: state file update diff --git a/internal/refinery/types.go b/internal/refinery/types.go index 8d2ae1b7..6526261d 100644 --- a/internal/refinery/types.go +++ b/internal/refinery/types.go @@ -44,9 +44,6 @@ type Refinery struct { // LastMergeAt is when the last successful merge happened. LastMergeAt *time.Time `json:"last_merge_at,omitempty"` - - // Stats contains cumulative statistics. - Stats RefineryStats `json:"stats"` } // MergeRequest represents a branch waiting to be merged. @@ -150,24 +147,6 @@ func DefaultMergeConfig() MergeConfig { } } -// RefineryStats contains cumulative refinery statistics. -type RefineryStats struct { - // TotalMerged is the total number of successful merges. - TotalMerged int `json:"total_merged"` - - // TotalFailed is the total number of failed merges. - TotalFailed int `json:"total_failed"` - - // TotalSkipped is the total number of skipped MRs. - TotalSkipped int `json:"total_skipped"` - - // TodayMerged is the number of merges today. - TodayMerged int `json:"today_merged"` - - // TodayFailed is the number of failures today. - TodayFailed int `json:"today_failed"` -} - // QueueItem represents an item in the merge queue for display. type QueueItem struct { Position int `json:"position"` diff --git a/internal/witness/types.go b/internal/witness/types.go index ec0077b9..077bc2e1 100644 --- a/internal/witness/types.go +++ b/internal/witness/types.go @@ -36,12 +36,6 @@ type Witness struct { // MonitoredPolecats tracks polecats being monitored. MonitoredPolecats []string `json:"monitored_polecats,omitempty"` - // LastCheckAt is when the last health check was performed. - LastCheckAt *time.Time `json:"last_check_at,omitempty"` - - // Stats contains cumulative statistics. - Stats WitnessStats `json:"stats"` - // Config contains auto-spawn configuration. Config WitnessConfig `json:"config"` @@ -67,21 +61,4 @@ type WitnessConfig struct { IssuePrefix string `json:"issue_prefix,omitempty"` } -// WitnessStats contains cumulative witness statistics. -type WitnessStats struct { - // TotalChecks is the total number of health checks performed. - TotalChecks int `json:"total_checks"` - - // TotalNudges is the total number of nudges sent to polecats. - TotalNudges int `json:"total_nudges"` - - // TotalEscalations is the total number of escalations to mayor. - TotalEscalations int `json:"total_escalations"` - - // TodayChecks is the number of checks today. - TodayChecks int `json:"today_checks"` - - // TodayNudges is the number of nudges today. - TodayNudges int `json:"today_nudges"` -}