Skip to content

chore(release): promote dev to main - #1593

Merged
JOY (JOY) merged 5 commits into
mainfrom
dev
Nov 2, 2026
Merged

JOY (JOY) merged 5 commits into
mainfrom
dev

Conversation

@JOY

@JOY JOY (JOY) commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Promote dev to main.

Merge with a merge commit, never squash (Docs/Resources/RELEASE.md).


📌 TL;DR

This PR introduces a new review-values job that computes and stores review quality scores (using a shared reviewDepth classifier) 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

  • 🚀 New feature
  • 🧹 Refactor
  • 📚 Documentation
  • 🐛 Bugfix
  • ⚡ Performance
  • ⚙️ CI / Configuration

🔍 Changes Walkthrough

File Summary of Changes
apps/importer/package.json Added review-values script and included the new review-values.test.ts in the test suite.
apps/importer/src/shopee/jobs/review-values.ts New Job: Implements the review value scoring pipeline. It reads reviews/points, computes values using reviewValue and reviewDepth, 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.ts New Tests: Extensive unit tests for the new job, covering input gating, depth classification, batch sizing (row/byte limits), deadlock retry logic, and the exact-match verification of master ratings (V5 check).
apps/importer/src/shopee/ai-review-analyzer.ts Refactor: Replaced local Depth type and regex-based depth classification with the shared reviewDepth function 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.ts Tests: Added assertions to ensure the AI analyzer's depth classification matches the shared reviewDepth function for various comment types (empty, short, detailed, expert, coin spam).
apps/web/locales/cs.json i18n: Added Czech translations for review value tier labels and user-facing score display.

📊 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]
Loading

JOY (JOY) and others added 5 commits November 2, 2026 21:06
* 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>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

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.

@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
rate Ready Ready Preview Nov 2, 2026 8:46pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ff90ec0c-3c9c-4302-994d-a163ae99096c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

dos[bot]
dos Bot approved these changes Nov 2, 2026

@dos dos Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⏱️ Code Review completed (26 eligible files · 169,564 chars · 1 model call(s) · 6 PR unit(s))

Whole diff with bounded context at base 97120bf / head b1dfdab.

✅ CLEAN_PASS: Complete diff reviewed

@JOY
JOY (JOY) merged commit 62b808c into main Nov 2, 2026
24 checks passed

This branch was successfully deployed

1 active deployment
Preview — b1dfdabe Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:crawlers area:database area:frontend Frontend / Next.js / UI area:shared Shared packages / contracts / configs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant