mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-10-26 08:39:39 +00:00
Add src/period-diff.ts: pure period-vs-period difference engine. Totals come from the shared buildPeriodData rules; contributions per project and per model carry status new/gone/up/down/flat with pct=null at A=0 (labeled New, never an infinite percentage); normalized views per day and per 100 calls print their denominators; day arithmetic walks local midnights so DST and month boundaries count calendar days. historyBasis cross-checks the durable daily cache and reports aggregate-only carried days separately instead of force-reconciling them into the totals. diffSessions joins the drill-down on the canonical session identity (provider + project path + sessionId), attributing the model's own slice for the model lens. New command: compare-periods --format json|sessions with explicit --from-a/--to-a/--from-b/--to-b (local YYYY-MM-DD, validated loudly) defaulting to the last seven complete days vs the seven before, plus --provider and the existing --project/--exclude filtering. Range slicing reuses parseAllSessions' call-granularity behavior, so a session straddling the boundary contributes to each side by its own calls. Tests: engine fixtures including the X/Y/Z acceptance reconciliation, A=0/B=0, unequal lengths, DST and month walks, carried history, a real-parse boundary session split by call and joined back into one drill-down row, and CLI runs on a temp HOME fixture. |
||
|---|---|---|
| .. | ||
| perf | ||
| release-acceptance | ||
| upgrade-path | ||
| bundle-litellm.mjs | ||
| sign-plugin.mjs | ||
| smoke-plugin-socket.mjs | ||