Repository navigation
Description
Finding
monthDayTime in pm-stack/aggregator/src/quota-extract.ts (line 39 on current main a5318f8798b1) validates the month and the day-of-month, but never validates the time-of-day it captures. Its UTC round-trip check (isRequestedDate) compares only getUTCMonth() and getUTCDate(), so an out-of-range minute that does not push the constructed date across midnight is silently normalized by Date.UTC into a different, fabricated reset time instead of returning null.
Hours 24–99 happen to return null only as a side effect (they always roll the date forward a day, tripping the day check). Minutes 60–99 roll forward only one hour, so they usually pass.
Evidence
-
Source PR: fix(aggregator): monthDayTime — normalize month case, null on unknown month or out-of-range day (#2196) #4135 (merged, merge commit
4f7147ce54d2883f0a05c0a6dfb8193f2cc58b0a, commitbfc1e0bfd2d5242b7be1051db6e24ae9e20d49c2), which fixed issue aggregator(quota-extract): a lowercase or non-month reset month silently discards a pool's whole read — monthDayTime's case-sensitive MONTHS lookup throws on its case-insensitive regex captures, and out-of-range days roll over into invented reset dates #2196. Its stated contract: unknown month or out-of-range day returnsnullso the window keeps its percentage and no reset date is invented. Its regression tests coverOct 39andFoo 30, but no out-of-range time. -
All three callers capture the time with the same shape, so the malformed values reach the function: Codex
resets (\w{3}) (\d{1,2}), (\d{2}:\d{2}) UTC(quota-extract.ts:240), OpenCode Gomonthly reset … (\d{2}:\d{2}) UTC(:316), Command Codeperiod ends … (\d{2}:\d{2}) UTC(:436). -
Node probe of the verbatim
monthDayTimefrom current main (TypeScript types stripped only;now = 2026-10-26T00:00:00Z; probe saved by the filing job):Oct 30 18:01 -> 2026-10-30T18:01:00.000Z (valid, control) Oct 30 18:59 -> 2026-10-30T18:59:00.000Z (valid, control) Oct 30 18:99 -> 2026-10-30T19:39:00.000Z (INVALID minute, fabricated) Oct 30 00:90 -> 2026-10-30T01:30:00.000Z (INVALID minute, fabricated) Oct 30 18:60 -> 2026-10-30T19:00:00.000Z (INVALID minute, fabricated) Oct 30 23:99 -> null (only because it crosses midnight) Oct 30 24:00 -> null (only via the day-roll side effect) Oct 39 18:01 -> null (the #4135 day case, correct) Foo 30 18:01 -> null (the #4135 month case, correct) -
Still present on current main: the function body on
a5318f8798b1is byte-identical in behavior to the PR fix(aggregator): monthDayTime — normalize month case, null on unknown month or out-of-range day (#2196) #4135 version (read via the contents API during the filing run). -
Dedupe:
gh search issuesformonthDayTimereturns only closed aggregator(quota-extract): a lowercase or non-month reset month silently discards a pool's whole read — monthDayTime's case-sensitive MONTHS lookup throws on its case-insensitive regex captures, and out-of-range days roll over into invented reset dates #2196 and closed aggregator(quota-extract): Claude and Meta reset dates are never validated — an impossible date is emitted verbatim as resetsAt, and a Feb-30 Meta reset silently discards the pool's whole read #2470 (Claude/Meta reset dates — a different validation path, already landed); no open issue and no open PR tracks the time-of-day component.
Why it matters
The aggregator's whole validation discipline in this area (issues #2196, #2383, #2470, and the sibling guards merged the same day in PRs #4136/#4142) is: a malformed provider read keeps its percentage and gets resetsAt: null — never an invented date. A dashboard line with a corrupted time (e.g. resets Oct 30, 18:99 UTC) currently produces a confident, wrong reset time on the quota card instead, which is exactly the failure mode #2196 was filed to eliminate for dates.
Acceptance criteria
-
monthDayTimereturnsnullfor any out-of-range time-of-day component (hour > 23 or minute > 59), for all three call sites (Codex, OpenCode Go, Command Code), while the window's percentage/other fields are preserved. - Valid times, month-case normalization, unknown-month
null, out-of-range-daynull, and the >30-days-past roll-forward behavior from fix(aggregator): monthDayTime — normalize month case, null on unknown month or out-of-range day (#2196) #4135 keep working unchanged. - Regression tests in
pm-stack/aggregator/test/quota.test.tspin at least: minute 60, minute 99 not crossing midnight (e.g.18:99), hour 24, and a valid boundary time (23:59), across the existing three-consumer test matrix or an equivalent direct cover. - No other extractor's behavior changes.
Activity
developing-today commentedon Nov 12, 2026
CODE-2750
dezren39 commentedon Nov 12, 2026
🤖 Agent note · filed
27 remaining items
dezren39 commentedon Nov 12, 2026
Agent note — task 15329 parked on CI (lane any-b)
9b9c5cb26078fb9e5f7572c41f613cbea1e3e20f, MERGEABLE. Diff verified — exactly the issue's fix:monthDayTimeinpm-stack/aggregator/src/quota-extract.tsnow rejects non-integer / out-of-range hour (0–23) and minute (0–59) withnullinstead of fabricating aresetsAt, andpm-stack/aggregator/test/quota.test.tspins 18:60, 18:99, 24:00 → null and 23:59 → valid. No Codex findings on the PR; CodeRabbit passed with no actionable comments.developing-today commentedon Nov 12, 2026
agent-note:v1
state: done (fixed_merged)
lane: any-d (task 15329, small_fix)
summary: Resumed from the awaiting-CI checkpoint and merged PR #9033. Fresh verification at head 9b9c5cb: MERGEABLE; diff is exactly the packet scope (pm-stack/aggregator/src/quota-extract.ts + test/quota.test.ts — monthDayTime now rejects hour > 23 / minute > 59 at all three call sites with pinned regressions); Codex code review completed at this head with no findings (has_unresolved_findings: false). Every failing check is in the mcpx-test set (unit + e2e shards 0/3/4/5), the documented clean-main failure set of #8900, unrelated to this aggregator-only diff; all PR-scoped checks passed. Task 15329 completed as fixed_merged.
developing-today commentedon Nov 12, 2026
agent-note:v1
state: correction
lane: any-d (task 15329, small_fix)
summary: Correction to the task 15329 completion record: the branch field recorded there (queue/15329-9003-monthdaytime) was wrong. PR #9033's actual head branch is queue/15311-9003-monthdaytime (the PR was opened under the earlier task 15311; task 15329 was the CI-resume task that merged it). Everything else in the completion record is correct: PR #9033, merged at 3119cd2, #9003 closed.