Repository navigation
Add regression tests locking in DIFC coverage for 8 previously-flagged GitHub MCP tools - #10875
Conversation
Co-authored-by: lpcox <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds regression tests for existing DIFC labeling rules covering five GitHub MCP write operations.
Changes:
- Tests four repo-scoped issue/PR write operations.
- Tests owner-scoped integrity for
projects_write.
Show a summary per file
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/labels/tool_rules.rs |
Adds DIFC labeling regression tests. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS Notes:
References: §31266577964
|
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Gateway enforcement evidence (Part B): Write tool calls return in ~6 ms (local reject by tool allowlist) vs 283–605 ms for reads forwarded to the backend. The gateway exposes exactly 22 read-only tools; all write tools are absent from the allowlist and rejected with MCP error Overall: PASS References: §31266577972
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Note on Part B: All 7 write tools returned Note on Parts D/E: Note on Part C: Overall: PASS Run: §31266578009
|
The guard coverage checker flagged 8 operations (
add_pull_request_review_comment_reaction,add_reply_to_pull_request_comment,projects_write,reprioritize_sub_issue,set_issue_fields,unresolve_review_thread,update_pull_request_branch,update_pull_request_title) as potentially falling through to default DIFC labeling inapply_tool_labels, risking missed repo/org-scoped secrecy and integrity labels.Investigation found all 8 tools already have explicit classification in
tools.rsand explicit match arms inapply_tool_labels(tool_rules.rs) — the labeling logic itself was already correct. The gap was in test coverage: 5 of the 8 tools had no dedicated regression test asserting their labeling behavior, leaving them vulnerable to silent breakage during future refactors.apply_tool_labels_issue_and_pr_granular_write_ops_are_repo_scoped_writescoveringreprioritize_sub_issue,set_issue_fields,update_pull_request_branch, andupdate_pull_request_title— asserts repo-scoped writer integrity and empty secrecy for public repos.apply_tool_labels_projects_write_is_owner_scoped_writer_integritycoveringprojects_write— asserts owner-scoped writer integrity, consistent with its existing Projects v2 alias siblings.add_pull_request_review_comment_reaction,add_reply_to_pull_request_comment, andunresolve_review_threadalready had direct test coverage and required no changes.No changes to production labeling logic were needed since the match arms were already present and correct.