fix(retention-gc): bind cursor windows to stable evidence#66
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Warning Review limit reached
Next review available in: 6 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
json_each(?)bindWhy
PR #65 capped result rows but not rows examined: its numeric-range COUNT and DELETE still walked an adversarial live-repopulated range. This fresh successor removes rowids from the mutation identity and removes the second numeric-range COUNT entirely. PR #65 remains the durable rejected artifact.
Red-first proof
Commit
1df040887bfe1377d35ae8b959ee679b5e2f2d80changes tests only. On unchanged 0.2.21 source, both token and audit races fail at the intended assertion after scanning original rowids{1, 2000}, deleting max rowid 2000, and normally reinserting live rows that reuse 2..2000:expiredCount=1; expected 2 retained original stable candidatesGreen proof
Observed runtime: Node v22.22.2, matching the server CI job.
npm pack --dry-run:dist/engine/retention-gc.{js,d.ts}present with additive candidate evidence and all four existing cursor APIsgit diff --check: PASSWork-bound measurement
SQLite 3.51
-stats, exact final query shapes, adversarial dense live spans 100,000 and 1,000,000:All final queries reported Fullscan Steps 0 and Sort Operations 0. Absolute VM counts are advisory because SQLite builds vary; the safety gates are the flat 10x span comparison plus structural and semantic tests.
Safety invariant
scanned <= 1000,candidates <= scanned,point lookups <= candidates,deleted <= candidates.This PR does not publish, deploy, run prod SQL, change retention from 90 days, or touch Cloud/KV.