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
{{ message }}
Repository navigation
Commit 510a4bd
Browse filesBrowse the repository at this point in the historyBrowse files
test(objectql): pin the temporal-comparand door fixture's clock with fake timers (#8937) (#8939)
* test(objectql): de-calendar the temporal-comparand door fixture (#8937)
The [#8690] door suite pinned its clock at 2026-08-15T09:00:00.000Z, threaded
it as `{ context: { now } }`, and asserted the `{30_days_ago}` floor equalled
that instant minus 30 days. The assertion held only while the real date and
the fixture date agreed: at 2026-08-16T00:00Z it went red on every branch at
once, with no code change, blocking the merge queue for everyone.
The clock it threaded does not exist. `now` is declared neither on
`ExecutionContextSchema` (@objectstack/spec) nor on `ExecutionContextLike`
(@objectstack/core), and nothing on the engine read path reads it --
`filterTokenContextFrom` takes an explicit `now` argument the engine never
passes, so `resolveFilterTokens` falls back to the process clock. The
`as never` casts on those calls were the tell.
Every temporal expectation is now derived rather than written down: the
fixture seeds from the real clock (38-in / 13-out holds at any wall time, with
two days of margin), and the floor is compared against what the platform's own
resolver yields, bracketing the engine call so a UTC-midnight crossing is
absorbed exactly rather than tolerated. Two added cases keep that comparison
honest: one shows the resolver is genuinely clock-sensitive (so agreement with
it is a real statement, not two constants matching), and one records as a
tested fact that an injected `context.now` is inert today.
Whether the engine SHOULD expose a declared, injectable clock is #8937's
remaining half -- a public-contract question left open here, not assumed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fgvh1iEJfxetei7aNVdtJt
* test(objectql): pin the clock with fake timers, matching sibling suites (#8937)
Supersedes the derive-from-real-clock approach in the previous commit with this
package's established convention for pinning a clock in an engine test:
`vi.useFakeTimers({ toFake: ['Date'] })` + `vi.setSystemTime(PINNED_NOW)`, as
used by engine-cel-default-temporal-shape and the three engine-autonumber-*
suites. `toFake: ['Date']` keeps real timers, so the engine's async paths are
untouched.
This is strictly better here. The engine resolves `{30_days_ago}` against the
PROCESS clock, so pinning that clock makes the original readable assertion
(floor === '2026-07-16') deterministic forever instead of replacing it with a
bracketed comparison against a resolver-derived value. The written dates are
honest again: they are what the code under test actually sees.
The two companion cases are kept and simplified against the pinned clock: one
shows the resolver genuinely tracks the instant it is handed (so the pin is not
two constants agreeing), and one records as a tested fact that an injected
`context.now` is inert today.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fgvh1iEJfxetei7aNVdtJt
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments