Stop the restart button refusing rooms it could replay #327

Merged
nelsong6 merged 1 commit from claude/restart-button-always-acts into main 2026-09-09 19:26:25 -07:00
nelsong6 commented 2026-09-09 18:54:19 -07:00 (Migrated from github.com)

Three of the button's eleven refusals were unwritten code rather than real limits.

Rest sites and treasure rooms

They fell through to default: Blocked("not a combat, shop, or event"). Neither writes a save — verified, they carry no SaveManager reference at all, exactly like MerchantRoom, which the code already documents as "Merchants never save. The whole visit is replayable."

Two case labels. A rest site is arguably the room most worth redoing, since smith vs. rest is a real decision.

Fights and events that are already over

A won fight was refused as "this fight is already over", because replaying lands on the reward screen rather than at the top of the fight. That's a destination, not a failure — picking a reward again is a legitimate reason to go back. Finished events and event-started fights were refused on the same reasoning and are now offered too.

The label was lying

Since where a replay lands now varies by room, RoomRestartAvailability carries a ReplayNote and the menu prints it, instead of always claiming the room replays "from the start, undoing everything you did here" — untrue for every case above.

The snapshot no longer dies on hot reload

The room-entry snapshot, which the run record rewinds to, was memory-only. A Core hot reload dropped it and the button stayed refused for the rest of the room — during development, most of the time. It's now written at capture and read back when a fresh Core load has none.

It lives in its own directory on purpose: RunsDir is enumerated with *.json to find run records, so a snapshot placed there would be read back as one.

What still refuses, correctly

A restart already in progress · no run · run shutting down · no save on disk · multiplayer (the restore path is SetUpSavedSingleplayer, and the multiplayer equivalent needs a LoadRunLobby that can't be rebuilt) · standing on the map with no room to replay.

Verification

Built, deployed and hot-reloaded; 433 classes patched, 0 failed, clean log. 2128 passed, 0 failed.

Behavioural verification not run — per the repo's user-owned verification policy, the restart paths themselves haven't been exercised in a live run.

🤖 Generated with Claude Code

Three of the button's eleven refusals were unwritten code rather than real limits. ## Rest sites and treasure rooms They fell through to `default: Blocked("not a combat, shop, or event")`. Neither writes a save — verified, they carry no `SaveManager` reference at all, exactly like `MerchantRoom`, which the code already documents as *"Merchants never save. The whole visit is replayable."* Two `case` labels. A rest site is arguably the room most worth redoing, since smith vs. rest is a real decision. ## Fights and events that are already over A won fight was refused as `"this fight is already over"`, because replaying lands on the reward screen rather than at the top of the fight. That's a **destination, not a failure** — picking a reward again is a legitimate reason to go back. Finished events and event-started fights were refused on the same reasoning and are now offered too. ## The label was lying Since where a replay lands now varies by room, `RoomRestartAvailability` carries a `ReplayNote` and the menu prints it, instead of always claiming the room replays *"from the start, undoing everything you did here"* — untrue for every case above. ## The snapshot no longer dies on hot reload The room-entry snapshot, which the run record rewinds to, was memory-only. A Core hot reload dropped it and the button stayed refused for the rest of the room — during development, most of the time. It's now written at capture and read back when a fresh Core load has none. It lives in its own directory on purpose: `RunsDir` is enumerated with `*.json` to find run records, so a snapshot placed there would be read back as one. ## What still refuses, correctly A restart already in progress · no run · run shutting down · no save on disk · multiplayer (the restore path is `SetUpSavedSingleplayer`, and the multiplayer equivalent needs a `LoadRunLobby` that can't be rebuilt) · standing on the map with no room to replay. ## Verification Built, deployed and hot-reloaded; `433 classes patched, 0 failed`, clean log. `2128 passed, 0 failed`. Behavioural verification not run — per the repo's user-owned verification policy, the restart paths themselves haven't been exercised in a live run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/spirelens!327
No description provided.