Repository navigation
Conversation
…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>
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
|
There was a problem hiding this comment.
⏱️ 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 |
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
🔍 Changes Walkthrough
.github/workflows/ci.yml.gitignoreDocs/Proposals/2026-11-03-ai-review-points.htmlDocs/Proposals/2026-11-03-dos-me-review-ai-points.mdDocs/Proposals/2026-11-03-dos-me-review-ai-points.sqlrate.review_ai_batchesandrate.review_ai_extractionstables, sets up Row Level Security (RLS), and definesstore_review_ai_pointsandpurge_review_ai_pointsfunctions with strict validation logic.Docs/Proposals/2026-11-03-dos-me-review-ai-points-verify.sqlDocs/Proposals/2026-11-03-dos-me-review-ai-points-rollback.sql📊 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