Commit ddc957f
refactor(cli): switch compare to relayburn_sdk::normalize_since (#421)
* refactor(cli): switch compare to relayburn_sdk::normalize_since
`burn compare` was the only presenter still carrying its own
`normalize_since` + Hinnant civil-date math; the SDK has exposed
`normalize_since` for a while and the sibling `summary` and `hotspots`
presenters already use it.
Delete the local helpers and their tests, drop ~380 LOC of duplicated
date plumbing. The cli-golden snapshot still matches.
Closes #333
https://claude.ai/code/session_01VFvKstujMoXwZkP5vwrHxQ
* fix(sdk): canonicalize normalize_since to UTC .mmmZ
Codex / Devin / coderabbit flagged a latent regression on PR #421:
the SDK's `normalize_since` returned relative ranges as `...SSZ` (no
millis) and passed ISO inputs through unchanged. Because the ledger
filter is `ts >= ?` against `.mmmZ` rows in SQLite (lex-compared),
this silently dropped same-second turns (`.` < `Z`) and misordered
offset-bearing cutoffs (e.g. `-07:00` sorting before any UTC row).
This was already true for `burn summary` and `burn hotspots`; PR #421
just made `burn compare` adopt the same behavior. The fix is in the
SDK so all three presenters get consistent, correct date filtering:
- Relative ranges emit canonical `YYYY-MM-DDTHH:MM:SS.000Z` (24 chars).
- ISO inputs parse and re-emit as UTC `.mmmZ`: offsets get converted
(`...-07:00` → `...07:00:00.000Z`), no-fraction widens to `.000Z`,
sub-ms truncates to ms, `Z`/`z` and date-only forms supported.
- Garbage errors out (no more `looks_like_iso` permissive pass-through).
Tests cover each shape and the lex-compare property against ledger rows.
Also rewords the CHANGELOG bullet to be user-impact-first per
coderabbit's note.
https://claude.ai/code/session_01VFvKstujMoXwZkP5vwrHxQ
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 67d7255 commit ddc957f
3 files changed
Lines changed: 292 additions & 419 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
7 | 19 | | |
8 | 20 | | |
9 | 21 | | |
| |||
0 commit comments