Skip to content

Centralize remaining Rust guard write-tool names - #14833

Merged
lpcox merged 2 commits into
mainfrom
copilot/rust-guard-add-tool-names-constants
Oct 13, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/rust-guard-add-tool-names-constants

Conversation

Copilot AI commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Write-tool names were duplicated across Rust guard operation lists and label rules, risking inconsistent classification. This change adds canonical constants for the remaining names and uses them at those call sites.

  • Constants: Add 11 tool_names constants with canonical-value assertions.
  • Classification: Replace literals in write-operation lists, label rules, and related tests; preserve sorted order for binary search.
tool_names::ACTIONS_RUN_TRIGGER,

Copilot AI changed the title [WIP] Add tool_names constants for remaining write-tool literals Centralize remaining Rust guard write-tool names Oct 13, 2026
Copilot AI requested a review from lpcox October 13, 2026 21:24
@lpcox
lpcox marked this pull request as ready for review October 13, 2026 22:03
Copilot AI balanced review requested due to automatic review settings October 13, 2026 22:03

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

The substitutions preserve exact values and sorted operation lists while fully addressing the duplication.

0 open findings

What changed in this PR

Centralizes Rust guard write-tool names to prevent classification drift.

Changes:

  • Adds 11 canonical tool-name constants and assertions.
  • Replaces duplicated literals across operation lists, label rules, and tests.
  • Preserves binary-search ordering.
File Description
labels/​constants.rs Defines and validates canonical names.
tools.rs Uses constants in write-operation classifications.
labels/​tool_rules.rs Uses constants in label matching.
labels/​mod.rs Updates label-rule tests.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@lpcox
lpcox merged commit bc6457a into main Oct 13, 2026
45 checks passed
@lpcox
lpcox deleted the copilot/rust-guard-add-tool-names-constants branch October 13, 2026 22:57
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] Add tool_names constants for remaining write-tool literals

3 participants