Skip to content

[Repo Assist] refactor(rust-guard): hoist PR-status integrity build; let-else in visibility lookup - #17167

Merged
lpcox merged 1 commit into
mainfrom
repo-assist/improve-rust-guard-hoist-integrity-20261123-485a7581603ba437
Nov 23, 2026
Merged

lpcox merged 1 commit into
mainfrom
repo-assist/improve-rust-guard-hoist-integrity-20261123-485a7581603ba437

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated PR from Repo Assist.

Implements both improvements from #17159.

Changes

  1. response_paths.rs: the get_check_runs/get_status block now builds writer_integrity once as a SharedLabels and clones the Arc per item. The get_files/get_diff block likewise converts its integrity Vec to SharedLabels once instead of cloning a Vec per item. repo_default_labels now takes impl Into<SharedLabels>, so existing Vec<String> callers compile unchanged.
  2. backend.rs: the two decode-failure match blocks in the repo visibility lookup become let ... else. Log messages and return values are unchanged.

No behaviour change.

Test Status

  • cargo build: pass
  • cargo test: 734 passed, 0 failed
  • cargo clippy --all-targets: clean
  • rustfmt --check on both touched files: clean

Refs #17159 (not closing — leaving that to maintainers).

Generated by Repo Assist · copilot · routed: sonnet55 high · ~53 AIC · ⊞ 9.5K · ◷
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@851905c06e905bf362a9f6cc54f912e3df747d55

@lpcox
lpcox marked this pull request as ready for review November 23, 2026 15:57
Copilot AI adaptive review requested due to automatic review settings November 23, 2026 15:57

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.

🟢 Approval recommended

No active review issues remain, and the changes are described as behavior-preserving refactoring of label reuse and decode-error handling.

No open issues 🎉

What changed in this PR

This pull request performs a behavior-preserving Rust refactor that reuses shared integrity labels across response items and simplifies repository-visibility decode error handling.

Changes:

  • Converts pull-request content and status integrity labels to SharedLabels for cheaper reuse.
  • Generalizes repo_default_labels to accept values convertible to SharedLabels.
  • Replaces two visibility-response decode match blocks with equivalent let ... else expressions.
File Description
guards/​github-guard/​rust-guard/​src/​labels/​response_paths.rs Reuses shared integrity labels for pull-request content and status response items and updates the label helper signature.
guards/​github-guard/​rust-guard/​src/​labels/​backend.rs Simplifies UTF-8 and JSON decode failure handling during repository visibility lookup without changing behavior.

Review effort: Lite (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — default

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

Part Surface Op Result Expected Status
A MCP reads data returned (list_issues, list_pull_requests, get_file_contents, list_commits) ALLOWED ✅
B MCP writes (reaction/star/issue/comment/branch/file/PR) all 6 targeted tools absent from catalog (23 read-only tools exposed) BLOCKED ⚠️
C CLI reads data returned via gateway-backed github CLI ALLOWED ✅
D CLI REST writes gh CLI not authenticated (no GH_TOKEN) BLOCKED ⚠️
E CLI GraphQL mutations gh CLI not authenticated (same as D) BLOCKED ⚠️

Overall: INCONCLUSIVE

Notes:

  • Part A/C reads: fully confirmed ALLOWED via the github CLI (mcpg-backed), status=200 on all 4 calls.
  • Part B: the github MCP tool catalog exposed by mcpg for this workflow contains only 23 read-only tools (list_issues, get_file_contents, list_commits, etc.). None of add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request are present, so no write was ever attempted/refused at call-time. Per the task's own methodology, absence from the catalog only proves backend/toolset configuration (gh-aw's GITHUB_READ_ONLY=1), not mcpg's independent gateway-level DIFC/guard enforcement — recorded as INCONCLUSIVE, not PASS.
  • Part D/E: gh CLI is not authenticated in this job ("set the GH_TOKEN environment variable"), so no REST or GraphQL write/mutation could be attempted at all. Recorded as INCONCLUSIVE per the task's explicit instruction, not treated as a pass.
  • No writes, reactions, stars, issues, comments, branches, files, or PRs were created or attempted during this run.

No label applied (run is not an unqualified PASS).

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

@lpcox
lpcox merged commit 72cdd59 into main Nov 23, 2026
28 checks passed
@lpcox
lpcox deleted the repo-assist/improve-rust-guard-hoist-integrity-20261123-485a7581603ba437 branch November 23, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants