Skip to content

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

Merged
JOY (JOY) merged 6 commits into
mainfrom
dev
Nov 4, 2026
Merged

JOY (JOY) merged 6 commits into
mainfrom
dev

Conversation

@JOY

@JOY JOY (JOY) commented Nov 4, 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 the database schema and security controls for an AI-driven review analysis feature, adding new tables to track batch processing costs and extraction markers, along with strict Postgres functions to safely store and purge AI-generated pros/cons. It also includes comprehensive documentation, verification/rollback scripts, and a CI replay test to ensure the migration is idempotent and secure.

🎯 Type of Change

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

🔍 Changes Walkthrough

File Summary of Changes
.github/workflows/ci.yml Adds a CI step to replay the new AI points proposal migration in a Dockerized PostgreSQL environment.
.gitignore Un-ignores the new SQL proposal, rollback, and verification files so they are tracked in the repository.
Docs/Proposals/2026-11-03-ai-review-points.html Adds a detailed design document outlining the AI model selection, cost estimates, prompt structure, and safety guardrails for extracting pros/cons from reviews.
Docs/Proposals/2026-11-03-dos-me-review-ai-points.md Adds a markdown summary of the database proposal, detailing the new tables, functions, and the specific decisions made regarding data isolation and cost tracking.
Docs/Proposals/2026-11-03-dos-me-review-ai-points.sql Core Migration: Creates rate.review_ai_batches and rate.review_ai_extractions tables, sets up Row Level Security (RLS), and defines store_review_ai_points and purge_review_ai_points functions with strict validation logic.
Docs/Proposals/2026-11-03-dos-me-review-ai-points-verify.sql Adds read-only verification queries (V1-V8) to validate RLS policies, data integrity constraints, and hash consistency post-migration.
Docs/Proposals/2026-11-03-dos-me-review-ai-points-rollback.sql Adds a safe, idempotent rollback script that removes AI-generated data and drops the new tables/functions without affecting user-written data.

📊 Architectural Flow

flowchart TD
    subgraph "AI Job (apps/importer)"
        A[Fetch Reviews] --> B{Filter & Hash}
        B -->|Valid| C[Send Batch to Claude API]
        C --> D[Receive Structured Output]
        D --> E[Validate Evidence & Limits]
    end

    subgraph "PostgreSQL (rate schema)"
        F[(rate.review_ai_batches)]
        G[(rate.review_ai_extractions)]
        H[(rate.review_points)]
        
        F -->|Tracks Cost & Status| F
        G -->|Process-once Marker| G
        
        subgraph "Security Functions"
            I[store_review_ai_points]
            J[purge_review_ai_points]
        end
    end

    E -->|Insert Batch Record| F
    E -->|Call Writer Function| I
    I -->|Validate & Lock| G
    I -->|Write 'ai' Lines| H
    I -->|Update Marker| G
    
    K[Manual / Job Purge] --> J
    J -->|Delete 'ai' Lines| H
    J -->|Clear Markers| G
Loading

