manifest_verifier: accept a flat entry named files #2403

Open
github-bot wants to merge 1 commit from github-bot/gh-2403 into main AGit
Owner

@⁠bimo0o on GitHub · 2026-11-26 20:18 UTC · original
bimo0o:verify-flat-files → main · +41 −3 · 2 files · 1 commits · open

Claimed in the coordination issue as: VERIFY-FLAT-FILES

What and why

The verifier treated every top-level files key as a wrapper. Accept a flat entry named files when its value is a SHA-256 digest string or an object with an integer size and a SHA-256 string. Preserve wrapped manifests that list files named sha256 or size.

Tested

  • Both flat forms reproduced the bug on main (fac8b4b) and pass with the fix.
  • Manifest verifier on Windows, Python 3.12.3 and 3.14.0: 68 passed and 2 skipped on each.
  • Related path, game-data guard, and line-ending tests: 37 passed and 1 skipped.
  • Compileall, CLI help, changed-file game-data check, and git diff --check passed.
  • Full translator and runtime suites were not run.

GPUs tested: n/a. Synthetic fixtures only.

AI-assisted: yes (Codex).

Checklist

  • One topic.
  • No game data, keys or decryption.
**@⁠bimo0o** on GitHub · 2026-11-26 20:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2403) `bimo0o:verify-flat-files` → `main` · +41 −3 · 2 files · 1 commits · open Claimed in the coordination issue as: [VERIFY-FLAT-FILES](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why The verifier treated every top-level `files` key as a wrapper. Accept a flat entry named `files` when its value is a SHA-256 digest string or an object with an integer size and a SHA-256 string. Preserve wrapped manifests that list files named `sha256` or `size`. ### Tested - Both flat forms reproduced the bug on main (`fac8b4b`) and pass with the fix. - Manifest verifier on Windows, Python 3.12.3 and 3.14.0: 68 passed and 2 skipped on each. - Related path, game-data guard, and line-ending tests: 37 passed and 1 skipped. - Compileall, CLI help, changed-file game-data check, and `git diff --check` passed. - Full translator and runtime suites were not run. GPUs tested: n/a. Synthetic fixtures only. AI-assisted: yes (Codex). ### Checklist - [x] One topic. - [x] No game data, keys or decryption.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:19:41 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-26 20:43 UTC · original · reviewed

On Windows 11 with Python 3.12.1, the manifest verifier suite had 68 passes and 2 skips. I ran the two new cases again with only the verifier loaded from the parent commit. Both flat forms raised ManifestError, while the wrapped manifest with entries named sha256 and size still passed.

AI-assisted.

**@⁠lixonik** on GitHub · 2026-11-26 20:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2403#pullrequestreview-6080301016) · **reviewed** On Windows 11 with Python 3.12.1, the manifest verifier suite had 68 passes and 2 skips. I ran the two new cases again with only the verifier loaded from the parent commit. Both flat forms raised `ManifestError`, while the wrapped manifest with entries named `sha256` and `size` still passed. AI-assisted.
Author
Owner

@⁠tiguan26 on GitHub · 2026-11-27 04:43 UTC · original · approved these changes

Approving 2b738d3ba.

A flat entry named files is taken as a file only when it looks like one (a 64-hex digest, or an object with an integer size and a string sha256). A real wrapper cannot look like that: its size member would be a file entry, not an integer, so a wrapped manifest that lists files called size or sha256 still reads as wrapped. The digest check now shares one compiled pattern.

Merged onto main d1dff7949 together with #2410, #2299, #2297, #2330 and #2286 (no conflicts), on Linux with Python 3.13. tests/test_manifest_verifier.py: 68 passed, 2 skipped (main: 66 passed). AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠tiguan26** on GitHub · 2026-11-27 04:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2403#pullrequestreview-6083581746) · **approved these changes** Approving 2b738d3ba. A flat entry named `files` is taken as a file only when it looks like one (a 64-hex digest, or an object with an integer `size` and a string `sha256`). A real wrapper cannot look like that: its `size` member would be a file entry, not an integer, so a wrapped manifest that lists files called `size` or `sha256` still reads as wrapped. The digest check now shares one compiled pattern. Merged onto `main` `d1dff7949` together with #2410, #2299, #2297, #2330 and #2286 (no conflicts), on Linux with Python 3.13. `tests/test_manifest_verifier.py`: 68 passed, 2 skipped (main: 66 passed). AI-assisted (Claude Code, Claude Opus 5.5).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2403/head:github-bot/gh-2403'
git switch 'github-bot/gh-2403'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2403'
git switch 'github-bot/gh-2403'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2403'
git switch 'github-bot/gh-2403'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2403'
git switch 'main'
git merge --squash 'github-bot/gh-2403'
git switch 'main'
git merge --ff-only 'github-bot/gh-2403'
git switch 'main'
git merge 'github-bot/gh-2403'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.