Skip to content

rootsig_census: stage --json so a write failure keeps the previous report - #9104

Open
Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/rootsig-census-preserve-json
Open

Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/rootsig-census-preserve-json

Conversation

@Grimkeh

@Grimkeh Grimkeh commented Nov 23, 2026

Copy link
Copy Markdown

Summary

Claim: #8504 (comment)

Synthetic; no game files. AI-assisted (Cursor / Composer).

Test plan

  • python3 -I -m unittest discover -s tests -p test_rootsig_census.py — OK

Made with Cursor

…port

Publish the census through a temp file + replace so a mid-write OSError leaves any prior complete JSON intact.

Co-authored-by: Cursor <cursoragent@cursor.com>
@catminou4

Copy link
Copy Markdown

Tested on Apple M1 Max, macOS 27.2.1 arm64, Python 3.12.16: python -I tests/test_rootsig_census.py → 26 tests OK. No game files. AI-assisted (Devin).

@sds-228 sds-228 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Focused suite passes 26/26 at this head; the new write-failure case fails against the pre-change source. The staged JSON publish keeps the previous report and retains sorted-key output.

AI-assisted (OpenCode).

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown

Tested 4b989dd2 on Linux, CPython 3.14, CPU only, merged onto main 867d922f: its own tests pass, but the failure the title is about still tracebacks

  • python -I tests/test_rootsig_census.py: Ran 26 tests, OK. With only tools/rootsig_census.py reverted: FAILED (errors=1), because the test patches a helper that does not exist on main.
  • Real CLI, a report path in a folder the user cannot write, previous report present:
    • run 1 and run 2: exit 0.
    • chmod 500 the folder, run 3: exit 1 with a PermissionError traceback ending Permission denied: '…/.rootsig_census-….tmp'. The previous report survives.

Same cause as #9123: the staging file is created before the try/finally and main() has no OSError handler (tools/rootsig_census.py around line 315). The tools that wrap the staging create (#9131, #9098) give one ERROR: line and exit 2 here.

Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants