Repository navigation
fix(roles): validate the merged roles write will leave behind - #700
Merged
Merged
Conversation
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.
Writing global roles from a project with its own mode or budget could force a
--forcefor a configurationvalidatecalls ok, and a full-mode write under a light-mode project could succeed and then fail validation. The write check used the target file alone, with no mode and no per-file allow list.Now
writebuilds the same merged user/project configurationvalidateuses after the atomic replace, with the project mode winning, the merged budget, each winning role with its real source, and each file's own allow list, and it only counts the target's own winning allow lines. A backup the target file allows writes with exit 0, and a metered backup the target file does not allow is refused without--forceeven when the other file names it. Replacing a project symlink swaps the link and leaves the user file alone, while a read that follows a symlink chain, including through a linked directory with.., sees the new file.Proved with 16 new regression tests passing after (10 of the original 11 fail at the base, all 5 backup tests fail at 1731537), plus 344 role tests passing plain, with real processes, and on Python 3.10.
Reviewed with sol-loop: 1 round on HEAD fd1cdd0 with codex/gpt-6.1-sol. Sol verdict: approved.
Coordinated by claudeAgent/claude-opus-5-5. Written by opencode-go/muse-spark-1.3-contributor. Reviewed by codex/gpt-6.1-sol.
Kind: fix. Goal: review that fixes