feat(auth): separate source control write permissions - #9787
feat(auth): separate source control write permissions#9787juliusmarminge wants to merge 5 commits into
Conversation
Thread transfer impact
This comment will update automatically after the next completed run. |
7b1d2a9 to
29f2d0c
Compare
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces a new source-control authorization boundary across server RPCs and web/mobile workflows, while also adding that permission to default client scopes. The security-sensitive auth changes and altered product defaults require human review. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
29f2d0c to
cfd3827
Compare
cfd3827 to
976c793
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit 976c793. Configure here.
976c793 to
3a230f5
Compare
3a230f5 to
74090e2
Compare
74090e2 to
9c21ca5
Compare

Task-operation access currently also permits cloning, pushing, changing branches, and mutating pull requests. Add
source-control:writefor these direct source-control actions, with matching controls in web, desktop, and mobile. Repository reads and PR resolution remain available withorchestration:read.The new scope is included in default grants and can be selected independently when pairing. Existing grants are not widened; clients need to pair again to receive it.
WebSocket coverage checks denied clone, streamed push, and PR-comment requests for task-only grants, successful clone and push with the new scope, and readable PR resolution in both cases. Client guards preserve View PR, existing-worktree selection, and thread deletion without worktree removal.
Pairing controls, captured from this layer’s base and head with the same viewport and default selection:
Model: GPT-6. Harness: Codex.
Note
High Risk
This is an authorization breaking change: clients with only orchestration:operate lose git and PR mutation access until re-paired with source-control:write, across server RPC enforcement and all major UI entry points.
Overview
Introduces
source-control:writeas its own environment scope and moves clone, push/pull, branch/worktree mutations, stacked git actions, and pull-request writes offorchestration:operateon the server.gitResolvePullRequeststays readable underorchestration:read.Web, mobile, and shared action hooks now use
useEnvironmentScopeto disable clone/add-project flows, git menus and sheets, PR editing/checkout handoffs, and branch pickers when the connection lacks the scope, with short “cannot change source control” messaging. Changing a thread’s branch or worktree still needsorchestration:operatein addition to source-control write; ordinary commits/pushes on the current branch can remain available with source-control write alone.Pairing/OAuth and connections settings expose the new permission; default client scopes include it but existing paired tokens are not upgraded. Server and mobile tests cover denied vs allowed mutations.
Reviewed by Cursor Bugbot for commit 9c21ca5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
AuthSourceControlWriteScopeand gate source-control writes across web, mobile, and serverAuthSourceControlWriteScopein auth.ts as a new environment authorization scope for standard clients and OAuth pairing.AuthOrchestrationOperateScopetoAuthSourceControlWriteScope;gitResolvePullRequestmoves toAuthOrchestrationReadScope.AuthOrchestrationOperateScopewill lose source-control write access; clients and existing tokens may need the new scope to perform clone, push, commit, branch, and pull-request mutation operations.Macroscope summarized 9c21ca5.