Skip to content

[codex] Fix atomic state writes - #2933

Merged
Widthdom merged 1 commit into
mainfrom
fix-issue2828
Jun 2, 2026
Merged

[codex] Fix atomic state writes#2933
Widthdom merged 1 commit into
mainfrom
fix-issue2828

Conversation

@Widthdom

@Widthdom Widthdom commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Added a shared atomic file writer that writes to a same-directory temp file, flushes to disk, then renames over the target with best-effort temp cleanup.
  • Routed small persistent state writes through it: active workspace/private text writes, suggestion store, update-check cache, and scan checkpoints.
  • Added focused cleanup coverage and kept the existing suggestion-store atomic write behavior covered.

Documentation and changelog

  • Added changelog.d/unreleased/2828.fixed.md.
  • No README/guide update: this changes durability of existing state writes, not a CLI flag, command contract, or documented workflow.

Validation

  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedName~DataDirectorySecurityTests|FullyQualifiedName~SuggestionStoreTests" -p:UseSharedCompilation=false
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release --no-build --filter "FullyQualifiedName~UpdateChecker"
  • dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=false
  • dotnet build CodeIndex.sln -p:UseSharedCompilation=false
  • dotnet format CodeIndex.sln --verify-no-changes
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json
  • Codex adversarial review: No blocking/actionable issues found.

Full Release test run was attempted with the repository runsettings, but it was not a clean validation signal in this local environment: it produced unrelated extractor/concurrency failures while other CodeIndex worktree test runs were also active, then stalled. Representative failed tests passed when rerun individually.

Follow-up candidates

None.

Fixes #2828

@Widthdom
Widthdom marked this pull request as ready for review June 2, 2026 10:12
@Widthdom
Widthdom merged commit 503e66b into main Jun 2, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue2828 branch June 3, 2026 23:00
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.

Use atomic flushed writes for small persistent state files

1 participant