Skip to content

feat(tracking): capture Microsoft Copilot shoppingCards into prompt_results - #85

Merged
gkhngyk merged 1 commit into
feat/tracking-shopping-cardsfrom
feat/tracking-copilot-shopping-cards
May 23, 2026
Merged

gkhngyk merged 1 commit into
feat/tracking-shopping-cardsfrom
feat/tracking-copilot-shopping-cards

Conversation

@gkhngyk

@gkhngyk gkhngyk commented May 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Companion to #46 — captures Microsoft Copilot's product cards into prompt_results.shopping_cards, the same column Perplexity writes to. Copilot returns its cards under camelCase shoppingCards; we unwrap that into the parsed object's shopping_cards key so the existing storage path (column, types, result-handler from #46) needs no Copilot-specific code.

Both providers store their cards raw, in their own shape — downstream branches on prompt_results.platform to interpret. No flattening, no normalization.

Closes #47

Change

Single line in server/src/lib/cloro-scraper.js (the generic/non-Google branch that Copilot + Perplexity both use):

shopping_cards: result.shopping_cards ?? result.shoppingCards ?? [],
  • Perplexity → result.shopping_cards (snake_case)
  • Copilot → result.shoppingCards (camelCase)
  • Everyone else → neither key → []

There's no dedicated Copilot branch in the parser (Copilot goes through the shared generic branch), so handling both keys there is the minimal, non-duplicating change — rather than forking a Copilot-only branch that would copy the text/citations/model logic.

Stacked on #46

Depends on #46 (PR #83), which adds the shopping_cards column, Supabase types, and the result-handler insert. This PR is based on that branch — merge #83 first; GitHub will then retarget this to main and the diff is the single line above.

Verification

Out of scope

Shape normalization, UI, scoring, brand-in-card detection, MCP/REST exposure — all future, same as #46.

…esults

Companion to #46. Copilot returns its product cards under camelCase
`shoppingCards`; unwrap it into the same parsed `shopping_cards` key so it
lands in prompt_results.shopping_cards raw (Copilot shape), alongside
Perplexity's snake_case cards in the same column. Contents are stored
verbatim — downstream branches on `platform` for shape.

Stacked on #46 (PR #83), which adds the column, types, and result-handler.

Closes #47
@gkhngyk
gkhngyk merged commit 61e64fb into feat/tracking-shopping-cards May 23, 2026
3 checks passed
@gkhngyk
gkhngyk deleted the feat/tracking-copilot-shopping-cards branch May 23, 2026 17:45
gkhngyk added a commit that referenced this pull request May 23, 2026
…esults (#87)

Copilot returns its product cards under camelCase `shoppingCards`; unwrap
into the shared snake_case `shopping_cards` parsed key (generic branch that
Copilot + Perplexity share). Verified live against Cloro (real populated
card). Stored verbatim; downstream branches on `platform` for shape.

Closes #47

(Redo: the original PR #85 was stacked on the Perplexity branch and got
merged into that branch instead of main, so the change never reached main.
This targets main directly off the merged #46.)

This branch was successfully deployed

1 active deployment
Preview — 500a3499 Deployed May 23, 2026 by vercel[bot]
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