SAVE-DATA-BLOB: import save payloads under the title's blob name #446

Merged
bobcatchris merged 1 commit from upstream-pr/446 into main 2026-11-29 01:37:02 +00:00
bobcatchris commented 2026-11-24 05:34:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-24T05:34:51Z.


Claimed in the coordination issue as: SAVE-DATA-BLOB

What and why

saves.py import wrote the payload under the payload file name on a guess that the docs marked VERIFY. The executable settles the data-blob name statically: XGameSaveSubmitBlobWrite is called with "Save Game Header" first and "Save Game Data" with the payload, and the read path matches the same two names. A payload imported under any other name is never read back.

This writes imported payloads as Save Game Data (still %-encoded on disk by the existing layout) and updates docs/saves.md to separate what was measured from what was not. Container names remain a guess because neither CreateContainer call passes a literal; --map still overrides either name. No real save files, save contents, keys or game data are included.

Tested

  • python -I tests/test_saves.py — 70 tests OK, 1 skipped
  • python -I tests/test_docs_links.py — 16 tests OK
  • python -I tests/test_docs_cli_flags.py — 4 tests OK
  • python -m compileall -q tools tests — OK
  • git diff --check — clean
  • security sweep of the diff — 0 hits

GPUs tested: n/a (CPU-only tool and documentation change)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • No new translator rule.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5466730089 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/446). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-11-24T05:34:51Z. --- Claimed in the coordination issue as: SAVE-DATA-BLOB ### What and why `saves.py import` wrote the payload under the payload file name on a guess that the docs marked VERIFY. The executable settles the data-blob name statically: `XGameSaveSubmitBlobWrite` is called with `"Save Game Header"` first and `"Save Game Data"` with the payload, and the read path matches the same two names. A payload imported under any other name is never read back. This writes imported payloads as `Save Game Data` (still %-encoded on disk by the existing layout) and updates `docs/saves.md` to separate what was measured from what was not. Container names remain a guess because neither `CreateContainer` call passes a literal; `--map` still overrides either name. No real save files, save contents, keys or game data are included. ### Tested - `python -I tests/test_saves.py` — 70 tests OK, 1 skipped - `python -I tests/test_docs_links.py` — 16 tests OK - `python -I tests/test_docs_cli_flags.py` — 4 tests OK - `python -m compileall -q tools tests` — OK - `git diff --check` — clean - security sweep of the diff — 0 hits GPUs tested: n/a (CPU-only tool and documentation change) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [x] No new translator rule.
Oliwettoo commented 2026-11-24 10:38:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Oliwettoo on 2026-11-24T10:38:25Z.


tests/test_saves.py passes with the PR on current main, and the existing same-container/blob check still catches two slots mapped to one container now that every payload is named Save Game Data. I couldn't check the executable measurement itself. One thing to settle before merge: the two texts disagree on whether the title needs the header. docs/saves.md says the read path "keeps the header only if its size is 0x128" (optional), while the new comment above SAVE_DATA_BLOB says the read path "also requires the 296-byte Save Game Header blob". If it is required, an import without the header won't load in the title, which the doc should say plainly. If it isn't, the comment should drop "requires". AI-assisted review.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7129048923 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/446#issuecomment-7129048923). Originally posted by [Oliwettoo](https://github.com/Oliwettoo) on 2026-11-24T10:38:25Z. --- `tests/test_saves.py` passes with the PR on current `main`, and the existing same-container/blob check still catches two slots mapped to one container now that every payload is named `Save Game Data`. I couldn't check the executable measurement itself. One thing to settle before merge: the two texts disagree on whether the title needs the header. `docs/saves.md` says the read path "keeps the header only if its size is `0x128`" (optional), while the new comment above `SAVE_DATA_BLOB` says the read path "also requires the 296-byte `Save Game Header` blob". If it is required, an import without the header won't load in the title, which the doc should say plainly. If it isn't, the comment should drop "requires". AI-assisted review.
bobcatchris commented 2026-11-24 23:42:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-24T23:42:43Z.


Rebased on current main. Verified: test_saves.py 70 tests (1 skipped), docs CLI-flag tests 4/4, no-game-data check and patch security sweep clean.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7147709661 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/446#issuecomment-7147709661). Originally posted by [bobcatchris](https://github.com/bobcatchris) on 2026-11-24T23:42:43Z. --- Rebased on current main. Verified: test_saves.py 70 tests (1 skipped), docs CLI-flag tests 4/4, no-game-data check and patch security sweep clean.
zmasi commented 2026-11-28 22:49:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:49:31Z.


