mirror of
https://github.com/boshu2/agentops.git
synced 2026-09-14 15:08:13 +08:00
a8267ddc8f
Add storage.FsyncDir — the single dir-fsync impl — and call it after the rename in canonical storage.AtomicWriteFile, so the rename itself (not just the file body) is durable across power loss. Every delegator (quest, cmd/ao inject, vendorimage codexruntime, llmwiki.AtomicWriteFile) inherits it. Close the same gap in the separate-rename writers: pool.atomicMove, llmwiki.AtomicWriteFromReader, storage.FileStorage.atomicWrite. Dedup the 4th private copy (evalsubstrate.WriteAtomic's fsyncDir) onto storage.FsyncDir. FsyncDir swallows only the directory-fsync-unsupported errnos (EINVAL/ENOTSUP/ ENOTTY — macOS APFS) and propagates genuine I/O errors, not the prior swallow-all shape that would hide a real durability failure. Note: the bead's '3 private copies (inject/vendorimage/pool)' framing was stale — inject and vendorimage already delegate through quest->storage; the real remaining work was the parent-dir fsync durability gap across all rename sites.