Skip to content

fix(doctor): derive the sensitive files line from the built-in rule list - #721

Merged
ajianaz merged 1 commit into
developfrom
fix/doctor-sensitive-files
Nov 14, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/doctor-sensitive-files

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What

The sensitive files line of tole doctor is now built from the same rule list the matcher uses.

Why

The line still listed the six original names (.env*, *.pem, id_*, .npmrc, .netrc, *.key) after #683 added more (*.env, credentials, .pgpass, kubeconfig, *.tfvars, and others), so the report understated what is withheld.

Changes

  • tole-core/src/sensitive.rs: BUILTIN_NAME_GLOBS and BUILTIN_PATH_RULES (.docker/config.json) are the single source; is_sensitive_name matches against the glob list (same behaviour, now data-driven) and builtin_rules() exposes the list.
  • tole-cli/src/doctor.rs: the line joins builtin_rules().
  • Tests: the_builtin_rules_are_what_the_matcher_uses (every glob matches a name made from it, every known sensitive name is covered by a listed rule) and the_sensitive_files_line_lists_every_builtin_rule (the doctor line lists every rule).

Testing

cargo fmt, clippy --workspace --all-targets --all-features -D warnings, cargo test --workspace twice, tole-core --no-default-features: green. Not changed: the read_file_raw tool description in read_file.rs still names the six original patterns; it is part of the tool spec wire size, so it is left for its own change.

Refs #683

The line listed the six original names and drifted after #683. The matcher and the report now share one list, with a test for each.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 0a2c03a into develop Nov 14, 2026
19 checks passed
@ajianaz
ajianaz deleted the fix/doctor-sensitive-files branch November 20, 2026 08:38
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.

2 participants