Apply published_mode(path) to temporary cache file before atomic replacement,
and restore write permission (0o600) before unlink in exception block when
replace fails, preventing Windows PermissionError [WinError 5] and stranded
temporary cache files.
agent: yes
AI-assisted: yes
Merging.
**Why merged:** manifest_verifier also protects every file the manifest lists from being overwritten by cache writes (the companion to #334). Reviewed as good by Oliwettoo.
**Why it's good:** Its tests: 83 passed, 4 skipped, on its own and stacked with #334.
Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).
AI-assisted (Claude Code, Claude Opus 5.5).
A manifest with no entries ({"files": {}}, {}, or metadata keys only) loaded as an empty table, so
every file in the target folder was reported NEW and manifest_verifier printed OK and exited 0
without hashing anything. A create that was cut short or a mistyped --manifest therefore passed as
a clean verification. tools/manifest.py verify already refuses this case.
verify_manifest now raises ManifestError when the manifest lists no files but the folder holds
some, with the same wording as manifest.py ("<manifest> lists no files, but <dir> holds N"). The
CLI reports it as ERROR on stderr and exits 2, like other manifest errors. An empty manifest
against an empty folder still passes.
test_cli_manifest_without_entries_is_an_error_not_ok runs the CLI on the synthetic test folder with
each of the three empty shapes and checks for exit 2, the message, and no OK. With the fix reverted
it fails on all three (exit 0).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_report_paths' macOS normcase fix landed on main as f7c7d57b; take main's
version of the file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A full run with the temp folder in a profile named in Cyrillic found:
- tools/hw_oracle/runner.py wrote build_hw_oracle.cmd with encoding
"ascii", so any non-ASCII path (the temp work folder, Visual Studio,
the source) raised UnicodeEncodeError before hw_oracle compiled
anything. Non-ASCII paths now go in as their 8.3 short names, the file
in the OEM code page cmd.exe reads it with (UTF-8 elsewhere). New check
in test_hw_oracle: a work folder named "Пользователь".
- test_spirv_metal_set0_extra: its subprocess stubs didn't take the
errors= argument this branch added to tools/spirv_metal_set0.py.
- test_user_sgpr_census, test_anim_index, test_awc_manifest,
test_gamedata_graph, test_manifest_verifier, test_world_build: they
decoded the Python child's output as UTF-8, but the tool writes in the
locale encoding (the ANSI code page on Windows), so a non-ASCII temp
path never matched; test_awc_manifest's reader thread died (no errors=).
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Normalize only the host separator. A backslash is an ordinary filename character on POSIX and must not let a top-level file verify as a missing nested path.