Reserve synthetic guest scene output before writing reports (GUEST-SCENE-OUTPUT-OWNERSHIP) #1958

Merged
leonida/mandy
alexandersato0830 merged 1 commit from codex/guest-scene-output-ownership into main 2026-11-28 19:29:44 +00:00

Pull request successfully merged and closed

alexandersato0830 commented 2026-11-25 16:46:33 +00:00

Claimed in the coordination issue as: GUEST-SCENE-OUTPUT-OWNERSHIP

What and why

Two invocations can both see an empty --out during argument parsing. When the second invocation sees the first run's logs/ during setup, it can write a failure report into the shared directory. The active invocation then fails when it tries to publish its own report.json.

Create logs/ exclusively before input hashing or report handling. If another run owns the directory, the later invocation exits through the existing setup-error handling and leaves the first run's logs and report alone.

Tested

  • python -I tests/test_guest_scene_reference.py passed all 7 tests. The new regression fails before the fix because the competing run creates report.json.
  • python -I tests/test_dev_guest_scene.py passed all 4 tests.
  • A separate two-process repro let both invocations pass the real argument check before either entered execute(). On 9e7720c9e, the second invocation wrote the report and the active invocation raised FileExistsError. With the patch, the second invocation returned 1 and the active invocation recorded the synthetic loader's exit code 7.
  • git diff --check and the source-only check passed. Tested on Windows 11 with Python 3.11.17.

GPUs tested: n/a (CPU-only synthetic fixtures)

AI-assisted: yes (Codex)

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption.
Claimed in the coordination issue as: [GUEST-SCENE-OUTPUT-OWNERSHIP](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7168448353) ### What and why Two invocations can both see an empty `--out` during argument parsing. When the second invocation sees the first run's `logs/` during setup, it can write a failure report into the shared directory. The active invocation then fails when it tries to publish its own `report.json`. Create `logs/` exclusively before input hashing or report handling. If another run owns the directory, the later invocation exits through the existing setup-error handling and leaves the first run's logs and report alone. ### Tested - `python -I tests/test_guest_scene_reference.py` passed all 7 tests. The new regression fails before the fix because the competing run creates `report.json`. - `python -I tests/test_dev_guest_scene.py` passed all 4 tests. - A separate two-process repro let both invocations pass the real argument check before either entered `execute()`. On `9e7720c9e`, the second invocation wrote the report and the active invocation raised `FileExistsError`. With the patch, the second invocation returned 1 and the active invocation recorded the synthetic loader's exit code 7. - `git diff --check` and the source-only check passed. Tested on Windows 11 with Python 3.11.17. GPUs tested: n/a (CPU-only synthetic fixtures) AI-assisted: yes (Codex) ### Checklist - [x] Based on current `main`. - [x] One topic. - [x] No game data, keys or decryption.
zmasi commented 2026-11-28 12:21:43 +00:00

#1958 | head ab3eb20e6d7663a004aaf953861afefb76cb38d6 (merged cleanly with main d48a957bb) | python -I tests/test_guest_scene_reference.py | red on main: FAILED (failures=1) (wrote report.json into a competing run's output/ directory) | green on PR+main: 7 tests OK | Windows 11, Python 3.12.10 | AI-assisted: yes

Audited execute in scripts/run_guest_scene.py (reserving session.logs.mkdir() without exist_ok inside the initial OSError guard before entering the finally block that writes report.json, so a concurrent run that already claimed out/logs fails cleanly with exit 1 without overwriting report.json or logs). Also verified tests/test_ci_registration.py (18 OK), tests/test_text_write_line_endings.py (3 OK), and scripts/check_no_game_data.py.

#1958 | head ab3eb20e6d7663a004aaf953861afefb76cb38d6 (merged cleanly with main d48a957bb) | `python -I tests/test_guest_scene_reference.py` | red on main: `FAILED (failures=1)` (wrote `report.json` into a competing run's `output/` directory) | green on PR+main: `7 tests OK` | Windows 11, Python 3.12.10 | AI-assisted: yes Audited `execute` in `scripts/run_guest_scene.py` (reserving `session.logs.mkdir()` without `exist_ok` inside the initial `OSError` guard before entering the `finally` block that writes `report.json`, so a concurrent run that already claimed `out/logs` fails cleanly with exit `1` without overwriting `report.json` or logs). Also verified `tests/test_ci_registration.py` (`18 OK`), `tests/test_text_write_line_endings.py` (`3 OK`), and `scripts/check_no_game_data.py`.
MoonEyes commented 2026-11-28 19:29:41 +00:00

Red/green: tests/test_guest_scene_reference.py fails on main (writes report.json into a competing run's output directory) and passes with the PR merged, on GitHub Actions Linux and natively on Windows.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: tests/test_guest_scene_reference.py fails on main (writes report.json into a competing run's output directory) and passes with the PR merged, on GitHub Actions Linux and natively on Windows. Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
OreoFR commented 2026-11-28 21:56:35 +00:00

Verified by OreoFR

  • Base: main 4a54aedcb + PR head ab3eb20e6
  • Test: python -I tests/test_guest_scene_reference.py
  • Red on main: 1 failure (another run's output touched)
  • Green with the PR: OK
  • Verdict: READY
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

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

**Verified by OreoFR** - Base: main `4a54aedcb` + PR head `ab3eb20e6` - Test: `python -I tests/test_guest_scene_reference.py` - Red on main: 1 failure (another run's output touched) - Green with the PR: OK - Verdict: READY - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No description provided.