CM-69233 ai guardrails respect ignores#499
Open
Ilanlido wants to merge 3 commits into
Open
Conversation
Two fixes so AI guardrails honors .cycode/config.yaml exclusions like regular scans do: - Gate hook block/warn decisions on issue_detected (post-exclusion) instead of the raw detections_count, so detections ignored by value/sha/rule no longer trigger a block claiming 0 violations. - Skip the file-read content scan when the file path is covered by a configured path exclusion (cycode ignore --by-path), reusing the same check as the file collector. Co-Authored-By: Claude Fable 5 <[email protected]>
…tials test_set_credentials_update_only_client_id left update_oidc_credentials unmocked, so every test run wrote client_id='new client id' into the developer's real ~/.cycode/credentials.yaml. Rewrite the file in seeded-files style: run everything on pyfakefs, seed real YAML files as the current state, mock only typer.prompt, and assert on final file contents instead of writer-method calls. This exercises the real managers/YAML layer and can't miss an unmocked writer by construction. The typer app is converted to a click command once at import time — building it under pyfakefs breaks typer's pathlib.Path parameter introspection (fake Path is not a subclass of the real one). Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
The test seeded a hardcoded POSIX exclusion path, but is_sub_path compares the raw stored path against os.path.commonpath of the absolutized paths - on Windows abspath adds the drive prefix, so '/project/secrets' never matched. Build the paths with os.path.abspath/join the way stores them. Co-Authored-By: Claude Fable 5 <[email protected]>
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.
Two fixes so AI guardrails honors .cycode/config.yaml exclusions like
regular scans do:
instead of the raw detections_count, so detections ignored by
value/sha/rule no longer trigger a block claiming 0 violations.
configured path exclusion (cycode ignore --by-path), reusing the same
check as the file collector.