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

Manually merged
github merged 1 commit from gh-pr/1315/head into gh-pr/1315/base 2026-11-26 09:47:10 +00:00
Owner

@⁠fin-github on GitHub · 2026-11-24 21:45 UTC · original
fin-github:codex/exe-sha-source → main · +12 −4 · 2 files · 1 commits · merged 2026-11-25 02:35 UTC

Claimed in the coordination issue as: EXE-SHA-SOURCE (#14)

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)

**@⁠fin-github** on GitHub · 2026-11-24 21:45 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1315) `fin-github:codex/exe-sha-source` → `main` · +12 −4 · 2 files · 1 commits · merged 2026-11-25 02:35 UTC Claimed in the coordination issue as: EXE-SHA-SOURCE (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:47:07 +00:00
github manually merged commit 1d983bcb24 into gh-pr/1315/base 2026-11-26 09:47:10 +00:00
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-24 23:38 UTC · original

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.
**@⁠whoalin1** on GitHub · 2026-11-24 23:38 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1315#issuecomment-7147633594) 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.
Author
Owner

@⁠QemmHD on GitHub · 2026-11-25 02:35 UTC · original

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).

**@⁠QemmHD** on GitHub · 2026-11-25 02:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1315#issuecomment-7150918673) 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).
This discussion has been locked. Commenting is limited to contributors.
No description provided.