Skip to content

v0.25.3: session analytics correctness, data-safety fixes, 22 new tests

Choose a tag to compare

@joryeugene joryeugene released this 22 Feb 20:12
· 207 commits to main since this release

What's Changed

Session Analytics Correctness

avg_duration cap raised from 12h → 24h (serve.py)
Real production data from 321 session-meta files showed 18 sessions exceeding 480 min. Legitimate 9-hour coding sessions were incorrectly excluded by the 720-min ceiling. Sessions above 1440 min (24h) are definitively corrupted/unclosed and are still excluded.

JSONL read window expanded (storage.py)
Large active JSONL files reach 1.4 MB in production. The two-pass read (head + tail) now covers 32 KB at the start and 20 KB at the end (up from 20 KB + 10 KB). This doubles tool-diversity coverage for long sessions, reducing misclassification of deep sessions as medium.

Histogram window aligned to KPI window (serve.py)
The session histogram was using days_back=7 while KPIs used days_back=30. This caused the 21-50 and 51+ message buckets to always show 0. Both now use 30 days.

Data-Safety Fixes

  • Atomic stats writes (temp file + rename) prevent partial-write corruption on crash
  • Backup error propagation: backup failures now surface instead of silently continuing
  • JSONL overlap prevention in two-pass session reads
  • Score ceiling enforced on session quality metrics
  • Newline sanitization in log injection paths
  • Release recipe moved to tracked justfile with auto-commit for ruff format rewrites

Tests

22 new unit tests across 3 files — each covering a real bug path:

Class Count What it guards
TestToolCountsParsing 6 tool_counts accumulation, tail-read for >52 KB files, active_dirs dedup, malformed content safety
TestSessionDurationRender 4 duration span for completed vs live sessions, zero-duration branching, hours+minutes format
TestSessionDepthClassification 5 shallow/medium/deep boundary conditions at 5-msg and 15-msg+4-tool thresholds
TestAvgDurationCap 5 boundary at 1440 min, exclusion at 1441 min, 22921-min corrupted session does not skew average

test_skips_stale_jsonl renamed → test_idle_session_still_returned: active_dirs from lsof provides positive confirmation the process is alive, so mtime filtering is no longer applied.

Full test suite: 1960 passed, 0 failures.


Full Changelog: v0.25.2...v0.25.3