conformance: check cmake configure status, guard NativeCommandError and clean scratch in negative-control.ps1 #1848

Merged
kirigayakazima merged 1 commit from upstream-pr/1848 into main 2026-11-28 15:03:34 +00:00
kirigayakazima commented 2026-11-25 13:04:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-25T13:04:49Z.


Claimed in the coordination issue as: CONFORMANCE-NEGATIVE-CONTROL-PS1-SAFETY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163205423)

What and why

  • Check $LASTEXITCODE immediately after cmake -S ... -B ... configure in tools/conformance/native/scripts/negative-control.ps1 so configure failures stop with CONFIGURE FAILED <code > before running --build.
  • Temporarily set $ErrorActionPreference = 'Continue' inside a try/finally block around & ... conform_native.exe ... 2>&1 so Windows PowerShell 5.1 does not abort with NativeCommandError when diagnostics go to stderr.
  • Force array capture @(...) for $failedScenes and compare sorted scene lists without Compare-Object (which crashes when $failedScenes is empty/$null on Windows PowerShell 5.1).
  • Use -LiteralPath on file/directory operations and wrap the throwaway negative-control directory in try/finally cleanup while preserving CRLF line endings.
  • Add Windows PowerShell 5.1 regression tests in tests/test_conformance_negative_control.py.

Tested

  • python -I tests/test_conformance_negative_control.py -v (live Windows PowerShell 5.1) -> Ran 4 tests in 2.068s, OK.
  • Detached upstream/main (98c2f777) baseline worktree with tests/test_conformance_negative_control.py -> Ran 4 tests in 2.026s, FAILED (failures=4).
  • CRLF verification on tools/conformance/native/scripts/negative-control.ps1 -> PS1_CRLF=82 PS1_LF_ONLY=0.
  • python -I tests/test_ci_registration.py -> Ran 16 tests in 4.946s, OK.
  • python -I tests/test_text_write_line_endings.py -> Ran 3 tests in 13.453s, OK.
  • python -I scripts/check_no_game_data.py tools/conformance/native/scripts/negative-control.ps1 tests/test_conformance_negative_control.py, python -I -m compileall -q tests/test_conformance_negative_control.py, and git diff --check -> exit 0.

GPUs tested: n/a (Windows PowerShell 5.1 + stdlib Python tests on Windows 11 x64)

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)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5491880044 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1848). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-25T13:04:49Z. --- Claimed in the coordination issue as: CONFORMANCE-NEGATIVE-CONTROL-PS1-SAFETY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163205423) ### What and why - Check `$LASTEXITCODE` immediately after `cmake -S ... -B ...` configure in `tools/conformance/native/scripts/negative-control.ps1` so configure failures stop with `CONFIGURE FAILED <code >` before running `--build`. - Temporarily set `$ErrorActionPreference = 'Continue'` inside a `try/finally` block around `& ... conform_native.exe ... 2>&1` so Windows PowerShell 5.1 does not abort with `NativeCommandError` when diagnostics go to stderr. - Force array capture `@(...)` for `$failedScenes` and compare sorted scene lists without `Compare-Object` (which crashes when `$failedScenes` is empty/`$null` on Windows PowerShell 5.1). - Use `-LiteralPath` on file/directory operations and wrap the throwaway `negative-control` directory in `try/finally` cleanup while preserving CRLF line endings. - Add Windows PowerShell 5.1 regression tests in `tests/test_conformance_negative_control.py`. ### Tested - `python -I tests/test_conformance_negative_control.py -v` (live Windows PowerShell 5.1) -> `Ran 4 tests in 2.068s`, `OK`. - Detached `upstream/main` (`98c2f777`) baseline worktree with `tests/test_conformance_negative_control.py` -> `Ran 4 tests in 2.026s`, `FAILED (failures=4)`. - CRLF verification on `tools/conformance/native/scripts/negative-control.ps1` -> `PS1_CRLF=82 PS1_LF_ONLY=0`. - `python -I tests/test_ci_registration.py` -> `Ran 16 tests in 4.946s`, `OK`. - `python -I tests/test_text_write_line_endings.py` -> `Ran 3 tests in 13.453s`, `OK`. - `python -I scripts/check_no_game_data.py tools/conformance/native/scripts/negative-control.ps1 tests/test_conformance_negative_control.py`, `python -I -m compileall -q tests/test_conformance_negative_control.py`, and `git diff --check` -> exit `0`. GPUs tested: n/a (Windows PowerShell 5.1 + stdlib Python tests on Windows 11 x64) 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. - [ ] A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)
zmasi commented 2026-11-28 12:57:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T12:57:17Z.


#1848 | head 914e7f51da (merged cleanly with main d48a957bb) | python -I tests/test_conformance_negative_control.py | red on main: FAILED (failures=4) (continued past cmake -S failure, aborted on stderr NativeCommandError / empty $failedScenes, skipped failure report on exit 0, and left negative-control scratch dir behind on missing anchor) | green on PR+main: 4 tests OK | Windows 11 (10.0.26200.9974, powershell.exe 5.1.26100.9818), Python 3.12.10 | AI-assisted: yes

Audited tools/conformance/native/scripts/negative-control.ps1 and tests/test_conformance_negative_control.py on Windows 11 PowerShell 5.1, verifying CONFIGURE FAILED exit-code gating before --build, $ErrorActionPreference = 'Continue' scoping around conform_native.exe 2>&1 so stderr lines stringify cleanly instead of raising NativeCommandError, exact ($failedScenes -join ',') comparison when 0 scenes fail, and try / finally -LiteralPath cleanup of the negative-control scratch directory across all exit paths. 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7239583756 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1848#issuecomment-7239583756). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T12:57:17Z. --- #1848 | head 914e7f51daad08971ecc15232d0dfe3275e85f0a (merged cleanly with main d48a957bb) | `python -I tests/test_conformance_negative_control.py` | red on main: `FAILED (failures=4)` (continued past `cmake -S` failure, aborted on stderr `NativeCommandError` / empty `$failedScenes`, skipped failure report on `exit 0`, and left `negative-control` scratch dir behind on missing anchor) | green on PR+main: `4 tests OK` | Windows 11 (`10.0.26200.9974`, `powershell.exe` `5.1.26100.9818`), Python 3.12.10 | AI-assisted: yes Audited `tools/conformance/native/scripts/negative-control.ps1` and `tests/test_conformance_negative_control.py` on Windows 11 PowerShell 5.1, verifying `CONFIGURE FAILED` exit-code gating before `--build`, `$ErrorActionPreference = 'Continue'` scoping around `conform_native.exe 2>&1` so stderr lines stringify cleanly instead of raising `NativeCommandError`, exact `($failedScenes -join ',')` comparison when 0 scenes fail, and `try / finally` `-LiteralPath` cleanup of the `negative-control` scratch directory across all exit paths. 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 15:03:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T15:03:30Z.


Red/green: classified READY by cloud-3 (red on main 09c153948, green on head merged with main); head 914e7f51da unchanged since 2026-11-25, before that run.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7241165890 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1848#issuecomment-7241165890). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T15:03:30Z. --- Red/green: classified READY by cloud-3 (red on main 09c153948, green on head merged with main); head 914e7f51daad unchanged since 2026-11-25, before that run. Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
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!1848
No description provided.