Unit 07.03: Context that was true last week
A fact in the state carries no indication of when it stopped being true.
Per-fact age against per-fact budget
How long a fact stays usable depends on how often that kind of fact changes.
The example below checks three facts against budgets derived from their change frequency.
fact age budget status
payment terms are 30 days 9d 365d ok
account balance is 240.00 28d 1d STALE -- re-fetch
the customer's plan is 'individual' 58d 30d STALE -- re-fetch
The balance is 28 days old against a budget of one. It will be used with exactly the same confidence as the payment terms, which are 9 days old against a budget of 365.
A single global staleness rule cannot handle both. Set to a day it re-fetches contract terms constantly; set to a year it uses month-old balances. The budget has to belong to the fact.
The mistake this prevents
The mistake is assuming a long-running workflow re-reads what it needs. It reads once, at the step that needed it, and carries the value forward - so in a run that pauses for a two-day approval, everything read before the pause is two days old afterwards.
Takeaway
Give each fact an as-of date and a budget based on how often it changes, and re-fetch when it is past. Long pauses make everything read before them stale.
