tests: boot journal seed compares canonical long paths, with explicit 8.3 short inputs #3231

Merged
MoonEyes merged 3 commits from upstream-pr/3231 into main 2026-12-03 16:07:45 +00:00
MoonEyes commented 2026-12-02 21:28:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T21:28:29Z.


Claimed in the coordination issue as: CI-BOOT-JOURNAL-SHORT-INPUT (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7359313374), follow-up to CI-BOOT-JOURNAL-SHORT-PATH.

What and why

tests/test_windows_boot_journal_seed.py failed in the check job of #2472 (job 143766686004) with the seed printed in long form (runneradmin) and expected in 8.3 short form (runner~1). That job tested refs/pull/2472/merge on base 34e33d3d (27 Nov), which predates the test-side realpath in setUp (d98fc7fb, merged with #2593 on 29 Nov). #2472 goes green once it merges current main.

What remained: the test only stayed green because setUp happened to make self.tmp long. No case handed boot.ps1 a short path on purpose, and every comparison was normcase only, so the spelling each side picked decided the result. boot.ps1 itself is fine: its seed comes from [IO.Path]::GetFullPath, which expands 8.3 names of an existing folder (the red run below shows the long form coming back from a short input), and its overlap check already compares final paths.

  • canonical_path() = normcase(realpath()). assertSamePath compares both sides with it and replaces the six normcase-only path comparisons.
  • short_path() (ctypes GetShortPathNameW) and two new cases that hand boot.ps1 the 8.3 spelling: a short -Runtime, and a relative runtime from a short shell location. They skip on a volume that makes no 8.3 names.

Tested

Red/green on the Windows check job (not red_green.py: the fix is in the test itself, so there is no source to revert):

  • Red, commit 74b3369d (new cases, old normcase comparison), job 143806324936: FAILED (failures=2), both new cases, the same assertion as #2472:
    'c:\users\runneradmin\...\leonida_boot_seed_vzlox3d4\port\pipeline_cache.d' != 'c:\users\runner~1\...\leonid~1\port\pipeline_cache.d'
  • Green, commit d5d93627 (head), job 143799961871: Ran 28 tests ... OK, none skipped, so the 8.3 cases ran. All other jobs green.
  • python -I scripts/check_no_game_data.py tests/test_windows_boot_journal_seed.py: clean. On Linux the file compiles and its Windows cases skip.

GPUs tested: n/a (test-only change, no GPU involved)

AI-assisted: yes. Author: Claude Opus 5.5 (Claude Code). Independent read-only reviewer: Claude Opus 5.5. It found a short_path fallback bug (an empty string on a failed second call) and two nits, all fixed in d5d93627. Its doubt that the red commit would fail is answered by the red run above.

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption, including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md: n/a, no translator change.

https://claude.ai/code/session_01DDMsHurjjLd5pVRXSps7Po


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5615018346 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3231). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T21:28:29Z. --- Claimed in the coordination issue as: CI-BOOT-JOURNAL-SHORT-INPUT (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7359313374), follow-up to CI-BOOT-JOURNAL-SHORT-PATH. ### What and why `tests/test_windows_boot_journal_seed.py` failed in the `check` job of #2472 (job 143766686004) with the seed printed in long form (`runneradmin`) and expected in 8.3 short form (`runner~1`). That job tested `refs/pull/2472/merge` on base `34e33d3d` (27 Nov), which predates the test-side `realpath` in `setUp` (d98fc7fb, merged with #2593 on 29 Nov). #2472 goes green once it merges current `main`. What remained: the test only stayed green because `setUp` happened to make `self.tmp` long. No case handed `boot.ps1` a short path on purpose, and every comparison was `normcase` only, so the spelling each side picked decided the result. `boot.ps1` itself is fine: its seed comes from `[IO.Path]::GetFullPath`, which expands 8.3 names of an existing folder (the red run below shows the long form coming back from a short input), and its overlap check already compares final paths. - `canonical_path()` = `normcase(realpath())`. `assertSamePath` compares both sides with it and replaces the six `normcase`-only path comparisons. - `short_path()` (ctypes `GetShortPathNameW`) and two new cases that hand `boot.ps1` the 8.3 spelling: a short `-Runtime`, and a relative runtime from a short shell location. They skip on a volume that makes no 8.3 names. ### Tested Red/green on the Windows `check` job (not `red_green.py`: the fix is in the test itself, so there is no source to revert): - **Red**, commit 74b3369d (new cases, old `normcase` comparison), [job 143806324936](https://github.com/ProjectLeonida/mandy/actions/runs/46974717444/job/143806324936): `FAILED (failures=2)`, both new cases, the same assertion as #2472: `'c:\users\runneradmin\...\leonida_boot_seed_vzlox3d4\port\pipeline_cache.d' != 'c:\users\runner~1\...\leonid~1\port\pipeline_cache.d'` - **Green**, commit d5d93627 (head), [job 143799961871](https://github.com/ProjectLeonida/mandy/actions/runs/46974962750/job/143799961871): `Ran 28 tests ... OK`, none skipped, so the 8.3 cases ran. All other jobs green. - `python -I scripts/check_no_game_data.py tests/test_windows_boot_journal_seed.py`: clean. On Linux the file compiles and its Windows cases skip. GPUs tested: n/a (test-only change, no GPU involved) AI-assisted: yes. Author: Claude Opus 5.5 (Claude Code). Independent read-only reviewer: Claude Opus 5.5. It found a `short_path` fallback bug (an empty string on a failed second call) and two nits, all fixed in d5d93627. Its doubt that the red commit would fail is answered by the red run above. ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption, including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`: n/a, no translator change. https://claude.ai/code/session_01DDMsHurjjLd5pVRXSps7Po --- _Generated by [Claude Code](https://claude.ai/code)_
fiestorra commented 2026-12-02 21:40:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T21:40:33Z.


VERIFY-3231 — Windows nativo: pasa, pero el escenario que arregla no existe en esta máquina, y eso lo digo

Head (this PR)
Merge base b41763227 = current main

Ran

main  (tests/…boot_journal_seed.py as it is)   Ran 26 tests — OK
PR head                                        Ran 28 tests — OK   (the two new ones included)

The change is the right one: assertSamePath now compares both sides as canonical long paths (os.path.normcase(os.path.realpath(path))), where the old assertion normalised case only. realpath expands 8.3 short names, so a runtime that prints C:\Users\RUNNER~1\… and a test that spells the long path now compare equal — and the new tests cover both a short runtime path and a relative runtime started from a short shell location (they add short_path() via GetShortPathNameW).

But the red side is not reproducible here, and here is the measurement: my TEMP is C:\Users\Isegurav\AppData\Local\Temp and its 8.3 spelling is the same string — no ~1 name exists on this volume, so short_path() returns the path unchanged and the old assertion passed too. That is why main is green here: the bug only appears where the temp directory has a short name (GitHub's Windows runners print RUNNER~1). A regression test that cannot fail on the machine you verify it on is still worth having — but the review should say which machine it protects.

Stacked, again

The branch carries #3204's frame.rs, #3210's launcher exit code, #3213/#3224/#3227's tooling — main has none of it. Sixth stacked branch tonight. Merge order needs a rule.

What I could not test

  • A short-name temp directory: my probe showed there is none here; I did not try to force 8.3 names on a volume (fsutil 8dot3name) because that changes the machine.
  • The boot journal itself: the tests build a synthetic runtime directory; no boot.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7359618890 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3231#issuecomment-7359618890). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T21:40:33Z. --- ## VERIFY-3231 — Windows nativo: pasa, pero **el escenario que arregla no existe en esta máquina**, y eso lo digo | | | |---|---| | Head | `(this PR)` | | Merge base | `b41763227` = current `main` | **Ran** ``` main (tests/…boot_journal_seed.py as it is) Ran 26 tests — OK PR head Ran 28 tests — OK (the two new ones included) ``` **The change is the right one**: `assertSamePath` now compares **both sides as canonical long paths** (`os.path.normcase(os.path.realpath(path))`), where the old assertion normalised case only. `realpath` **expands 8.3 short names**, so a runtime that prints `C:\Users\RUNNER~1\…` and a test that spells the long path now compare equal — and the new tests cover both a **short runtime path** and a **relative runtime started from a short shell location** (they add `short_path()` via `GetShortPathNameW`). **But the red side is not reproducible here, and here is the measurement**: my TEMP is `C:\Users\Isegurav\AppData\Local\Temp` and **its 8.3 spelling is the same string** — no `~1` name exists on this volume, so `short_path()` returns the path unchanged and **the old assertion passed too**. That is why `main` is green here: the bug only appears where the temp directory *has* a short name (GitHub's Windows runners print `RUNNER~1`). **A regression test that cannot fail on the machine you verify it on is still worth having — but the review should say which machine it protects.** ## Stacked, again The branch carries **#3204's `frame.rs`**, **#3210's launcher exit code**, **#3213/#3224/#3227's tooling** — `main` has none of it. **Sixth stacked branch tonight.** Merge order needs a rule. ## What I could not test - **A short-name temp directory**: my probe showed there is none here; I did not try to force 8.3 names on a volume (`fsutil 8dot3name`) because that changes the machine. - **The boot journal itself**: the tests build a synthetic runtime directory; no boot. Written with an AI assistant.
merzleckeier commented 2026-12-02 22:41:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T22:41:57Z.

Review: COMMENTED


Reviewed d5d93627. I checked the exact-head Windows job: test_windows_boot_journal_seed.py ran 28 tests with no skips, so both new 8.3 cases ran. The cases cover a short -Runtime value and the distinct case of a relative runtime after changing the PowerShell location to a short path.

One environment detail for anyone checking locally: on Wine 11.22, an isolated helper check generated an 8.3 alias and os.path.samefile agreed that both spellings named the same directory, but Python realpath kept the alias there. The native Windows job supplies the evidence for the long-name behavior this test expects.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6160333812 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3231#pullrequestreview-6160333812). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T22:41:57Z. **Review:** COMMENTED --- Reviewed `d5d93627`. I checked the exact-head [Windows job](https://github.com/ProjectLeonida/mandy/actions/runs/46974962750/job/143799961871): `test_windows_boot_journal_seed.py` ran 28 tests with no skips, so both new 8.3 cases ran. The cases cover a short `-Runtime` value and the distinct case of a relative runtime after changing the PowerShell location to a short path. One environment detail for anyone checking locally: on Wine 11.22, an isolated helper check generated an 8.3 alias and `os.path.samefile` agreed that both spellings named the same directory, but Python `realpath` kept the alias there. The native Windows job supplies the evidence for the long-name behavior this test expects.
icdmkg2 commented 2026-12-03 07:34:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by icdmkg2 on 2026-12-03T07:34:20Z.


Verified on Windows 11 (Python 3.12, no game files needed): \python -I scripts/red_green.py 3231 --no-cargo --mutate\ ran \ ests/test_windows_boot_journal_seed.py\ — 28/28 passed on both base (\d9b618f10) and head (\d5d936274) (expected
o red\ for a test-only canonical-path/8.3-short-input hardening change). AI-assisted: Gemini 4 Neon (Antigravity).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7371158699 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3231#issuecomment-7371158699). Originally posted by [icdmkg2](https://github.com/icdmkg2) on 2026-12-03T07:34:20Z. --- Verified on Windows 11 (Python 3.12, no game files needed): \python -I scripts/red_green.py 3231 --no-cargo --mutate\ ran \ ests/test_windows_boot_journal_seed.py\ — **28/28 passed** on both base (\d9b618f10\) and head (\d5d936274\) (expected \ o red\ for a test-only canonical-path/8.3-short-input hardening change). AI-assisted: Gemini 4 Neon (Antigravity).
fiestorra commented 2026-12-03 07:51:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T07:51:35Z.


Lo que queda de esta PR son sus tests: el código ya está en main

Aplicada sobre main de hoy (d9b618f10) con el cherry-pick del rango, el diff resultante no toca nada fuera de tests/:

git cherry-pick del rango sobre origin/main
git diff --name-only origin/main..HEAD
  tests/test_windows_boot_journal_seed.py

O sea que el cambio de producción entró por otra vía (otra PR, o el mismo cambio dentro de un merge más grande), y lo que esta PR aporta desde hoy son las pruebas de algo que ya está en main.

Lo que eso significa, en las dos direcciones:

  • se puede fusionar sin revisar código nuevo — es el merge más barato de la cola;
  • y es fácil que se pierda, porque nadie va a notar que falta hasta que alguien toque ese código y no haya test que lo defienda.

Lo que verifiqué: que el diff sobre main es sólo de tests (con el rango, no con el tip: las PRs de varios commits aplican mal por partes).
Lo que no: que los tests pasen sobre main — eso lo compruebo en el lote siguiente y lo dejo escrito aquí si algo falla.

Si el autor prefiere cerrarla para no acumular, las pruebas siguen teniendo valor: se pueden mover a la PR que trajo el código, o a una propia más pequeña.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7371516566 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3231#issuecomment-7371516566). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T07:51:35Z. --- ## Lo que queda de esta PR son **sus tests**: el código ya está en `main` **Aplicada sobre `main` de hoy (`d9b618f10`) con el *cherry-pick* del rango, el diff resultante no toca nada fuera de `tests/`**: ``` git cherry-pick del rango sobre origin/main git diff --name-only origin/main..HEAD tests/test_windows_boot_journal_seed.py ``` **O sea que el cambio de producción entró por otra vía** (**otra PR, o el mismo cambio dentro de un merge más grande**), **y lo que esta PR aporta desde hoy son las pruebas de algo que ya está en `main`.** **Lo que eso significa, en las dos direcciones**: - **se puede fusionar sin revisar código nuevo** — **es el merge más barato de la cola**; - **y es fácil que se pierda**, **porque nadie va a notar que falta** hasta que alguien toque ese código y no haya test que lo defienda. **Lo que verifiqué**: **que el diff sobre `main` es sólo de tests** (**con el rango, no con el tip: las PRs de varios commits aplican mal por partes**). **Lo que no**: **que los tests pasen sobre `main`** — **eso lo compruebo en el lote siguiente y lo dejo escrito aquí si algo falla.** **Si el autor prefiere cerrarla para no acumular**, **las pruebas siguen teniendo valor**: **se pueden mover a la PR que trajo el código, o a una propia más pequeña.**
fiestorra commented 2026-12-03 07:53:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T07:53:00Z.


Y lo comprobado, como dije: los tests de esta PR pasan sobre main de hoy.

tests/test_windows_boot_journal_seed.py 28 passed + 6 subtests   (12 s)

Verde. Las 28 pruebas del diario de arranque de Windows pasan sobre main.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7371545757 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3231#issuecomment-7371545757). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T07:53:00Z. --- **Y lo comprobado, como dije**: **los tests de esta PR pasan sobre `main` de hoy.** ``` tests/test_windows_boot_journal_seed.py 28 passed + 6 subtests (12 s) ``` **Verde.** Las 28 pruebas del diario de arranque de Windows pasan sobre `main`.
fiestorra commented 2026-12-03 08:19:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T08:19:33Z.


Corrección: esto no es una PR a medio fusionar — es una PR de sólo tests, y lo fue desde el principio

Escribí que «su código ya entró por otra vía y sólo queda el test», y es falso. Su diff propio, contra su base, nunca tocó nada fuera de tests/:

git diff --name-only $(git merge-base origin/main <head>)..<head>
  1 fichero, y está en tests/

Así que el test no es lo que sobra de un cambio ya fusionado: es lo único que la PR ha tenido siempre.

Cómo me equivoqué, porque el método importa: aplicarla sobre main y ver que el diff resultante sólo toca tests/ no distingue «PR de tests» de «PR cuyo código ya entró» — las dos dan el mismo resultado. La prueba que las distingue es el diff propio de la PR contra su base, que es lo que debí mirar antes de escribir el comentario anterior.

Lo que sí sigue en pie: aplicada sobre el main de hoy, su fichero de test entra limpio, y los tests pasan (medido: 28 tests y 6 subtests en verde (12 s)). Eso es lo que hacía falta saber, y no dependía de mi clasificación.

Y a quien lea esto de fuera: una PR de sólo tests es de las más fáciles de dejar parada — no rompe nada, no arregla nada visible, y nadie la echa de menos hasta que el código que prueba se rompe.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7372118253 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3231#issuecomment-7372118253). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T08:19:33Z. --- ## Corrección: **esto no es una PR a medio fusionar** — es una PR de sólo tests, y lo fue desde el principio **Escribí que «su código ya entró por otra vía y sólo queda el test»**, **y es falso.** **Su diff propio, contra su base, nunca tocó nada fuera de `tests/`**: ``` git diff --name-only $(git merge-base origin/main <head>)..<head> 1 fichero, y está en tests/ ``` **Así que el test no es lo que sobra de un cambio ya fusionado: es lo único que la PR ha tenido siempre.** **Cómo me equivoqué, porque el método importa**: **aplicarla sobre `main` y ver que el diff resultante sólo toca `tests/` no distingue «PR de tests» de «PR cuyo código ya entró»** — **las dos dan el mismo resultado.** **La prueba que las distingue es el diff propio de la PR contra su base**, **que es lo que debí mirar antes de escribir el comentario anterior.** **Lo que sí sigue en pie**: **aplicada sobre el `main` de hoy, su fichero de test entra limpio, y los tests pasan** (**medido: 28 tests y 6 subtests en verde (12 s)**). **Eso es lo que hacía falta saber, y no dependía de mi clasificación.** **Y a quien lea esto de fuera**: **una PR de sólo tests es de las más fáciles de dejar parada** — **no rompe nada, no arregla nada visible, y nadie la echa de menos hasta que el código que prueba se rompe.**
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!3231
No description provided.