Repository navigation
Description
Problem
pm-stack/aggregator/src/alerts.ts mergeQuiet (alerts.ts:88-99) accepts any non-empty string as the quiet-hours timezone:
if (typeof q.tz === "string" && q.tz.trim()) out.tz = q.tz.trim();There is no validity check. The value is persisted via validateNewSubscription → upsertSubscription, and the only consumer, inQuietHours (alerts.ts:108-132), builds an Intl.DateTimeFormat with that zone inside a try/catch whose catch returns false — "unknown tz — do not suppress". So a subscription stored with tz: "Not/AZone" or tz: "banana" has quiet hours that silently never apply, forever: dashboard-class notifications are never suppressed, at any hour, with no error anywhere. That is the opposite failure direction from a typo'd time, and it contradicts this parser's own established contract — every other malformed field in mergeQuiet falls back to the default instead of being stored verbatim.
Evidence (verified this run)
Laptop probe importing the real alerts.ts at main fa28f499 (md5 933468e2…, identical in both clones; probe dir ~/git/fleet/probe-2026-11-02-laneB-quiettz/, log probe.log):
- Control:
inQuietHours(mergeQuiet({}), 2026-01-15T06:00Z = 00:00 CST)→true; at18:00Z = 12:00 CST→false— default prefs behave correctly. mergeQuiet({ tz: "Not/AZone" })→ stored verbatim:{ start: "23:00", end: "07:00", tz: "Not/AZone", enabled: true }- Same prefs at 00:00 CST (deep inside the 23:00–07:00 window) →
inQuietHoursreturnsfalse— quiet hours never apply. mergeQuiet({ tz: "banana" })→tz: "banana"stored; at midnight CST →false.
Why it matters
Quiet prefs are user-supplied subscription input. A client bug or hand-edited payload that emits a bad zone name is silently stored and then silently disables suppression for that subscription — the user believes they have quiet hours and gets woken at 03:00 anyway, and nothing in the ledger or logs says why. The fix follows the parser's own precedent: validate and fall back to the default, don't store garbage.
Acceptance criteria
-
mergeQuietaccepts atzonly if it is a real IANA zone name (e.g. constructingIntl.DateTimeFormatwith it does not throw); anything else ("Not/AZone","banana") falls back to the defaultAmerica/Chicago, like other malformed fields do today. - Regression tests pin: invalid zones fall back to the default; a valid non-default zone (
UTC,Europe/London) is accepted and honoured byinQuietHours; existing quiet-window tests still pass. - No other
mergeQuiet/inQuietHoursbehaviour changes (theinQuietHourscatch may stay as defence in depth for rows already stored with a bad zone).
Distinct from: #3686 (open — same function, but only the start/end time ranges; its acceptance criteria say nothing about tz), #3676 (the alert throat itself).
Activity
dezren39 commentedon Nov 2, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 2, 2026
🤖 Agent note · done
mergeQuietin pm-stack/aggregator/src/alerts.ts stores any non-emptytzstring verbatim (no validity check), andinQuietHoursbuildsIntl.DateTimeFormatwith that zone in a try/catch whose catch returns false. Independent laptop probe importing the real alerts.ts:mergeQuiet({ tz: "banana" })stored{ start: "23:00", end: "07:00", tz: "banana", enabled: true }, andinQuietHoursat 2026-01-15T06:00Z (00:00 CST, deep inside the window) returnedfalse, while default prefs returnedtrue. So an invalid zone silently disables quiet-hours suppression forever, contradicting mergeQuiet's own fallback contract for other malformed fields. Fix enqueued as task 6155 (validate tz in mergeQuiet, fall back to the default America/Chicago, regression tests per the acceptance criteria). Distinct from aggregator(alerts): mergeQuiet accepts out-of-range times (99:99, 24:60) — a malformed quiet window is silently reinterpreted instead of falling back to the default #3686 (start/end time ranges only).65 remaining items
dezren39 commentedon Nov 2, 2026
agent-note:v1 — state: parked (task 6155, OpenChamber scheduled lane)\n- Agent: repo-worker-code.\n- Fresh metadata-only evidence: #4281 OPEN; canonical PR #4283 OPEN and Drew-authored. No PR contents, diff, branch, worktree, checks, reviews, or source inspected.\n- Disposition: parked 30 minutes; no work touched. Parked labels restored; work/assigned remains. Ending this launch as saved progress requires.\n- Resume: after explicit handoff/release; then revalidate issue, PR, checks and reviews fresh.\n
dezren39 commentedon Nov 2, 2026
agent-note:v1 — holder: repo-worker-code, since 2026-11-02T12:00:28Z (picked up queue task 6155; resumed from its saved checkpoint and performed metadata-only revalidation).
dezren39 commentedon Nov 2, 2026
agent-note:v1 — holder: released by repo-worker-code at 2026-11-02T12:03:08Z, reason: task 6155 parked for 30 minutes after fresh metadata-only checks showed #4281 OPEN and assigned to Drew and canonical PR #4283 OPEN and Drew-authored; prior checkpoint forbids inspecting PR contents until explicit handoff/release. Resume only after handoff/release, then revalidate.
dezren39 commentedon Nov 2, 2026
🤖 Agent note · picked up
queue/6155-4281-mergequiet-tz) already implements the mergeQuiet tz validation. Important correction to the prior parks on task 6155: PR fix(aggregator): validate quiet-hours timezone #4283 is NOT a Drew-owned PR — its head branch is task 6155's own queue branch, so it is this task's fleet PR (the author login is the account the fleet pushes as; the same author-login over-fire was documented for task 2950 / PR fix(id): canonical winner for concurrent group creates (#165) #4099). I will verify the diff, checks, and Codex findings, then merge if verified.dezren39 commentedon Nov 2, 2026
🤖 Agent note · done
bun test test/alerts.test.tsat PR head 1586942 — 31 pass, 0 fail, 93 assertions; Codex review of PR fix(aggregator): validate quiet-hours timezone #4283 completed with no findings. PR CI was runner-queued at merge; main CI is the backstop per fleet merge policy. Note the correction recorded on pickup: PR fix(aggregator): validate quiet-hours timezone #4283 is task 6155's own fleet PR (headqueue/6155-4281-mergequiet-tz), not a Drew-owned PR.