Skip to content

Make project-trust saves atomic and serialized - #506

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-6705-make-project-trust-saves-atomic-and-serialized
Aug 22, 2026
Merged

Make project-trust saves atomic and serialized#506
TheGreatAxios merged 1 commit into
mainfrom
cl-6705-make-project-trust-saves-atomic-and-serialized

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Project-trust saves wrote the store file directly with no temp+rename and no mutation queue, so concurrent trust-plugin/trust-MCP updates could interleave read-mutate-write and drop a grant or leave truncated JSON. This now writes via temp-file + rename and serializes load/mutate/save behind a per-path mutation queue, mirroring the existing path-trust.ts pattern.

Adds regression tests for concurrent plugin trust, concurrent plugin+MCP trust, and many concurrent writers, asserting all grants persist and the on-disk file stays valid JSON with no leftover temp file.

Fixes CL-6705
https://linear.app/abklabs/issue/CL-6705

Persist project trust via temp-file + rename and serialize load-mutate-save
behind a per-path mutation queue, mirroring path-trust.ts. Prevents concurrent
plugin/MCP trust grants from interleaving and dropping a grant or leaving
truncated JSON on disk.
@linear-code

linear-code Bot commented Aug 22, 2026

Copy link
Copy Markdown

CL-6705

@TheGreatAxios
TheGreatAxios merged commit 354df71 into main Aug 22, 2026
2 checks passed
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