Skip to content

feat(web): add 30-day EU Omnibus floor audit and 90d cycle signal - #1869

Open
JOY (JOY) wants to merge 4 commits into
devfrom
feat/1863-omnibus-price-audit
Open

JOY (JOY) wants to merge 4 commits into
devfrom
feat/1863-omnibus-price-audit

Conversation

@JOY

@JOY JOY (JOY) commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1863
Claimant: antigravity:0bf51a92-7798-4214-9d8f-7dc9804217b4

Summary

Implements Package 8A Feature F1 (30-day EU Omnibus prior price-floor check and 90-day Buy-Now vs Wait cycle indicator) across rate.vn product price history, /inspect, and /deals with zero database migrations and zero LLM/runtime infrastructure cost:

  1. Pure 30-Day EU Prior Floor & 90-Day Percentile Engine (apps/web/src/lib/omnibus-price-audit.ts)

    • Computes priorFloorPriceVnd, exact VND and percentage deltas vs the prior floor, and seller strikethrough markup vs the prior floor.
    • Strict 30-day window honesty: certifies a 30-day EU prior floor (omnibus_30d_certified) ONLY when actual observed history (seriesLatestMs - earliestMs and anchorMs - earliestMs) spans >= 30 full days across >= 3 distinct observation days with zero blackout gaps (> 18 days). Shorter windows (< 30 days) report exact observed days (partial_window) and gapped logs (blackout_gap) withhold certification without fabricating day counts.
    • 90-day Buy-Now vs Wait percentile: buckets valid observations into 24-hour day slots (immune to same-day crawl bursts) over a 90-day lookback (>= 5 distinct observed days spanning >= 14 days, >= 1% relative range) to classify buy_now_floor (<= P15), fair_market (P16..P70), or above_recent_floor (> P70, reporting exact VND gap above the 90-day low).
    • Excludes bait-price (implausiblyLow, < MINIMUM_DEVICE_PRICE_FLOOR_VND / < MINIMUM_EARBUDS_PRICE_FLOOR_VND), out_of_stock / discontinued, and synthetic live_listing rows.
  2. Three UI Surfaces (PriceHistorySection.tsx, DeepInspectWorkspace.tsx, DealFinderWorkspace.tsx)

    • Renders the 3-column EU 30-day floor & 90-day cycle card on product detail pages (PriceHistorySection.tsx, adapting between product-wide verified floor and per-merchant filter selection) and /inspect (DeepInspectWorkspace.tsx, evaluating matched listings strictly against their own 30-day history and the 90-day market cycle at the listing's own price, with WCAG 3.1.2 lang tagging on seller names).
    • Adds seasonal sale campaign filter chips (All devices, Top genuine sale drops, Pre-sale inflated strikethrough alerts) and per-card callouts on /deals (DealFinderWorkspace.tsx), preserving keyboard focus on empty-state resets.
  3. Localization & Accessibility (vi, en, cs)

    • Full key and placeholder parity across vi, en, and cs strictly inside "deals", "inspect", and "priceVerdict" namespaces, using plain shopper sentence-case copy, Czech NBSP / decimal comma formatting, zero em/en-dashes, and WCAG 2.1 AA contrast (>= 4.5:1) in both light and dark themes.

Review Gate

  • Reviewer 1 (Independent Fresh-Context Subagent - Pricing, Math & Plausibility): Found 3 P1 + 5 P2 findings in Round 1 (/inspect matched-listing 90d cycle price & 0-history listing scoping, PriceHistorySection unavailable-offer & peer-reference propagation, seriesSpanMs trailing-silence window honesty, non-earbuds 1,200,000 VND floor propagation, blackout_gap windowDaysUsed = 0, 90d < 1% micro-spread guard + live low clamping, sub-0.05% 2-decimal rounding without -0%/+0%, and matchesSeasonalSaleFilter strict priceOriginal > priceCurrent / savingsVsMedianVnd > 0 checks). All 8 findings fixed and covered by unit regression tests.
  • Reviewer 2 (Independent Fresh-Context Subagent - WCAG A11y, i18n & Boundary): Verified light/dark theme contrast ratios (>= 4.97:1 across all token pairs), heading hierarchy (h1 -> h2 -> h3), ARIA group/pressed semantics, and strict file/namespace partition. Found 3 P2 + 2 P3 findings (blackout_gap per-offer badge guard, <ContentText> lang="vi" wrapper on /inspect seller name, focusCardIndex restoration on /deals campaign reset, double-negative save {savings} & Czech NBSP before d polish). All 5 findings fixed and verified.
  • Codex CLI note: Local Codex CLI is out of quota until Nov 25, 2026, so /codex:review could not run locally in this session.

Verification

  • pnpm --filter @repo/web test (all suites including core-rate-architecture, display-truth, discount-verdict-copy, sale-state, offer-plausibility, client-messages, plural-copy) - PASS
  • pnpm typecheck - PASS
  • pnpm lint (--max-warnings 0) - PASS
  • pnpm build - PASS

📌 TL;DR

This PR introduces a "Seasonal Sale Campaign" filter to the Deal Finder and a comprehensive "Omnibus Price Audit" card to the Deep Inspect workspace. These features leverage 30-day EU price-floor rules and 90-day market cycles to distinguish genuine discounts from inflated "fake sale" traps, with full localization support for English, Czech, and Vietnamese.

🎯 Type of Change

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

🔍 Changes Walkthrough

File Summary of Changes
apps/web/locales/cs.json Added Czech translations for seasonal campaign filters, empty states, and the new 3-column Omnibus audit card (30-day floor & 90-day cycle).
apps/web/locales/en.json Added English translations for seasonal campaign filters, empty states, and the new 3-column Omnibus audit card.
apps/web/locales/vi.json Added Vietnamese translations for seasonal campaign filters, empty states, and the new 3-column Omnibus audit card.
apps/web/src/components/deals/DealFinderWorkspace.tsx Implemented UI for seasonal sale campaign filtering (chips for "All", "Genuine Drops", "Inflated Traps"). Added conditional rendering for deal cards to display specific trap/genuine callouts based on the active filter.
apps/web/src/components/inspect/DeepInspectWorkspace.tsx Integrated the evaluateOmnibusPriceAudit logic to calculate 30-day EU floors and 90-day cycles. Rendered a new 3-column audit card displaying current price vs. claimed price, verified floor status, and buy/wait recommendations.

📊 Architectural Flow

flowchart TD
    subgraph Data Layer
        A[Price History Points] --> B[Omnibus Price Audit Lib]
        C[Current Offer Data] --> B
    end

    subgraph Deal Finder
        D[DealFinderWorkspace] --> E{Seasonal Filter Mode}
        E -->|All| F[Show All Deals]
        E -->|Genuine| G[Filter Genuine Drops]
        E -->|Traps| H[Filter Inflated Traps]
        G --> I[Render Genuine Callouts]
        H --> J[Render Trap Callouts]
    end

    subgraph Deep Inspect
        K[DeepInspectWorkspace] --> L[Calculate 30d EU Floor]
        K --> M[Calculate 90d Cycle]
        L --> N[Omnibus Audit Card]
        M --> N
        N --> O[Col 1: Current vs Claimed]
        N --> P[Col 2: Verified Floor Status]
        N --> Q[Col 3: Buy Now vs Wait]
    end
Loading

@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 22, 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 22, 2026 3:51pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: c85a832e-df8f-4e00-8f17-1a31ccfb7fc0
Commits

Reviewing files that changed from the base of the PR and between 1c75b42 and 22152b3.

Files selected for processing: 9

  • apps/web/locales/cs.json
  • apps/web/locales/en.json
  • apps/web/locales/vi.json
  • apps/web/src/components/deals/DealFinderWorkspace.tsx
  • apps/web/src/components/inspect/DeepInspectWorkspace.tsx
  • apps/web/src/components/price-history/PriceHistorySection.tsx
  • apps/web/src/lib/__tests__/discount-verdict-copy.test.ts
  • apps/web/src/lib/__tests__/sale-state.test.ts
  • apps/web/src/lib/omnibus-price-audit.ts
  • 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

dos[bot]
dos Bot approved these changes Nov 22, 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 (9 eligible files · 156,450 chars · 1 model call(s) · 6 PR unit(s))

Whole diff with bounded context at base 1c75b42 / head 22152b3.

✅ CLEAN_PASS: Complete diff reviewed

This branch was successfully deployed

1 active deployment
Preview — 22152b36 Deployed Nov 22, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(web): add 30-day EU Omnibus price-floor audit and buy-vs-wait signal

2 participants