Skip to content

fix(roles): validate the merged roles write will leave behind - #700

Merged
creedants merged 4 commits into
mainfrom
landing/e62
Oct 29, 2026
Merged

creedants merged 4 commits into
mainfrom
landing/e62

Conversation

@creedants

Copy link
Copy Markdown
Owner

Writing global roles from a project with its own mode or budget could force a --force for a configuration validate calls 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 write builds the same merged user/project configuration validate uses 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 --force even 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

@creedants
creedants merged commit 70dbe89 into main Oct 29, 2026
15 checks passed
@creedants
creedants deleted the landing/e62 branch October 29, 2026 04:16
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