Skip to content

Leaderboard coverage + durable disconnect/continuous save#64

Merged
BCook98 merged 15 commits into
mainfrom
leaderboard-coverage
Jun 15, 2026
Merged

Leaderboard coverage + durable disconnect/continuous save#64
BCook98 merged 15 commits into
mainfrom
leaderboard-coverage

Conversation

@BCook98

@BCook98 BCook98 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What

Makes every game record to the leaderboard, saves a player's score when they disconnect mid-game, and keeps continuous ("never-ending") games saving periodically. Includes the audit, design spec, and implementation plan under docs/superpowers/.

Draft — blocked on kit v2.11.0. These games adopt the new kit.ScoreKeeper (shellcade/kit#40). Once that tags, each touched module's go.mod gets bumped to v2.11.0 + go mod tidy (a follow-up commit) and this comes out of draft. CI will fail until then.

Audit result

18 games audited. 8 were already sound (bytebreaker, salvo, paperdrift, blackjack, floorfall, pokies, scratchies, stacked). The rest are fixed here:

Game Fix
voidrunners tracked kills in KV but never posted → now posts live + DNF on leave
neon-snake no OnLeave → added; flushes current score (DNF) on disconnect
spaceterm co-op run score now flushed on crew disconnect (was lost if all left before core death)
boneyard banks current depth (DNF) on disconnect instead of only on death/collapse
putt par-extrapolated DNF on disconnect (lower-is-better board — a raw partial would top it)
chess declared a Wins leaderboard (SumResults); posts 1/0 win counts on every end path
tic-tac-toe-rs declared a Wins leaderboard (Rust); win metrics were already 1/0
roulette (harden) periodic peak flush (10s, game-clock) for abandoned tables
shellracer (harden) settles the race when the last racer disconnects (results were armed but never delivered)

DNF semantics

The platform reader ranks DNF rows like finished ones, so: higher-better games post raw partials (safe — max keeps best); cumulative-wins games post 1/0; lower-better putt par-extrapolates.

Test

Every fixed game has a new *_leaderboard_test.go asserting the DNF/score behavior (each verified failing first). All game modules: go test ./... + go build ./... green; Rust: cargo test green.

🤖 Generated with Claude Code

BCook98 and others added 15 commits June 15, 2026 20:17
Audit of 18 games + design for a shared kit ScoreKeeper helper, per-game
disconnect/continuous-save fixes, putt lower-better correctness, Rust
tic-tac-toe spec, and a conformance guardrail.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
18 TDD tasks across kit (ScoreKeeper helper), games (10 per-game fixes),
and shellcade (conformance guardrail), with go.work-based local dev and a
kit-tag-before-pin release phase.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add an OnLeave handler that posts the leaving player's current score with
StatusDNF and persists their personal best to KV. Adopt kit.ScoreKeeper
(OnImprove cadence) to track each player's current score, fed when a snake
eats. Handles both the solo/co-op (single seat controls both snakes) and
head-to-head (members[0]=snake1, members[1]=snake2) shapes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
These reference shellcade private internals (store/postgres, conformance
harness, seat-grace) and violate the games-repo hard rule against
shellcade-internal material. They move to the private platform repo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
These three adopt kit.ScoreKeeper (shipped in v2.11.0). Bump + tidy so they
build against the published kit instead of the local dev workspace.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Games now adopt kit v2.11.0 (ScoreKeeper). Point validate.yml + publish.yml at
the shellcade-kit 2.11.0 release so conformance exercises the kit features these
games use. Goes green once the shellcade-kit v2.11.0 binary is published (the
shellcade lockstep release).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bump the shellcade-kit toolchain pin to 2.11.1 (carries the conformance
publishing-gate fix) and pass --require-leaderboard to `check` in validate.yml
and publish.yml so every published game must declare a leaderboard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Smoke screens

Deterministic scripted screens for b6b2e6d9bdcd492ae543ac3a0829a1affefa9e92 (what is this?)

games/alan/chess — 8 screens

01-opening.seat0
01-opening.seat0

01-opening.seat1
01-opening.seat1

02-after-1-e4-e5.seat0
02-after-1-e4-e5.seat0

02-after-1-e4-e5.seat1
02-after-1-e4-e5.seat1

03-after-2-Nf3.seat0
03-after-2-Nf3.seat0

03-after-2-Nf3.seat1
03-after-2-Nf3.seat1

04-after-3-Nxe5.seat0
04-after-3-Nxe5.seat0

04-after-3-Nxe5.seat1
04-after-3-Nxe5.seat1

games/alan/roulette — 12 screens

01-table.seat0
01-table.seat0

01-table.seat1
01-table.seat1

02-bets.seat0
02-bets.seat0

02-bets.seat1
02-bets.seat1

03-spinning.seat0
03-spinning.seat0

03-spinning.seat1
03-spinning.seat1

04-landed.seat0
04-landed.seat0

04-landed.seat1
04-landed.seat1

05-flashing.seat0
05-flashing.seat0

05-flashing.seat1
05-flashing.seat1

06-result.seat0
06-result.seat0

06-result.seat1
06-result.seat1

games/bcook/boneyard — 5 screens

01-the-gate
01-the-gate

02-first-steps.seat0
02-first-steps.seat0

02-first-steps.seat1
02-first-steps.seat1

03-into-the-dark.seat0
03-into-the-dark.seat0

03-into-the-dark.seat1
03-into-the-dark.seat1

games/bcook/putt — 16 screens

01-hole1-open.seat0
01-hole1-open.seat0

01-hole1-open.seat1
01-hole1-open.seat1

02-aiming.seat0
02-aiming.seat0

02-aiming.seat1
02-aiming.seat1

03-power-dial.seat0
03-power-dial.seat0

03-power-dial.seat1
03-power-dial.seat1

04-putt-rolling.seat0
04-putt-rolling.seat0

04-putt-rolling.seat1
04-putt-rolling.seat1

05-holed-out.seat0
05-holed-out.seat0

05-holed-out.seat1
05-holed-out.seat1

06-rival-view.seat0
06-rival-view.seat0

06-rival-view.seat1
06-rival-view.seat1

07-scorecard.seat0
07-scorecard.seat0

07-scorecard.seat1
07-scorecard.seat1

08-hole2-dogleg.seat0
08-hole2-dogleg.seat0

08-hole2-dogleg.seat1
08-hole2-dogleg.seat1

games/bcook/shellracer — 6 screens

01-start.seat0
01-start.seat0

01-start.seat1
01-start.seat1

02-midrace.seat0
02-midrace.seat0

02-midrace.seat1
02-midrace.seat1

03-nearfinish.seat0
03-nearfinish.seat0

03-nearfinish.seat1
03-nearfinish.seat1

games/bcook/spaceterm — 12 screens

01-lobby
01-lobby

02-bridge.seat0
02-bridge.seat0

02-bridge.seat1
02-bridge.seat1

02-bridge.seat2
02-bridge.seat2

03-hail
03-hail

04-teamwork.seat0
04-teamwork.seat0

04-teamwork.seat1
04-teamwork.seat1

04-teamwork.seat2
04-teamwork.seat2

05-fumble.seat0
05-fumble.seat0

05-fumble.seat1
05-fumble.seat1

05-fumble.seat2
05-fumble.seat2

06-debrief
06-debrief

games/bcook/tic-tac-toe-rs — 4 screens

01-opening
01-opening

02-midgame
02-midgame

03-block
03-block

04-win
04-win

games/luke/neon-snake — 5 screens

01-start
01-start

02-theme_cycled
02-theme_cycled

03-game_over
03-game_over

04-mode_hazards
04-mode_hazards

05-settings_menu
05-settings_menu

games/matt/voidrunners — 10 screens

01-arena.seat0
01-arena.seat0

01-arena.seat1
01-arena.seat1

02-thrust.seat0
02-thrust.seat0

02-thrust.seat1
02-thrust.seat1

03-fire.seat0
03-fire.seat0

03-fire.seat1
03-fire.seat1

04-rival-view.seat0
04-rival-view.seat0

04-rival-view.seat1
04-rival-view.seat1

05-steady.seat0
05-steady.seat0

05-steady.seat1
05-steady.seat1

@BCook98
BCook98 marked this pull request as ready for review June 15, 2026 13:38
@BCook98
BCook98 merged commit 7a02bba into main Jun 15, 2026
2 checks passed
@BCook98
BCook98 deleted the leaderboard-coverage branch June 15, 2026 13:38
@github-actions

Copy link
Copy Markdown

shellcade could not publish this release to the arcade

The GitHub release was cut, but the arcade's re-verification refused it,
so the game will NOT go live / update until this is resolved:

alan/chess — tag alan-chess-v8

catalog: alan-chess-v8 refused: conformance: posts on leave (no post, no settling end vs ≥1 leaderboard result)

alan/roulette — tag alan-roulette-v7

catalog: alan-roulette-v7 refused: conformance: posts on leave (no post, no settling end vs ≥1 leaderboard result)

bcook/boneyard — tag bcook-boneyard-v9

catalog: bcook-boneyard-v9 refused: conformance: posts on leave (no post, no settling end vs ≥1 leaderboard result)

bcook/putt — tag bcook-putt-v4

catalog: release by tag: Get "https://api.github.com/repos/shellcade/games/releases/tags/bcook-putt-v4": context deadline exceeded

bcook/shellracer — tag bcook-shellracer-v9

catalog: bcook-shellracer-v9 refused: conformance: posts on leave (no post, no settling end vs ≥1 leaderboard result)

bcook/tic-tac-toe-rs — tag bcook-tic-tac-toe-rs-v8

catalog: release by tag: Get "https://api.github.com/repos/shellcade/games/releases/tags/bcook-tic-tac-toe-rs-v8": context deadline exceeded

luke/neon-snake — tag luke-neon-snake-v4

catalog: luke-neon-snake-v4 refused: conformance: posts on leave (no post, no settling end vs ≥1 leaderboard result)

matt/voidrunners — tag matt-voidrunners-v8

catalog: release by tag: Get "https://api.github.com/repos/shellcade/games/releases/tags/matt-voidrunners-v8": context deadline exceeded

See the publish run for full logs. Re-running it retries the arcade publish.

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