Game Mode: unique session names + lever-simulation feedback - #200
Merged
marota merged 1 commit intoJul 23, 2026
Merged
Conversation
Session naming: GET /api/game/player-sessions now returns the concrete session_names (sorted) alongside session_count. The config screen auto-suggests the first FREE "<player> - session <n>" index over the recorded names and blocks a name that already exists (Start disabled + inline warning). Fixes the re-suggested "session 3" collision the count-plus-one heuristic produced when the recorded indices had gaps. Lever hints: double-clicking a most-used lever shows a simulating -> simulated transition and blocks a redundant second run. "Simulated" is read from a new simulatedActionIds set on the game-bridge snapshot, so a lever also flips to simulated when its action arrives through the recommender's suggestions, and a failed run self-clears. gameBridge.requestLeverInteraction is now awaitable so the panel can drive the transition. Injection levers (redispatch / load-shedding / curtailment) now map to the backend dynamic-action id and simulate with no target_mw, so the backend applies its default incremental injection delta instead of the lever degrading to inspect. Only PST / raw gen_p / load_p levers still degrade. Tests: backend player_session_count names + endpoint; frontend config first-free-index + duplicate-block; hints-panel simulating/simulated feedback, re-run block, cross-marking from the snapshot, and injection default-delta simulate. Docs, CHANGELOG and the OpenAPI snapshot updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WnKZGPhT4mVVeKeLQw3kMn Signed-off-by: marota <amarot91@gmail.com>
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
Two Game Mode fixes reported from a live session:
config screen kept re-suggesting
session 3(a name that already existed),and nothing stopped you from starting a run under a name already in the
shared base.
and injection levers simulate with the default incremental delta instead
of degrading to "set the amount in the SLD".
Changes
Session naming
GET /api/game/player-sessionsnow returns the concretesession_names(sorted) alongside
session_count.<player> — session <n>index by scanning those names — fixing the root cause: the old
count + 1heuristic re-suggested a taken name whenever the recorded indiceshad gaps (e.g.
{1, 3}→ suggested the colliding3).shared base keys retentions by session name, so a duplicate would merge two
runs).
Lever-simulation feedback (beginner-assistance hints)
simulated transition (
gameBridge.requestLeverInteractionis nowawaitable).
re-simulation).
simulatedActionIdsset on the game-bridgesnapshot, so a lever also flips to ✓ when its action arrives through the
recommender's suggestions; a failed run self-clears (its id never enters the
set) so the lever stays runnable.
Injection levers
redispatch:/ls:/rc:levers map to the backend dynamic-action id andsimulate with no
target_mw, so_create_dynamic_actions_if_neededappliesthe default incremental injection delta — a double-click runs them
straight away. Only PST / raw
gen_p:/load_p:levers still degrade toinspect (a tap / signed setpoint is required).
Tests & docs
player_session_countnames + endpoint response(
test_game_solutions.py); regeneratedopenapi.snapshot.json.simulating→simulated feedback, re-run block, cross-marking, and injection
default-delta simulate; updated
buildLeverInteraction/useLeverInteractiontests.
docs/features/game-mode-codabench.md, the threeCLAUDE.mdguides,the test-conventions guide, and
CHANGELOG.md.Verification
tsc -bclean; ESLint 0 errors; code-quality gate OK; standalone parity 30/30 + full
Layer-1 parity.
🤖 Generated with Claude Code