Repository navigation
Conversation
…P6) (#1579) * feat(shared-data): review value score, tier and completeness weight factor Refs #1547. Design #1531 section 6, D6 and D7: a 0-100 value score from completeness (35), specificity (20), a verified purchase (15), helpful votes through the Wilson lower bound (20) and author trust (10). Gated reviews score 0. A public tier (basic, complete, excellent) and the gaps the writer can fill. Completeness lifts the rating weight by x1.00 to x1.25, capped at 3. Lines count once however often they are repeated, dodging cons earn nothing and a superficial text earns no completeness. * fix(shared-data): stricter value score lines, photo-free weight for imports Refs #1547. From two fresh-context reviews: lines are deduplicated without diacritics or spaces; praise alone, dodges and AI-extracted lines earn nothing; a category without its own criteria list has none to complete; a verdict that repeats a line or is too long earns nothing. The new weightCompleteness drops the photo of a review without pros and cons, so a marketplace review keeps its weight (design 6.2). Malformed input reads as an empty review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…6) (#1580) * feat(shared-data): review value score, tier and completeness weight factor Refs #1547. Design #1531 section 6, D6 and D7: a 0-100 value score from completeness (35), specificity (20), a verified purchase (15), helpful votes through the Wilson lower bound (20) and author trust (10). Gated reviews score 0. A public tier (basic, complete, excellent) and the gaps the writer can fill. Completeness lifts the rating weight by x1.00 to x1.25, capped at 3. Lines count once however often they are repeated, dodging cons earn nothing and a superficial text earns no completeness. * fix(shared-data): stricter value score lines, photo-free weight for imports Refs #1547. From two fresh-context reviews: lines are deduplicated without diacritics or spaces; praise alone, dodges and AI-extracted lines earn nothing; a category without its own criteria list has none to complete; a verdict that repeats a line or is too long earns nothing. The new weightCompleteness drops the photo of a review without pros and cons, so a marketplace review keeps its weight (design 6.2). Malformed input reads as an empty review. * docs(proposals): dos-me review value score and completeness weight (P6) Refs #1547. A DOS-Me migration proposal, nothing applied: the D6 factor from the stored weightCompleteness, the rating weight LEAST(3, weight x factor), the trigger on the factor, and store_review_values as the one checked writer for the scoring job. Verify V1-V7, a rollback that puts P2's functions back, and a Docker replay in CI. * fix(proposals): stricter p6 writer, lock-safe rollback, refresh on re-apply Refs #1547. From two fresh-context reviews: the writer accepts only a breakdown the shared module could produce (keys, tier, gaps, parts, the photo rule both ways, 2 MB) and locks rows in id order; the CHECK ties weightCompleteness to completeness; lock_timeout on the ALTERs; a refresh after the transaction re-lifts kept values; the rollback refreshes before it drops under a short lock; V2, V6 and V7 check more; the replay stores a 448-input grid of module output. The md lists the decisions honestly. * fix(proposals): p6 keeps the value number private (D7) Refs #1547. The PO held decision 1 to the approved D7: the tier is public, the number only for the writer. Values move to rate.review_values (RLS, no anon or authenticated access, written only by store_review_values); the public rate.reviews gets value_tier, and a CHECK keeps P2's number columns empty; rate.my_review_values lets a writer read their own through rate.review_authors. The rating joins the private table and its own triggers refresh on a factor change; P2's reviews trigger is untouched. * fix(proposals): p6 writer without temp table, safer locks, pre-apply guard Refs #1547. From two fresh-context reviews of the D7 redesign: the writer reads its batch straight from p_values (a caller-made temp table could hijack it), locks FOR NO KEY UPDATE; the apply refuses a review that already holds a public number and alters rate.reviews before creating the table; the rollback keeps reviews_value_private and refreshes only lifted masters; V3 checks DELETE and TRUNCATE; the md states D7's limits and the job's retry and V5 duties. The module header points at the writer. * Merge remote-tracking branch 'origin/dev' into docs/1547-dos-me-review-value-proposal # Conflicts: # packages/shared-data/src/rules/review-value.ts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the web (#1582) * feat(shared-data): review depth on the whole review text, shared with the web (#1581) - reviewDepth in @repo/shared-data/rules classifies axis C over the comment, verdict and writer lines (AI-extracted lines skipped), each part matched alone. - Repeated clauses and runs of a word or phrase (3+) leave the length, so padding cannot reach the 30/90/240 thresholds. - evaluateReviewTrustAssessment uses it and the shared regexes; a comment without repeats classifies as before. review-value takes ReviewDepth from it. Closes #1581 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 the "Review Value Score" (P6) database migration, which adds a private
rate.review_valuestable to store detailed review quality metrics and a publicvalue_tiercolumn, while refactoring the web application to use shared depth-classification logic from@repo/shared-data.🎯 Type of Change
🔍 Changes Walkthrough
.github/workflows/ci.yml@repo/shared-dataand run the newtest-review-value-proposal.mjsscript to validate the SQL proposal in Docker..gitignoreDocs/Proposals/2026-11-02-dos-me-review-value-score.sqlrate.review_values(private, RLS-protected), addsvalue_tiertorate.reviews, implementsrate.review_completeness_factor, updatesrate.master_rating_extrasto apply the weight factor, and createsrate.store_review_values(writer) andrate.my_review_values(reader) functions.Docs/Proposals/2026-11-02-dos-me-review-value-score-rollback.sqlDocs/Proposals/2026-11-02-dos-me-review-value-score-verify.sqlDocs/Proposals/2026-11-02-dos-me-review-value-score.mdapps/web/src/lib/rate-domain-core.tsReviewDepthAxis) with the sharedreviewDepthfunction from@repo/shared-data/rules. Removes local regexes for product aspects and platform labels in favor of shared constants.apps/web/src/server/rate/__tests__/core-rate-architecture.test.ts@repo/shared-data/rulesinrate-domain-core.ts.packages/shared-data/src/__tests__/shared-data.test.tsreviewDepth(Axis C classification) andreviewValue(scoring logic), ensuring parity between the shared module and the previous web implementation.📊 Architectural Flow
sequenceDiagram participant ScoringJob as Scoring Job (rate_worker) participant DB as PostgreSQL (rate schema) participant Web as Web App (authenticated) participant Shared as @repo/shared-data Note over ScoringJob, Shared: 1. Scoring & Storage ScoringJob->>Shared: Compute reviewValue (depth, completeness, etc.) Shared-->>ScoringJob: Return breakdown JSON ScoringJob->>DB: Call rate.store_review_values(jsonb) DB->>DB: Validate breakdown (strict schema check) DB->>DB: INSERT/UPDATE rate.review_values (Private) DB->>DB: UPDATE rate.reviews.value_tier (Public) DB->>DB: Trigger refresh on rate.master_rating_extras Note over Web, DB: 2. Reading Data Web->>DB: SELECT rate.reviews (Public) DB-->>Web: Return reviews with value_tier (basic/complete/excellent) Web->>DB: Call rate.my_review_values(uuid[]) DB->>DB: Check auth.uid() against rate.review_authors DB-->>Web: Return value_score & breakdown (Only for own reviews) Note over Web, Shared: 3. Depth Classification (Refactor) Web->>Shared: Import reviewDepth() Shared-->>Web: Return ReviewDepth (stars_only, detailed, etc.)