Skip to content

fix(ea1): bound wildcard-tool-access match to a single line and a sta… - #417

Open
benedictkwok wants to merge 1 commit into
NVIDIA:mainfrom
benedictkwok:fix/ea1-wildcard-line-boundary
Open

fix(ea1): bound wildcard-tool-access match to a single line and a sta…#417
benedictkwok wants to merge 1 commit into
NVIDIA:mainfrom
benedictkwok:fix/ea1-wildcard-line-boundary

Conversation

@benedictkwok

Copy link
Copy Markdown

…ndalone asterisk

Two independent EA1 false positives, both confirmed against the official anthropics/skills repo (mcp-builder/SKILL.md):

  • The pattern used bare \s* between the colon and the expected wildcard value. Python's \s matches newlines, so the gap could span a blank line and bridge two unrelated headings ("For each tool:" + blank line + "Input Schema:"). Changed to [ \t]* so the match is bounded to a single line.

  • Nothing required the matched * to be a standalone token, so the first

    • of a closing ** bold-markdown span satisfied it ("API Coverage vs. Workflow Tools:" matched as "Tools:*"). Added a negative lookahead (?!*|\w) so the asterisk must not be immediately followed by another asterisk or a word character.

New test file added (test_ea1_wildcard_line_boundary.py) covering both false-positive cases plus regression tests confirming genuine single-line wildcard grants (tools: "", tools: [], permissions: '*', tools: *) still fire.

Testing:

  • make test (unit + integration): 2804 passed, 31 passed, 0 failed
  • make lint: clean
  • make format: clean

Closes #405

…ndalone asterisk

Two independent EA1 false positives, both confirmed against the official
anthropics/skills repo (mcp-builder/SKILL.md):

- The pattern used bare \s* between the colon and the expected wildcard
  value. Python's \s matches newlines, so the gap could span a blank line
  and bridge two unrelated headings ("For each tool:" + blank line +
  "**Input Schema:**"). Changed to [ \t]* so the match is bounded to a
  single line.

- Nothing required the matched * to be a standalone token, so the first
  * of a closing ** bold-markdown span satisfied it ("**API Coverage vs.
  Workflow Tools:**" matched as "Tools:*"). Added a negative lookahead
  (?!\*|\w) so the asterisk must not be immediately followed by another
  asterisk or a word character.

New test file added (test_ea1_wildcard_line_boundary.py) covering both
false-positive cases plus regression tests confirming genuine single-line
wildcard grants (tools: "*", tools: [*], permissions: '*', tools: *)
still fire.

Testing:
- make test (unit + integration): 2804 passed, 31 passed, 0 failed
- make lint: clean
- make format: clean

Closes NVIDIA#405

Signed-off-by: Benedict Kwok <bkwok.oracle@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant