fix: retune precision false positives - #81
Merged
Conversation
alxxjohn
added a commit
that referenced
this pull request
Jul 28, 2026
🤖 I have created a release *beep* *boop* --- ## [1.3.5](v1.3.4...v1.3.5) (2026-07-28) ### Bug Fixes * cover remaining precision retunes ([1fd6f2b](1fd6f2b)) * retune precision false positives ([6a09863](6a09863)) * retune precision false positives ([#81](#81)) ([a63ff23](a63ff23)) * split defensive sequence collision signal ([c734e9a](c734e9a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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
This PR retunes CodeGuard's local quality precision checks to reduce high-volume false positives from common TypeScript/JavaScript, React, Next.js, and API-boundary patterns while preserving the intended production-readiness signals.
What changed
Hardened
function.hidden-mutationso local scratch mutation in pure builders/parsers is not treated as hidden mutation.Set.add,Map.set,array.push,.sort,.split().pop(), object accumulation, and Cheerio cleanup when the function returns a derived value.Retuned
function.command-query-mixfor query-safe builder/parser patterns.Improved boundary/resource validation recognition.
z.safeParse, helper-returned validated values, NextResponse early-return guards,new URL(...)plus protocol allowlists, shared upload validators, and imported byte-limit constants.Content-Lengthpreflight, explicittake/limit,slice, count/size/byte guards, and bounded response byte-length checks fordefensive.missing-resource-limit.Split sequence-allocation risk from arithmetic overflow.
defensive.sequence-collision-riskfor count-derived external ID allocation without guarded unique-collision retry.defensive.integer-overflow.Reduced naming and smell noise.
show*,matches*,visible,active,open,selected,enabled.krs,docs, andids.smell.switch-on-type.Added rule metadata and documentation.
defensive.sequence-collision-riskin the rule catalog and fix-template catalog.docs/checks.mdso users can discover the new defensive rule.Tests
Validation
go test ./tests/checks -run 'TestDefensive(Integer|Resource)|TestRulesCatalog' -count=1go test ./tests/checks -count=1go test ./...golangci-lint runmake codeguard-ci