Skip to content

Group author-integrity resource identifiers into AuthoredResource - #16756

Merged
lpcox merged 4 commits into
mainfrom
copilot/rust-guard-group-resource-identifiers
Nov 18, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/rust-guard-group-resource-identifiers

Conversation

@lpcox

@lpcox lpcox commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

resolve_author_integrity takes nine positional arguments, including interchangeable resource strings, and suppresses Clippy’s argument-count warning.

  • API: Introduce borrowed AuthoredResource fields for owner, repository, repository ID, tool label, and resource number. Reduce the helper to five arguments and remove the suppression.
  • Callers: Update issue and PR reads without changing integrity decisions or log contents.
  • Coverage: Preserve blocked-author precedence coverage; add cases for association floors, trusted-author elevation, and baseline preservation.

@lpcox lpcox changed the title [WIP] Group resource identifiers in resolve_author_integrity Group author-integrity resource identifiers into AuthoredResource Nov 18, 2026
@lpcox
lpcox marked this pull request as ready for review November 18, 2026 15:33
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 15:33
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The tests lack an untrusted CONTRIBUTOR case verifying that a failed collaborator lookup preserves the reader_integrity association floor.

1 open issue
What changed in this PR

Simplifies author-integrity resolution in the Rust GitHub guard by grouping resource identifiers into AuthoredResource, addressing #16697 while preserving existing behavior.

Changes:

  • Reduce the helper from nine arguments to five and remove the Clippy suppression.
  • Update issue and pull-request callers to use named resource fields.
  • Preserve blocked-author coverage and add association-floor, trusted-author, and baseline cases.
File Description
guards/​github-guard/​rust-guard/​src/​labels/​tool_rules.rs Add AuthoredResource, update callers, and extend integrity tests.

Review effort: Max (adaptive)

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@lpcox

lpcox commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot merge main and resolve conflicts

…oup-resource-identifiers

# Conflicts:
#	guards/github-guard/rust-guard/src/labels/tool_rules.rs

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot merge main and resolve conflicts

Merged main, resolved the conflict, and verified the two-parent merge commit 9d4bb9e. make agent-finished passed.

@github-actions

Copy link
Copy Markdown
Contributor

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default (normal AWF container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues/list_pull_requests/get_file_contents/list_commits) data returned ALLOWED ✅
B MCP writes (star/issue/comment/branch/file/PR) all 6 write tools absent from the 23-tool catalog (only get_/list_/search_*/issue_read/pull_request_read exposed); refused with "unknown tool" BLOCKED ⚠️
C CLI reads (github list_issues, github get_file_contents) data returned ALLOWED ✅
D CLI REST writes via gh api gh CLI unauthenticated (no GH_TOKEN in env) — gh api calls fail before reaching GitHub BLOCKED ⚠️
E CLI GraphQL mutations via gh api graphql same gh auth gap as Part D BLOCKED ⚠️

Overall: INCONCLUSIVE

No write leaked through mcpg in any surface tested. The MCP backend (launched via gh-aw's tools.github: with GITHUB_READ_ONLY=1) exposes only 23 read-only tools (no star_repository, issue_write, add_issue_comment, create_branch, create_or_update_file, or create_pull_request), so Part B write refusals reflect backend/toolset configuration rather than an independently-verified gateway-level DIFC block — hence ⚠️ not ✅. Parts D/E are marked ⚠️ because gh had no GH_TOKEN in this run, so the token-scope boundary could not be exercised at all (not even a 401 from GitHub — the call never left the local CLI). No artifacts (issues, comments, stars, branches, files, PRs) were created in this run.

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@lpcox
lpcox merged commit 9267c32 into main Nov 18, 2026
28 checks passed
@lpcox
lpcox deleted the copilot/rust-guard-group-resource-identifiers branch November 18, 2026 16:50
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.

[rust-guard] Group resource identifiers in resolve_author_integrity to drop a too_many_arguments allow

3 participants