← Back to Pull requests

feat(functions): Cirque Colors store filter and indie source batch 2 survey #388

Closed
unknown closed this pull request without merging on Oct 20, 2026 03:10 UTC
View on GitHub
unknown unknown commented on Oct 20, 2026 02:55 UTC
Author

What

Batch 2 of the indie Shopify sources for #273. No new store is added: every remaining Shopify candidate's terms forbid automated access, and the brief says not to add those. The batch delivers the Cirque Colors store filter instead, which is the biggest catalog gain available right now.

  • Cirque Colors store filter (connectors/store-filters/cirque-colors.ts, registered in SHOPIFY_STORE_PRODUCT_FILTERS). Cirque's product_type holds the finish or line (Jelly, Magnetic, Crème, Retired Colors…), so the generic gate kept only 10 of 415 products. The filter now keeps 328 of 415: 293 color, 23 topper, 7 treatment, 4 base coat and 1 top coat by the rule classifier. It drops 85 products: sets, duos, trios, quads, bundles, nail-art kits, tools, charms, stickers, remover, wipes, the gift card, the (100% off) free gifts and the creator profile pages. The bundle tag drops 2 more. Unit tests use a trimmed fixture of the full 2026-10-19 catalog (tests/fixtures/cirque-colors-products.json).

  • Connector category fix (shopify-generic.ts). Cirque tags real shades and coats with nail-art tutorial names such as "Abstract Dry Brush", and those tags hit the June tag blocklist. When a store filter keeps such a product, the connector now records the rule category (the one materialization stores) instead of accessory. Materialization already re-classified products, so this fixes the normalized record and makes it consistent with what gets stored.

  • Coat precedence (CodeRabbit). classifyProductCategory and docs/queries/catalog-hygiene-audit.sql now read base coat, top coat and treatment wording in the name, title and product type before the tags. Cirque tags every coat "Top & Base Coat", which made "Looking Glass Top Coat" a base_coat; it is now a top_coat. The next product-category backfill re-files any existing shade whose title and tags disagree in this way.

  • Seed safety (docs/seed_data_sources.sql). Before this change, the seed's ON CONFLICT overwrote enabled and replaced all of metadata, which is the issue CodeRabbit raised on the indie migration. A reseed now keeps an existing row's enabled and every metadata key it already has (notes, recorded approval, metadata.ingestion). Missing keys are still filled in. metadata.verification is merged with the seed's values winning, so re-survey facts reach existing rows. The Cirque seed row records storeFilterPass: 328.

  • Docs: the survey docs/indie-sources-2026-10.md gets a new Batch 2 section; the roadmap §4 catalog-shades row has the dry-run counts; the Functions README covers the connector, data source and store filter sections; the CLAUDE.md connector bullet is updated.
  • Per-store results

    | Store | Result |
    |---|---|
    | Mooncat, Cupcake Polish | Already enabled sources (no change) |
    | ILNP | WooCommerce, products.json 404: not a shopify-generic source |
    | KBShimmer | Cloudflare challenge (403) |
    | Painted Polish | Big Cartel: needs its own connector |
    | Stella Chroma, Lemming Lacquer, Sweet & Sour, Maniology, What's Up Nails, F.U.N, Glam Polish, Moon Shine Mani, Dreamland | Terms carry a scraping clause: not added |
    | Nails.INC, Ninja Polish | Terms forbid reproducing content without written permission (Ninja is also a multi-brand reseller): not added |
    | Great Lakes Lacquer, Bee's Knees, Kathleen & Co, Sassy Sauce, Clionadh | Already sources |
    | ~35 other guessed domains | No storefront answer, password page or not Shopify |

    Dry-run counts. I ran the connector's own gate (classifyIngestedProduct + store filter + isBundle, built from this branch) over each store's downloaded products.json:

  • Cirque Colors: 415 fetched, 328 accepted (generic gate before this PR: 10).

  • Great Lakes Lacquer (existing source, re-checked): 27 fetched, 26 accepted; dropped "Replacement Fan Brush". "The Boat Load Bundle" is kept because it has no bundle tag (follow-up).
  • Judgment calls

  • "Do not add a store whose terms forbid it": I counted the Shopify default "spider, crawl, or scrape" clause as forbidding. Emily de Molly and Cirque were seeded under that same clause, but only as a step toward a written OK. I followed the brief and added none of these stores. The survey lists each one so the owner can ask them.

  • I only fetched full products.json from stores whose terms have no such clause or that have already signed off (Cirque, Great Lakes). For the others I made one ?limit=1 request plus the terms page, the same method as the first survey.

  • I did not run a full ingest against local Postgres plus the Functions host. That would have re-fetched Cirque's live catalog through the full pipeline (images, AI). The dry run uses the same gate code over the downloaded JSON. A connector-level unit test drives ShopifyGenericConnector.pullProducts with Cirque products and checks the categories.

  • The legacy migration 20261019013349049_add-more-indie-shopify-sources still has the open CodeRabbit thread on #375 about its Down section. Committed migrations are protected by the repo hook and already applied, so I left it alone. The seed fix here covers the reseed side.
  • Decisions needed

    1. Ask the scraping-clause stores for written OK? The best candidates are Stella Chroma, Lemming Lacquer, Sweet & Sour, F.U.N Lacquer, Glam Polish and Moon Shine Mani. I recommend asking the first three, then adding each disabled and pending with the agreement recorded in notes. This blocks any further indie Shopify growth.
    2. The +10k target. Indie Shopify is nearly exhausted without store agreements: this batch adds about 316 shades. I recommend prioritizing a non-Shopify route (affiliate/retailer feeds, docs/data-sources-research.md). This blocks the roadmap §4 metric.

    No store had odd pagination or rate limiting: Cirque has 2 pages of 250 and Great Lakes 1.

    Verification

  • npm run typecheck ✅, npm run lint ✅ (0 errors; 11 pre-existing web warnings)

  • npm test --workspace=swatchwatch-functions: 2214 pass, 0 fail (includes 10 new Cirque tests and a coat-precedence classifier test)

  • docs-sync-checker agent: flagged the CLAUDE.md connector bullet, now updated
  • Part of #273

    🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: mattmck Review duration: 15m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.52) × (1 − Review Confidence (0.56)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 96% · Reviewer familiarity: 35%
    55%
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #388"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 55.8% 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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 55.8% · Lower = rushed or shallow review
    55.8%
    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: 23.0% · Safe to merge
    23.0%