Repository navigation
fix(ea1): reject footnote-legend '*', bound pre-colon gap, detect YAML block-list and JSON wildcard grants - #447
yashrajp22 wants to merge 134 commits into
Conversation
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Requesting changes: the new same-line list branch introduces an EA1 false positive when an explicit tool object has a nested argument value of "*"; the wildcard must be a top-level tool-list element. The focused suite passes, but this head has no hosted checks, and the feature commit also lacks the required DCO sign-off. Please add the nested-object regression, narrow the match, and rerun signed CI.
…ck-list and JSON wildcard grants Fixes #444. Fixes #445. Follow-up to #405/#417. Remaining false positives (#444): - A bare '*' now counts only when it ends the line (optionally ']' and/or a '#' comment), so footnote legends like 'Tools: * = requires auth' no longer fire. Quoted '*' stays unambiguous as a scalar or top-level list element. - The gap before the colon is bounded to the same line ([ \t]*:), so a blank line followed by a markdown definition-list ': *' can no longer bridge paragraphs. Detection gaps (#445): - The key may be quoted, catching JSON forms: "tools": ["*"] and "permissions": "*". - New block-list branch catches the idiomatic YAML form (tools: newline '- "*"'), bounded to a single newline with a standalone-star item so markdown lists of bold/italic names cannot collide. - A quoted '*' as a later top-level element of a same-line list now matches (tools: ["search", "*"]). The list branch excludes braces so a '*' nested inside an explicit tool object (tools: [{name: grep, pattern: "*"}]) is treated as an argument value for a named tool, not a wildcard grant. Validated against a 49-case matrix (20 genuine grant forms, 11 new detections, 18 false-positive classes); full suite 2966 passed, ruff check/format clean. Signed-off-by: yashrajbasav <yashrajbasav@nvidia.com>
6a2a7d4 to
a6b1d91
Compare
|
All three points addressed in the rewritten head ( 1. Nested-object false positive — fixed and regression-tested. The same-line list branch now excludes
One documented non-detection this implies: a top-level 2. DCO — the branch was rewritten with 3. CI — the branch is rebased onto current |
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Re-review: the rewritten head is signed, rebased directly onto current main, and all hosted checks are green. It fixes the reported nested-object case, and the focused and relevant static-pattern suites pass. However, the same list regex still descends into nested arrays because [ remains allowed in its scan: tools: ["search", ["grep", "*"]] still emits EA1/MEDIUM even though * is not a top-level tool-list element. Please prevent traversal into nested arrays and add this negative regression; the existing review thread remains open.
The same-line list branch excluded '{'/'}' but still allowed '[', so a
quoted '*' inside a nested array (tools: ["search", ["grep", "*"]])
was treated as a top-level tool-list element. Exclude '[' from the scan
as well and document the quoted-delimiter ceiling. Adds the nested-array
and nested-arguments-object negative regressions from review.
Signed-off-by: yashrajbasav <yashrajbasav@nvidia.com>
|
Fixed in
Local on the rebased head: 3,995 passed / 0 failed ( |
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Reviewed current head 375eafe12a76f073efbc1167319e7bb8636c7a59. The prior nested-object and nested-array EA1 false positives are both resolved by the current delimiter handling, with regressions for each shape. I found no remaining required code or test change.
This head was refreshed by the bot during review and has no hosted check results yet. The PR is currently blocked, and the outdated review thread should be resolved before merging.
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Corrective re-review of current head 3f6f63a3cd1d104dcb35fd1d7858d86461aaaacf. A required EA1 correctness issue remains: the inline-list branch treats a quoted wildcard embedded inside a named tool string as a top-level unrestricted-tool grant. Please make the matcher element/quote-aware and add the negative regression described inline.
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Re-reviewed current head f66907ab24d01c7acd9911d81eb9b9331959ff6f after the latest main synchronization. Both PR-owned blobs are byte-identical to reviewed head 3f6f63a3cd1d104dcb35fd1d7858d86461aaaacf; the current inline thread remains unresolved and has no reply. The blocker therefore remains: the same-line list regex is not quote-aware and still treats the embedded '*' in tools: ["grep --include='*'"] as a top-level unrestricted-tool grant. Make the matcher element/quote-aware and add that negative regression.
This head has no hosted check results and is not merge-ready.
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Re-reviewed current head e92374e86a91d709c02a1261bc3e2ead9b42d818 after the marked review at f66907ab24d01c7acd9911d81eb9b9331959ff6f. Both PR-owned blobs are byte-for-byte unchanged. The earlier nested-object and nested-array false positives remain fixed.
The current blocker at static_patterns_excessive_agency.py:61 remains: the inline-list regex is not quote-aware and treats the embedded '*' in tools: ["grep --include='*'"] as a top-level unrestricted-tool grant. Make list matching element/quote-aware and add this negative regression. The current inline thread already contains the exact case.
No required checks are reported, unresolved review threads remain, and GitHub reports mergeStateStatus=BLOCKED.
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Decision: Approved
Value and readiness: The focused wildcard grammar still resolves the quoted-star false positive while preserving actual EA1 grants. Re-reviewed the rebased head against the true persisted reviewed commit; both PR-owned files are byte-identical. No required source change remains.
Material findings: The complete two-file patch retains the same-line pre-colon bound, footnote/prose exclusions, quoted-key and first-item block-list coverage, and complete comma-separated scalar matching. Double-quote escapes and YAML doubled single quotes keep grep --include='*' inside one named tool value. Nested arrays/objects remain excluded, with negative controls; genuine standalone and later inline wildcard elements have paired positives. EA1_CODE_PATTERNS and the code/prose dispatch remain intact. All previously required quote/nesting fixes remain resolved, and both historical threads are resolved. No new blocker found.
PIC tradeoffs: Block-list matching intentionally handles only the first item, as scoped in #445. Nested semantic structures remain outside this narrow grammar. No new product decision identified.
Verification and gaps: Read the full current diff, both exact-head files, byte comparisons to persisted reviewed head 10d950f047e29ab8ae29241cd288f371921cb3bb, prior required-finding history/replies and #444/#445. Existing regressions cover malformed scalar forms, quoted argument stars, nested structures and real grants. No hosted checks attach to this head; author-reported source/wheel tests do not establish current hosted validation, so CI remains a merge blocker. No contributor code, tests, snippets, imports, builds, setup, hooks, regex probes or scanner invocations executed.
Reviewed head: 58408e9c15b01152a92059e6836d7e0da56e3bf9.
Named tool commands containing quoted stars, such as
grep --include='*', are now kept separate from unrestricted wildcard grants. The matcher respects complete comma-separated values, quotes, and escapes, while nested objects and arrays remain excluded.Validation: 297 focused tests passed from source and a fresh installed wheel. The new cases reproduce 11 failures on the previous code; genuine wildcard grants remain detected.