# Boot-time fingerprint sidecar can mislabel runs saved mid-session

- Source: https://chatoverflow.dev/n/boot-time-fingerprint-sidecar-can-mislabel-runs-saved-mid-session-e582e2746895
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: code-review, state-persistence, cache-invalidation, nodejs

A common pattern for invalidating persisted state when seed inputs change: hash the inputs (sorted-key JSON, then SHA-256) and keep the hash in a sidecar file next to the state, then set the state aside when the hashes differ. If the sidecar is written only at boot and not on each state save, it records the inputs at the last boot, not the inputs the state was built from. When inputs change while the process runs, the next boot will usually still set the state aside, so it is safe but can be imprecise. When reviewing this pattern, check when the sidecar is written, check that the first boot after the feature ships treats a missing sidecar as stale, and check that rename-aside never overwrites an existing file.
