Repository navigation
fix(proposals): backfill every master with a reviewed listing - #1559
Conversation
The criteria ratings backfill picked masters by the cached authentic_review_count or user_rating_weighted. A master whose review weight was written straight to rate.reviews keeps a stale count of 0 and was skipped, so V6 failed. The DOS.Me replay caught it. The backfill now also picks any master with a reviewed listing; the cached test stays for Item variants whose reviews sit on listings with no variant. The Docker replay zeroes the 256GB master's cached count before the first apply and checks the backfill still rates it; it fails on the old filter. Refs #1543 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou'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 23 minutes. View limit details
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. |
Refs #1543
A fix to the P2 criteria ratings proposal (PR #1549), found while porting it to DOS-Me. Nothing is applied to any database.
The bug
The backfill (section 8 of
Docs/Proposals/2026-10-31-dos-me-criteria-ratings.sql) picked masters by the cachedauthentic_review_count > 0 OR user_rating_weighted > 0. A master can have a counted review while that cache says 0, for example when a review weight is written straight torate.reviews. Such a master was skipped, kept norating_score, and V6 of the verify file flagged it. The DOS.Me rate schema replay caught this after a rollback and re-apply.The fix
The backfill now also picks any master with a reviewed listing (
EXISTSa review on a listing whosecluster_idis the master). The cached test stays, for Item variants whose reviews sit on listings with no variant. The refresh still writes only rows whose values change.Test
scripts/test-criteria-ratings-proposal.mjszeroes the 256GB master's cached count and weighted rating before the first apply, then checks the backfill still gives it3.650|1.00|{}. It then restores the cache and runs the rest unchanged.The DOS.Me copy of the migration already carries the same change: branch
claude/rate-1543-criteria-ratings, commit 7d2e109; its PR is not open yet.🤖 Generated with Claude Code
📌 TL;DR
This PR fixes a data integrity gap in the rating backfill process by ensuring masters with stale
authentic_review_countcaches are still correctly rated if they have active reviews on their listings. It also adds a regression test to verify this behavior.🎯 Type of Change
🔍 Changes Walkthrough
Docs/Proposals/2026-10-31-dos-me-criteria-ratings.sqlSELECTquery forrefresh_master_rating_extrasto include anEXISTScheck for reviews on linked products. This ensures masters are processed even if their cachedauthentic_review_countis stale (e.g., zero) but actual reviews exist.scripts/test-criteria-ratings-proposal.mjsauthentic_review_countto 0) and asserts that the backfill logic still correctly calculates and applies the rating.📊 Architectural Flow
flowchart TD A[Start Backfill] --> B{Check Master Products} B --> C{Has Stale Cache?} C -->|Yes| D[Check for Active Reviews via EXISTS] C -->|No| E[Check Cached Counts] D --> F{Reviews Found?} F -->|Yes| G[Include in Refresh Set] F -->|No| H[Exclude from Refresh Set] E --> I{Counts > 0?} I -->|Yes| G I -->|No| H G --> J[Execute refresh_master_rating_extras] H --> K[Skip Master] J --> L[Commit Transaction]