fix(analyzers): reduce false positives for negated safety constraints#254
Open
koriyoshi2041 wants to merge 1 commit into
Open
fix(analyzers): reduce false positives for negated safety constraints#254koriyoshi2041 wants to merge 1 commit into
koriyoshi2041 wants to merge 1 commit into
Conversation
Signed-off-by: kigland <shuaizhicheng336@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #251
Problem
Static scans can currently turn benign safety-policy prose into high-risk findings. In a local fixture, text such as
must not access credentialsandDo not modify this skill's own files, plus scoped cleanup of this tool's own cache path, producedPE3,RA1, andTM1findings with a HIGH / DO_NOT_INSTALL recommendation.Fix
This adds regression coverage for that false-positive class and narrows the static filters so:
PE3andRA1matches are skipped when the matched phrase is explicitly negated in nearby policy prose.${HOME}/.cache/...or~/.cache/...is treated like the existing low-risk cache cleanup path instead of destructive arbitrary deletion.Test
I also re-scanned the local benign fixture after the patch:
score=0,severity=LOW,recommendation=SAFE,finding_count=0.Risk
The negation guard is intentionally narrow:
PE3andRA1only. The cache-cleanup handling is scoped to user cache paths, not arbitrary recursive deletion. This addresses a concrete subset of #251 rather than every false-positive case in that issue.