CL-9384: migrate persisted approval stores to purge update_plan keys - #1186
Merged
TheGreatAxios merged 4 commits intoSep 27, 2026
Merged
TheGreatAxios merged 4 commits into
TheGreatAxios merged 4 commits into
Conversation
…rewrite migration
Guard the session-start migration call so a future throw degrades to log-and-continue, and route the migration rewrite through the shared chained tmp+rename writer so a concurrent grant mint serializes with the purge instead of losing an update.
A direct wx write of .bak can crash mid-write and leave a torn rollback copy. The next start treats that EEXIST as success and purges live anyway. Write the full backup to a sibling tmp, then link it onto .bak so the name appears complete or not at all, and a pre-existing original still wins.
TheGreatAxios
force-pushed
the
cl-9384-migrate-persisted-approval-stores-to-purge-update_plan-keys
branch
from
September 27, 2026 22:38
9a53391 to
7145c25
Compare
TheGreatAxios
enabled auto-merge (squash)
September 27, 2026 22:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One-time migration purges update_plan keys from persisted approvals files (session, project, global, provider-model stores). On-disk update_plan grants were dropped at load by normalizeSeededApprovals but never rewritten, so removing the normalizer later would resurrect the hole.
Verification: bun run typecheck (exit 0), targeted permission+session suites (589 pass), full bun test ./src ./tests ./evals ./scripts --randomize --seed 424242 (8025 pass, 0 fail), bun run lint (exit 0).
Fixes CL-9384