feat(discordsh): Phase 4 session persistence for dungeon profiles#8136
Merged
feat(discordsh): Phase 4 session persistence for dungeon profiles#8136
Conversation
Add Supabase-backed player persistence so dungeon progress (level, XP,
gold, gear, inventory, quests, lifetime stats) survives across sessions.
Proto: DungeonProfile, DungeonRun, LeaderboardEntry messages + RPCs
SQL: dungeon_profiles + dungeon_runs tables with advisory locks,
append-only enforcement, JSONB inventory validation, per-category
leaderboard queries with deterministic tie-breakers
Rust: ProfileStore (LRU cache + PostgREST RPC), death penalty logic
(25% XP + 50% run gold on defeat), save on game-over/end/leave/expire,
load on start/join, /dungeon leaderboard subcommand
Closes #8111
Contributor
Dependency ReviewThe following issues were found:
License Issuesapps/discordsh/axum-discordsh/Cargo.toml
OpenSSF Scorecard
Scanned Files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DungeonProfile,DungeonRun,LeaderboardEntrymessages, enums (DungeonOutcome,DungeonClass,LeaderboardCategory), and RPC methods todiscordsh.protodungeon_profiles+dungeon_runstables with advisory locks, append-only enforcement trigger, JSONB inventory shape validation, per-category leaderboard queries with deterministic tie-breakers, service functions (service_load_profile,service_upsert_profile,service_leaderboard)ProfileStore(LRU cache + Supabase PostgREST RPC), death penalty logic (25% XP + 50% run gold on defeat), profile load on/dungeon startand/dungeon join, save on game-over/end/leave/expire,/dungeon leaderboardsubcommandDeath Penalty
Files Changed
packages/data/proto/kbve/discordsh.protopackages/data/sql/schema/discordsh/discordsh_dungeon_profiles.sqlpackages/data/sql/dbmate/migrations/20260316210000_...sqlapps/discordsh/axum-discordsh/src/discord/game/persistence.rsapps/discordsh/axum-discordsh/src/discord/game/mod.rsapps/discordsh/axum-discordsh/src/discord/game/types.rssaved_snapshotto PlayerStateapps/discordsh/axum-discordsh/src/state.rsapps/discordsh/axum-discordsh/src/discord/commands/dungeon.rsapps/discordsh/axum-discordsh/src/discord/game/router.rsapps/discordsh/axum-discordsh/src/discord/game/session.rsapps/discordsh/axum-discordsh/src/discord/bot.rsTest plan
cargo test -p axum-discordsh— 675 tests pass (no regressions)Closes #8111
🤖 Generated with Claude Code