Skip to content

Commit 138dca7

Browse files
authored
Support GitHub MCP Server v1.3.0: add PR commits routing, guard docs, and spec updates
1 parent 67ac13f commit 138dca7

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

guards/github-guard/docs/INTEGRITY_TAG_SPEC.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Resource labels are coarse pre-check labels by tool call.
127127
| `search_pull_requests` | baseline `none` (cross-repo coarse) | baseline `none` |
128128
| `get_commit` | start at max(author_association floor, approved); if default-branch reachable => merged | start at author_association floor; if default-branch reachable => merged; otherwise remain floor unless other endorsement applies |
129129
| `list_commits` | if ref is default/no-ref: merged; else max(author_association floor, approved) | if ref is default/no-ref: merged; else author_association floor (response items refine per commit) |
130-
| `get_file_contents` | default/no-ref: merged; otherwise approved (author floor does not usually apply to blob metadata) | default/no-ref: merged; otherwise approved |
130+
| `get_file_contents`, `get_file_blame` | default/no-ref: merged; otherwise approved (author floor does not usually apply to blob metadata) | default/no-ref: merged; otherwise approved |
131131
| `list_branches`, `list_tags`, `get_tag`, `list_releases`, `get_latest_release`, `get_release_by_tag`, `get_label`, `list_label`, `actions_get`, `actions_list`, `search_code`, `get_repository`, `search_repositories`, `get_repository_tree`, `list_discussion_categories` | approved | approved |
132132
| `get_job_logs` | approved | approved |
133133
| `list_discussions`, `get_discussion`, `get_discussion_comments` | max(author_association floor, approved) | author_association floor (user content) |
@@ -156,7 +156,7 @@ Response labels are fine-grained per item and are authoritative when available.
156156
| Issue item (`list_issues`, `search_issues`, `get_issue`) | max(author_association floor, approved) | author_association floor (NONE => `unapproved`, FIRST_TIMER => `none`) |
157157
| Pull request item (`list_pull_requests`, `search_pull_requests`, `get_pull_request`) | max(author_association floor, approved); if merged/default-branch reachable => merged | start from author_association floor; apply lineage baseline (direct => approved, forked => unapproved); if merged/default-branch reachable => merged |
158158
| Commit item (`list_commits`, `get_commit`) | max(author_association floor, approved); if default-branch reachable => merged | author_association floor; if default-branch reachable => merged; otherwise stay at floor unless other endorsement evidence applies |
159-
| File content item (`get_file_contents`) | default/no-ref: merged; otherwise approved | default/no-ref: merged; otherwise approved |
159+
| File content item (`get_file_contents`, `get_file_blame`) | default/no-ref: merged; otherwise approved | default/no-ref: merged; otherwise approved |
160160
| Branch/tag/release metadata item (`list_branches`, `list_tags`, `get_tag`, `list_releases`, `get_latest_release`, `get_release_by_tag`) | merged if tied to default branch, otherwise approved | merged if tied to default branch, otherwise approved |
161161
| Label metadata (`get_label`, `list_label`) | approved | approved |
162162
| GitHub Actions workflow/artifact metadata (`actions_get`, `actions_list`) | approved | approved |
@@ -177,6 +177,7 @@ Notes:
177177
- For user-authored objects that include `author_association`, response labeling starts from the author-association floor and then elevates with endorsement evidence.
178178
- For issue/PR/commit-style response objects, helper functions enforce explicit baseline `none` when no stronger integrity is present.
179179
- Response labeling is authoritative and may be more precise than coarse resource labels.
180+
- `pull_request_read` sub-method responses (e.g., `get_commits`, `get_files`, `get_reviews`, `get_review_comments`, `get_check_runs`) use PR-level resource labels from the tool call rather than per-item response labeling; the PR facts lookup (merge status, author association, fork lineage) provides the correct integrity bound for all PR sub-resources.
180181

181182
---
182183

guards/github-guard/rust-guard/src/labels/response_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub fn label_response_items(
102102
// === Pull Requests - label by merged state ===
103103
"list_pull_requests" | "search_pull_requests" | "pull_request_read" | "get_pull_request" => {
104104
// For pull_request_read sub-methods that return non-PR objects (e.g.
105-
// get_check_runs, get_files, get_review_comments, get_reviews,
105+
// get_check_runs, get_commits, get_files, get_review_comments, get_reviews,
106106
// get_comments, get_diff, get_status), skip per-item response labeling.
107107
// The resource-level labels from tool_rules (which call
108108
// get_pull_request_facts) provide correct PR-scoped integrity.

internal/proxy/proxy_coverage_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ func TestMatchRoute_AdditionalRoutes(t *testing.T) {
7878
wantArgs: map[string]interface{}{"owner": "org", "repo": "repo", "pullNumber": "7", "method": "get_review_comments"},
7979
},
8080

81+
// PR commits (get_commits method, added in GitHub MCP Server v1.3.0)
82+
{
83+
name: "PR commits",
84+
path: "/repos/github/gh-aw/pulls/42/commits",
85+
wantTool: "pull_request_read",
86+
wantArgs: map[string]interface{}{"owner": "github", "repo": "gh-aw", "pullNumber": "42", "method": "get_commits"},
87+
},
88+
8189
// Search repositories
8290
{
8391
name: "search repositories",

internal/proxy/router.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ var routes = []route{
120120
return prArgs(m[1], m[2], m[3], "get_review_comments")
121121
},
122122
},
123+
{
124+
pattern: regexp.MustCompile(`^/repos/([^/]+)/([^/]+)/pulls/(\d+)/commits$`),
125+
toolName: "pull_request_read",
126+
extractArgs: func(m []string) map[string]interface{} {
127+
return prArgs(m[1], m[2], m[3], "get_commits")
128+
},
129+
},
123130
{
124131
pattern: regexp.MustCompile(`^/repos/([^/]+)/([^/]+)/pulls/(\d+)$`),
125132
toolName: "pull_request_read",

0 commit comments

Comments
 (0)