Skip to content

fix: make json store writes atomic - #3

Open
gaoshiweiGit wants to merge 1 commit into
clevercon-protocol:mainfrom
gaoshiweiGit:codex/safe-json-writes
Open

fix: make json store writes atomic#3
gaoshiweiGit wants to merge 1 commit into
clevercon-protocol:mainfrom
gaoshiweiGit:codex/safe-json-writes

Conversation

@gaoshiweiGit

Copy link
Copy Markdown

Summary

  • add a shared writeJsonSafe() helper that writes JSON through a unique temp file and atomic rename
  • add a small in-process JSON write queue and use it for registry agent saves
  • switch orchestrator JSON stores to the shared atomic writer for initialization and saves
  • add regression tests for atomic writes and queued writes

Closes #2

Verification

  • npm test
  • C:\Program Files\Git\bin\bash.exe scripts/typecheck.sh
  • npm run lint (passes with existing warnings only)
  • git diff --check

Bosun-Josh121 pushed a commit that referenced this pull request Jun 28, 2026
…04770901

Remove test snapshots from agent-vault
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.

Protect registry.json and all data stores from corruption on concurrent writes

1 participant