Repository navigation
fix: parse space-separated allowed-tools strings (fixes #327) - #330
Conversation
rng1995
left a comment
There was a problem hiding this comment.
[Automated SkillSpector Review]
Requesting changes. The space-separated allowed-tools behavior is correct and its focused tests pass (11 tests), but the exact patch fails the repository format gate: ruff format --check reports that src/skillspector/nodes/build_context.py would be reformatted. Please run Ruff format on that file and update the PR.
|
@Bimpebabs - Please address review comments, CI failures and resolve merge conflicts. |
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Re-review: still requesting changes. The prior formatting blocker remains visible in the patch and the current lint check is failing; DCO also fails. Please run the repository formatter on the touched Python files, restore green lint, and sign off the commits. The allowed-tools parsing behavior and unit tests otherwise remain sound.
|
Powered by Codex: PR council review result. This is a triage signal, not a maintainer approval.
|
|
@Bimpebabs - Please address my review comments, resolve merge conflicts and ping me for approval to merge. |
|
Hi @rng1995 -- thanks for the thorough review, and apologies for the delay in getting back to this. I've addressed all the review comments: Formatting -- Ran Lint -- DCO -- Commit is now signed off: Merge conflicts -- Rebased onto latest The parsing logic and tests are unchanged from the original review -- the only delta in this push is the formatting fix and the DCO signoff. Ready for re-review whenever you have a moment. Thanks again! |
Signed-off-by: Adebimpe Babsalaam <bbabs@github>
d50eea6 to
8dc4acb
Compare
|
Hi @rng1995 - I've addressed all the review comments and resolved the merge conflicts. This is ready for your review and approval to merge. What changed in this push
Tests - the four focused tests are retained and pass locally: three in Comma-separated and list declarations behave exactly as before; the only new behavior is that a space-separated string is no longer treated as a single tool name. Ready to merge whenever you get a chance - thanks! |
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Re-review: the formatting and DCO blockers are addressed. Both manifest-normalization paths now accept whitespace-separated allowed-tools values while preserving list and comma-separated behavior; focused Ruff checks are clean, 91 focused tests pass, all required checks are green, and the branch merges cleanly with current main. Approved.
The path-scoped rule for build_context.py and mcp_least_privilege.py told a reader that allowed-tools is split on commas only and must not be fixed. Upstream 1b87593 (NVIDIA#330) made both parsers accept the space-separated form, and the 2.12.0 sync took it, so the rule was steering work against the code. Measured: "Read Write Bash" now derives file_read, file_write and shell. The rule keeps the half that is still true -- scoped syntax such as Bash(git:*) maps to no capability -- and the design document and README say the separator is closed rather than deliberately unfixed. Riding along, each exposed by the same sync: - test-provider accepts gemini; CLAUDE.md and the tests rule listed three. - The analyzers rule called DEVELOPMENT.md's registration steps an omission. They are upstream text that contradicts the discovered registry, and the rule now says which side wins. - CLAUDE.md names the Node extension tests, which neither pytest nor make runs, and the Pi extension rule also loads for .opencode/tools. Signed-off-by: Rodrigo França <20980109+rodrigorjsf@users.noreply.github.com> Claude-Session: https://claude.ai/code/session_01MnmBpZQ83pCoXJTvmStS8t
Fixes #327
What
Fixes the
allowed-toolsparsing bug where space-separated tool names were treated as a single tool, causing false positives on fully-declared skills.Why
The current parsing splits on commas but not whitespace. A declaration like
allowed-tools: Bash Readis parsed as a single tool namedBash Read, which never matches any actual tool name. This causes the LP1 check to fire on skills that have correctly declared their tools.How
build_context.py: split theallowed-toolsstring on whitespace (spaces, tabs, newlines) when no comma is present. Comma-separated strings continue to work as before.mcp_least_privilege.py: same fix in_normalize_allowed_toolsfor consistency.Testing
Manual verification
Tested on: Windows 11, Python 3.14
Steps:
allowed-tools: Bash Read(space-separated)skillspector scanon the test skillallowed-tools: Bash, Read(comma-separated) — backward compat confirmedallowed-tools: [Bash, Read](list form) — backward compat confirmedResult: PASS — space-separated parsed correctly, LP1 false positive eliminated, backward compatibility maintained.