Repository navigation
test(night): cover the window and briefing on clock-change nights (#222) - #248
Merged
juancguerrerodev merged 6 commits intoDec 6, 2026
Merged
Conversation
10 of 16 tasks
Contributor
|
Ready to merge once the pull request template is filled in, including the "I read and ran everything" box (details on #234). 🦀 |
juancguerrerodev
force-pushed
the
test/night-dst-222
branch
from
December 6, 2026 07:57
aedf860 to
3800c4c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #222
The night shift runs inside a window like 23:00 to 05:00 and sends its morning briefing at a set time (HM-NIGHT-01,
US-NIGHT-01).
packages/night/src/settings.tsdoes that math withlocalMinutes,localInstant,inWindow,briefingDate,briefingTimeandnextWindowStart, but every existing test usesAmerica/Costa_Rica, which has nodaylight saving time, so nothing checked the nights when the clock moves.
What this PR does
describeblock topackages/night/test/settings.test.tsfor the clock-change nights, building instants withDate.UTC(...)and writing the local time each one stands for in a comment. Tests only:settings.tsis unchanged.Tests
America/New_Yorkin 2026, window 23:00 to 05:00:inWindowis true at local 01:30 and 03:30 on both the March 8spring night and the November 1 autumn night (including both instants that read 01:30), and false at local 05:30.
briefingTime("2026-03-08", "07:00", zone)andbriefingTime("2026-11-01", "07:00", zone)give 07:00 local with thatmorning's offset (11:00 UTC and 12:00 UTC).
nextWindowStartfrom local noon on each change day gives 23:00 localthat evening, with that evening's offset.
localMinutesat the two instants that both read 01:30 on November 1 gives90 for both.
America/Santiagoin 2026, same window:inWindowat local 23:30 and 02:00 on the night of April 4 to 5 (includingthe repeated 23:30) and on the night of September 5 to 6,
briefingDatefor instants inside the window, andbriefingTimefor 07:00 the next morning.No result was wrong, so no bug report was needed: the briefing does not fire an hour early on either change night in
either zone.
How to check
Keep in mind
there: what should happen then is a product question.
Pull request template
What and why
Closes #222.
Adds clock-change-night tests for the night shift window and briefing math.
Vision fit
Principle 7, small, typed and tested: the window and briefing rules now have cases where the clock moves, US and Chile included.
Non-negotiables
Checklist
acceptedproposal.pnpm check:privacy,pnpm typecheck,pnpm lint,pnpm testandnode scripts/guard/check.mjs --patterns scripts/guard/patterns.txt. Gate note: privacy and guard pass on this checkout today; the rest was run per package as listed under AI agents, not as one root gate on this Windows machine, where unrelated pre-existing failures appear in the site badges, the devices table and mobile source scans.packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes.Model path
packages/model,agent,skillsoreval, the prompt, the router, tool descriptions, normalizers, examples or the model file.Screenshots
New dependencies and network calls
None. No new dependency and no new network call.
AI agents
What was run: pnpm --filter @hermit/night exec vitest run test/settings.test.ts (19/19); full @hermit/night test at the time; typecheck; eslint.