Repository navigation
Pin renderedstep/engine#100's head (6bf995e): rest an hour in a safe room with no foe in it, and mend eight - #376
Merged
Merged
Conversation
…room with no foe in it, and mend eight
Stage 8 of the dungeon plan, server half ("Rest"). A `wait` in a safe room
(`locations.sanctuary`) with nobody in it a foe, by a living player with a
stat block, is a rest: it mends one healing thing's worth (8) up to the
game's maximum, and on the told path its scene spends an hour. It is never
refused, even past a floor's countdown; the player then falls with the
floor. The notice is engine copy for the player only; no model is told. A
world with no sanctuary plays as before.
- Migration 20261031180000 CreatePlaythroughRests, the engine's version and
declaration. schema.rb moves to 2026_10_31_180000.
- Playthrough::Rest (playthrough_rests): validations, and #to_s, word for
word the engine's Game::rest_to_s, its maximum read at the rest's time.
Factory :playthrough_rest, rolling nothing.
- Playthrough, Location and Scene gain has_many :rests (destroy, destroy,
nullify), as their floors_reached neighbours.
- The log: Playthrough#turn_log preloads rests; the turn partial shows this
game's rests after its floors; Protocol::V1#entry appends them to notices.
- Playthrough::SqlitePackage::PLAYTHROUGH_TABLES adds playthrough_rests.
- Location::OneRoomFold moves a rest's location with the room, and counts a
rest in the place row as history (its schema-walking test requires the
move).
- Sweep: world a-place-to-rest, script resting-in-a-safe-room, golden
vendored and checks file written.
calebl
added a commit
to renderedstep/engine
that referenced
this pull request
Oct 30, 2026
… cfe509a The game's pin PR (renderedstep/server#376) carries migration 20261031180000, so the dump is now the one its own loader writes from a schema load, with playthrough_rests in the schema rather than migrated on after. The rows are the same; only timestamps, the schema digest and the order the dump lists them in moved. No golden or records file moves.
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.
Stage 8 of the dungeon plan, server half: rest. The engine half is renderedstep/engine#100. This pins its head,
6bf995e. Once it merges, a follow-up commit will re-pin to its merge commit.A
waitis a rest when three things hold: the room is a safe room (locations.sanctuary), nobody in it is a foe, and the player is alive with a stat block. A rest mends 8 hit points (one healing thing's worth), up to the game's maximum, and on the told path its scene spends an hour. A rest is never refused, even when it runs past a floor's countdown; the player then falls with the floor. The notice is engine copy for the player only, and no model is told. A world with no sanctuary plays exactly as before.No model was called. Every command ran with
OPENROUTER_API_KEYandTYPESAFE_API_KEYunset. No prompt or request builder changed, and nothing that builds a request reads the new table.What changed
This follows the engine PR's section "What the server pin PR must change", item by item.
Migration
20261031180000_create_playthrough_rests.rb. It uses the engine's version and declaration, with the "THE VERSION AND THE DECLARATION ARE THE ENGINE'S" header.db/schema.rbmoves to2026_10_31_180000. I placed the table into the schema by hand, because Rails' dumper would otherwise reorder unrelated columns. The version still follows main's latest (20261031150000, checked against a freshly fetchedorigin/main).Playthrough::Rest(playthrough_rests):recoveredandhp_after(whole numbers from 0) andstory_timestamp;#to_s, word for word the engine'sGame::rest_to_s. It says1 hit pointin the singular, and reads the maximum at the rest's own time;:playthrough_rest, which rolls nothing;test/models/playthrough/rest_test.rb.Associations:
has_many :restsonPlaythrough(destroy),Location(destroy) andScene(nullify), each with a reasoning comment like itsfloors_reachedneighbour's.Log:
Playthrough#turn_logpreloadsrests: [:location, {playthrough: [:character, :floors_reached]}];turns/_turn.html.erbshows this game's rests after its floors, as<p class="notice" id="playthrough_rest_N">.Protocol:
Protocol::V1#entryappends this game's claimed rests tonotices, after the floors.openapi.jsonis unchanged:noticesis an array of strings. One test,test/controllers/playthrough_toll_notices_test.rb, covers both the log entry and the protocol entry, including that another game's rest on the same scene is left out.Playthrough::SqlitePackage::PLAYTHROUGH_TABLESaddsplaythrough_rests. The package test checks that the row travels.Vendored at the pin:
resting-in-a-safe-room.yml, with itswhy:notes, and worlda-place-to-rest.yml, both from the engine PR body;test/engine_parity/resting-in-a-safe-room.json;resting-in-a-safe-room.checks.json, written byengine:checks.The engine's
parity/records/files are not vendored in this repository, as with every earlier stage.One thing not in the engine's list:
Location::OneRoomFoldnow moves a rest'slocation_idwith the room (REFERENCES), and counts a rest in the place row as history (PLACE_HISTORY, beside tolls). Its schema-walking test fails on any location foreign key the fold does not move.Gates (all local, both provider keys unset)
bin/rails test: 5494 runs, 0 failures, 0 errors, 0 skips (includesrake game:sweep)bundle exec rubocop: no offensesbin/rails zeitwerk:check: all goodbin/brakeman --no-pager: 0 security warningsbin/rails engine:vendored: VENDORED at6bf995ebin/rails engine:rust_gates: PASSED, 114 scripts (goldens, invariants, doctor and audit)bin/rails engine:kept_requests: ok, 45 passedSCRIPT=resting-in-a-safe-room bin/rails engine:parity GOLDENS=/tmp/...: the extension's dump is byte-identical to the vendored goldenFor the engine's follow-up
SERVER_COMMITat this branch's head.parity/worlds/a-place-to-rest.sqlfrom this branch's loader, with the migration in its schema (item 8 of the engine's list).No
Update::REGISTRYstep is needed.bin/updatealready runs pending migrations, and the new table starts empty.