JOY (JOY) and others added 6 commits November 3, 2026 16:37
…ews (#1596)

* docs(proposals): ai extraction of pros and cons from marketplace reviews

Design only for the 'ai' method of rate.review_points (#1531, section
4.3): which reviews qualify, prompt and output schema per category,
model choice, batching and a process-once marker, cost per 1,000
reviews, where it runs, quality checks, a kill switch, and how D9
counts ai lines. Nothing calls an LLM.

Refs #1531

* docs(proposals): address the review of the ai review points design

Gate wording, where the 0.5 weight applies, process-once on crashes and
cut-off results, NFC evidence matching per review, two kill switches and
per-model caps.

Refs #1531

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…roduct points (#1598)

* feat(shared-data,importer): ai review lines count at half weight in product points

- A line AI extracted from a marketplace review (method 'ai') counts its
  review as one writer, adding 0.5 x min(decayed weight, 1) toward support and
  the D9 sum; it is never an expert's. It never reaches criterion stars or the
  review value score.
- aggregateProductPoints takes hideAiLines, and the product-points job reads
  'ai' lines unless --hide-ai or PRODUCT_POINTS_HIDE_AI=true leaves them out.

Refs #1531

* fix(shared-data,importer): writers label ai-backed points; strict hide switch (#1531 review)

- A cluster with any writer line takes its label from the writers' lines.
- --hide-ai=<value> is read, and an unknown value of the flag or
  PRODUCT_POINTS_HIDE_AI throws instead of showing lines meant to be hidden.
- The job header tells product_points 'ai' rows from review_points 'ai' lines.

Refs #1531

* feat(shared-data): writer-backed points rank first; count marketplace reviews (#1531)

- byRank puts a point with at least one writer line before AI-only points,
  then support; AI-only points stay eligible below them.
- PointCluster.aiReviewerCount and ProductPoints.aiReviewCount give the
  marketplace reviews counted only through AI lines, for the web's
  "trong đó N review trên sàn".

Refs #1531

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…etplace reviews (#1599)

* feat(importer): review ai points job extracts pros and cons from marketplace reviews

Step 2 of the AI review points design (#1531, all six decisions approved
by JOY on 2026-11-03). The job picks crawled user reviews past the gate,
long enough and in Vietnamese or English, sends them through the Message
Batches API (Claude Haiku 5.5 by default, structured output per category,
effort low, cached instructions), checks every line (evidence found in
its own review, compared as the writer compares) and stores what passes
through rate.store_review_ai_points as rate_worker.

Dry run by default and never calls a model. --apply sends one batch and
records its id at once, so a crash collects it instead of paying twice;
cut-off, refused and errored results are stored as failed, never empty.
REVIEW_AI_POINTS_ENABLED stops every model call, at most 2000 reviews a
run, a monthly cap per model read from rate.review_ai_batches, quality
stops, and --purge. Tests use a fake model client and a fake database.

Adds @anthropic-ai/sdk 1.3.0 to @repo/crawlers.

Refs #1531

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… writer (#1597)

* docs(proposals): dos-me migration for the review ai points marker and writer

D6 of the AI review points design (#1531), approved by JOY on
2026-11-03 with all six decisions as recommended. A proposal only:
nothing is applied from DOS/Rate.

rate.review_ai_batches keeps each Batch API batch's id, manifest and
cost, so a crashed run collects its batch and the month's spend is in
the database. rate.review_ai_extractions is the process-once marker,
keyed by NFC text hash, prompt and criteria version and category.
rate.store_review_ai_points writes the 'ai' lines and the marker in
one transaction, for crawled user reviews with no writer lines only;
rate.purge_review_ai_points removes them by version or all.
rate_worker still cannot write rate.review_points directly.

Verify and rollback files, and a Docker replay wired into CI. A
fresh-context review's findings are fixed (failed flag required,
retry cap in the database, lines version for the purge, category in
the key, exact quotes checked, skips instead of refusals).

Refs #1531

* chore(gitignore): track the review ai points proposal sql files

The Docs/Proposals .sql files of #1597 matched the *.sql rule; list them
as exceptions like the earlier proposals, so the secret scan sees them.

Refs #1531

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(db): mirror the review ai points migration

DOS.Me applied 20261106120000_rate_review_ai_points.sql to production
(DOS.Me#1553, merge 069105a7). The file is copied byte for byte from
DOS.Me main, and database.types.ts is regenerated: review_ai_batches,
review_ai_extractions and the three functions.

Refs #1531

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(extension): m1 disclosure drift and tiktok product paths

- On www.tiktok.com the content script runs only on product page paths
  (/view/product/, /@shop/product/, /shop/.../pdp/), not on the video
  feed; the pipeline test checks both sides.
- The privacy policy names the toggle as the side panel does, says the IP
  address is used only in memory for a per-minute limit, and that an
  opt-in signal is stored with its receipt time (vi, en, cs).
- CHROMEWEBSTORE.md names all 10 stores, the TikTok paths, the IP handling
  and the receipt time; RELEASE.md follows the new matches.

What the extension sends, the ingest API and the opt-in default are
unchanged.

Refs #1601, #1175

* fix(extension): tighten disclosure claims after review

- No "personal data" claims: the texts say no account, name, email or
  cookies, since the server receives the IP with each request.
- The IP sentence says the Rate.vn code keeps it only in memory and the
  hosting provider keeps standard access logs for a short time.
- An opt-in signal may be re-checked on the store by the Rate.vn
  servers; the bot-check sentence is about the extension itself.
- The browser storage list adds the lookup wait time; the store doc gives
  the English toggle label; RELEASE.md uses the real label and dates the
  updated row.
- TikTok: video pages are excluded even when a query mentions /product/;
  the test matches like Chrome (path and query, no fragment) and checks
  that every covered URL is a product to the extractor.

Refs #1601

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 4, 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 4, 2026 5:01am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 4, 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: 161d701a-cc51-4449-a8eb-285e756f52bb

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

@github-actions github-actions Bot added ci CI/CD workflows and pipelines docs Documentation changes area:frontend Frontend / Next.js / UI area:shared Shared packages / contracts / configs area:crawlers area:database area:extension labels Nov 4, 2026
dos[bot]
dos Bot approved these changes Nov 4, 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 (28 eligible files · 291,377 chars · 2 model call(s) · 10 PR unit(s))

Whole diff with bounded context at base 7201101 / head 8919776.
Excluded by noise policy: pnpm-lock.yaml.

✅ No verified defects

1 possible issue(s) could not be grounded in or verified against the snapshot source, so they are not published.

🔒 Dependency check

✅ Passed. Every new package version comes from the public registry or a source this lockfile already used for it, its checksum is pinned where the format records one, and OSV lists no new malicious package or high or critical vulnerability for the versions it was asked about.

Changed packages (6)
Package From To Lockfile
@anthropic-ai/sdk new 1.3.0 pnpm-lock.yaml
@stablelib/base64 new 1.0.1 pnpm-lock.yaml
fast-sha256 new 1.3.0 pnpm-lock.yaml
json-schema-to-ts new 3.1.1 pnpm-lock.yaml
standardwebhooks new 1.1.1 pnpm-lock.yaml
ts-algebra new 2.0.0 pnpm-lock.yaml

@JOY
JOY (JOY) merged commit f598f84 into main Nov 4, 2026
23 checks passed

This branch was successfully deployed

1 active deployment
Preview — 89197762 Deployed Nov 4, 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:extension area:frontend Frontend / Next.js / UI area:shared Shared packages / contracts / configs ci CI/CD workflows and pipelines docs Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant