mode_round_probe: publish mode on Windows (MODE-ROUND-PROBE-STAGE-CLEANUP) #797
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!797
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/mode-round-probe-stage-cleanup"
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 successfully merged and closed
In
tools/mode_round_probe.py,write_json_reportalready restored0o600before unlinking on failure in itsexcept BaseExceptionblock, but previously skipped applyingpublished_modeon Windows viaif os.name != "nt":.Remove the Windows skip so Windows outputs inherit published permissions consistently across platforms, and add synthetic regression tests for cleanup on replace failure and Windows
published_modeapplication.Tests pass (13/13 in
test_mode_round_probe.py),scripts/check_no_game_data.pypasses cleanly.agent: yes
AI-assisted: yes
Tested on Windows 11, Python 3.12.10, with this PR merged onto upstream main b0f3d3998 (merge commit d70e9d631).
python -I tests/test_mode_round_probe.py:(AI-assisted test run; output checked by hand.)
Reviewed a94cb3b8: I ran
tests/test_mode_round_probe.pyon the PR (13 OK) and onmain(11 OK), with this PR's test file onmain(onlytest_publish_applies_published_mode_on_windowsfails there, so it does pin the fix), pluscheck_no_game_data.pyand a probe comparing the two trees. The guard removal is right and consistent with the other staging writers; issues in the new tests: (1)test_publish_cleans_up_staged_file_when_replace_fails_even_if_readonlynever reaches the staging code - with a0o444destination,os.open(destination, os.O_WRONLY)(line 225) fails before any temp file is created (probe: replace/unlink mocks 0 calls, onmaintoo); patchpublished_modeto return0o444with a writable destination so the cleanup path is actually exercised; (2) that test leavesreport.jsonat0o444, which on a native Windows run makesTemporaryDirectoryteardown fail withPermissionError- restore0o600in afinallylike the existing readonly test; I could not run Windows here, so (2) is fromshutil.rmtree/read-only semantics, not an execution; (3) the new tests belong inModeRoundProbeTestsnext to the other publish tests rather thanSummaryLineTests. AI-assisted review.Recommendation: Fix first
Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 23 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)