Repository navigation
docs(proposals): dos-me migration for criteria ratings, pros and cons (p2) - #1549
Conversation
… (p2) Phase P2 of #1531 (D2, D3, D9, D10), for JOY to review and apply through DOS-Me; nothing is applied from DOS/Rate. New review columns (exact star, verdict, criteria version, value score), rate.review_points and rate.product_points with RLS, and the master columns rating_score (Bayesian, k 3, mu 4.2), rating_weight_sum and criteria_scores (D9 thresholds). The live refresh_master_product_rating is renamed to a base and wrapped, so every caller also runs the new extras function. Verify and rollback files, and a Docker replay in CI that applies it on the reference stack and after M0 and M1+M2. 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 45 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. |
…apper Review of #1549. Renaming refresh_master_product_rating to a base and wrapping it broke when M1+M2 or its rollback replaced the function, and the Item path (refresh_item_rating, votes) bypassed it. The migration now replaces no function: triggers on reviews, review_flags and master_products refresh the new columns, scoped like the live refresh (per master, or the whole Item once M1+M2 is in). The schema change and the backfill commit separately; criteria keys must look like the shared-data keys; V3 checks PUBLIC and authenticated too, V4 the triggers, and V6 recomputes every master. The replay applies it before and after M1+M2 and through the M1+M2 rollback. Refs #1543 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ia ratings Round 2 review of #1549. Variants of an Item are written in id order with SKIP LOCKED, as refresh_item_rating does, so two refreshes of sibling variants never deadlock. Triggers resolve masters from listings, so a review on an Item listing with no variant refreshes the Item, and each Item is refreshed once per statement. Only changed rating inputs fire a refresh. The CHECKs are added NOT VALID and validated in the backfill transaction; V1 covers product_points. The replay adds a no-variant review, an unchanged rewrite and its delete; the runbook lists bulk flag imports, concurrent writers and listing deletes as known limits. Refs #1543 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Secret scan job refuses tracked files that match .gitignore. The three P2 proposal files get the same named exceptions as the earlier DOS-Me proposals. Refs #1543 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The web rounded the stored 2-decimal score again for display, so 4.249 showed 4.3. rating_score is numeric(4,3) and the criterion scores keep 3 decimals too; pages round once, to 1 decimal. Replay expectations follow. Refs #1543 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #1543
Phase P2 of #1531, decision D10: the DOS-Me migration for JOY to review and apply. Nothing is applied from DOS/Rate: no DDL, no data writes. The runbook is
Docs/Proposals/2026-10-31-dos-me-criteria-ratings.md.Files for JOY
Docs/Proposals/2026-10-31-dos-me-criteria-ratings.sql: the migration. It is idempotent and runs in two transactions: first the schema change, then CHECK validation and a backfill of the reviewed masters.Docs/Proposals/2026-10-31-dos-me-criteria-ratings-verify.sql: V1 to V6 must return 0; V7 is for information.Docs/Proposals/2026-10-31-dos-me-criteria-ratings-rollback.sql: one transaction, re-runnable, safe before or after M1+M2.scripts/test-criteria-ratings-proposal.mjs: a Docker replay, added to CI.What the migration does
rate.reviews: addsrating_exact numeric(2,1),verdict,criteria_version,value_scoreandvalue_breakdown.rate.review_pointsandrate.product_points: RLS on, public read. The service role writes both;rate_workerwritesproduct_pointsonly.rate.master_products:rating_score: Bayesian with k = 3 and mu = 4.2, each weight capped at 3, usingrating_exactwhen set. This is the same formula as the web.rating_weight_sum.criteria_scores: a criterion appears only with at least 3 reviews and a weight sum of at least 1.5 (D9). Keys must look like the shared-data keys.rate.reviewsandrate.review_flags, once per statement, when a rating input changes;rate.master_products, whenuser_rating_weightedorauthentic_review_countchanges.refresh_item_ratingdoes.Replay (Docker): passes locally
Reference stack: apply twice. Check:
Then roll back twice.
Apply before M0 and M1+M2. The two sizes become one Item, and both variants show 4.10 with display 3.80. Then check, in order:
M1+M2 rollback with this migration in place. V6 flags the stale variant, and re-running the backfill fixes it.
M1+M2 again, then this migration on top, then the rollback.
Review
Round 1 (fresh context):
Fixed in f75dbcb by moving to triggers.
Round 2:
Fixed in 4b12a3b.
Known limits (in the runbook):
trg_review_flags_sync_weight.V6 shows all three.
🤖 Generated with Claude Code