Reported by the OmniSim evaluation of the public u-link example
(2026-09-11): pip install + export.py on Windows died three times in
the build layer before any geometry was built.
- Binary-mode opens: every byte-exact os.open site now sets O_BINARY
via _internal/os_compat.with_binary_flag. autocrlf=true clones read
builder sources in text mode, stripped CR, and aborted with a false
file_input_changed (25579-byte u_link.py read back as 25092); the
same hazard expanded LF on cache writes and would corrupt CAS
hashes. Sites: build/dependencies.py, artifacts/feature_graph.py,
scene/archive.py, cache/store.py (object/record writes, lock
create), artifacts/interface.py (lock create).
- Directory fsync is POSIX-only: os.open(<dir>)+fsync raised
PermissionError on Windows in cache/store.py and
artifacts/interface.py; both now no-op off POSIX via one helper.
- Stale-lock recovery by evidence: a lock whose recorded owner pid is
provably dead is recovered immediately (unreadable owners still wait
out the age gate, live owners are never broken). Windows liveness
probing uses OpenProcess/GetExitCodeProcess — os.kill(pid, 0) maps
to TerminateProcess there and kills the process being probed.
- Console hardening at import: non-UTF strict streams are reconfigured
to backslashreplace so a cp1252 console cannot raise
UnicodeEncodeError from a diagnostic print inside an error handler
and mask the real failure.
- .gitattributes: byte-exact by default, LF pinned for text formats,
so builder-source digests stop depending on core.autocrlf.
Tests: test_os_compat.py (15) + dead-owner immediate recovery in
test_cache_store.py; full suite 1799 passed, 5 skipped. ty: zero new
diagnostics.
Store a unique lock token with the owning PID, refuse to reclaim locks
held by live processes, and only unlink a lock when its on-disk token
still belongs to the current context. This prevents stale recovery from
removing a replacement owner's lock.
When get_or_compute cannot acquire the key lock within policy timeout,
compute independently and publish via the existing atomic object/record
writes. Cache contention can duplicate work but no longer fails an
otherwise valid build.