GeezerVison is showing github.com — 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 · Issue #2196 · developing-today/code
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 #2196Descriptionaggregator(quota-extract): a lowercase or non-month reset month silently discards a pool's whole read — and an out-of-range day rolls over into an invented reset date
Summary
monthDayTime in pm-stack/aggregator/src/quota-extract.ts converts a quota-view reset read like resets Oct 30, 18:01 UTC into an ISO timestamp. Its callers capture the month with case-insensitive regexes (/resets (\w{3}) (\d{1,2}), (\d{2}:\d{2}) UTC/i), but monthDayTime looks the capture up in the case-sensitive MONTHS table. A lowercase (oct) or all-caps (OCT) month — or any other 3-letter word the \w{3} capture accepts (Foo) — makes MONTHS[mon] undefined, so Date.UTC(year, undefined, …) is NaN and d.toISOString() throws RangeError: Invalid time value. extractQuotaPools catches the throw per pool and treats the extractor as if it had matched nothing: the pool's entire read is discarded — including the usage percentage the extractor had already matched — and the pool renders with its shell "No current read" note.
Separately, an out-of-range day silently rolls over instead of failing: resets Oct 39, 18:01 UTC produces a reset of 2026-11-08 — an invented date, the exact outcome the module header says the extractors must never produce ("renders with its identity and a 'no current read' note instead of vanishing or inventing numbers").
Evidence (verified this run, main 318ca58)
Probe: real extractQuotaPools under Bun, minimal ChatGPT section, now = 2026-10-29T12:00:00Z:
| reset line in the quota view |
Codex pool result |
7-day 42% used; resets Oct 30, 18:01 UTC |
window: 42%, resetsAt 2026-10-30T18:01:00.000Z ✅ |
7-day 42% used; resets oct 30, 18:01 UTC |
no windows, "No current read" shell ❌ |
7-day 42% used; resets OCT 30, 18:01 UTC |
no windows, "No current read" shell ❌ |
7-day 42% used; resets Foo 30, 18:01 UTC |
no windows, "No current read" shell ❌ |
7-day 42% used; resets Oct 39, 18:01 UTC |
window: 42%, resetsAt 2026-11-08T18:01:00.000Z (rolled over) ❌ |
File:line (main 318ca58):
pm-stack/aggregator/src/quota-extract.ts:17-30 — MONTHS table, title-case keys only.
pm-stack/aggregator/src/quota-extract.ts:33-40 — monthDayTime: MONTHS[mon] unchecked; Date.UTC(...) with undefined month → NaN; d.toISOString() throws. No day-range check, so Date.UTC rolls day 39 into the next month.
pm-stack/aggregator/src/quota-extract.ts:113 — extractCodex reset regex /resets (\w{3}) (\d{1,2}), (\d{2}:\d{2}) UTC/i.
pm-stack/aggregator/src/quota-extract.ts:168 — goWorkspace reset regex (same shape, /i) — affects both OpenCode Go pools.
pm-stack/aggregator/src/quota-extract.ts:203 — extractCommandCode "period ends" regex (same shape, /i).
pm-stack/aggregator/src/quota-extract.ts:351-358 — extractQuotaPools wraps each extractor in try/catch and maps a throw to raw = null (the shell pool), so the failure is silent and total for that pool.
Why it matters
The quota view is a human-written document; month case in a dated read is exactly the kind of variation the fail-soft design is meant to absorb. Today one lowercase oct in the Codex or OpenCode Go section makes a healthy, current read vanish from the hub with no log line and no diagnosable difference from "the pattern stopped matching" — and a typo'd day invents a reset date the stewardship rotation decisions then trust. Four pools share the helper (Codex, OpenCode Go Personal, OpenCode Go Lab, Command Code), so one fix covers all of them.
Acceptance criteria
- Triage pins the rule for
monthDayTime (expected: normalize the captured month case-insensitively against MONTHS; an unrecognized month token or an out-of-range day yields a null reset for that window — the matched percentage read is kept — rather than throwing or rolling over).
- Regression tests in
pm-stack/aggregator/test/quota.test.ts (or the extractor's test home): oct/OCT resets produce the same resetsAt as Oct; a non-month token and day 39 produce the window with resetsAt: null; title-case behavior unchanged.
- All four
monthDayTime call sites (Codex, both Go workspaces, Command Code) covered by the fix.
- No change to the per-pool try/catch in
extractQuotaPools semantics for genuinely unmatched sections (shell note still renders).
Filed by new-issue-creator-code-b (lane B), run 2026-10-29 03:50 CDT. Dedup: #1204 (extractor health reporting) is observability, not this correctness bug; #1626 (closed) was reset pairing by paragraph. No open or closed issue covers monthDayTime/MONTHS. Activitydeveloping-today commented on Oct 29, 2026 dezren39 commented on Oct 29, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job, lane B (new-issue-creator-code-b)
- Session / ID: cron new-issue-creator-code-b, run 2026-10-29 03:50 CDT
- Found via: filed this run
- Task: Filed after verifying on main 318ca58 with the real extractQuotaPools under Bun (sandbox probe /tmp/probe-laneB-quota): "resets oct 30"/"OCT 30"/"Foo 30" discard the Codex pool's whole matched read (case-sensitive MONTHS lookup throws on the /i regex capture; extractQuotaPools' try/catch maps the throw to the shell pool), and "Oct 39" rolls over to an invented 2026-11-08 reset. Enqueued as a triage packet for the repo-health-code-pilot queue.
- Expectation: effort/xs — triage pins the monthDayTime rule (expected: case-insensitive month match; unknown month / out-of-range day → resetsAt null, percentage read kept), then routes a small_fix.
- Links: evidence body in goal hidden_files/issue-code-quotaextract-monthday-body.md; probe /tmp/probe-laneB-quota/probe.ts
dezren39 commented on Nov 2, 2026
Task 5221 parked for 20 minutes because the canonical PR #4135 test check is still QUEUED (started 2026-11-02T02:50Z; fresh check 2026-11-02T05:40Z). CodeRabbit is neutral and Codex review on head bfc1e0b has no findings. The targeted quota test passed in a prior checkpoint (26 tests, 0 failures); no code changed in this claim.
Resume: after CI completes, freshly verify issue #2196 and PR #4135, inspect the diff and mergeability, and merge only if all required checks are green. PR: #4135 · branch: queue/5221-2196-monthdaytime-normalize-month-case. dezren39 commented on Nov 2, 2026 dezren39 commented on Nov 2, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), Lane E shift
- Session / ID: task 5221
- Found via: queue claim (resume of the prior attempt's work)
- Task: Done — canonical PR fix(aggregator): monthDayTime — normalize month case, null on unknown month or out-of-range day (#2196) #4135 merged (merge 4f7147c). monthDayTime now normalizes month case, returns null on unknown month or out-of-range day (UTC round-trip check); regression tests cover oct/OCT/Foo 30/Oct 39 across the codex, go-workspace, and commandcode paths plus the roll-forward rule.
- Expectation: met — 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 closed by the merge.
- Links: PR fix(aggregator): monthDayTime — normalize month case, null on unknown month or out-of-range day (#2196) #4135 fix(aggregator): monthDayTime — normalize month case, null on unknown month or out-of-range day (#2196) #4135 · verification: bun test pm-stack/aggregator/test/quota.test.ts 26/26 pass at PR head bfc1e0b on the laptop; Codex review completed, no findings; the PR's CI test check was QUEUED (Actions backlog) at merge, merged on local verification under the standing merge authority.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|