Skip to content

[codex] Write single proofs atomically#192

Merged
ryan-wong-coder merged 1 commit into
mainfrom
codex/atomic-sproof-writes
Jul 15, 2026
Merged

[codex] Write single proofs atomically#192
ryan-wong-coder merged 1 commit into
mainfrom
codex/atomic-sproof-writes

Conversation

@ryan-wong-coder

Copy link
Copy Markdown
Collaborator

Summary

  • Write .sproof single-proof files through a sibling temporary file and rename into place.
  • Preserve private 0600 permissions and clean temporary files on failure.
  • Explicitly reject directory targets so atomic rename cannot replace an existing directory on platforms that allow that edge case.

Root cause

The core single-proof writer used os.WriteFile directly, unlike the CLI and desktop export paths. An interrupted export could leave a partial proof file, and the first atomic-write draft exposed a platform-specific directory replacement edge case that now has regression coverage.

Validation

  • go test ./internal/sproof ./sdk ./cmd/trustdb
  • go test ./...
  • go vet ./...

@ryan-wong-coder
ryan-wong-coder merged commit 5f1236a into main Jul 15, 2026
9 checks passed
@ryan-wong-coder
ryan-wong-coder deleted the codex/atomic-sproof-writes branch July 15, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant