Add detector invariants project rule#4922
Open
dustin-decker wants to merge 1 commit intomainfrom
Open
Conversation
Capture the detector contracts around verification, result identity, redaction, and tests so reviewers catch compatibility and sensitivity regressions consistently.
| - Verifiers must use non-destructive API checks and never leak secret keys, tokens, or passwords into errors. | ||
| - `Raw` and `RawV2` are compatibility boundaries. Single-part credentials use `Raw` only, set to the token. Multi-part credentials set `Raw` to the key or secret value and `RawV2` to every piece needed for verification, including varying URL or host, IDs, and token. Once defined, do not change the shape or effective value. | ||
| - `Redacted` is display-only and must stay non-sensitive. When a stable key, account, or credential ID exists, set `Redacted` to that ID; never put the actual secret value there. | ||
| - `SecretParts` is the credential source of truth, and analyzer-facing keys must stay aligned with what analyzers expect. |
Contributor
There was a problem hiding this comment.
If the corresponding analyzer isn’t available in OSS, will Bugbot flag this as unnecessarily setting SecretParts, given it can’t validate the expected keys?
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.
Summary
.cursor/rules/detector-invariants.mdc. These will apply for Cursor users but also Bugbot CI automation.Raw/RawV2,Redacted,SecretParts, result cleaning, and concurrency safetyTest plan
pkg/detectors/**/*.go.mdcfile has no linter errorsNote
Low Risk
Low risk because this PR only adds a Cursor project rule file and does not change runtime code or detector behavior.
Overview
Adds a repo-local Cursor rule,
.cursor/rules/detector-invariants.mdc, scoped topkg/detectors/**/*.go, to guide detector reviews.The rule codifies invariants around verification semantics (including
VerificationErrorusage), secret redaction/non-leakage,Raw/RawV2compatibility boundaries,Redacted/SecretPartsexpectations, result-cleaning behavior, andFromDataconcurrency/test-matrix requirements.Reviewed by Cursor Bugbot for commit 10db740. Bugbot is set up for automated code reviews on this repo. Configure here.