gate: game-gate.ps1 says it needs PowerShell 7 (D3D12-GATE-PWSH7) #2805

Merged
TheGeogeo merged 1 commit from upstream-pr/2805 into main 2026-12-01 07:50:37 +00:00
TheGeogeo commented 2026-12-01 00:28:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-12-01T00:28:47Z.


Claimed in the coordination issue as: D3D12-GATE-PWSH7 (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7295445406)

What and why

A tester ran scripts/game-gate.ps1 (#2782) under Windows PowerShell 5.1. It failed in about 2 s without starting the game and without saying why. The script needs PowerShell 7.

  • scripts/game-gate.ps1 now starts with #Requires -Version 7.0. Windows PowerShell 5.1 refuses the script with its own message before anything runs.
  • docs/game_gate.md ("Running it") says it needs pwsh.
  • tests/test_game_gate.py keeps the line (test_it_needs_powershell_7).

scripts/game-abba.ps1 (#2804) carries the same line from the start.

Tested

On Windows 11 Pro 10.0.26300, at main b7a1be296:

  • tests/test_game_gate.py: 22 tests OK. With main's scripts/game-gate.ps1 put back, the new test fails and the other 21 pass.
  • The script parses in PowerShell 7.
  • The docs tests and scripts/check_no_game_data.py on the changed files are clean.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5576376738 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2805). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-12-01T00:28:47Z. --- Claimed in the coordination issue as: D3D12-GATE-PWSH7 (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7295445406) ### What and why A tester ran `scripts/game-gate.ps1` (#2782) under Windows PowerShell 5.1. It failed in about 2 s without starting the game and without saying why. The script needs PowerShell 7. - `scripts/game-gate.ps1` now starts with `#Requires -Version 7.0`. Windows PowerShell 5.1 refuses the script with its own message before anything runs. - `docs/game_gate.md` ("Running it") says it needs `pwsh`. - `tests/test_game_gate.py` keeps the line (`test_it_needs_powershell_7`). `scripts/game-abba.ps1` (#2804) carries the same line from the start. ### Tested On Windows 11 Pro 10.0.26300, at `main` b7a1be296: - `tests/test_game_gate.py`: 22 tests OK. With `main`'s `scripts/game-gate.ps1` put back, the new test fails and the other 21 pass. - The script parses in PowerShell 7. - The docs tests and `scripts/check_no_game_data.py` on the changed files are clean. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change)
OreoFR commented 2026-12-01 00:30:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T00:30:09Z.


Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12, head f4c6aca75, main b7a1be296. CPU only.

MEASURED

  • Red (main + only this PR's tests/test_game_gate.py): 1 failed, 21 passed. The failure is Script::test_it_needs_powershell_7.
  • Green (main + this PR, merge-tree): 22 passed.

READ IN CODE

  • The fix is one line: #Requires -Version 7.0 as the first line of scripts/game-gate.ps1. Under Windows PowerShell 5.1 the script then stops at once with PowerShell's own "requires version 7.0" message, instead of failing after about 2 s with no reason. That is the case DadaCap reported on the bridge (5080).

ASSUMED

  • Not run under PowerShell 5.1 or 7 here (no pwsh on this Mac). The behavior of #Requires itself is standard PowerShell.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7296407014 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2805#issuecomment-7296407014). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-01T00:30:09Z. --- Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12, head `f4c6aca75`, main `b7a1be296`. CPU only. **MEASURED** - Red (main + only this PR's `tests/test_game_gate.py`): 1 failed, 21 passed. The failure is `Script::test_it_needs_powershell_7`. - Green (main + this PR, merge-tree): 22 passed. **READ IN CODE** - The fix is one line: `#Requires -Version 7.0` as the first line of `scripts/game-gate.ps1`. Under Windows PowerShell 5.1 the script then stops at once with PowerShell's own "requires version 7.0" message, instead of failing after about 2 s with no reason. That is the case DadaCap reported on the bridge (5080). **ASSUMED** - Not run under PowerShell 5.1 or 7 here (no pwsh on this Mac). The behavior of `#Requires` itself is standard PowerShell. AI-assisted: Claude Code
fiestorra commented 2026-12-01 01:17:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T01:17:57Z.


Verified on Windows, with the control that matters: the tests fail when the change is reverted.

Cherry-picked onto main d920d850d in a clean worktree, Python 3.13.14:

python -m pytest tests/test_game_gate.py -q with this pull request: 22 passed with scripts/game-gate.ps1 from main: 1 failed

So the new tests are tied to the change and not to each other's fixtures. No part of this needed a GPU, a display or game data, which is what the gate tests are built for.

What I could not test: the script against a real run folder - game-abba.ps1 drives one, and this machine has the game but not the gate harness the other contributors used, so the shape is proven and the run is not.

AI-assisted: yes - DeepSeek v4.1 (flash), applied and ran both arms on the machine above.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7297340997 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2805#issuecomment-7297340997). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-01T01:17:57Z. --- **Verified on Windows, with the control that matters: the tests fail when the change is reverted.** **Cherry-picked onto `main` `d920d850d` in a clean worktree, Python 3.13.14:** ` python -m pytest tests/test_game_gate.py -q with this pull request: 22 passed with scripts/game-gate.ps1 from main: 1 failed ` **So the new tests are tied to the change and not to each other's fixtures.** **No part of this needed a GPU, a display or game data, which is what the gate tests are built for.** **What I could not test:** **the script against a real run folder** - `game-abba.ps1` drives one, **and this machine has the game but not the gate harness the other contributors used**, so the shape is proven and the run is not. **AI-assisted:** yes - DeepSeek v4.1 (flash), applied and ran both arms on the machine above. Written with an AI assistant.
KelboLive commented 2026-12-01 05:40:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T05:40:21Z.

Review: COMMENTED


Verified on this machine, and the guard is reachable — which was the question worth asking: #Requires is a parser directive, not a statement, so 5.1 refuses the script before any line runs.

powershell.exe 5.1.26100.9711   exit 1: The script 'game-gate.ps1' cannot be run because it contained a
                                "#requires" statement for Windows PowerShell 7.0 … currently running 5.1.26100.9711
pwsh 7.7.0                      stop -> "asked … to stop", STOP written, exit 0
line 1 deleted, 5.1             ran (exit 0) — the file is otherwise 5.1-parseable
line 2 made 7-only, 5.1         the #requires error still wins

So it is not the "guard inside a 7-only script, unreachable after the parse error" anti-pattern. 22/22 tests, check_no_game_data clean, and deleting the line fails Script.test_it_needs_powershell_7.

Two notes:

  • The test is textual: it catches removal, movement or a changed version string, but not a wrong or missing message at run time. The repo already runs PowerShell in tests/test_win_launchers.py, so a one-case execution test (skip when powershell.exe is absent) asserting ScriptRequiresUnmatchedPSVersion and exit 1 would pin the behaviour rather than the text.
  • Since the file is 5.1-parseable and stop works under 5.1, the docs' "it needs PowerShell 7" would be clearer saying what in run needs 7 — today it states the support boundary without the reason.
<!-- greyfinch-sync:ubiquitarianism/leonida:review:6125749575 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2805#pullrequestreview-6125749575). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T05:40:21Z. **Review:** COMMENTED --- Verified on this machine, and the guard is reachable — which was the question worth asking: `#Requires` is a **parser directive**, not a statement, so 5.1 refuses the script before any line runs. ``` powershell.exe 5.1.26100.9711 exit 1: The script 'game-gate.ps1' cannot be run because it contained a "#requires" statement for Windows PowerShell 7.0 … currently running 5.1.26100.9711 pwsh 7.7.0 stop -> "asked … to stop", STOP written, exit 0 line 1 deleted, 5.1 ran (exit 0) — the file is otherwise 5.1-parseable line 2 made 7-only, 5.1 the #requires error still wins ``` So it is not the "guard inside a 7-only script, unreachable after the parse error" anti-pattern. 22/22 tests, `check_no_game_data` clean, and deleting the line fails `Script.test_it_needs_powershell_7`. Two notes: - The test is **textual**: it catches removal, movement or a changed version string, but not a wrong or missing message at run time. The repo already runs PowerShell in `tests/test_win_launchers.py`, so a one-case execution test (skip when `powershell.exe` is absent) asserting `ScriptRequiresUnmatchedPSVersion` and exit 1 would pin the behaviour rather than the text. - Since the file is 5.1-parseable and `stop` works under 5.1, the docs' "it needs PowerShell 7" would be clearer saying *what in `run`* needs 7 — today it states the support boundary without the reason.
MoonEyes commented 2026-12-01 07:50:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T07:50:34Z.


Merging. Head f4c6aca75 merges cleanly with main e56aff1ce and does not force a rebase of #2566. CI green on this head and on main. Red/green by OreoFR (macOS) and fiestorra (Windows) on it, and KelboLive ran it under PowerShell 5.1 and 7; I ran it on main + PR (Windows, Python 3.14): 22 tests OK, one fails without the change. MoonEyes asked for this merge. One directive and its test and docs, no in-game run needed. Merged by MoonEyes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7304547445 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2805#issuecomment-7304547445). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-01T07:50:34Z. --- Merging. Head `f4c6aca75` merges cleanly with `main` `e56aff1ce` and does not force a rebase of #2566. CI green on this head and on main. Red/green by OreoFR (macOS) and fiestorra (Windows) on it, and KelboLive ran it under PowerShell 5.1 and 7; I ran it on main + PR (Windows, Python 3.14): 22 tests OK, one fails without the change. MoonEyes asked for this merge. One directive and its test and docs, no in-game run needed. Merged by MoonEyes. AI-assisted (Claude Code).
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!2805
No description provided.