Skip to content

fix(valuation): stop minting a duplicate roster artist per funnel signup (chat#1850 P1)#46

Merged
sweetmantech merged 1 commit into
mainfrom
feat/drop-funnel-duplicate-artist-mint
Jul 8, 2026
Merged

fix(valuation): stop minting a duplicate roster artist per funnel signup (chat#1850 P1)#46
sweetmantech merged 1 commit into
mainfrom
feat/drop-funnel-duplicate-artist-mint

Conversation

@sweetmantech

@sweetmantech sweetmantech commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What

Deletes lib/valuation/linkArtistToAccount.ts (and its test) and its call in useCatalogValuation.doRun — the funnel no longer mints an artist account per signup.

Call-site decision (delete, not find-first)

linkArtistToAccount had exactly one caller: the valuation flow (useCatalogValuation.doRun, post-run). Per the settled design the choice was delete vs. keep-but-find-first. Deleted, because:

  • The claim (useGetFullReportclaimCatalogPOST /api/catalogs) now attaches the canonical artist server-side — the roster gets the artist that actually owns the song_artists links, at the moment the account takes ownership.
  • A run-time roster artist without a claimed catalog lit no surface anyway (a song-less artist is the exact 0/$0 defect), while actively polluting rosters and artist search with duplicates.
  • Leads who run but never claim therefore no longer get a roster artist; that surface loss is nil (nothing rendered from it) and re-clicking "Get the full report" later heals the roster via the api's re-claim attach.

Verification

  • pnpm --ignore-workspace test: 19 files / 62 tests green (was 20/67 — the 5 deleted-file tests removed).
  • NEXT_PUBLIC_PRIVY_APP_ID=… pnpm --ignore-workspace build: green (the marketing gate, per marketing#44).
  • Pending (needs deploy): fresh funnel walkthrough confirming no duplicate artist is created and the chat hero shows the valuation.

Links

Merge order

  1. docs → 2. database → 3. api → 4. marketing (this PR). All PRs base main.

🤖 Generated with Claude Code

…nup (chat#1850 P1)

linkArtistToAccount POSTed /api/artists {name} unconditionally on every
run, creating a duplicate, song-less artist account that hid the
artist-scoped homepage hero. The valuation flow was its only caller;
roster attach now happens server-side at claim time (POST /api/catalogs
resolves the canonical artist through the songs graph), so the client
call is deleted rather than made find-first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 8, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marketing Ready Ready Preview Jul 8, 2026 2:40am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@sweetmantech, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b2ce3ab1-6c60-41e6-b049-c7467852fa1b

📥 Commits

Reviewing files that changed from the base of the PR and between f9862ee and d573564.

📒 Files selected for processing (3)
  • hooks/useCatalogValuation.ts
  • lib/valuation/__tests__/linkArtistToAccount.test.ts
  • lib/valuation/linkArtistToAccount.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/drop-funnel-duplicate-artist-mint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

@sweetmantech

Copy link
Copy Markdown
Contributor Author

Preview verification — 2026-07-08, marketing-git-feat-drop-funnel-duplicate-artist-mint-recoup.vercel.app

Ran the funnel end-to-end on the branch preview (Chrome DevTools, isolated browser context) with network capture, logging in as an existing account (sweetmantech@gmail.com) — a fresh account isn't needed to observe the removed call. This PR is a pure frontend deletion (the linkArtistToAccount mint in useCatalogValuation.doRun), so the definitive test is a network-level check: after a completed run, the old POST /api/artists (+ follow-up PATCH /api/artists/{id}) must no longer fire, while the run and its retained side effects still work.

Results matrix — documented vs actual

# Check Expected (post-#46) Actual (live preview) Status
1 Duplicate-mint removed no POST /api/artists after the run across all 91 requests, zero POST to …/api/artists
2 Social-attach removed no PATCH /api/artists/{id} after the run zero PATCH to …/api/artists/{id}
3 Valuation still runs (no regression from the deletion) run kicks off + polls + card renders POST /research/measurement-jobs202; 36× GET /research/albums/{id}/measurements200; card shows $2.1M (range $1.4M–$2.9M), 558M streams, 67 tracks, 36 releases
4 Retained post-run side effect captureRunLead still fires POST /api/valuation/lead200 (the only post-run write)
5 Auth gate intact search → Value my catalog → OTP → run Privy passwordless/authenticate 200, modal closed, run proceeded

The removed behavior would have appeared as POST {apiUrl}/artists (create) + PATCH {apiUrl}/artists/{id} (Spotify social) immediately after the card resolved. Neither is present. The post-run write surface is now exactly POST /api/valuation/lead and nothing else.

Scope / not exercised on this preview

  • Claim → canonical attach (the replacement path): not exercised here. Marketing preview builds talk to test-recoup-api.vercel.app (lib/config.ts — only production hits the prod API), whereas api#768's claim-time attach is deployed to prod. That half was verified separately on the api#768 preview against the shared prod DB (results matrix): first claim attaches the canonical, no duplicate artist minted, artist-scoped measurements return 67 / $2.06M.
  • New-signup DB assertion (a fresh funnel account creates zero duplicate artist rows and the chat hero lights up): belongs to the post-deploy prod walkthrough on chat#1859, since prod is where both fix(valuation): stop minting a duplicate roster artist per funnel signup (chat#1850 P1) #46 and api#768 will be live together.

Verdict: the removal behaves exactly as intended on the preview — the funnel no longer mints a duplicate roster artist, and the run + lead capture are unaffected. Good to merge (then the post-deploy prod walkthrough + the backfill pass-2/cleanup on #1859).

🤖 Generated with Claude Code

@sweetmantech sweetmantech merged commit d006b91 into main Jul 8, 2026
3 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