fix: stage pinned docker/saves into AppData before native game/load - #76
Merged
Conversation
Native POST /game/load reads RimWorld AppData Saves, not docker/saves. The YAML pin only hashed the repo mirror, so #75's Crashlanded seed (SimpleResearchBench + Smithing) could be ignored in favor of a stale April AppData file. Copy the canonical save when the live hash diverges and fail closed if the pin cannot be satisfied. Co-authored-by: Jason <jkbennitt@users.noreply.github.com>
jkbennitt
commented
Sep 8, 2026
jkbennitt
left a comment
Member
Author
There was a problem hiding this comment.
LGTM — closes the native/AppData gap after #75: ensure_live_save stages docker/saves → OS Saves when live SHA ≠ pin; fail-closed LiveSavePinError before game/load; docker skips (stage_live=False); metadata live_save_sha256/copied; RLE_RIMWORLD_SAVES override. Tests cover copy/no-op/fail-closed/load_save_and_settle wiring. No scoring/matrix. All five CI SUCCESS on df06459 (run 34259830319). Still draft — HOLD merge for CoS clear; plain squash (no --admin).
jkbennitt
marked this pull request as ready for review
September 8, 2026 17:55
cursor Bot
pushed a commit
that referenced
this pull request
Sep 8, 2026
Move the post-#76 adapter tests into their own class so the existing read-endpoint cases stay under TestReadEndpoints. Co-authored-by: Jason <jkbennitt@users.noreply.github.com>
jkbennitt
added a commit
that referenced
this pull request
Sep 8, 2026
…rge) (#77) * fix: read BuildingDto.def and merge research progress Post-#76 native pin-match still reported research_bench_present false and research_target Smithing locked. Live buildings use snake_case def (label fallback has spaces); /research/summary has no current project and by-tech-level bucketing dropped Smithing from available. Map def → def_name → label, strip spaces in the bench matcher, and merge /research/progress + finished + tree so current can be Smithing. Co-authored-by: Jason <jkbennitt@users.noreply.github.com> * test: keep research adapter cases out of TestReadEndpoints Move the post-#76 adapter tests into their own class so the existing read-endpoint cases stay under TestReadEndpoints. Co-authored-by: Jason <jkbennitt@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Jason <jkbennitt@users.noreply.github.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.
Why
Native runs (
docker_mode: false) callPOST /api/v1/game/loadwithfile_name=rle_crashlanded_v1. RIMAPI loads that name from RimWorld AppData Saves, not fromdocker/saves/.#75 updated
docker/saves/rle_crashlanded_v1.rws(builtSimpleResearchBench+ queuedSmithing) and re-pinned YAMLsave_sha256. The loader pin insrc/rle/scenarios/loader.pyonly hashed the repo mirror. A stale April AppData file (no bench / nocurrentProj) still loaded on native machines. Docker is fine:docker/entrypoint.shalready symlinks/opt/savesinto the container Saves folder. Native had no equivalent.What landed
ensure_live_save()copiesdocker/saves/<name>.rwsinto the OS Saves folder (Windows AppData LocalLow / macOS Application Support / Linux~/.config/unity3d/...) when the live SHA ≠ the scenario pin.LiveSavePinErrorbeforegame/load.run_scenarioexits 1;run_benchmarkdoes not swallow the pin error.load_save_and_settle(..., stage_live=)so Crashlanded and the other pinned scenarios get it. Native CLIs passstage_live=True;--dockerpassesFalse.live_save_sha256andlive_save_copied. Optional$RLE_RIMWORLD_SAVESoverride (also reused bycreate_scenario_saves.py).Tests
load_save_and_settlestages beforegame/load, skips staging whenstage_live=False, and does not callload_gameon pin failureNo scoring changes, no matrix / billed model / cal runs.
Out of scope
SCORING_VERSION