You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(snapshots): add a lifetime scope, because a TTL straddles two moments
snapshot_cache_ttl shipped in 0.1.5 taking only seconds, and seconds are
the wrong shape for the case it was added for. A run that has pinned one
point in time does not want that answer to change underneath it, and a
TTL expiring mid-run lets the next resolution return a different
snapshot. Nothing raises, and the data is real on both sides of the
expiry; it is simply from two different times. That is the same failure
this area keeps producing, an answer that looks entirely plausible.
"lifetime" resolves once and holds for the life of the client, which
matches the invariant a sync actually relies on: it pinned one snapshot,
and snapshots are immutable. It still yields to an upload through the
same client, because that is an event that makes the answer wrong rather
than merely old, so lifetime means "until something makes it wrong".
Seconds stay right for repeated independent reads, and the docs now say
which shape suits which caller instead of leaving it to be discovered.
Suggested by the Nautobot integration, whose own snapshot cache is
lifetime-scoped for exactly this reason and who pointed out that a TTL
quietly breaks the invariant while looking like a performance knob.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Kbxab7ihjPntGAmnsZtqG
0 commit comments