Skip to content

feat(checks): add tools-duplicate rule for within-field repeated tools - #43

Merged
protosphinx merged 2 commits into
mainfrom
bot/tools-duplicate-check
Jul 14, 2026
Merged

feat(checks): add tools-duplicate rule for within-field repeated tools#43
protosphinx merged 2 commits into
mainfrom
bot/tools-duplicate-check

Conversation

@protosphinx

Copy link
Copy Markdown
Member

Summary

  • Adds a new tools-duplicate check that warns when the same tool appears more than once within a single tools: or allowed-tools: field.
  • Adds the corresponding tools-duplicate entry to the SARIF RULES catalog so GitHub Code Scanning gets stable metadata for the rule.
  • Adds 6 tests covering the new rule: duplicate in allowed-tools, duplicate in legacy tools array, message content, no-warn on clean lists, no-warn for cross-field duplication (already covered by tool-fields-ambiguous), and no-warn on invalid frontmatter.

Motivation

combineTools silently deduplicates tools across and within fields, so an author writing allowed-tools: Read Edit Read never learns that their second Read is a no-op. This check surfaces the problem explicitly before deduplication happens.

Self-merge gate checklist

  • CI green
  • LOC delta < 250 (95 lines added, 0 removed in source/tests)
  • No public API change (new diagnostic rule only; no type or export changes)
  • No runtime dependencies added
  • No workflow files touched
  • Tests included (6 new test cases, all passing)

Generated by Claude Code

claude added 2 commits July 13, 2026 16:12
… tools

When an author writes `allowed-tools: Read Edit Read`, combineTools silently
drops the second Read. The new tools-duplicate check surfaces this as an
explicit warning before the deduplication happens so authors learn about
the redundant entry rather than having it silently disappear.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Me9172bjbsRuEnq6RV7JKP
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Me9172bjbsRuEnq6RV7JKP
@protosphinx
protosphinx merged commit 3e8a694 into main Jul 14, 2026
3 checks passed
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