Skip to content

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

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

JOY (JOY) merged 3 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 the "Review Value Score" (P6) database migration, which adds a private rate.review_values table to store detailed review quality metrics and a public value_tier column, while refactoring the web application to use shared depth-classification logic from @repo/shared-data.

🎯 Type of Change

  • 🚀 New feature
  • 🧹 Refactor
  • ⚙️ CI / Configuration

🔍 Changes Walkthrough

File Summary of Changes
.github/workflows/ci.yml Adds a CI step to build @repo/shared-data and run the new test-review-value-proposal.mjs script to validate the SQL proposal in Docker.
.gitignore Un-ignores the new SQL proposal, rollback, and verify files so they are tracked in the repository.
Docs/Proposals/2026-11-02-dos-me-review-value-score.sql Core Migration: Creates rate.review_values (private, RLS-protected), adds value_tier to rate.reviews, implements rate.review_completeness_factor, updates rate.master_rating_extras to apply the weight factor, and creates rate.store_review_values (writer) and rate.my_review_values (reader) functions.
Docs/Proposals/2026-11-02-dos-me-review-value-score-rollback.sql Rollback Script: Reverts the rating function to the previous version, drops triggers, and removes the new table/columns/constraints.
Docs/Proposals/2026-11-02-dos-me-review-value-score-verify.sql Verification Script: Read-only checks (V1-V8) to ensure the factor formula matches the shared module, permissions are correct, and data integrity is maintained.
Docs/Proposals/2026-11-02-dos-me-review-value-score.md Documentation: Detailed proposal explaining the D6 (weight) and D7 (privacy) decisions, apply/rollback procedures, and security implications.
apps/web/src/lib/rate-domain-core.ts Refactor: Replaces local regex-based depth classification (ReviewDepthAxis) with the shared reviewDepth function 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 Updates architecture tests to allow value imports from @repo/shared-data/rules in rate-domain-core.ts.
packages/shared-data/src/__tests__/shared-data.test.ts Adds comprehensive tests for reviewDepth (Axis C classification) and reviewValue (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.)
Loading

JOY (JOY) and others added 3 commits November 2, 2026 10:12
…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>

@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 9:05am 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: a0addae9-631f-4351-9639-4a2192eea2e9

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 labels Nov 2, 2026
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 (13 eligible files · 115,831 chars · 1 model call(s) · 4 PR unit(s))

Whole diff with bounded context at base 92d86ba / head 0b2b46c.

✅ CLEAN_PASS: Complete diff reviewed

@JOY
JOY (JOY) merged commit 3799c82 into main Nov 2, 2026
23 checks passed
JOY (JOY) added a commit that referenced this pull request Nov 6, 2026
* chore(db): mirror the review author keys migration from dos-me

Mirrors 20261109130000_rate_review_author_keys.sql byte for byte (DOS.Me #1584,
promote DOS.Me #1585) and regenerates database.types.ts.

Refs #1614

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 0b2b46c7 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: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