← Back to Pull requests

feat(ingestion): retailer mode, Harlow & Co, Beyond Polish, Hypnotic Polish, vendor-code aliases and source image removal (brand sources Phase B) #503

Closed
unknown closed this pull request without merging on Nov 09, 2026 07:24 UTC
View on GitHub
unknown unknown commented on Nov 08, 2026 12:41 UTC
Author

Summary

Stacked on #502 (Phase A). Base is feat/brand-sources-phase-a so the diff shows Phase B only; GitHub retargets it to dev when #502 merges.

Phase B of the brand-sources ingestion plan (docs/superpowers/plans/2026-11-08-brand-sources-ingestion.md, Tasks 4–9b, 19 commits), stacked on #502 (Phase A). Retailer mode for the generic Shopify connector and the three multi-brand retailers from the evaluation (docs/brand-sources-evaluation-2026-11.md).

  • Retailer title parsing (lib/connectors/retailer-title.ts): parseRetailerTitle(title, brand, extraPrefixes?) reads Brand - Shade - Line #CODE titles (vendor prefix, product line, dotted / glued vendor codes ≥ 2 chars, sizes, set detection with isRetailerSetSegment, end-anchored so "Set Sail" stays a shade).

  • Retailer mode in the generic connector (shopify-generic.ts): retailer/feed sources resolve the vendor through metadata.vendorAliases (resolveRetailerVendor; a vendor-less product is skipped, metadata.vendorlessSkipped), parse the listing title, and emit records with finishes: [], collections: [], listingTitle, productLine, vendorCode, discontinued, kind; pipe tag markers (|| Top Coat) are stripped. Polish Pickup keeps its own parser. New env SHOPIFY_CONNECTOR_PAGE_DELAY_MS (default 1000, Terraform-wired) paces multi-page catalogs.

  • Harlow & Co (HarlowAndCoShopify, enabled, CAD, migration 20261108120000000), Beyond Polish (BeyondPolishShopify, enabled, USD, includeGel false, maxPages 100, migration 20261108130000000), Hypnotic Polish (HypnoticPolishShopify, disabled / pending approval, EUR, migration 20261108140000000), each with a store filter, a fixture and tests; Beyond Polish has an end-to-end fake-DB ingest test over a real-pull fixture. No imagesPermitted on any of them: no images stored until the owner records the store's OK.

  • Vendor-code aliases: a retailer listing's vendorCode and raw title become shade_alias rows, so a scanned OPI bottle labelled NLB83 matches through catalog search. docs/queries/reseller-duplicates.sql is the post-run duplicate audit.

  • Source image removal (POST /api/images-admin/source-images/remove, npm run remove:source-images, Backfills tab): for a disabled source, unlink and delete its catalog images and blobs in keyset batches; labeled / color-feature images and shared blobs are kept.
  • Not done here (owner checklist)

  • Email Beyond Polish and Harlow & Co (spec §7); on an images OK set metadata.imagesPermitted = true and re-run.

  • Email Hypnotic Polish; on a yes, enable the row (README "Enabling a pending store").

  • Local dry run of the Harlow & Co and Beyond Polish jobs before the enabled rows reach prod (the full Beyond Polish read is 71 pages with 1 s pauses; confirm it fits INGESTION_WORKER_TIME_BUDGET_MS), then run docs/queries/reseller-duplicates.sql and record the per-brand counts.
  • Test plan

  • npm run build:functions && npm run test --workspace=swatchwatch-functions (3330 tests, 3328 pass, 2 skipped)

  • npm run typecheck, npm run lint

  • CI Mobile / web builds green
  • 🤖 Generated with Claude Code

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

    Summary by CodeRabbit

    New Features
    Added retailer listing support for Harlow & Co. and Beyond Polish, with improved shade, product-line, vendor-code, and brand recognition. Hypnotic Polish is available as a disabled, pending-approval source.
    Added an admin tool and command-line option to remove images from disabled sources, with dry-run mode, batch processing, progress reporting, and safeguards for shared or labeled images.
    Added configurable Shopify page limits and request delays, including per-source page-limit overrides.
    Bug Fixes
    Improved image-removal reports to preserve batch failures and resume progress when a batch encounters errors.
    Documentation
    Expanded guidance for retailer sources, Shopify settings, and image cleanup workflows.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 524 lines (+393 / -131) across 6 files Reviewer: mattmck Review duration: 1122m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 524 lines diff across 6 files
    0.48
    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.375
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #503"
    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: 47.8% (MEDIUM) · Higher = larger blast radius
    47.8%
    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: 18.9% · Safe to merge
    18.9%