sandbox_scene: protect the placement input from output aliases #2442
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2442"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-27T10:16:54Z.
Claimed in the coordination issue as: SANDBOX-SCENE-ENTITIES-ALIAS
What and why
The entities JSONL is consumed before the scene is opened for writing. An output path naming that input, including a hard link with another extension, silently replaced the placements with an LSB1 file. Check both paths with the repository’s shared identity helper before building. The CLI regression verifies exit status 2 and preserves the source bytes for both spellings.
Tested
Windows, Python 3.14.7, synthetic fixtures.
python -I tests/test_sandbox_scene.pypython -I tests/test_sandbox_scene_build.pygit diff --checkpassed.GPUs tested: N/A (CPU-only).
AI-assisted: Yes.
Checklist
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T07:35:42Z.
#2442 | head
096fce1d45(merged cleanly with main09c153948) |python -I tests/test_sandbox_scene.py| red on main:FAILED (failures=2)(test_scene_output_cannot_replace_placements:AssertionError: 0 != 2on direct--entitiespath and hardlink alias) | green on PR+main:13 tests OK(-k test_scene_output_cannot_replace_placements:1 test OK) | Windows 11, Python 3.12.10 | AI-assisted: yesAudited
main()intools/sandbox_scene.py(same_report_path(args.out, args.entities)guard before opening output), and verified bothPR + main(09c153948) and combined sibling mergesmain + #2443 + #2442andmain + #2444 + #2443 + #2442(0conflicts;14 tests OKintests/test_sandbox_scene.py,9 tests OKintests/test_sandbox_scene_build.py). Also passedtests/test_report_paths.py(24 OK, skipped=1),tests/test_text_write_line_endings.py(3 OK),tests/test_runner_calls_all_tests.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:42:06Z.
Red/green: tests/test_sandbox_scene.py fails 2 subtests on main (--out equal to or hard-linked to --entities overwrites the placements) and passes with the PR (cloud run on main
7daa4a4, re-run on Windows against main8b318bd).Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
7daa4a4a5in GitHub Actions: no new failure.AI-assisted (Claude Code, Claude Opus 5.5)