Skip to content

fix(importer,web): plan v7 section 5 code fixes - #3

Merged
JOY (JOY) merged 1 commit into
devfrom
feat/importer-plan-s5-fixes
Oct 6, 2026
Merged

JOY (JOY) merged 1 commit into
devfrom
feat/importer-plan-s5-fixes

Conversation

@JOY

Copy link
Copy Markdown
Contributor

Summary

Implements section 5 (code-side fixes) of the approved Rate domain plan (Docs/Proposals/2026-10-04-rate-domain-migration-plan.md, Codex APPROVED-WITH-NOTES + Gemini APPROVED after 7 adversarial rounds). The schema half of the plan is already merged in DOS-Me PR #1027.

  • entity-matcher: infra errors abort ingestion (no silent cluster split); Tier 3 upsert on model_key; low-confidence identities seeded as draft
  • product-normalizer: RAM-aware storage parsing with regression proof (A55 8GB RAM 256GB case); ambiguous titles -> ':unknown' + needs_review instead of the old 128GB guess
  • shopee-to-supabase: idempotent price_history via stable observation_id; review observation-id fallback; errors surfaced
  • rate-api: env hardening (no prod fallback), errors thrown, review verdicts (review_flags) embedded for badges

Verification

  • tsc --noEmit clean for importer and web
  • Normalizer regression: 4 cases pass (RAM-after-token, ROM marker, single candidate, ambiguous->unknown)
  • Note: price observation_id upsert requires DOS-Me migrations 20261005130000/130001 in the target env (in beta->prod pipeline); fails hard otherwise by design

Implements section 5 of the approved Rate domain plan v7 (Codex
APPROVED-WITH-NOTES after 7 adversarial rounds, Gemini APPROVED; schema
half merged in DOS-Me PR #1027):

- entity-matcher: Tier 1/2 infra errors abort ingestion (no silent
  cluster split); Tier 3 insert-only + winner refetch; fuzzy below
  0.70 and unparseable identities seed as draft, never auto-published
- product-normalizer: deterministic RAM-word matching - every RAM
  phrase claims its adjacent size token, the single unclaimed
  remainder is storage, ambiguity keeps ':unknown' identity + draft;
  ROM/bo-nho-trong markers beat RAM phrases, loose 'dung luong' keeps
  a RAM-phrase lookahead; decimal comma accepted. 18/18 regression
  cases incl. all Codex probes
- shopee-to-supabase: idempotent price_history via listing-scoped
  observation_id (client-side dedupe - partial index cannot take
  ON CONFLICT); stable review observation ids without createdAt;
  review writes dedupe in-batch and fail ingestion on error
- rate-api: fail hard on missing env, throw on query errors,
  review_flags verdicts embedded for UI badges, published-only reads

Dependency: price_history.observation_id + review_flags live in
DOS-Me migrations 20261005130000/130001 (propagating beta->prod);
missing schema fails hard by design.
@JOY
JOY (JOY) force-pushed the feat/importer-plan-s5-fixes branch from 4e3fc84 to fe5e2a9 Compare October 6, 2026 03:17
@JOY
JOY (JOY) merged commit 52b4b80 into dev Oct 6, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant