Eval cases with frozen date-dependent answers fail as time passes: 4 of 6 by 18 November with no code change. Pin an as-of clock and test the window edges.
A passing suite that started failing on its own
Tanishka wrote an evaluation suite for the returns agent at Belgavi's Book Store on 20 October 2026. Each case is a help-desk question, such as whether the customer on CASE-6102 can still return order BB-1602, and an expected answer. The agent answers by calling a return_eligibility tool that applies the store's rule: an order may be returned up to and including day 30 after delivery.
The suite passed on the day it was written. Eleven days later one case failed. By 18 November four of the six cases failed. Nobody had changed the agent, the prompt, the model or the tool. The expected answers were literals computed on 20 October, while the tool read the machine's clock on the day the suite ran. Every case about a recent delivery was quietly turning into a different question.
Date-dependent answers are common in agent work: return windows, business-day deadlines, subscription renewals, whether a promotion is active, how old a case is. An eval that mixes a frozen expectation with a live clock tests the calendar, not the agent.
The failure in numbers
The companion example runs the same six cases with two harnesses. The agent under test is a stand-in that calls the tool and repeats its answer, so every failure is the eval's own.
| Run date | Wall-clock harness failures | Pinned harness failures |
|---|---|---|
| 20 Oct 2026 | none | none |
| 31 Oct 2026 | CASE-6103 | none |
| 18 Nov 2026 | CASE-6101, 6102, 6103, 6106 | none |
| 5 Jan 2027 | CASE-6101, 6102, 6103, 6106 | none |
CASE-6103 failed first because its order was delivered exactly 30 days before the suite was written, the last allowed day. One day later it was outside the window. The other three followed as their deliveries aged past 30 days. Two cases, about orders already outside the window in October, kept passing. They still catch a tool that wrongly allows an old return, but they no longer test anything near the window edge, and the suite gives no sign that its coverage of the boundary has gone.
A team that sees these failures has two bad options. It can update the literals, which silently changes what the cases test, or it can mark them flaky, which teaches everyone to ignore the suite.
Pin one clock per case
The fix is to make time an input. Each case carries an as_of date, the tool receives that date instead of reading the clock, and dates in the fixture are stored relative to it.
def pinned_case(case_id, order_ref, delivered_days_before, expected):
return {'id': case_id, 'order': order_ref, 'as_of': date(2026, 10, 20),
'delivered_days_before': delivered_days_before, 'expected': expected}
def run_case(case, agent):
delivered = case['as_of'] - timedelta(days=case['delivered_days_before'])
clock = FixedClock(case['as_of'])
answer = agent.answer(case['order'], tools=build_tools(clock=clock, orders={case['order']: delivered}))
return answer == case['expected']With the pinned harness all six cases pass on every run date. The expected answer is still the literal a reviewer agreed on when the case was written; it is never recomputed from the tool's own rule, or a bug in the rule would grade itself.
Pinning requires the clock to be injectable everywhere the agent's tools read time. In Java that is a java.time.Clock passed to the service; in Python, a callable or an object with a now() method passed to each tool. Patching the global clock in the test process is weaker, because tools that run in another process, a container or a remote service keep the real time.
Test the boundary on purpose
The original suite caught an off-by-one bug only by luck. In the example, an implementation that uses < instead of <= makes day 30 a refused day. On the authored date, CASE-6103 happens to be a day-30 case and catches it. Change the fixture slightly and nothing would.
So for every date-dependent rule, add boundary variants of one case: day 29, day 30 and day 31 relative to as_of, with expected answers written from the policy text. In the example the off-by-one implementation fails CASE-6101/day 30, a variant that exists precisely to test the edge. Boundary variants cost three cases per rule and remove the dependence on whatever dates the original author happened to pick.
Make the agent see the date too
Pinning the tool's clock is not enough if the model also reasons about dates. If the system prompt says today is 18 November while the tool computes eligibility as of 20 October, the agent may notice the contradiction and argue with its own tool. Pass the same as_of into the prompt or context the harness builds, and record it in the eval result. When a case's answer depends on the date, store the date it was evaluated against beside the score, so a later reader can tell a regression from a calendar effect.
Detect expectations that changed meaning
A check that runs before grading can find wall-clock cases still in the suite. For each case with a frozen literal, evaluate the reference rule at the run date and compare it with the literal. In the example, stale_expectations lists the same four cases the wall-clock harness failed. Run it in continuous integration and fail the build when a case has no as_of, rather than waiting for scores to drift.
Other places the live clock leaks into evals:
- Fixtures that store absolute dates generated at authoring time, like
delivered: 2026-10-18, with noas_ofbeside them. - Tools that call a live calendar or holiday service, whose answer changes when the service updates next year's holidays.
- Graders that check a quoted deadline against
today + 14 dayscomputed at grading time. - Time zones: the same instant is a different calendar day in Kolkata and in California, so the boundary case can pass in one region's runner and fail in another.
What stays deterministic
The rule, the clock and the expected answers are deterministic and reviewable. The model's job in the eval is to call the tool, read its answer and phrase the reply. A date-dependent case that fails under a pinned clock is a real failure of the agent or the tool; under a wall clock it might only mean that time passed.
Tradeoffs
Pinning the clock makes cases stable, and it also makes them blind to bugs that only appear with real time: a time-zone database update, a daylight-saving change, a leap day or a year boundary. Keep a small set of cases that deliberately run at chosen dates across those boundaries, each with its own as_of, rather than relying on the calendar to supply them by accident.
Relative dates also need care. "Delivered 29 days before as_of" is stable; "delivered last Monday" depends on which weekday as_of falls on, so a case that moves its as_of changes meaning. Store the smallest relative fact the rule needs, usually a day count, and keep the reviewed expectation next to it. When the policy itself changes, for example the window moves from 30 to 45 days, update the cases on purpose in the same change as the tool, and review the diff of expected answers.
Where to start
- Grep fixtures and tool code for clock reads:
date.today,datetime.now,Instant.now,System.currentTimeMillis. - Add a clock parameter to every tool that reads time, defaulting to the system clock in production.
- Add
as_ofto every eval case and store dates relative to it; keep the reviewed expected answers as literals. - Add boundary variants for each date rule.
- Record
as_ofwith every eval result, and fail continuous integration on cases without it.
When this does not matter
If no tool and no expected answer depends on the current date, there is nothing to pin. If a case is meant to test behaviour on the real current date, such as a production smoke test that a promotion is live today, keep it out of the regression suite and label it as a live check, with an owner who expects it to change.