Repository navigation
Description
aggregator(quota-extract): dateTimeCDT hardcodes UTC-5 year-round — winter (CST) reset reads render an hour early
Summary
dateTimeCDT in pm-stack/aggregator/src/quota-extract.ts:43-46 converts a quota-view dated read (2026-12-16 + 14:00 CDT) into an ISO timestamp by stamping a fixed -05:00 offset:
/** "2026-10-28" + "14:00" CDT (UTC-5) -> ISO. */
function dateTimeCDT(date: string, hhmm: string): string {
return `${date}T${hhmm}:00-05:00`;
}US Central Time is UTC-5 only during daylight saving (CDT, mid-March to early November). For the rest of the year it is CST, UTC-6. The quota view's dated reads are Central wall-clock times (the stewardship writer stamps them "CDT" by convention — every extractor pattern matches the literal CDT), so for any read dated in the CST months the extractor emits a resetsAt one hour earlier than the wall time it claims to encode. The same codebase already knows the right model: pm-stack/aggregator/src/derive.ts:473-480 has "Calendar helpers (America/Chicago — Drew's timezone)" built on Intl.DateTimeFormat with timeZone: "America/Chicago".
Evidence (verified this run, main 318ca58)
Probe: real extractQuotaPools under Bun, minimal Claude section, now = 2026-12-10T12:00:00Z:
- Input:
weekly 68% used, weekly reset Wed 2026-12-16 14:00 CDT - Emitted window:
resetsAt: "2026-12-16T14:00:00-05:00"= 19:00Z - Ground truth: 2026-12-16 falls in CST —
Intl.DateTimeFormatwithtimeZone: "America/Chicago"reportsCSTfor that date, and 14:00 Central wall time =2026-12-16T20:00:00.000Z. The emitted reset is one hour early.
Call sites (all Central-time reads, all affected):
pm-stack/aggregator/src/quota-extract.ts:100—extractClaude: weekly reset → the window'sresetsAt.pm-stack/aggregator/src/quota-extract.ts:132—extractMeta: weekly reset →resetsAtandwallLiftsAt;extractMetaalso comparesnow >= Date.parse(resetIso)(line 134) to decide the window has reset, so a winter wall lifts / window clears an hour early in the model, not just in display.pm-stack/aggregator/src/quota-extract.ts:189—extractClinePass: the measured-read base instant from which both relative resets (weekly/monthly) are computed — a winter ClinePass read shifts both derived resets by an hour.
Why it matters
Reset and wall-lift times drive the hub's pool state (poolState, the "walled" rendering, burn/rotation decisions in stewardship). For roughly 4.5 months of the year every Claude, Meta, and ClinePass reset derived from a dated read is an hour off — pools shown as reset (or walls shown as lifted) an hour before they actually are. October reads are correct only by accident of the calendar; the first winter dated read (the quota view is already accumulating late-October reads) silently inherits the error, and no test pins a CST-month date.
Acceptance criteria
- Triage pins the conversion rule (expected: interpret the stamped wall time in
America/Chicago— DST-aware, matching derive.ts's calendar helpers — rather than a fixed-05:00; or, if the fixed-offset convention is deliberately kept, rename/document it so the winter error is a stated choice, not an accident). - Regression tests in
pm-stack/aggregator/test/quota.test.ts: a December/January dated reset read yields the UTC-6 instant (e.g.2026-12-16 14:00→2026-12-16T20:00:00.000Z); an October read still yields UTC-5; a read on a DST transition date is covered or explicitly ruled out of scope on the issue. - All three call sites covered (Claude reset, Meta reset/wallLiftsAt + the reset-passed comparison, ClinePass measured base).
- No behavior change for reads dated inside CDT.
Filed by new-issue-creator-code-b (lane B), run 2026-10-29 03:50 CDT. Dedup: searches for dateTimeCDT, "CDT offset", "daylight" (open+closed) found no covering issue; #1541 (closed) was quota-current future-skew, a different aggregator time bug.
Activity
developing-today commentedon Oct 29, 2026
CODE-1084
dezren39 commentedon Oct 29, 2026
🤖 Agent note · filed
59 remaining items
dezren39 commentedon Nov 2, 2026
🤖 Agent note · parked
testcheck has been QUEUED since 2026-11-02T08:02Z (45+ min, CI backlog); laptop tests passed 29/29 in the prior shift.Merge pull request #4270 from developing-today/queue/5220-2197-quota-…
dezren39 commentedon Nov 2, 2026
🤖 Agent note · done
held/user/owned/do-not-merge/do-not-auto-editlabel.