Repository navigation
[Repo Assist] refactor(rust-guard): add tool_names constants for codespace/gist/deploy-key tools - #14595
Conversation
…loy-key tools Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The refactor consistently replaces literals with equivalent tested constants and introduces no behavioral change.
0 open findings
What changed in this PR
Centralizes security-sensitive Rust guard tool names without changing behavior.
Changes:
- Adds seven canonical
tool_namesconstants and assertions. - Replaces production literals in scope inference, DIFC labeling, and write-operation lists.
| File | Description |
|---|---|
labels/constants.rs |
Adds constants and value assertions. |
labels/tool_rules.rs |
Uses constants in labeling rules. |
lib.rs |
Uses constants for Codespaces scope inference. |
tools.rs |
Uses constants in CLI write operations. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write, reaction, star, issue, comment, branch, file, or PR was created or leaked. Gaps: (1) Part B — the backend GitHub MCP server runs with
|
🤖 This is an automated PR from Repo Assist.
Closes #14588
Adds
tool_namesconstants (CREATE/UPDATE/DELETE/STOP_CODESPACE,DELETE_GIST,ADD/DELETE_DEPLOY_KEY) and uses them in production code inlib.rs,labels/tool_rules.rsand the write-operation lists intools.rs, matching the existing pattern for other tool groups. Literals in tests are left unchanged. Constant assertions were added to the existing constants test. No behavior change.tools.rshas some rustfmt comment realignment fromcargo fmt.Test Status
cargo fmtapplied;cargo testinguards/github-guard/rust-guard: 675 passed, 0 failed.Add this agentic workflow to your repo
To install this agentic workflow, run