CL-9384: migrate persisted approval stores to purge update_plan keys - #1186
Open
TheGreatAxios wants to merge 8 commits into
Open
TheGreatAxios wants to merge 8 commits into
TheGreatAxios wants to merge 8 commits into
Conversation
Advertise read/write/edit/delete/bash/grep/glob plus the control-plane. Registry engines stay posix-named. Hidden aliases dispatch; grants canonicalize both sides. Codex does not advertise apply_patch, shell, or update_plan. Fixes CL-8400
Authorize classified Codex command arrays as empty strings, so reactor-gated hidden shell auto-allowed and the unwrapped script ran.
Stored update_plan grants canonicalized onto manage_tasks, so a create-only plan approval auto-allowed full task lifecycle calls. Coverage is now one-directional and seeders drop the narrow key.
Live requests never present as aliases (coerced before matching), so tests presenting update_plan requests exercise an unreachable path. Fail-closed pins and seeder tests remain.
…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.
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