From 7f22f09f72f70e1d9fba373458c9af8efb6c6200 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 20:18:21 +0000 Subject: [PATCH] fix: separate Compactions and ContextBombsDelivered counters in buildReportData Compactions now counts only EventRun entries where SessionSnapshotPresent is true (genuine compaction events where the PreCompact hook ran). ContextBombsDelivered counts all EventRun entries regardless of snapshot presence. Also adds backward-compatibility handling for entries with an empty EventType field, treating them as EventRun (same logic already present in ReadAll). Fixes #432 Co-Authored-By: Grey Newell Co-Authored-By: Claude Sonnet 4.6 --- cmd/report.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/report.go b/cmd/report.go index 7afd7ef..a00ce47 100644 --- a/cmd/report.go +++ b/cmd/report.go @@ -147,7 +147,12 @@ func buildReportData(filtered []activitylog.Entry, windowLabel string) reportDat for i := range filtered { e := &filtered[i] // Only count EventRun entries for compaction/delivery stats. - if e.EventType != activitylog.EventRun { + // Backward compatibility: old entries without event_type are EventRun. + eventType := e.EventType + if eventType == "" { + eventType = activitylog.EventRun + } + if eventType != activitylog.EventRun { continue } runCount++ @@ -200,7 +205,7 @@ func buildReportData(filtered []activitylog.Entry, windowLabel string) reportDat return reportData{ Window: windowLabel, - Compactions: runCount, + Compactions: snapshots, ContextBombsDelivered: runCount, SessionSnapshotsSaved: snapshots, TotalContextBombBytes: totalBytes,