Skip to content

Extract pure sensitive-path predicate from Rust guard label logic - #15628

Merged
lpcox merged 2 commits into
mainfrom
copilot/rust-guard-extract-is-sensitive-path
Oct 27, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/rust-guard-extract-is-sensitive-path

Conversation

Copilot AI commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

check_file_secrecy couples path classification with policy-dependent label construction, requiring policy fixtures to test string-matching rules.

  • Separation: Extract is_sensitive_path(&str) -> bool; preserve matching behavior and leave label selection in check_file_secrecy.
  • Coverage: Consolidate existing cases into one table-driven predicate test, add boundary cases, and retain two label-wiring tests.

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Extract pure is_sensitive_path predicate from check_file_secrecy Extract pure sensitive-path predicate from Rust guard label logic Oct 27, 2026
Copilot AI requested a review from lpcox October 27, 2026 15:01
@lpcox
lpcox marked this pull request as ready for review October 27, 2026 15:39
Copilot AI max review requested due to automatic review settings October 27, 2026 15:39

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 focused extraction preserves existing behavior and test coverage, with only an optional documentation clarification remaining.

No open issues 🎉

What changed in this PR

Separates sensitive-path detection from policy-dependent secrecy labeling in the Rust guard, improving testability without changing matching behavior.

Changes:

  • Extracts the pure is_sensitive_path predicate.
  • Consolidates existing cases into a table-driven test and adds boundary coverage.
  • Retains two label-wiring tests and strengthens the unchanged-default check.
File Description
guards/​github-guard/​rust-guard/​src/​labels/​tool_rules.rs Extracts path classification and reorganizes tests while preserving secrecy-label behavior.

Review effort: Max

@lpcox
lpcox merged commit 14146b3 into main Oct 27, 2026
48 checks passed
@lpcox
lpcox deleted the copilot/rust-guard-extract-is-sensitive-path branch October 27, 2026 15:52
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] Rust Guard: Extract pure is_sensitive_path predicate from check_file_secrecy

3 participants