[PR #1380] Review/1360 reserve manifest paths #1412

Open
opened 2026-11-26 20:21:10 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1380
Author: @xel1uz
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: review/1360-reserve-manifest-paths


📝 Commits (2)

  • 8270eae rootsig_census: guard --json inputs with same_report_path and catch write OSError (ROOTSIG-CENSUS-JSON-GUARD)
  • 6c85fba Reserve root and disassembly manifests before writing a census report

📊 Changes

2 files changed (+143 additions, -9 deletions)

View changed files

📝 tests/test_rootsig_census.py (+92 -0)
📝 tools/rootsig_census.py (+51 -9)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1380 **Author:** [@xel1uz](https://github.com/xel1uz) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `review/1360-reserve-manifest-paths` --- ### 📝 Commits (2) - [`8270eae`](https://github.com/ubiquitarianism/leonida/commit/8270eaea3ee0ea807a1abd77d9bca4739106ee47) rootsig_census: guard --json inputs with same_report_path and catch write OSError (ROOTSIG-CENSUS-JSON-GUARD) - [`6c85fba`](https://github.com/ubiquitarianism/leonida/commit/6c85fbaebfca2f739d9d5f1b333a680e4ba42a24) Reserve root and disassembly manifests before writing a census report ### 📊 Changes **2 files changed** (+143 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_rootsig_census.py` (+92 -0) 📝 `tools/rootsig_census.py` (+51 -9) </details> ### 📄 Description Claimed in the coordination issue as: [ROOTSIG-CENSUS-JSON-GUARD](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7146264254) (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://github.com/ubiquitarianism/leonida/pull/1360#issuecomment-7146694792) 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1412
No description provided.