run_guest_scene: take the Wine from $WINE when --wine is not given (OLD-10047) #1239

Merged
leonida/mandy
quietfold merged 2 commits from carry/old-10047-run-guest-scene-wine into main 2026-11-29 01:32:27 +00:00

Pull request successfully merged and closed

quietfold commented 2026-11-24 20:42:04 +00:00

What changed

Carries forward old-pr/10047 (draft #313, original commit by @SkippySteve) rebased cleanly onto main (2e026b03e), preserving the original author commit and adding a follow-up fix for native Windows:

  1. Original commit (@SkippySteve):
    • scripts/run_guest_scene.py: default --wine to $WINE when --wine is omitted (blank counts as unset; --wine still overrides), include the missing binary path in --wine: not found: ..., and update CLI/docstring messages.
    • tests/test_run_guest_scene_wine.py: 5 unit tests covering $WINE pickup, --wine-arg with $WINE, --wine overriding $WINE, missing/empty $WINE refusal outside Windows, and nonexistent $WINE reporting.
  2. Follow-up commit (df763ce9f, addressing @xel1uz's review):
    • scripts/run_guest_scene.py: only read $WINE as the default outside Windows (os.name != "nt"), qualify the docstring / --wine help text (default: $WINE outside Windows), and keep --wine-arg requires --wine on Windows.
    • tests/test_run_guest_scene_wine.py: add RunGuestSceneWindowsEnvTest (3 tests, runs on every platform via a SimpleNamespace stub on runner.os) confirming ambient WINE (existing or missing) is ignored on Windows, explicit --wine still works, and --wine-arg requires explicit --wine.

Item ID

  • Coordination issue #14 item: OLD-10047 (carries forward old-pr/10047 / draft #313, #17)
  • Depends on: none

Verification

Tested on macOS 27.2.1 (Apple M5 arm64), Python 3.14 (no game files, no GPU, standard library only):

  • TMPDIR=/var/tmp python3 -I tests/test_run_guest_scene_wine.py -v -> 8/8 OK (5 POSIX + 3 Windows-mode tests)
  • python3 -I tests/test_guest_scene_reference.py -v -> 6/6 OK
  • Mutation check vs HEAD~1 (without the Windows guard) -> FAILED (3 failures) across all 3 Windows ambient-WINE checks; mutation check vs main -> FAILED (3 failures, 2 errors); restoring HEAD returns to 8/8 OK.
  • python3 -m compileall -q scripts/run_guest_scene.py tests/test_run_guest_scene_wine.py -> OK
  • python3 -I scripts/check_no_game_data.py scripts/run_guest_scene.py tests/test_run_guest_scene_wine.py -> OK
  • python3 -I tests/test_ci_registration.py -> 15/15 OK
  • python3 -I tests/test_text_write_line_endings.py -> 3/3 OK

Checklist

  • No game files, binaries, shaders, textures, audio, or logs quoting them
  • No keys, decryption, or online services
  • Claimed in the coordination issue (#14) before opening this PR
  • AI-assisted: yes (carried forward, audited, rebased, updated per review, and regression-verified with AI assistance; original commit by @SkippySteve preserved)
## What changed Carries forward `old-pr/10047` (draft #313, original commit by @SkippySteve) rebased cleanly onto `main` (`2e026b03e`), preserving the original author commit and adding a follow-up fix for native Windows: 1. **Original commit (`@SkippySteve`)**: - `scripts/run_guest_scene.py`: default `--wine` to `$WINE` when `--wine` is omitted (blank counts as unset; `--wine` still overrides), include the missing binary path in `--wine: not found: ...`, and update CLI/docstring messages. - `tests/test_run_guest_scene_wine.py`: 5 unit tests covering `$WINE` pickup, `--wine-arg` with `$WINE`, `--wine` overriding `$WINE`, missing/empty `$WINE` refusal outside Windows, and nonexistent `$WINE` reporting. 2. **Follow-up commit (`df763ce9f`, addressing @xel1uz's review)**: - `scripts/run_guest_scene.py`: only read `$WINE` as the default outside Windows (`os.name != "nt"`), qualify the docstring / `--wine` help text (`default: $WINE outside Windows`), and keep `--wine-arg requires --wine` on Windows. - `tests/test_run_guest_scene_wine.py`: add `RunGuestSceneWindowsEnvTest` (3 tests, runs on every platform via a `SimpleNamespace` stub on `runner.os`) confirming ambient `WINE` (existing or missing) is ignored on Windows, explicit `--wine` still works, and `--wine-arg` requires explicit `--wine`. ## Item ID - Coordination issue #14 item: `OLD-10047` (carries forward `old-pr/10047` / draft #313, #17) - Depends on: none ## Verification Tested on macOS 27.2.1 (Apple M5 arm64), Python 3.14 (no game files, no GPU, standard library only): - `TMPDIR=/var/tmp python3 -I tests/test_run_guest_scene_wine.py -v` -> **8/8 OK** (5 POSIX + 3 Windows-mode tests) - `python3 -I tests/test_guest_scene_reference.py -v` -> **6/6 OK** - Mutation check vs `HEAD~1` (without the Windows guard) -> **FAILED (3 failures)** across all 3 Windows ambient-`WINE` checks; mutation check vs `main` -> **FAILED (3 failures, 2 errors)**; restoring `HEAD` returns to 8/8 OK. - `python3 -m compileall -q scripts/run_guest_scene.py tests/test_run_guest_scene_wine.py` -> OK - `python3 -I scripts/check_no_game_data.py scripts/run_guest_scene.py tests/test_run_guest_scene_wine.py` -> OK - `python3 -I tests/test_ci_registration.py` -> **15/15 OK** - `python3 -I tests/test_text_write_line_endings.py` -> **3/3 OK** ## Checklist - [x] No game files, binaries, shaders, textures, audio, or logs quoting them - [x] No keys, decryption, or online services - [x] Claimed in the coordination issue (#14) before opening this PR - [x] AI-assisted: yes (carried forward, audited, rebased, updated per review, and regression-verified with AI assistance; original commit by @SkippySteve preserved)
copilot-pull-request-reviewer[bot] reviewed 2026-11-24 20:42:13 +00:00
copilot-pull-request-reviewer[bot] left a comment
No description provided.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
xel1uz reviewed 2026-11-24 20:48:19 +00:00
xel1uz left a comment
No description provided.
The Linux precedence cases pass, but on native Windows an ambient `WINE` now changes a launch even when the caller omits `--wine`. With a missing binary the parser exits 2; with an existing one, the guest path builder prefixes an already native drive path with `Z:`. All five new Wine tests skip on Windows. The inline change restored native paths in the Windows check while preserving the five Wine tests and six reference tests on Ubuntu. Please add a native-Windows regression case and qualify the CLI help accordingly. The original Wine change is [draft #313](https://github.com/ubiquitarianism/leonida/pull/313); the description currently points to #312. AI-assisted review, CPU only.
quietfold commented 2026-11-24 21:00:27 +00:00

Thank you for catching that, @xel1uz! Pushed follow-up commit df763ce9f (preserving @SkippySteve's original commit):

  • Restricted the $WINE default to os.name != "nt", updated the docstring and --wine help text (default: $WINE outside Windows), and kept --wine-arg requires --wine on Windows.
  • Added RunGuestSceneWindowsEnvTest (3 tests, runs on both POSIX and Windows via a SimpleNamespace stub for runner.os) verifying that ambient WINE (existing or missing) is ignored on Windows, explicit --wine still takes precedence, and --wine-arg requires explicit --wine (verified 3 failures against HEAD~1, 8/8 OK on HEAD).
  • Fixed the draft PR reference in the description (#313).
Thank you for catching that, @xel1uz! Pushed follow-up commit `df763ce9f` (preserving @SkippySteve's original commit): - Restricted the `$WINE` default to `os.name != "nt"`, updated the docstring and `--wine` help text (`default: $WINE outside Windows`), and kept `--wine-arg requires --wine` on Windows. - Added `RunGuestSceneWindowsEnvTest` (3 tests, runs on both POSIX and Windows via a `SimpleNamespace` stub for `runner.os`) verifying that ambient `WINE` (existing or missing) is ignored on Windows, explicit `--wine` still takes precedence, and `--wine-arg` requires explicit `--wine` (verified 3 failures against `HEAD~1`, 8/8 OK on `HEAD`). - Fixed the draft PR reference in the description (`#313`).
lixonik reviewed 2026-11-25 05:33:31 +00:00
lixonik left a comment
No description provided.
Rechecked the follow-up at `df763ce9` on native Windows and Ubuntu under WSL. With the same inherited `WINE` pointing to a missing path and no explicit flag, the first PR head exited 2 on native Windows and the follow-up left the native launch selected. The three Windows cases passed, and all eight tests passed under Ubuntu. A separate CLI run on Ubuntu launched a synthetic wrapper from a relative `WINE` path containing spaces, forwarded `--wine-arg`, and preserved an explicit `--wine` override. The wrapper was launched after the runner switched into its output overlay. AI-assisted review. CPU-only checks with synthetic inputs and launchers.
xel1uz approved these changes 2026-11-25 19:35:16 +00:00
xel1uz left a comment

Approving df763ce9: the follow-up resolves what I requested.

  • Native Windows (Python 3.12, WINE set to a missing path, no --wine): tests/test_run_guest_scene_wine.py 8 tests OK (the 3 Windows-mode cases pass, the 5 POSIX cases skip), tests/test_guest_scene_reference.py 6/6 OK.
    • Bite check: with scripts/run_guest_scene.py from the first head (f3cd82af), the 3 Windows-mode cases fail.
      • Linux (Ubuntu 26.04, Python 3.14): both files OK on the PR head and on the PR merged with current main (merges without conflicts).
        AI-assisted review, CPU only.
Approving `df763ce9`: the follow-up resolves what I requested. - Native Windows (Python 3.12, `WINE` set to a missing path, no `--wine`): `tests/test_run_guest_scene_wine.py` 8 tests OK (the 3 Windows-mode cases pass, the 5 POSIX cases skip), `tests/test_guest_scene_reference.py` 6/6 OK. - - Bite check: with `scripts/run_guest_scene.py` from the first head (`f3cd82af`), the 3 Windows-mode cases fail. - - - Linux (Ubuntu 26.04, Python 3.14): both files OK on the PR head and on the PR merged with current `main` (merges without conflicts). AI-assisted review, CPU only.
OreoFR commented 2026-11-28 21:48:12 +00:00

Verified by OreoFR

  • Base: main 5cb45921e + PR head df763ce9f
  • Test: python -I tests/test_run_guest_scene_wine.py
  • Red on main: 8 OK (5 skipped)
  • Green with the PR: 8 OK (5 skipped)
  • Verdict: NO RED (the 5 Wine tests are skipped on Windows ("only apply outside Windows"): the PR's case is not exercised here)
  • 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 `5cb45921e` + PR head `df763ce9f` - Test: `python -I tests/test_run_guest_scene_wine.py` - Red on main: 8 OK (5 skipped) - Green with the PR: 8 OK (5 skipped) - Verdict: NO RED (the 5 Wine tests are skipped on Windows ("only apply outside Windows"): the PR's case is not exercised here) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 01:12:20 +00:00

#1239 | head df763ce9fbf1e4b4e3fc59391385286ebd7847ab (merged cleanly onto origin/main 818d881b1f) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Independent Verification (Windows 11)

  • Diff & safety audit: Inspected 100% of the diff across scripts/run_guest_scene.py and tests/test_run_guest_scene_wine.py. python -I scripts/check_no_game_data.py scripts/run_guest_scene.py tests/test_run_guest_scene_wine.py passed (rc=0).
  • Native Windows 11 (os.name == "nt") verification:
    • python -I tests/test_run_guest_scene_wine.py -> 8 ran, OK (skipped=5) (RunGuestSceneWindowsEnvTest 3/3 passed; POSIX-only RunGuestSceneWineTest 5/5 skipped cleanly on nt).
    • Unmocked native Windows 11 parse_args() check: Executed scripts/run_guest_scene.py's parse_args() directly on Windows 11 (os.name == "nt", without mocking os) with WINE set in os.environ to a nonexistent .exe -> args.wine is None, confirming an ambient WINE environment variable cannot hijack or break native Windows launches while explicit --wine <path> still resolves as expected.
#1239 | head df763ce9fbf1e4b4e3fc59391385286ebd7847ab (merged cleanly onto origin/main 818d881b1f) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes ### Independent Verification (Windows 11) - **Diff & safety audit**: Inspected 100% of the diff across `scripts/run_guest_scene.py` and `tests/test_run_guest_scene_wine.py`. `python -I scripts/check_no_game_data.py scripts/run_guest_scene.py tests/test_run_guest_scene_wine.py` passed (`rc=0`). - **Native Windows 11 (`os.name == "nt"`) verification**: - `python -I tests/test_run_guest_scene_wine.py` -> `8 ran, OK (skipped=5)` (`RunGuestSceneWindowsEnvTest` 3/3 passed; POSIX-only `RunGuestSceneWineTest` 5/5 skipped cleanly on `nt`). - **Unmocked native Windows 11 `parse_args()` check**: Executed `scripts/run_guest_scene.py`'s `parse_args()` directly on Windows 11 (`os.name == "nt"`, without mocking `os`) with `WINE` set in `os.environ` to a nonexistent `.exe` -> `args.wine is None`, confirming an ambient `WINE` environment variable cannot hijack or break native Windows launches while explicit `--wine <path>` still resolves as expected.
OreoFR commented 2026-11-29 01:26:09 +00:00

Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main 53b77df14 : red 3 failures + 2 errors (test_wine_from_environment, test_wine_args_with_wine_from_environment, test_wine_from_environment_that_does_not_exist, test_missing_wine_still_refused_outside_windows x2 subtests) / green 8 OK.

  • PR head df763ce9f, python -I tests/test_run_guest_scene_wine.py.
  • The Wine tests run here (they are skipped on Windows, "only apply outside Windows"): this is the PR's case exercised for the first time.
  • Red: 8 run, 3 failures, 2 errors. On main, $WINE is not read (AttributeError: 'int' object has no attribute 'wine') and the error says --wine is required outside Windows where the tests expect --wine (or WINE) is required outside Windows / --wine: not found. MEASURED, 3 runs, 3/3 fail.
  • Green: 8 run, OK, 0 skipped. MEASURED, 3/3 pass.
  • Verdict: READY.

Red = main + only the test file from this PR (git checkout pr-N -- <test>); green = main + git merge --no-ff of this PR, no conflict. Green runs more tests than red because the merge keeps the tests main added to this file since the PR branched; that is the method, not a finding.

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

Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main 53b77df14 : red 3 failures + 2 errors (test_wine_from_environment, test_wine_args_with_wine_from_environment, test_wine_from_environment_that_does_not_exist, test_missing_wine_still_refused_outside_windows x2 subtests) / green 8 OK. - PR head df763ce9f, `python -I tests/test_run_guest_scene_wine.py`. - The Wine tests run here (they are skipped on Windows, "only apply outside Windows"): this is the PR's case exercised for the first time. - Red: 8 run, 3 failures, 2 errors. On main, `$WINE` is not read (`AttributeError: 'int' object has no attribute 'wine'`) and the error says `--wine is required outside Windows` where the tests expect `--wine (or WINE) is required outside Windows` / `--wine: not found`. MEASURED, 3 runs, 3/3 fail. - Green: 8 run, OK, 0 skipped. MEASURED, 3/3 pass. - Verdict: READY. Red = main + only the test file from this PR (`git checkout pr-N -- <test>`); green = main + `git merge --no-ff` of this PR, no conflict. Green runs more tests than red because the merge keeps the tests main added to this file since the PR branched; that is the method, not a finding. AI-assisted: Claude Code (Claude Opus 5.5).
MoonEyes commented 2026-11-29 01:32:30 +00:00

Merged after OreoFR's red/green check (check) (macOS 27.2.1, Apple M5, APFS case-insensitive, Python 3.12) and a local re-check here. Merged after local re-verification: this PR merged onto main 35159222a without conflict, and its test file(s) (tests/test_run_guest_scene_wine.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.

Merged after **OreoFR**'s red/green check ([check](https://github.com/ProjectLeonida/mandy/pull/1239#issuecomment-7248780537)) (macOS 27.2.1, Apple M5, APFS case-insensitive, Python 3.12) and a local re-check here. Merged after local re-verification: this PR merged onto `main` 35159222a without conflict, and its test file(s) (`tests/test_run_guest_scene_wine.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 description provided.