Review/1360 reserve manifest paths #1380

Open
github-bot wants to merge 2 commits from github-bot/gh-1380 into main AGit
Owner

@⁠xel1uz on GitHub · 2026-11-24 22:56 UTC · original
xel1uz:review/1360-reserve-manifest-paths → main · +143 −9 · 2 files · 2 commits · open

Claimed in the coordination issue as: ROOTSIG-CENSUS-JSON-GUARD (original claim by @⁠JesusACD).

Depends on: #1360. This branch includes @⁠JesusACD's output-path checks and adds a fix for a manifest that does not exist yet.

What and why

With an empty root/ directory, running python -I tools/rootsig_census.py root --json root/index.json twice gave different results. The first run exited 0 and wrote a census report to the manifest path. The identical second run exited 2 because index.json now existed. The same sequence occurred with --disasm disasm --json disasm/index.json.

This change reserves both manifest paths before the first write. The command now exits 2 and leaves the path empty in both cases. The reproduction on #1360 records the original behavior.

Tested

  • On the original PR at 8270eaea, both subcases of the new regression test failed: the command returned 0 and created the report.
  • On 6c85fbae, python -I tests/test_rootsig_census.py passed all 30 tests on Windows. The new test checks both the exit code and that neither manifest file was created.
  • git diff --check and scripts/check_no_game_data.py passed for the changed files.

GPUs tested: n/a (filesystem and CLI behavior; synthetic directories).

AI-assisted: yes, OpenAI Codex.

Checklist

  • Verified a clean merge against upstream main at 28a32e19.
  • One topic: protect the census input manifest paths from --json output.
  • No game data, keys or decryption.
  • Translator contract table: n/a. No translator rule changed.
**@⁠xel1uz** on GitHub · 2026-11-24 22:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1380) `xel1uz:review/1360-reserve-manifest-paths` → `main` · +143 −9 · 2 files · 2 commits · open Claimed in the coordination issue as: [ROOTSIG-CENSUS-JSON-GUARD](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) (original claim by @⁠JesusACD). Depends on: #1360. This branch includes @⁠JesusACD's output-path checks and adds a fix for a manifest that does not exist yet. ### What and why With an empty `root/` directory, running `python -I tools/rootsig_census.py root --json root/index.json` twice gave different results. The first run exited 0 and wrote a census report to the manifest path. The identical second run exited 2 because `index.json` now existed. The same sequence occurred with `--disasm disasm --json disasm/index.json`. This change reserves both manifest paths before the first write. The command now exits 2 and leaves the path empty in both cases. The [reproduction on #1360](https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/1360) records the original behavior. ### Tested - On the original PR at `8270eaea`, both subcases of the new regression test failed: the command returned 0 and created the report. - On `6c85fbae`, `python -I tests/test_rootsig_census.py` passed all 30 tests on Windows. The new test checks both the exit code and that neither manifest file was created. - `git diff --check` and `scripts/check_no_game_data.py` passed for the changed files. GPUs tested: n/a (filesystem and CLI behavior; synthetic directories). AI-assisted: yes, OpenAI Codex. ### Checklist - [x] Verified a clean merge against upstream `main` at `28a32e19`. - [x] One topic: protect the census input manifest paths from `--json` output. - [x] No game data, keys or decryption. - Translator contract table: n/a. No translator rule changed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:49:27 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 15:13 UTC · original

Reviewed 6c85fbaeb: ran tests/test_rootsig_census.py on the PR (30/30 OK) and on main with the PR's tests copied in (9 failures + 1 error, so the tests do exercise the new guard), plus test_report_paths.py/test_report_path_case.py on both trees (unchanged, pass), --help, compileall and check_no_game_data.py (clean). A probe over both trees with a hand-built fspx fixture reproduces the main-branch behavior this fixes: --json into sig.dxbc, fspx/sig.json, index.json or disasm/sig.s silently overwrites the input with exit 0; on the PR each is refused with exit 2 and byte-identical inputs afterwards. Directory/nested/unwritable targets go from tracebacks to clean exit-2 errors, ordinary reports still write (including nested parents), symlinked input aliases are refused, and case-differing names are still allowed on case-sensitive volumes. No findings. Nothing here needs GPU/Windows/MSVC or game files.

AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 15:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1380#issuecomment-7166511708) Reviewed 6c85fbaeb: ran `tests/test_rootsig_census.py` on the PR (30/30 OK) and on main with the PR's tests copied in (9 failures + 1 error, so the tests do exercise the new guard), plus `test_report_paths.py`/`test_report_path_case.py` on both trees (unchanged, pass), `--help`, compileall and `check_no_game_data.py` (clean). A probe over both trees with a hand-built fspx fixture reproduces the main-branch behavior this fixes: `--json` into `sig.dxbc`, `fspx/sig.json`, `index.json` or `disasm/sig.s` silently overwrites the input with exit 0; on the PR each is refused with exit 2 and byte-identical inputs afterwards. Directory/nested/unwritable targets go from tracebacks to clean exit-2 errors, ordinary reports still write (including nested parents), symlinked input aliases are refused, and case-differing names are still allowed on case-sensitive volumes. No findings. Nothing here needs GPU/Windows/MSVC or game files. AI-assisted review. **Recommendation:** Merge
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/1380/head:github-bot/gh-1380'
git switch 'github-bot/gh-1380'

Merge

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