Skip to content

Game Mode: unique session names + lever-simulation feedback - #200

Merged
marota merged 1 commit into
ainetus:mainfrom
marota:claude/session-naming-simulation-feedback-li4rg4
Jul 23, 2026
Merged

Game Mode: unique session names + lever-simulation feedback#200
marota merged 1 commit into
ainetus:mainfrom
marota:claude/session-naming-simulation-feedback-li4rg4

Conversation

@marota

@marota marota commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two Game Mode fixes reported from a live session:

  1. Duplicate session names are blocked. After finishing "session 3", the
    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.
  2. Lever hints now give simulation feedback and can't be double-simulated,
    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-sessions now returns the concrete session_names
    (sorted) alongside session_count.
  • The config screen auto-suggests the first free <player> — session <n>
    index by scanning those names — fixing the root cause: the old
    count + 1 heuristic re-suggested a taken name whenever the recorded indices
    had gaps (e.g. {1, 3} → suggested the colliding 3).
  • A name that already exists disables ▶ Start with an inline warning (the
    shared base keys retentions by session name, so a duplicate would merge two
    runs).

Lever-simulation feedback (beginner-assistance hints)

  • Double-clicking a most-used lever shows a per-row ⏳ simulating… → ✓
    simulated
    transition (gameBridge.requestLeverInteraction is now
    awaitable).
  • A second double-click on a simulated lever is ignored (no accidental
    re-simulation).
  • "Simulated" is read from a new simulatedActionIds set on the game-bridge
    snapshot, 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 and
    simulate with no target_mw, so _create_dynamic_actions_if_needed applies
    the default incremental injection delta — a double-click runs them
    straight away. Only PST / raw gen_p: / load_p: levers still degrade to
    inspect (a tap / signed setpoint is required).

Tests & docs

  • Backend: player_session_count names + endpoint response
    (test_game_solutions.py); regenerated openapi.snapshot.json.
  • Frontend: config first-free-index + duplicate-block tests; hints-panel
    simulating→simulated feedback, re-run block, cross-marking, and injection
    default-delta simulate; updated buildLeverInteraction / useLeverInteraction
    tests.
  • Updated docs/features/game-mode-codabench.md, the three CLAUDE.md guides,
    the test-conventions guide, and CHANGELOG.md.

Verification

  • Frontend: full Vitest suite 1902 passed (3 pre-existing skips); tsc -b
    clean; ESLint 0 errors; code-quality gate OK; standalone parity 30/30 + full
    Layer-1 parity.
  • Backend: game + OpenAPI-contract tests green; ruff clean.

🤖 Generated with Claude Code

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>
@marota
marota merged commit 42d4760 into ainetus:main Jul 23, 2026
12 checks passed
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