Skip to content

fix(bracket): name each warned card once across printings - #1292

Merged
KaelSensei merged 1 commit into
devfrom
fix/bracket-warning-unique-names-20261108
Nov 8, 2026
Merged

KaelSensei merged 1 commit into
devfrom
fix/bracket-warning-unique-names-20261108

Conversation

@KaelSensei

Copy link
Copy Markdown
Owner

Roadmap item

I-03 Trustworthy Deck Feedback (Now) → Keep warning calculations deterministic and independent from AI output.

Bracket warnings (scoreBracket) named each banned, off-identity or Game Changer card once per deck row. A deck that holds the same card in two printings showed 2 Game Changer(s): Sol Ring, Sol Ring and Banned cards in deck: Griselbrand, Mana Crypt, Mana Crypt. validateDeck already deduplicated these names, so the two warning surfaces disagreed.

Change

  • src/lib/deck/validation.ts: moved the existing order policy out of sortedUniqueCardNames into a new sortedUniqueNames(names) helper (deduplicate, then sort case-insensitively with a case-sensitive tiebreak). sortedUniqueCardNames now delegates to it.
  • src/lib/deck/bracket.ts: warningCardNames now uses sortedUniqueNames, so bracket and validation warnings share one ordering and deduplication rule.
  • The Game Changer count is unchanged and still counts copies. Only the list of names is deduplicated.

No migration, no external service, no product decision.

TDD

Red (npx vitest run src/lib/deck/bracket.test.ts -t "names a card once"):

FAIL  scoreBracket > names a card once when the deck holds several printings of it
- "Banned cards in deck: Griselbrand, Mana Crypt",
- "Color identity violations: Lightning Bolt",
- "2 Game Changer(s): Sol Ring",
+ "Banned cards in deck: Griselbrand, Mana Crypt, Mana Crypt",
+ "Color identity violations: Lightning Bolt, Lightning Bolt",
+ "2 Game Changer(s): Sol Ring, Sol Ring",

Super Green: reused the existing deduplication and ordering policy instead of adding a second comparator. Refactor: sortedUniqueCardNames became a thin adapter over sortedUniqueNames. Its existing tests still pass.

Verification

  • npx tsc --noEmit: 0 errors
  • pnpm lint: no warnings or errors
  • pnpm test: 344 files, 3510 tests passed
  • Pre-push Docker Playwright: 74 passed and 8 passed. The first attempt failed on e2e/i18n-routing.spec.ts:52 ("locale prefix is preserved after navigation"). That failure is unrelated: an isVisible() guard races the onboarding dialog. The second attempt failed because playwright-report was owned by root, which I fixed with chown. The third attempt passed with no retry flag and without SKIP_E2E. The flaky i18n test deserves its own fix: call suppressOnboarding and drop the isVisible() guard.
  • Sonar: no .env.sonar in this worktree, so it is left to CI.

Roadmap, changelog and progress docs are untouched (they go in the chore/docs PR).

🤖 Generated with Claude Code

Bracket warnings listed a banned, off-identity or Game Changer card once
per deck row, so two printings of one card repeated its name. Share the
deduplicating, case-insensitive name order already used by validateDeck.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
magic-ai-builder Ready Ready Preview Nov 8, 2026 11:25am UTC

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-08T11:23:18.445946Z
We couldn’t complete this review. Comment @codex review to try again.
ea111a2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 82bbbf05-830e-440d-b69f-ebf66b353601

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sonarqubecloud

sonarqubecloud Bot commented Nov 8, 2026

Copy link
Copy Markdown

@KaelSensei
KaelSensei merged commit b75d1a1 into dev Nov 8, 2026
7 checks passed

This branch was successfully deployed

1 active deployment
Preview — ea111a22 Deployed Nov 8, 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