Skip to content

fix(quota): guard isQuotaWindow against impossible resetsAt, negative values, out-of-range percent - #4423

Merged
dezren39 merged 1 commit into
mainfrom
queue/6079-3427-quota-window-guard
Nov 2, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/6079-3427-quota-window-guard

Conversation

@dezren39

@dezren39 dezren39 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Fixes #3427.

Tightens isQuotaWindow (pm-stack/aggregator/src/feed.ts): non-null resetsAt must satisfy isIsoDate (impossible calendar dates such as Feb-30 no longer roll forward in guidance), non-null limit and used must be non-negative finite, and percent when present must be within 0..100 (negative or >100 percents no longer misread as healthy/walled). Malformed windows drop individually in sanitizeQuotaView with droppedWindows counting them; valid windows and pools untouched.

Regression tests in pm-stack/aggregator/test/feed.test.ts: Feb-30 resetsAt dropped, negative used dropped, negative limit dropped, percent -50 dropped, percent 15000 dropped, valid windows untouched, sanitizeQuotaView droppedWindows count verified. Targeted suite: bun test test/feed.test.ts — 54 pass, 0 fail.

Scope per task: feed.ts guard + feed.test.ts only. Excludes #2470 (quota-extract unvalidated resetsAt) and #3365 (snapshot rollup guard); no derive.ts windowPercent semantic change.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e15e92f4-0130-4350-a7e9-d5d133200496
Commits

Reviewing files that changed from the base of the PR and between 4b0a959 and 4547db6.

Files selected for processing: 2
  • pm-stack/aggregator/src/feed.ts
  • pm-stack/aggregator/test/feed.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T15:34:40.173920Z 4547db6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit 4843f2e into main Nov 2, 2026
1 check passed
@dezren39
dezren39 deleted the queue/6079-3427-quota-window-guard branch November 2, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant