exe_sha: report the explicit hash source when --expect overrides --manifest (EXE-SHA-SOURCE) #1315

Merged
fin-github merged 1 commit from upstream-pr/1315 into main 2026-11-25 02:35:25 +00:00
fin-github commented 2026-11-24 21:45:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fin-github on 2026-11-24T21:45:22Z.


Claimed in the coordination issue as: EXE-SHA-SOURCE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7145320825)

What and why

When both options are supplied, the tool compares the file with the hash from --expect. The text verdict and JSON source now identify --expect. Previously both could credit a manifest the tool never read, even when the file was missing. The regression covers an existing manifest with a different size and hash and a missing manifest, in both output formats.

Tested

Windows 11 (build 26200.9974), Python 3.14.4. Synthetic files only.

  • Before, on upstream/main at 4a50cafc7 with only the test change, python -I tests/test_exe_sha.py -v ran 11 tests and failed all four new subtests.
  • After the fix, python -I tests/test_exe_sha.py -v passed all 11 tests and all four new subtests.
  • python -I tests/test_text_write_line_endings.py passed all 3 tests.
  • python -I scripts/check_no_game_data.py tools/exe_sha.py tests/test_exe_sha.py and git diff --check exited 0.

GPUs tested: no GPU

AI-assisted (Codex)

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5480857587 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1315). Originally posted by [fin-github](https://github.com/fin-github) on 2026-11-24T21:45:22Z. --- Claimed in the coordination issue as: EXE-SHA-SOURCE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7145320825) ### What and why When both options are supplied, the tool compares the file with the hash from `--expect`. The text verdict and JSON `source` now identify `--expect`. Previously both could credit a manifest the tool never read, even when the file was missing. The regression covers an existing manifest with a different size and hash and a missing manifest, in both output formats. ### Tested Windows 11 (build 26200.9974), Python 3.14.4. Synthetic files only. - Before, on `upstream/main` at `4a50cafc7` with only the test change, `python -I tests/test_exe_sha.py -v` ran 11 tests and failed all four new subtests. - After the fix, `python -I tests/test_exe_sha.py -v` passed all 11 tests and all four new subtests. - `python -I tests/test_text_write_line_endings.py` passed all 3 tests. - `python -I scripts/check_no_game_data.py tools/exe_sha.py tests/test_exe_sha.py` and `git diff --check` exited 0. GPUs tested: no GPU AI-assisted (Codex)
whoalin1 commented 2026-11-24 23:38:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-24T23:38:38Z.


Independent verification (AI-assisted, overnight review batch):

  • Checked out 1d983bc; one-line fix in tools/exe_sha.py:91 — source is now "--expect" if expect is not None else used, so an explicit --expect is credited even when --manifest is also passed (previously the unused manifest path was reported).
  • python -I tests/test_exe_sha.py -v: 11 tests OK, including the extended test_expect_overrides_the_manifest covering existing-manifest-with-different-values and missing-manifest in both text and JSON output.
  • python -I tests/test_text_write_line_endings.py: 3 tests OK.
  • check_no_game_data.py on both files: clean; compileall clean.
  • Edge cases reviewed: --expect with a non-64-hex value still reports --expect as source and mismatches correctly; --expect alone, manifest alone, and neither (find_manifest) paths unchanged. The text verdict's where clause keys off source == "--expect" so it now agrees with JSON.
  • CPU only, synthetic files, no game data. LGTM.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7147633594 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1315#issuecomment-7147633594). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-24T23:38:38Z. --- Independent verification (AI-assisted, overnight review batch): - Checked out 1d983bc; one-line fix in `tools/exe_sha.py:91` — `source` is now `"--expect" if expect is not None else used`, so an explicit `--expect` is credited even when `--manifest` is also passed (previously the unused manifest path was reported). - `python -I tests/test_exe_sha.py -v`: 11 tests OK, including the extended `test_expect_overrides_the_manifest` covering existing-manifest-with-different-values and missing-manifest in both text and JSON output. - `python -I tests/test_text_write_line_endings.py`: 3 tests OK. - `check_no_game_data.py` on both files: clean; compileall clean. - Edge cases reviewed: `--expect` with a non-64-hex value still reports `--expect` as source and mismatches correctly; `--expect` alone, manifest alone, and neither (find_manifest) paths unchanged. The text verdict's `where` clause keys off `source == "--expect"` so it now agrees with JSON. - CPU only, synthetic files, no game data. LGTM.
QemmHD commented 2026-11-25 02:35:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-25T02:35:23Z.


Merging.

Why merged: exe_sha credits gain an --expect check, so a run against the wrong executable says so instead of crediting it.

Why it's good: Own tests: 14 passed.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main b4b7756e8. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 3ff2a2adc (after #984): no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7150918673 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1315#issuecomment-7150918673). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-25T02:35:23Z. --- Merging. **Why merged:** exe_sha credits gain an --expect check, so a run against the wrong executable says so instead of crediting it. **Why it's good:** Own tests: 14 passed. Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main b4b7756e8. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 3ff2a2adc (after #984): no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. 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!1315
No description provided.