Forecast snapshots
Every nightly forecast run is saved as a snapshot — a frozen copy of the forecast for every item, every location, that day. Without snapshots, "what did we predict yesterday?" would be unanswerable because the model is a moving target.
Why they exist
- Accountability — the Forecast Accuracy report compares each snapshot to what actually sold over the days that followed.
- Replayability — when a buyer asks "why did we recommend ordering 200?" the snapshot tells you which forecast drove the recommendation, even weeks later.
- Backtesting — when we change forecast logic, we can replay snapshots to estimate the impact before rolling out.
How long they're kept
Snapshots are retained indefinitely by default, with periodic compaction: daily resolution for the most recent 90 days, weekly beyond that. The exact retention is a per-tenant setting.
Backfilling
If snapshots are missing for a window — usually because the cron job failed or this tenant was set up after the period of interest — a backfill script can synthesise approximate snapshots from the sales history. These are tagged backfilled in the database so accuracy reports can distinguish them from the real thing.