Repository navigation
Conversation
* chore(db): mirror the rs#739 and p6 migrations from dos-me DOS/DOS.Me#1462 (DOS/Rate-Services#739) and DOS/DOS.Me#1506 (P6) are on production through the promote DOS/DOS.Me#1520 (31001f14). Mirror their migrations byte for byte into supabase/migrations and regenerate packages/shared-data/src/database.types.ts: rate.review_values, rate.reviews.value_tier, store_review_values, my_review_values, review_completeness_factor and the three crawl queue reads. The P6 and P2 proposal replays now start from a stack that has P6: both roll P6 back first (the P6 replay also drops the CHECK its rollback keeps), so they still replay from the stack before it. Nothing is applied by this change. Refs #1547 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(importer): review value scoring job (P6) apps/importer/src/shopee/jobs/review-values.ts computes reviewValue (@repo/shared-data) for every crawled and community review, with reviewDepth on the whole text, and stores the values that changed through rate.store_review_values as the rate_worker Auth user. Dry run by default, --apply to write, --master to scope one master. Batches of 500 rows and 1.5 MB at most; a deadlock (40P01) is retried four times. After a run it checks every rated master as V5 of the verify file does: rate_worker cannot call rate.master_rating_extras, so the job computes P2's rating with the P6 weight from the rows it read, reads a differing master again, and lists the ones still stale (exit code 2). Refs #1547 * fix(importer): page review value reads, exact v5 check From two fresh-context reviews of the review values job: - Every read pages by key (keyset, 1000 rows, no OFFSET, no page cap), including the `in` lookups on product_id, review_id and cluster_id, which PostgREST cut at 1000 rows: a big master was scored and checked on a subset. - The V5 check computes in exact integers, as numeric does, and compares exactly: D9's 1.5 threshold no longer flips on float sums, and a master one unit off is stale. - Changed values are batched by master, so a backfill refreshes a master once or twice instead of once per batch. - Only a crawled review's purchase mark counts: community reviews took is_verified_buyer's default of true before 20261018100000. - The CLI signs out after a run. Refs #1547 * Merge remote-tracking branch 'origin/dev' into feat/1547-review-values-job Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ewDepth (#1589) * feat(web,importer): v2 pros and cons and the Shopee analyzer use reviewDepth (#1583) - The web review reads embed review_points, and the trust weight passes the v2 verdict line and the writer's pros and cons to reviewDepth with the comment; AI-extracted lines stay out. - The Shopee analyzer's axis C is reviewDepth (coin spam as filler), so the web, the analyzer and the review value job classify depth alike. Closes #1583 * test(web): v2 trust depth tests in their own file, with points-only and dedupe cases (#1583 review) The added block pushed core-rate-architecture past tsc's control-flow limit. The new file checks writer lines alone and that a verdict said twice weighs the same; a stale comment on the importer's product regex is fixed. Refs #1583 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th (#1590) * feat(web,importer): v2 pros and cons and the Shopee analyzer use reviewDepth (#1583) - The web review reads embed review_points, and the trust weight passes the v2 verdict line and the writer's pros and cons to reviewDepth with the comment; AI-extracted lines stay out. - The Shopee analyzer's axis C is reviewDepth (coin spam as filler), so the web, the analyzer and the review value job classify depth alike. Closes #1583 * test(web): v2 trust depth tests in their own file, with points-only and dedupe cases (#1583 review) The added block pushed core-rate-architecture past tsc's control-flow limit. The new file checks writer lines alone and that a verdict said twice weighs the same; a stale comment on the importer's product regex is fixed. Refs #1583 * feat(shared-data): battery measurements count as technical review depth (#1583) - REVIEW_BATTERY_MEASURE_RE: screen-on time or use in hours tied to the battery or screen, a timed charge between two percentages, and "đo/test thực tế" make a review expert depth, on the web, in the analyzer and in the value score. Hours alone ("giao hàng 2 tiếng") do not, and padding still adds nothing. - The POST response for a v2 review carries a trust assessment computed from its verdict and pros and cons, so the just-submitted card matches the list. Refs #1583 * test(web): the v2 POST card carries a trust assessment from its whole text (#1583) Refs #1583 * Merge remote-tracking branch 'origin/dev' into feat/1583-battery-measure * fix(shared-data): tighter battery measure, at specific_short length (#1583 review) - Gaps stay inside one clause and stop at delivery or waiting words; a spare battery, a torch, a watch or coin cell is not one; "đo/test thực tế" needs a number and "sot" an hours unit. - More real reports match: ranges (6-7 tiếng), charge left after hours, hyphenated screen-on, "sạc 0-100% 50p". - A number never starts inside another, so long digit runs stay linear. - A battery report is expert depth only at specific_short length or more. - The v2 POST card passes lines in their stored form, and its test proves the pros reach the classifier. Refs #1583 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#1592) * feat(web): review quality tier badge and the writer's own value score Review cards show the public tier from rate.reviews.value_tier: an icon and one word for complete and excellent, nothing for basic or unscored. The quality sort puts the tier first, then the existing helpful order. A signed-in writer sees the score and gaps of their own reviews. The page calls the new POST /api/v1/rate/reviews/my-values, which runs rate.my_review_values with the user's JWT. Visitors without a session cookie make no call and do not load the Supabase client. Refs #1547 * fix(web): review value follow-ups from review - A review the rating leaves out shows no tier and does not lead the sort, and a review buyers voted down (more down than up, 3+ votes) does not lead either; the order moves to compareByQuality with tests. - The writer's hint drops stale values on sign-out or failure, hides a gated review's 0, and shows at most three gaps they can act on. - Badge colours no longer match the flag pills; wording follows the design ("bậc", "chỉ bạn thấy"). - OpenAPI documents value_tier on review items; the test script lists the new test once. Refs #1547 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.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Promote dev to main.
Merge with a merge commit, never squash (Docs/Resources/RELEASE.md).
📌 TL;DR
This PR introduces a new
review-valuesjob that computes and stores review quality scores (using a sharedreviewDepthclassifier) and verifies master product ratings against a Bayesian model. It refactors the AI review analyzer to use the shared depth classification logic and adds comprehensive tests for the new scoring and rating verification workflows.🎯 Type of Change
🔍 Changes Walkthrough
apps/importer/package.jsonreview-valuesscript and included the newreview-values.test.tsin the test suite.apps/importer/src/shopee/jobs/review-values.tsreviewValueandreviewDepth, handles batched writes with deadlock retries, and verifies master product ratings using a Bayesian integer-arithmetic model to avoid floating-point errors.apps/importer/src/shopee/__tests__/review-values.test.tsapps/importer/src/shopee/ai-review-analyzer.tsDepthtype and regex-based depth classification with the sharedreviewDepthfunction from@repo/shared-data/rules. Removed redundant local regexes (PRODUCT_ASPECT_RE,TECHNICAL_MEASUREMENT_RE) in favor of the shared logic.apps/importer/src/shopee/test-review-analyzer.tsreviewDepthfunction for various comment types (empty, short, detailed, expert, coin spam).apps/web/locales/cs.json📊 Architectural Flow
flowchart TD subgraph "Data Sources" R[Reviews] P[Review Points] L[Listings] M[Master Products] end subgraph "Review Values Job" direction TB Read[Fetch Data<br/>Keyset Pagination] Compute[Compute Values<br/>reviewValue + reviewDepth] Diff[Detect Changes<br/>Canonical JSON Compare] Batch[Batch Rows<br/>500 rows / 1.5MB] Write[Store via RPC<br/>store_review_values] Verify[Verify Master Ratings<br/>Bayesian Integer Math] end subgraph "Shared Logic" RD[reviewDepth<br/>@repo/shared-data] RV[reviewValue<br/>@repo/shared-data] end R --> Read P --> Read L --> Read M --> Read Read --> Compute RD --> Compute RV --> Compute Compute --> Diff Diff --> Batch Batch --> Write Write --> Verify M --> Verify Verify -->|Stale Masters| Alert[Log Warning<br/>Exit Code 2] Verify -->|OK| Done[Job Complete]