Repository navigation
Conversation
This was referenced Nov 24, 2026
4 tasks done
The staged report carries the destination's bits, so on Windows a failed os.replace over a read-only report leaves a read-only stage the TemporaryDirectory cleanup refuses to delete, masking the real error with a cleanup failure. The cleanup now makes the staged file writable before deleting and lets one delete failure go, so the caller reports the replace; a successful publish is unchanged and the prior report stays intact on failure. Same shape as navmesh_index's, bvh_index's and story_index's staging cleanup. Regression test in the style of those failed-replace tests: it fails against the old code on the made-deletable assertion. Synthetic archives only; no game data. Claimed in the coordination issue as RPF9-NAMES-STAGE-CLEANUP (issue ProjectLeonida#14). AI-assisted.
djrolfes
force-pushed
the
djrolfes/rpf9-names-stage-cleanup
branch
from
November 25, 2026 19:45
60107f1 to
beb75ec
Compare
Contributor
Author
|
Rebuilt this branch independently on main e18b59a: beb75ec, exactly one cleanup commit. Removed #771 and sibling cleanup commits rather than adding a false dependency. 22 focused tests, compileall, changed-file scan and diff checks pass; clean merge-tree against 5da72d1. Explicit old-head lease used; prior head preserved. No full hosted CI result is inferred from a label check. AI-assisted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: RPF9-NAMES-STAGE-CLEANUP (#14 (comment))
Depends on: none
Fixes: none (the work item is the finding pattern in issue #14; there is no separate issue to close)
Independent branch update
Head
beb75ec56, based one18b59a5b, contains exactly one topic commit. Removed the accidentally inherited #771 concurrency change and all sibling cleanup commits; this PR is now genuinely independent, soDepends on: noneis accurate. Retested on Linux: 22 tests pass, Python compileall, changed-file scanner and diff checks pass. Clean merge-tree against5da72d19f. Original head preserved; branch updated with an explicit lease. A passing label check is not full CI, and no hosted-suite pass is claimed. AI-assisted.What and why
tools/rpf9_names.py'spublish_reportstages the JSON report in aTemporaryDirectorynext to the destination and chmods the staged file to the destination's permission bits beforeos.replace. When the replace fails over a read-only report on Windows, the staged file is read-only, so the context-manager cleanup cannot delete it: the staging directory is stranded beside the report and the cleanup'sPermissionErrorreplaces the real error thatmainis supposed to turn into its namedcannot write reportdiagnostic.The cleanup now runs in a
finally: make the staged file writable (0o600) before the directory is cleaned up and let one delete failure pass (suppress(OSError)), so the caller'sexcept OSErrorstill names the replace problem and exits 2. A successful publish is byte-for-byte unchanged, and a failed one leaves the prior report intact. The shape is the onenavmesh_index.py,bvh_index.pyand (in #789)story_index.pyuse.Tested
python3 -I tests/test_rpf9_names.py: 22 tests OK, including the newtest_failed_replace_of_read_only_report_makes_stage_deletable, which fails against the old code on the made-deletable assertion (it mocks the replace as failing over a0o444report, asserts the stage was made deletable, the prior report untouched, and no.rpf9_names-staging directory stranded).python3 -m compileall -q tools/rpf9_names.py tests/test_rpf9_names.pyclean;python3 -I scripts/check_no_game_data.py tools/rpf9_names.py tests/test_rpf9_names.pypasses; synthetic archives only.GPUs tested: n/a (standard-library tool; no game files, nothing online)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)