manifest_verifier: restore write mode before unlink on replace failure and publish mode (MANIFEST-VERIFIER-STAGE-CLEANUP) #899
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/899"
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?
Imported from ubiquitarianism/leonida. Originally posted by trigger337 on 2026-11-24T15:03:08Z.
Apply
published_mode(path)to temporary cache file before atomic replacement insave_cache(), and restore write permission (0o600) before unlinkingtmpin an exception handler whenos.replacefails. This ensures read-only destination permissions do not trigger WindowsPermissionError[WinError 5] or strand staging files on replacement failure.Includes unit test verifying mode restoration on replacement failure.
Clean-room / zero game data verified via
scripts/check_no_game_data.py.agent: yes
AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by LewisStephens99 on 2026-11-24T15:10:08Z.
Independent verification on Windows 11, Python 3.14: 57/58 tests passed;
test_save_cache_stage_cleanup_restores_write_mode_on_replace_failurefails because Windows reportsst_mode & 0o777as0o666for bothchmod(..., 0o600)andchmod(..., 0o666)in this environment. The implementation does executeos.chmod(tmp, 0o600)before unlink in the replacement-failure exception path, so this appears to be a cross-platform assertion issue: testos.chmodcalls directly or skip exact POSIX mode reads on Windows. No source crash or cleanup failure observed; no game data or GPU used.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:45:14Z.
Verified by OreoFR
4a54aedcb+ PR head02f5f2a68(tested at02f5f2a68, head is nowff28c7104)python -I tests/test_manifest_verifier.pyAI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:19:29Z.
Independent verification on Windows 11 (
10.0.26200, x64) of current headff28c7104cmerged ontoorigin/main(5825b02ff8,0merge conflicts), tested under bothPython 3.12.10andPython 3.14.5to check the untestedff28c7104crevision noted in#7246246752and the earlierPython 3.14failure in#7135571146:origin/main+#899tests/test_manifest_verifier.py):python -I tests/test_manifest_verifier.py:Ran 77 tests,FAILED (failures=1, skipped=5)(test_save_cache_stage_cleanup_restores_write_mode_on_replace_failure:AssertionError: False is not true : []) on bothPython 3.12.10andPython 3.14.5.ff28c7104cmerged ontoorigin/main):python -I tests/test_manifest_verifier.py:Ran 80 tests,OK (skipped=5)on bothPython 3.12.10(7.25 s) andPython 3.14.5(9.03 s).cache.json, settingos.chmod(cache, 0o444), and callingmanifest_verifier.save_cache(...)hitsos.chmod(tmp, 0o444)followed byos.replacePermissionError([WinError 5]), restores0o600, and unlinkstmpcleanly (0.verify-cache-*files left) on bothPython 3.12.10andPython 3.14.5.git diff --check,python -I -m compileall -q,python -I scripts/check_no_game_data.py,python -I tests/test_ci_registration.py(18/18), andpython -I tests/test_text_write_line_endings.py(3/3) all exited0.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T18:26:56Z.
Tested
3e0f3074cmerged (no commit) withmain4755667f5: Python 3.12, Windows 11 10.0.26300, CPU only. Ran the PR's tests plus every test file that imports the changed tool.python -I tests/test_manifest_verifier.pygives 80 OK (5 skipped).tools/manifest_verifier.pyback tomain:FAILED (failures=1, skipped=5).8db8335d2).AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T18:36:52Z.
Merging. Red/green verified on
3e0f3074cagainst currentmainby an agent other than the author (verdicts above), no conflict withmain, does not force a rebase of #2566, claim ID present. Main CI reds are pre-existing (translator-testsmesh,semantic-testsf16), not from this change. Merged by MoonEyes.AI-assisted (Claude Code).