[Repo Assist] refactor(rust-guard): use field_names constants for full_name/fullName literals - #11450
Conversation
…e in repo_id_from_repo_object Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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.
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
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 — 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
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.
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
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes leaked. No FAIL conditions. References: §32140209103
|
🤖 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"inrepo_id_from_repo_object(labels/backend.rs) withfield_namesconstants, matching the convention already used elsewhere in the file (e.g.field_names::LOGIN).Rationale
repo_id_from_repo_objectwas the only call site mixing raw string literals with the sharedfield_namesconstants module, even thoughfield_names::FULL_NAMEalready existed and is used inresponse_paths.rs,helpers.rs, andresponse_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
field_names::FULL_NAME_CAMEL = "fullName"next tofield_names::FULL_NAMEinlabels/constants.rs.repo_id_from_repo_objectinlabels/backend.rsto iterate over[field_names::FULL_NAME, field_names::FULL_NAME_CAMEL]instead of raw literals.Trade-offs
#[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) — ✅ succeededcargo test(guards/github-guard/rust-guard) — ✅ 642 passed, 0 failedAdd this agentic workflow to your repo
To install this agentic workflow, run