summaryrefslogtreecommitdiff
path: root/Magefile.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-17 21:33:45 +0300
committerPaul Buetow <paul@buetow.org>2025-09-17 21:33:45 +0300
commit88103657fb230bb41217a06aa5602ae23e7acb8b (patch)
tree524c437e4e40ee5d6713b6ea5414ad975654cc52 /Magefile.go
parent2b6232704ecc90630196b9f829f966533e5cdccd (diff)
feat(stats,tmux): global Σ@window stats across processes with flocked cache; width mitigation (narrow/maxlen); configurable [stats] window_minutes; robust coverage parsing; docs update\n\n- Add internal/stats with windowed event cache + flock + atomic writes\n- Wire stats into LSP/CLI/Tmux Action; tmux shows Σ@window with per-model tail\n- HEXAI_TMUX_STATUS_NARROW and HEXAI_TMUX_STATUS_MAXLEN for width control\n- Add [stats] window_minutes to config and apply on startup\n- Improve Magefile coverage handling; add tests to lift coverage >85%\n- Update docs/tmux.md and config example
Diffstat (limited to 'Magefile.go')
-rw-r--r--Magefile.go23
1 files changed, 16 insertions, 7 deletions
diff --git a/Magefile.go b/Magefile.go
index b297a9d..fdf5389 100644
--- a/Magefile.go
+++ b/Magefile.go
@@ -109,8 +109,8 @@ func RunTmuxAction() error {
// printCoverage prints a warning if an existing coverage profile shows total < coverateThreshold.
func printCoverage() {
- // Ensure the top-level coverage profile is refreshed at least once per day.
- ensureDailyCoverage(24 * time.Hour)
+ // Ensure the top-level coverage profile is refreshed at least once per day.
+ ensureDailyCoverage(24 * time.Hour)
select {
case coveragePrinted <- struct{}{}:
default:
@@ -126,11 +126,20 @@ func printCoverage() {
fmt.Println("[coverage] No coverage profile found (run 'mage cover' or 'mage coverall').")
return
}
- pct, ok := totalCoveragePercent(profile)
- if !ok {
- fmt.Println("[coverage] Could not parse total coverage from", profile)
- return
- }
+ pct, ok := totalCoveragePercent(profile)
+ if !ok {
+ // Attempt a one-time regen if the profile is malformed
+ if err := Coverage(); err == nil {
+ if p2, ok2 := totalCoveragePercent(profile); ok2 {
+ pct = p2
+ ok = true
+ }
+ }
+ }
+ if !ok {
+ fmt.Println("[coverage] Could not parse total coverage from", profile)
+ return
+ }
if pct < coverageThreshold {
fmt.Printf("[coverage] WARNING: total test coverage is %.1f%% (< %.1f%%)\n", pct, coverageThreshold)
} else {