Repository navigation
Conversation
* feat(shared-data): per-review author key for duplicate-text analysis Rate-Services will mask stored author names (RS#1073), so the analyzer can no longer tell authors apart by author_name. Reviews may now carry an optional authorKey (keyed HMAC computed by RS, 16 to 128 chars of [A-Za-z0-9_-]). - ScrapedReviewSchema and ShopeeReview accept authorKey. - The importer stores it in rate.review_author_keys (a table anon cannot read, unlike rate.reviews) and loads it for the analysis; failures log a warning. - Duplicate-text and near-duplicate seeding checks group by author_key when present, else by author_name, else by review id. - Proposal SQL, verify, rollback and the ingest contract in Docs/Proposals. Closes #1614 * fix(shared-data): track proposal SQL, all-or-nothing key load, drop bad keys - Force-add the three proposal SQL files (git-ignored by *.sql). - loadAuthorKeys returns an empty map on any failure so one analysis never mixes key and name identities. - A malformed authorKey is dropped instead of rejecting the listing. - Document the mixed-identity limits. * chore: allow the author-keys proposal SQL in .gitignore Refs #1614 * docs(proposals): author-keys migration after the second review Worker policy limited to crawled reviews, lock_timeout, no unused index, privilege-matrix verify, and the secret-rotation limit in the contract. Refs #1614 * fix(shared-data): leave database.types.ts to the migration mirror gen-db-types --check compares the file with supabase/migrations, and the review_author_keys migration is still a DOS-Me proposal. The generated type arrives with the mirror once DOS-Me applies it. Refs #1614 Co-Authored-By: Claude Sonnet 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 per-review
author_keymechanism to allow the review analyzer to distinguish between authors after Rate-Services masksauthor_namefor privacy. It adds a newrate.review_author_keystable with strict RLS, updates the ingestion pipeline to store and load these keys, and modifies the duplicate-detection logic to use the key as the primary author identifier.🎯 Type of Change
🔍 Changes Walkthrough
.gitignoreDocs/Proposals/2026-11-06-dos-me-review-author-keys.mdDocs/Proposals/2026-11-06-dos-me-review-author-keys.sqlrate.review_author_keystable with RLS policies.Docs/Proposals/2026-11-06-dos-me-review-author-keys-verify.sqlDocs/Proposals/2026-11-06-dos-me-review-author-keys-rollback.sqlrate.review_author_keystable.supabase/migrations/20261109130000_rate_review_author_keys.sqlpackages/shared-data/src/database.types.tsreview_author_keystable.packages/shared-data/src/schemas/specs.schema.tsauthorKeytoScrapedReviewSchemawith validation (16-128 chars, alphanumeric/underscore/hyphen) and a.catch(undefined)to drop invalid keys without rejecting the listing.packages/shared-data/src/__tests__/shared-data.test.tsauthorKeyvalues are kept and invalid ones are dropped during schema parsing.apps/importer/src/shopee/types.tsauthorKeyfield to theShopeeReviewinterface.apps/importer/src/shopee/ai-review-analyzer.tsauthor_keytoReviewInputItem. IntroducesreviewAuthorIdentity()helper to generate a unique identity string (key:,name:, orid:prefix) for duplicate detection. Updates the analyzer to use this new identity function.apps/importer/src/shopee/shopee-to-supabase.tsstoreAuthorKeys()to upsert keys into the DB after review ingestion. AddsloadAuthorKeys()to fetch keys for existing reviews before analysis. Integrates these into the main pipeline.apps/importer/src/shopee/test-review-analyzer.tsauthor_keyeven whenauthor_nameis masked or identical.apps/importer/src/shopee/__tests__/shopee-to-supabase.test.tsreview_author_keystable interactions and verifies that keys are correctly upserted during ingestion.📊 Architectural Flow
sequenceDiagram participant RS as Rate-Services participant Importer as Shopee Ingestion Pipeline participant DB as Supabase (rate.review_author_keys) participant Analyzer as AI Review Analyzer RS->>Importer: Sends reviews with masked author_name & authorKey (HMAC) Note over Importer: Ingestion Phase Importer->>DB: Upsert review_author_keys (review_id, author_key) DB-->>Importer: Success Note over Importer: Analysis Phase Importer->>DB: Load author_keys for stored reviews DB-->>Importer: Map of review_id -> author_key Importer->>Importer: Build ReviewInputItem[] with author_key Importer->>Analyzer: Pass reviews to analyzeWithHeuristics Note over Analyzer: Duplicate Detection Analyzer->>Analyzer: Use reviewAuthorIdentity() to group authors alt author_key exists Analyzer->>Analyzer: Identity = "key:<author_key>" else author_name exists Analyzer->>Analyzer: Identity = "name:<lowercased_name>" else Analyzer->>Analyzer: Identity = "id:<review_id>" end Analyzer-->>Importer: Returns analysis results (seeding flags, etc.)