Skip to content

fix: write ACP config atomically#50

Open
antfleet-ops wants to merge 1 commit into
Virtual-Protocol:mainfrom
antfleet-ops:fix/acp-cli-atomic-config
Open

fix: write ACP config atomically#50
antfleet-ops wants to merge 1 commit into
Virtual-Protocol:mainfrom
antfleet-ops:fix/acp-cli-atomic-config

Conversation

@antfleet-ops

Copy link
Copy Markdown

Summary

  • write ACP config updates to a unique temp file in the config directory
  • rename the complete temp file over the final config path
  • remove the temp file on write failure so the previous config remains intact

Fixes #40.

Verification

  • npm run typecheck
  • npm run build

AntFleet audit provenance

Filed from antfleet-ops after AntFleet's two-model Virtuals repo scan found that direct writes to CONFIG_PATH could leave partial JSON and make local agent or wallet state appear missing.

Constraint: fix must avoid changing config schema or keychain behavior.\nRejected: direct write to CONFIG_PATH | leaves partial JSON on interruption.\nConfidence: high\nScope-risk: narrow\nDirective: keep future config persistence rename-based or stronger; do not reintroduce truncate-in-place writes.\nTested: npm run typecheck; npm run build\nNot-tested: fsync durability across OS crash.
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.

Write ACP config atomically to avoid corrupting local agent state

1 participant