#446 | head 95db9aa141 (merged cleanly with main adfb3821a2) | python -I tests/test_saves.py -v + python -I tests/test_saves_import_args.py + python -I tests/test_leonida_saves.py + python -I tests/test_docs_cli_flags.py | red on main: FAILED (errors=1, skipped=3) (FileNotFoundError for local-user\SLOT3\Save%20Game%20Data because saves.import_saves defaulted blob to the source payload filename instead of "Save Game Data") | green on PR+main: 70 ran, OK (skipped=3) (test_saves.py), 1 ran, OK (test_saves_import_args.py), 15 ran, OK (test_leonida_saves.py), 37 ran, OK (skipped=1) (test_save_keys.py), and 4 ran, OK (test_docs_cli_flags.py) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Audited 95db9aa141 (tools/saves.py, tests/test_saves.py, and docs/saves.md) on Windows 11, confirming SAVE_DATA_BLOB = 'Save Game Data' writes local-user/<container>/Save%20Game%20Data matching xgameruntime_gamesave.cpp percent-encoding, keeps --map container/blob overrides and same-container collision detection intact, and passes tests/test_docs_links.py, tests/test_docs_repo_paths.py, tests/test_docs_encoding.py, tests/test_ci_registration.py, and scripts/check_no_game_data.py. (Echoing the earlier review note: aligning the wording on whether Save Game Header is optional vs required between docs/saves.md and the SAVE_DATA_BLOB comment in tools/saves.py would make the contract completely unambiguous.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247008941 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/446#issuecomment-7247008941). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T22:49:31Z. --- #446 | head 95db9aa1413d190bbf7eb7da1e3c7f54defcf466 (merged cleanly with main adfb3821a2) | `python -I tests/test_saves.py -v` + `python -I tests/test_saves_import_args.py` + `python -I tests/test_leonida_saves.py` + `python -I tests/test_docs_cli_flags.py` | red on main: `FAILED (errors=1, skipped=3)` (`FileNotFoundError` for `local-user\SLOT3\Save%20Game%20Data` because `saves.import_saves` defaulted `blob` to the source payload filename instead of `"Save Game Data"`) | green on PR+main: `70 ran, OK (skipped=3)` (`test_saves.py`), `1 ran, OK` (`test_saves_import_args.py`), `15 ran, OK` (`test_leonida_saves.py`), `37 ran, OK (skipped=1)` (`test_save_keys.py`), and `4 ran, OK` (`test_docs_cli_flags.py`) | Windows 11 (`10.0.26200.9974`), Python 3.12.10 | AI-assisted: yes Audited `95db9aa141` (`tools/saves.py`, `tests/test_saves.py`, and `docs/saves.md`) on Windows 11, confirming `SAVE_DATA_BLOB = 'Save Game Data'` writes `local-user/<container>/Save%20Game%20Data` matching `xgameruntime_gamesave.cpp` percent-encoding, keeps `--map` container/blob overrides and same-container collision detection intact, and passes `tests/test_docs_links.py`, `tests/test_docs_repo_paths.py`, `tests/test_docs_encoding.py`, `tests/test_ci_registration.py`, and `scripts/check_no_game_data.py`. (Echoing the earlier review note: aligning the wording on whether `Save Game Header` is optional vs required between `docs/saves.md` and the `SAVE_DATA_BLOB` comment in `tools/saves.py` would make the contract completely unambiguous.)
OreoFR commented 2026-11-29 01:31:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T01:31:53Z.


Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main 53b77df14 : red 1 error (ImportTest.test_import_layout_and_manifest) / green 70 OK.

  • PR head 95db9aa14, python -I tests/test_saves.py from the repository root.
  • Red (main + only this PR's test files): 70 run, 1 error, 1 skip. ImportTest.test_import_layout_and_manifest: FileNotFoundError on a temp SLOT3/Save%20Game%20Data path.
  • Green (main + git merge --no-ff of this PR, no conflict): 70 run, OK, 1 skip.
  • Skips: AtomicPackTest.test_destination_through_directory_junction_updates_the_target on both sides ("Windows directory junction"), still skipped on macOS.
  • Verdict: READY.

Red = main + only the test files from this PR (git checkout pr-446 -- tests/test_saves.py); green = main + the merged PR. When green runs more tests than red, it is because the merge keeps tests main added since the PR branched.

AI-assisted: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248842999 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/446#issuecomment-7248842999). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T01:31:53Z. --- Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main 53b77df14 : red 1 error (`ImportTest.test_import_layout_and_manifest`) / green 70 OK. - PR head 95db9aa14, `python -I tests/test_saves.py` from the repository root. - Red (main + only this PR's test files): 70 run, 1 error, 1 skip. `ImportTest.test_import_layout_and_manifest`: `FileNotFoundError` on a temp `SLOT3/Save%20Game%20Data` path. - Green (main + `git merge --no-ff` of this PR, no conflict): 70 run, OK, 1 skip. - Skips: `AtomicPackTest.test_destination_through_directory_junction_updates_the_target` on both sides ("Windows directory junction"), still skipped on macOS. - Verdict: READY. Red = main + only the test files from this PR (`git checkout pr-446 -- tests/test_saves.py`); green = main + the merged PR. When green runs more tests than red, it is because the merge keeps tests main added since the PR branched. AI-assisted: Claude Code (Claude Opus 5.5).
MoonEyes commented 2026-11-29 01:37:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T01:37:04Z.


Merged after OreoFR's red/green check (check) (macOS 27.2.1, Apple M5, Python 3.12) and a local re-check here. Merged after local re-verification: this PR merged onto main 0efc2bd43 without conflict, and its test file(s) (tests/test_saves.py) pass there. Earlier today the same tests failed on main without the PR (red/green) and a bundle with other open PRs showed no new failures. check_no_game_data.py is clean. Windows 11, Python 3.14; no GPU needed for these tests.

AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248901478 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/446#issuecomment-7248901478). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T01:37:04Z. --- Merged after **OreoFR**'s red/green check ([check](https://github.com/ProjectLeonida/mandy/pull/446#issuecomment-7248842999)) (macOS 27.2.1, Apple M5, Python 3.12) and a local re-check here. Merged after local re-verification: this PR merged onto `main` 0efc2bd43 without conflict, and its test file(s) (`tests/test_saves.py`) pass there. Earlier today the same tests failed on `main` without the PR (red/green) and a bundle with other open PRs showed no new failures. `check_no_game_data.py` is clean. Windows 11, Python 3.14; no GPU needed for these tests. _AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes._
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!446
No description provided.