Skip to content

Fix log decompression bounds and CCM time filters#141

Draft
cursor[bot] wants to merge 2 commits intomainfrom
cursor/critical-bug-inspection-aa7e
Draft

Fix log decompression bounds and CCM time filters#141
cursor[bot] wants to merge 2 commits intomainfrom
cursor/critical-bug-inspection-aa7e

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 6, 2026

Description

Fixes two critical correctness issues found in recent changes:

  • ZIP log blobs with unknown uncompressed sizes are now bounded by the configured decompressed log limit, preventing compressed log payloads from inflating beyond the budget.
  • CCM time filters that were advertised but not implemented (THIS_QUARTER, THIS_YEAR, LAST_QUARTER, LAST_YEAR, LAST_3_MONTHS, LAST_6_MONTHS) now map to explicit ranges instead of silently falling back to a last-30-days query.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Checklist

  • Tests pass
  • Typecheck passes

Validation:

  • pnpm test tests/utils/log-resolver.test.ts tests/registry/registry.test.ts
  • pnpm test
  • pnpm typecheck
  • pnpm build
  • git diff --check
Open in Web View Automation 

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings.

Assumptions / Open Questions

I assumed THIS_YEAR and THIS_QUARTER are intended to be period-to-date filters, because the implementation and added regression note/test explicitly encode that behavior. If CCM expects full-period semantics analogous to the existing THIS_MONTH branch, that contract should be clarified separately.

Overall Assessment

This PR aligns with Sunil's architecture standards overall. The fixes stay narrowly scoped to the affected helpers in src/registry/toolsets/ccm.ts and src/utils/log-resolver.ts, keep the logic in the right layer, harden the log path to fail loudly on oversized decompression, and add focused regression coverage without broad churn. The tasks/todo.md update is appropriate for this repository's required task-tracking workflow and matches the change set.

Verification / Residual Risk

Verified locally with:

  • pnpm test
  • pnpm typecheck
  • pnpm build

Residual risk is low. The main remaining gap is that the CCM regression test proves THIS_YEAR, but the other newly added date branches (THIS_QUARTER, LAST_QUARTER, LAST_YEAR, LAST_3_MONTHS, LAST_6_MONTHS) still rely on untested date math. I did not find an active defect in those branches, but they are the remaining regression surface for this PR.

Open in Web View Automation 

Sent by Cursor Automation: Sunil On Demand Architecture Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants