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
test(core): route-tuning note 'reset at ...Z' parsed in local time — normalization test fails outside UTC #29
packages/core/test/config/normalization.test.ts → "notes survive normalization and reach the tuner as match and text" fails on unmodified main when the process timezone is not UTC.
Reproduced 2026-10-17 (Bun 1.4.2):
TZ=America/Chicago bun run script/test.ts test/config/normalization.test.ts → 42 pass, 1 fail
TZ=UTC bun run script/test.ts test/config/normalization.test.ts → 43 pass, 0 fail
The note anthropic/claude-opus-5: promo credits, reset at 2026-01-04T00:00:00Z should produce a skip adjustment with until = Date.parse("2026-01-04T00:00:00Z") (1767484800000). Under America/Chicago the tuner returns until = 1767506400000 — exactly +6h, i.e. the Z-suffixed timestamp is being interpreted as local midnight instead of UTC.
Impact
If the parsing path is shared with production (not just the test), a user outside UTC gets route-tuning notes that expire hours early/late. Either way the test suite is red for every non-UTC contributor.
Suggested fix
Parse the note timestamp as UTC when it carries a Z (or normalize through Date.parse on the full ISO string rather than reconstructing a local date), and/or pin the tuner's parsing to UTC. Add a non-UTC regression run for this test.
Found by the issue sweep while verifying #14; unrelated to that change (fails identically on clean main).
Activity