Remove stats from .runtime/*.json observable state (gt-lfi2d)
Remove Stats fields from witness and refinery types that tracked observable metrics (total counts, today counts). These are now handled by the activity stream/beads system instead. Removed: - WitnessStats type and Stats field from Witness - RefineryStats type and Stats field from Refinery - LastCheckAt field from Witness - Stats display from gt witness status - Stats display from gt refinery status - Stats increment code from refinery.completeMR() Kept minimal process state: - RigName, State, PID, StartedAt (both) - MonitoredPolecats, Config, SpawnedIssues (witness) - CurrentMR, PendingMRs, LastMergeAt (refinery) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user