fix(mcp): require live write access for staged agent actions - #859
Conversation
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #859 +/- ##
==========================================
- Coverage 96.71% 96.69% -0.02%
==========================================
Files 108 108
Lines 14641 14650 +9
Branches 5298 5301 +3
==========================================
+ Hits 14160 14166 +6
- Misses 102 103 +1
- Partials 379 381 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
gittensory · advisory review Reviewed 3 changed file(s) — two independent AI reviewers. Changed files: Suggested action: 🛠️ Request changes. (reviewers split: request changes / merge) Address the suggestions below before merging. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
91ed609 to
077a7ab
Compare
Motivation
gittensory_propose_actionpath could stage write-capable actions (approve/merge/close/label) based on cached control-panel maintainer scope derived from PRauthor_association, which can misrepresent real GitHub write permission.Description
requireRepoManageAccessto callgetRepositoryCollaboratorPermissionand validate againstREPO_WRITE_PERMISSIONSinsrc/mcp/server.ts.getRepositoryCollaboratorPermissionand add theREPO_WRITE_PERMISSIONSconstant insrc/mcp/server.tsto centralize the write-permission check.requireRepoWriteAccessgate so accepting/rejecting pending actions also requires verified live write permission insrc/api/routes.ts.getRepositoryCollaboratorPermissionand asserting that cachedCOLLABORATORassociation without live write permission cannot stage actions intest/unit/mcp-automation-state.test.ts.src/mcp/server.ts,src/api/routes.ts,test/unit/mcp-automation-state.test.ts.Testing
npm test -- --run test/unit/mcp-automation-state.test.ts, which passed.npm test -- --run test/unit/routes-agent-approval.test.ts test/unit/routes-ai-byok.test.ts, which passed.npm run typecheck, which completed successfully.Codex Task