Public: anyone can read this; the crew can change it.
"Today" is the agent's day in their own time zone, set on the Profile, so at 6 pm Eastern the clock does not already show tomorrow #171
Check · Review · Land · Live done — Landed and live in production.
"Today" is now the agent's day in the time zone saved on the Profile, so at 7:30 pm Eastern the clock still shows today. The full bun test passes (570 tests). I could not run bun x tsc --noEmit: the repo has no TypeScript dependency or tsconfig.json, so the type check is unverified.
shipped production is serving it deploy d2eada7
1 earlier comment · 1 event
"Today" is now the agent's day in the time zone saved on the Profile, so at 7:30 pm Eastern the clock still shows today. The full bun test passes (570 tests). I could not run bun x tsc --noEmit: the repo has no TypeScript dependency or tsconfig.json, so the type check is unverified. scripts/gate.ts and scripts/design-lint.ts don't exist here, and I touched nothing in src/web/.
What changed
- Time zone on the Profile. It is stored as an IANA name, with the default
America/New_York. It is checked againstIntl.supportedValuesOf("timeZone")(plusUTC), and anything else gets a 422 whose message says "time zone", with thezonefield highlighted on the form. The Profile page offers a select of the six US zones and keeps a stored zone that isn't one of them. A save that leaveszoneout keeps the saved one, likeline. The permit cell is unchanged: the update stays admin-only. - One function in
src/dates.ts.today(zone, now)replaces the process clock, anddayOf(agent)reads it from the profile. The formatter is made once per zone. Everytoday()read insrc/routes.ts,src/mcp.ts,src/terminal.ts,src/sample.tsandsrc/reminders.tsnow passes the profile's zone. The clock, This week, People, the Monday sheet, today's reminders,/tick, the API, MCP and the terminal all go through that.today()with no argument still falls back toAmerica/New_York, which keeps the existing tests unchanged. Dates stay plainYYYY-MM-DDstrings. - Stored moments show as days in that zone. Done, waived, sent and fell-through days, and the CSV exports, are now derived in the agent's zone. Without this, a message sent at 7:30 pm Eastern showed as sent tomorrow.
DealViewcarrieszone, pluswaived_on,sent_onandDraft.sent_on. - Migration. The new one is appended and pinned in
src/migrations.pin.json; a database from before it boots with the default zone. I re-emittedcontract/openapi.jsonfor the newzonefield. - Tests.
src/timezone.test.tsis new. It fixes 2026-11-09T00:30Z: New York gives 2026-11-08 and a date due 2026-11-08 is not overdue, whileUTCgives 2026-11-09. It also covers zone validation, the select, admin-only saves,/tickfollowing the saved zone, and a pre-zone database booting with the default. - Docs. README "Make it yours" has the one sentence about setting the time zone.
docs/TECHNICAL.mdno longer says dates followTZand says what replaced it.
Existing tests I changed
waive.test.tsandfell.test.ts: they compared a UTC timestamp's date withtoday(), which only held when the UTC and Eastern dates agree. They now compare the derived day.profile.test.ts: expects the newzonefield.people.test.ts: its hand-built sent rows gainsent_on.migrations.test.ts: the old-database replay excludes the zone migration too.
What I chose not to do
- Sample timestamps: I left them on their own UTC-based anchoring.
- Zone lookup:
zoneOf(db)is cached per database and cleared on a profile save, so the "profile is one read per request" test still holds.
To try it
Open /profile as an admin, pick Pacific, save, and compare /tick's on with the Pacific date.
Two changes before this can land.
- Both doors (fix first). The terminal profile editor (
onProfileinsrc/terminal.ts, prompt steps name/brokerage/phone/email/line) has no time-zone step. A person can set the zone on the page, and over the API and MCP, but not in the terminal. Add a step ("Your time zone (enter keeps America/New_York)"), passzonetosetProfile, and show the zone on the terminal profile view. Update theprofileline in the header comment, and add a terminal test that saves a zone and then seestodaychange.
- Make 'one function' true.
today(zone = DEFAULT_ZONE, now)quietly answers Eastern when a caller leaves the zone out. That is how a missed call site (a route, a tool or a tty view that reads 'today' without the profile's zone) goes unnoticed, and it is why the existing tests passed untouched. Makezonea required argument, so the compiler and the tests find every caller that was not converted. Then confirm that/tick, the/apitally and people, progress, and the terminal's own clock all take the zone from the profile. The diff I could read stops atsrc/routes.tsline ~1050, so I could not check those, and the base still callstoday()bare atroutes.ts:1360,1414,1431and1461.
Minor: src/csv.ts has a doubled blank line after ACTIVITY_COLUMNS. Also run bun x tsc --noEmit if you can. The pull says the type check was not run.
What holds: the zone is validated at the boundary, with a 422 naming zone, and the update stays admin-only through permit, with no cell loosened. Formatters are cached per zone, the migration is appended and pinned, and the README and TECHNICAL.md are updated.
"Today" is now the agent's day in the time zone saved on the Profile, and all three doors set it: the page, the API and MCP, and now the terminal. The full bun test passes (571 tests).
Changes since the first push
zoneis required.today(zone, now)insrc/dates.tsno longer defaults to Eastern. Source has no baretoday()caller left; the only mentions are two doc comments insrc/deals.ts.- The cited routes take the zone from the profile.
routes.ts/tick(1361), the/apitally (1415), people (1432) and progress (1462) all usedayOf(agentFor(c)). Your line numbers match the base; this pull already converted them. - The terminal's clock takes the zone from the profile (
zoneOf(db)), as do the MCP tools andsample.ts. - Tests. Existing tests that called
today()bare now saytoday(DEFAULT_ZONE), so they stay in Eastern on purpose. - Terminal profile editor.
- New step. onProfile gains "Your time zone (enter keeps America/New_York; a name such as America/Chicago)" and passes zone to setProfile.
- View and docs. The profile view shows a Time zone line, and the header comment now lists it.
- Existing test. The existing profile-editor test needed one extra Enter for the new step.
- New test. It sets Pacific/Kiritimati, sees the zone and the header date change, and switches back to America/New_York. It also checks that an unknown name is refused.
csv.ts. The doubled blank line is gone.
Type check
bun x tsc --noEmit can't run here: the repo has no TypeScript dependency or tsconfig.json, and that command prints help. I ran tsc from a temporary install in $TMPDIR with a guessed strict config. It reports many errors that look unrelated, such as routes.ts 476 missing DealView and the Result.value narrowing in tests, and none are about a missing zone argument. I did not compare against the base, so I can't say all of them were already there. This is not a clean type check.
Earlier asks (zone required in today(), routes /tick, tally, people and progress taking the profile zone, the terminal profile editor with a zone step and its test, the csv blank line) are reported met by the builder, and the visible diff agrees: today(zone, now) has no default, one formatter per zone, migration appended and pinned, openapi and docs updated, permit cells untouched. The preview needs a sign-in so I could not drive the Profile there, and the diff I was given was cut before src/profile.ts, routes.ts and terminal.ts, so those rest on the builder's report and the tests. Non-blocking: tsc is not verifiable in this repo.
"Today" is now the agent's day in the time zone saved on the Profile, so at 7:30 pm Eastern the clock still shows today. The full
bun testpasses (570 tests). I could not runbun x tsc --noEmit: the repo has no TypeScript dependency ortsconfig.json, so the type check is unverified.scripts/gate.tsandscripts/design-lint.tsdon't exist here, and I touched nothing insrc/web/.What changed
America/New_York. It is checked againstIntl.supportedValuesOf("timeZone")(plusUTC), and anything else gets a 422 whose message says "time zone", with thezonefield highlighted on the form. The Profile page offers a select of the six US zones and keeps a stored zone that isn't one of them. A save that leaveszoneout keeps the saved one, likeline. The permit cell is unchanged: the update stays admin-only.src/dates.ts.today(zone, now)replaces the process clock, anddayOf(agent)reads it from the profile. The formatter is made once per zone. Everytoday()read insrc/routes.ts,src/mcp.ts,src/terminal.ts,src/sample.tsandsrc/reminders.tsnow passes the profile's zone. The clock, This week, People, the Monday sheet, today's reminders,/tick, the API, MCP and the terminal all go through that.today()with no argument still falls back toAmerica/New_York, which keeps the existing tests unchanged. Dates stay plainYYYY-MM-DDstrings.DealViewcarrieszone, pluswaived_on,sent_onandDraft.sent_on.src/migrations.pin.json; a database from before it boots with the default zone. I re-emittedcontract/openapi.jsonfor the newzonefield.src/timezone.test.tsis new. It fixes 2026-11-09T00:30Z: New York gives 2026-11-08 and a date due 2026-11-08 is not overdue, whileUTCgives 2026-11-09. It also covers zone validation, the select, admin-only saves,/tickfollowing the saved zone, and a pre-zone database booting with the default.docs/TECHNICAL.mdno longer says dates followTZand says what replaced it.Existing tests I changed
waive.test.tsandfell.test.ts: they compared a UTC timestamp's date withtoday(), which only held when the UTC and Eastern dates agree. They now compare the derived day.profile.test.ts: expects the newzonefield.people.test.ts: its hand-built sent rows gainsent_on.migrations.test.ts: the old-database replay excludes the zone migration too.What I chose not to do
zoneOf(db)is cached per database and cleared on a profile save, so the "profile is one read per request" test still holds.To try it Open
/profileas an admin, pick Pacific, save, and compare/tick'sonwith the Pacific date.Closes #163