← Back to Pull requests

fix(functions): treat polish sets and bundles as non-polish, catch more accessories (#347) #452

Closed
unknown closed this pull request without merging on Oct 23, 2026 16:59 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 16:13 UTC
Author

Non-polish products were still showing on dev (e.g. shades 973 "$2 Mystery 3D Nail Art", 847 "Nail Care Buffer, 3 Pack", 1107 "2025 Nail Lacquer Countdown Box Overpours"). This tightens the product-category rules and treats polish sets/bundles as non-polish.

Decision: sets are non-polish (for now)


A set should ideally put each of its polishes in the owner's inventory, but identifying them from photos isn't reliable. Sets are classified accessory with evidence set: skipped at ingestion (even when a Shopify store filter keeps the product) and hidden by the product-category backfill like accessories. No new category, no migration. Expanding a set later can match the polish names in its description text against the brand's catalog.

Rules (audit query first, classifier mirrors it)


  • Sets: bundle, duo, trio, quad, gift/box/mani set, advent calendar, countdown box, full collection, set of N, N pcs/pack/bottles (N ≥ 2); a name/title/product type with no " - " parts that ends in set(s)/collection; whole set tags (bundle, bundles-sets, collection-set, gift-set, ...).

  • Kept as polish: "Set On Fire", "Jet Set", "Bundle of Joy", "Duo Chrome …", "Box Office Bomb", "Brat Pack", Holo Taco's "Gift Receipt" (a silver metallic polish), single "1 Pc" items, and Dam's single shades annotated with their release ("… Nail Polish - 10th Anniversary Trio", "… - Chinese Zodiac Collection").

  • Accessories: nippers (a "Cuticle Nipper" was being read as a treatment), accessory/merch types, nail tattoos, keychains, t-shirts, hoodies, lip gloss/balm, and products whose type is non-polish "Nail Art" (stickers, tattoos, chrome powders, 3D nail art). "Nail Art No Smudge Top Coat" stays a top coat.
  • How it was checked


  • Ran old vs new gate over ~12k products from the 38 connected stores' public products.json; every newly rejected product was reviewed (all sets, kits or merch after the Dam fix).

  • Postgres and JS regexes give the same answer on the sample names; the audit query and classifyProductCategory agree on all 521 local shades.

  • npm test (functions 2483 pass, all workspaces green via the hook).
  • After merge


    Dev's catalog was never reclassified: stamping plates, stickers, nippers and buffers are still color there. Run npm run backfill:product-category --workspace=swatchwatch-functions -- --out report.json against dev (dry run), review, then --write.

    Refs #347

    🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Multi-polish sets and bundles are now classified as accessories rather than individual nail polishes, including when store-specific filters would otherwise allow them through.
    Nail-art products and products with certain accessory terms are more consistently recognized as accessories.
    Improved set detection helps distinguish collections from single polishes with similar names.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 388 lines (+291 / -97) across 4 files Reviewer: mattmck Review duration: 46m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 388 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.357
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #452"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.1% (MEDIUM) · Higher = larger blast radius
    43.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17% · Safe to merge
    17%