Skip to content

daily-cache: surgical tz-migration de-dup to replace the reverted coverage floor #770

Description

@iamtoruk

PR #762's P2 coverage floor was reverted before merge after adversarial verification: on a forced timezone re-derive against a real cache copy it dropped a genuine, non-duplicated carried day (claude 2026-06-18, 399.70 USD, 1,572 calls) that exists nowhere else, and the floor also engaged on every non-tz complete-parse re-derive, where the same drop class is latent for any mid-range source hole. The bounded alternative it fixes (a midnight-adjacent turn double-counting on the old and new bucket day after a tz change, roughly 117 USD over-count on the same dataset) is the smaller error and biases toward preservation, which is the store's declared bias.

The surgical design this issue tracks, per the review: on a tzChanged re-derive, identify the specific turns the fresh parse re-bucketed across midnight and subtract only their contribution from the carried old-day slice, instead of blanket-blocking carried slices by a per-provider coverage floor. This distinguishes 'semantics moved the data' from 'sources are gone' (the deferred finding #3 from the #755 review thread), which presence-based carry cannot.

The reverted implementation and its test suite live in #762's history (commit e07f324 and the lane doc removed in the split commit); the repro proving the loss is preserved in the review record. P3 from that PR (single-slice turn attribution) shipped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions