mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #2256] scripts/corpus_watch: strip BOM JSON, check --out/--game collisions, validate args, enforce UTF-8 #2260
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2260
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2256
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/corpus-watch-safety📝 Commits (1)
fa4d7aeHarden corpus_watch BOM JSON, output collisions, CLI validation, and UTF-8 subprocesses📊 Changes
2 files changed (+131 additions, -14 deletions)
View changed files
📝
scripts/corpus_watch.py(+34 -14)📝
tests/test_corpus_watch.py(+97 -0)📄 Description
Claimed in the coordination issue as: CORPUS-WATCH-CLI-ENCODING-COLLISION-AND-BOM-SAFETY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7189698488)
What and why
dxbc/index.json,spirv/index.json, and--resultsJSONL withencoding="utf-8-sig"inscripts/corpus_watch.pyand validate parsed container root types (list/dictfor carved index,dictforspirv/index.json).outputs_collide()(keeping 4-argument default compatibility) to check--outand--gamealongsidework,report,results, andlog.main(argv=None)to reject non-finite or negative--interval, non-positive--jobs, and directory/trailing-separator--resultsor--logpaths viaap.error(...)before tool checks or runningmake_game.py.--resultsand--logare created once prerequisites pass, and passencoding="utf-8", errors="replace"to bothsubprocess.run()invocations.tests/test_corpus_watch.pywith tests covering BOM indexes, malformed roots,--out/--gamecollision checks, CLI argument validation, nested parent folder creation, and subprocess encoding.Tested
python -I tests/test_corpus_watch.py -v->Ran 7 tests in 0.149s(OK).upstream/maina73a57e1with updatedtests/test_corpus_watch.pycopied into detached worktree):Ran 7 tests in 0.101s(FAILED (errors=10)).python -I tests/test_ci_registration.py(Ran 16 tests in 5.514s,OK),python -I tests/test_text_write_line_endings.py(Ran 3 tests in 13.118s,OK),python -I scripts/check_no_game_data.py(exit 0),python -I -m compileall -q(exit 0),git diff --check(exit 0).GPUs tested: n/a (mocked subprocess calls and corpus-counting unit tests)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.