Skip to content

[Repo Assist] refactor(rust-guard): use field_names constants for full_name/fullName literals - #11450

Merged
lpcox merged 1 commit into
mainfrom
repo-assist/improve-full-name-const-11439-47a0a1c5dd088468
Aug 18, 2026
Merged

[Repo Assist] refactor(rust-guard): use field_names constants for full_name/fullName literals#11450
lpcox merged 1 commit into
mainfrom
repo-assist/improve-full-name-const-11439-47a0a1c5dd088468

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.

Summary

Closes #11439.

Replaces the raw string literals "full_name" / "fullName" in repo_id_from_repo_object (labels/backend.rs) with field_names constants, matching the convention already used elsewhere in the file (e.g. field_names::LOGIN).

Rationale

repo_id_from_repo_object was the only call site mixing raw string literals with the shared field_names constants module, even though field_names::FULL_NAME already existed and is used in response_paths.rs, helpers.rs, and response_items.rs. There was no existing constant for the camelCase "fullName" variant, so this call site risked a silent typo diverging from the snake_case constant used elsewhere.

Changes

  • Added field_names::FULL_NAME_CAMEL = "fullName" next to field_names::FULL_NAME in labels/constants.rs.
  • Updated repo_id_from_repo_object in labels/backend.rs to iterate over [field_names::FULL_NAME, field_names::FULL_NAME_CAMEL] instead of raw literals.

Trade-offs

  • Purely mechanical, behavior-preserving change — no logic difference.
  • Test-only literals (e.g. JSON fixtures in #[cfg(test)] modules) were left untouched, since they are literal JSON payload contents, not guard logic.

Test Status

  • cargo build (guards/github-guard/rust-guard) — ✅ succeeded
  • cargo test (guards/github-guard/rust-guard) — ✅ 642 passed, 0 failed

Generated by Repo Assist · auto · 125.5 AIC · ⊞ 18.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

…e in repo_id_from_repo_object

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lpcox
lpcox marked this pull request as ready for review August 18, 2026 13:52
Copilot AI balanced review requested due to automatic review settings August 18, 2026 13:52

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@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 AWF (normal container isolation)

Part Surface Op Result Expected Status
A1 MCP list_issues 3 issues returned ALLOWED
A2 MCP list_pull_requests 3 PRs returned ALLOWED
A3 MCP get_file_contents (README.md) content returned ALLOWED
A4 MCP list_commits 3 commits returned ALLOWED
B MCP writes (add_issue_comment/star/issue_write/create_branch/create_or_update_file/create_pull_request) all absent from tool catalog BLOCKED ⚠️
C1 CLI list_issues 3 issues returned ALLOWED
C2 CLI get_file_contents content returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) gh unauthenticated (no GH_TOKEN) BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh unauthenticated (no GH_TOKEN) BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: All write tools (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) were absent from the MCP tool catalog (backend launched with GITHUB_READ_ONLY=1 per gh-aw framework). This confirms the backend-level defense-in-depth but does not independently confirm gateway-layer (DIFC/guard) write blocking. Per test plan, this is INCONCLUSIVE, not FAIL.

⚠️ Parts D/E: gh CLI is not authenticated in this environment (no GH_TOKEN). All REST/GraphQL write attempts returned auth errors, not gateway-enforced refusals. Cannot validate token-scope boundary in this run.

No write leaked through any surface. INCONCLUSIVE due to structural test methodology gaps (backend READONLY mode + no gh token), not due to any gateway failure.

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

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — gVisor (runsc)

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: gVisor (sandbox.agent.runtime: gvisor)

Part Surface Op Result Expected Status
A MCP list_issues 3 issues returned ALLOWED
A MCP list_pull_requests 3 PRs returned ALLOWED
A MCP get_file_contents (README.md) data returned ALLOWED
A MCP list_commits 3 commits returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) all: unknown tool [-32602] BLOCKED ⚠️
C CLI list_issues (github CLI) data returned ALLOWED
C CLI get_file_contents (github CLI) data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: All 7 write tools absent from the MCP catalog (Error [-32602]: unknown tool). The backend is launched with GITHUB_READ_ONLY=1, so write tools are never registered — this confirms the gh-aw framework defense-in-depth guarantee but does not independently confirm mcpg's own DIFC/guard enforcement layer. No writes leaked.

⚠️ Parts D & E: gh is not authenticated in this environment (You are not logged into any GitHub hosts). REST and GraphQL write attempts via gh could not be performed. Authentication gap prevents token-scope boundary validation for this run.

No writes succeeded. All Part A/C reads returned data as expected.

References: §32140209049

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

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — docker-sbx

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: docker-sbx (KVM-isolated microVM)

Part Surface Op Result Expected Status
A MCP reads (issues/PRs/file/commits) data returned ALLOWED
B MCP writes (reaction/star/issue/comment/branch/file/PR) all tools absent from catalog BLOCKED ⚠️
C CLI reads (list_issues, get_file_contents) data returned ALLOWED
D CLI REST writes (reaction/star/issue/comment/file) 401 unauthenticated BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) 401 unauthenticated BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: The github CLI tool catalog exposes exactly 23 read-only tools; all 7 write tools tested (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) were absent (unknown tool [-32602]). This is consistent with GITHUB_READ_ONLY=1 backend configuration — it confirms gh-aw's own defense-in-depth but does not independently confirm mcpg's DIFC/guard layer, since write tools never reach the gateway.

⚠️ Parts D & E: gh returned 401 Bad credentials for all write attempts. The token in GH_TOKEN is invalid for this environment, so the token-scope boundary cannot be validated. No writes succeeded; no data was created.

No writes leaked. No FAIL conditions.

References: §32140209103

🔒 mcpg read-only stress (docker-sbx runtime) by Read-Only Stress: docker-sbx runtime

@lpcox
lpcox requested a balanced review from Copilot August 18, 2026 14:56

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.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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.

[rust-guard] Rust Guard: Replace raw full_name/fullName literals with field_names constants in repo_id_from_repo_object

2 participants