Skip to content

golf: crown winners from the winners list only - #392

Merged
aaylward merged 1 commit into
mainfrom
claude/sleepy-rubin-tdjm8v
Sep 29, 2026
Merged

aaylward merged 1 commit into
mainfrom
claude/sleepy-rubin-tdjm8v

Conversation

@aaylward

Copy link
Copy Markdown
Contributor

Closes #231.

The blocker is gone: MoonBase games_hub/model/golf.smithy GameEnded has winners @required, and src/apps/golf/wire.ts already types it non-optional.

Most of the issue's checklist was absorbed by the hub rewrite — useGolfGame, golfNetworkPlugin, networkAdapter and their legacy-path tests no longer exist. The one remaining fallback was GolfTable.isWinner comparing player.id === ended.winner when winners was empty. Removed.

winner (display string) stays: the contract sends it, and it feeds the "X wins!" headline and the game-over notice. Deriving it from winners would be more code for no gain.

Tests

  • New: only the winners list crowns; the display string does not — winner: 'alice', winners: [] crowns nobody and still shows "alice wins!". Watched it fail on the old code (rendered "You won!"), pass after.
  • typecheck, lint, test:run (1249 passed), build — all clean.
  • Review panel not run; one-function change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FMAEXAt4rbVe5dSsKvvws4


Generated by Claude Code

golf.smithy's GameEnded requires winners, so the fallback to comparing
the display string is dead. Pinned with a test: winner alone crowns
nobody.

Closes #231

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FMAEXAt4rbVe5dSsKvvws4
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
muchq b66d0b8 Commit Preview URL

Branch Preview URL
Sep 29 2026, 07:32 PM

@cursor

cursor Bot commented Sep 29, 2026

Copy link
Copy Markdown

Blocking

None. golf.smithy GameEnded.winners is @required, and GolfGameEnded.winners is already non-optional on the wire — the player.id === ended.winner fallback was the last legacy path. Crowning is membership in winners only; winner stays as the joined display line for the celebration title and the game-over notice. The new test pins that winner alone crowns nobody (watched fail → pass). Issue #231’s other cleanup targets (useGolfGame, golfNetworkPlugin, …) are already gone. CI green.

Nits

None.

Fine

Small, contract-aligned cleanup. Closes #231.


Review of #392

@aaylward
aaylward merged commit 7a36514 into main Sep 29, 2026
2 checks passed
@aaylward
aaylward deleted the claude/sleepy-rubin-tdjm8v branch September 29, 2026 20:08
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.

Golf: remove legacy winner fallback once shared-wins backend rollout completes

2 participants