[sergo] Sergo Report: STABLE-71 cached-vein node_filter_too_narrow + 7-linter new-explore - 2026-09-16 #61266
Closed
Replies: 1 comment
|
This discussion was automatically closed because it expired on 2026-09-17T04:00:06.225Z.
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Executive summary
Run 68. Registry held stable at 71 registered analyzers — no new linter this cycle. All 7 issues open going into this run were confirmed still open and unfixed via
gh api, so no reverse-phantom reconciliation was needed this time. This run exploration produced 1 code-verified, high-confidence finding: two CI-enforced linters (globwalkignorederror,strconvparseignorederror) share an identical AssignStmt-only blind spot that a sibling linter (jsonmarshalignoredeerror) already fixed years ago — a clean textbook case of thenode_filter_too_narrowpattern class recurring in never-before-audited code.Tool and registry status
Strategy: 50/50 split
Cached vein (50%): Reused the node_filter_too_narrow pattern class, first documented from jsonmarshalignoredeerror (issue #39982: an AssignStmt-only node filter misses a bare ExprStmt call that discards all return values with no assignment at all). Searched every linter in pkg/linters/ for the exact nodeFilter AssignStmt-only shape used by that historical bug, to check whether the fix had been propagated to siblings sharing the same design.
New exploration (50%): First-ever solo audit of 7 linters that had never individually been the subject of a bug-report issue — globwalkignorederror, strconvparseignorederror, sprintferrorsnew, regexpcompileinfunction, sortslice, stringreplaceminusone, rawloginlib. These had only appeared in batch enforce-readiness issues or as passing mentions, never a dedicated deep read.
Targets: find at least 1 code-verified, non-duplicate finding; avoid re-filing anything already tracked or already ruled intentional.
Findings
Both linters register only AssignStmt and require the exact v, _ colon-equals f() shape (Lhs len 2, Rhs len 1, Lhs index 1 blank). Neither has a branch for a bare call statement — os.ReadDir(dir) or strconv.Atoi(s) used as a standalone ExprStmt — which is legal Go and silently drops every return value, an even more complete version of the exact failure both linters exist to catch. The sibling jsonmarshalignoredeerror hit this identical gap (issue #39982) and was fixed by adding an ExprStmt case (checkDiscardedJSONExpr). Neither globwalkignorederror nor strconvparseignorederror has that branch, and neither has any ExprStmt test fixture. Both are wired into .github/workflows/cgo.yml LINTER_FLAGS for native and wasm CI with -test=false — they are meant to be a complete gate. No live production site currently triggers this (checked via grep across pkg/), so it is a latent enforcement hole rather than an active false negative, but it is a silent gap in an already-enforced check.
Grepping errors.New with a bare identifier argument across pkg/ turned up 6 live production sites (pkg/cli/grype.go:221, pkg/cli/grant.go:153, pkg/workflow/engine.go:695, pkg/workflow/engine_definition.go:655, pkg/workflow/engine_inline_definition_validation.go:74, pkg/workflow/runtime_validation.go:93) where a fmt.Sprintf result is assigned to a variable and then passed to errors.New, escaping detection because the linter only matches a directly-nested fmt.Sprintf(...) call. This looked promising at first, but the testdata for this linter explicitly documents the behavior as deliberate scope (goodVariable fixture, comment: uses a pre-built string variable, not flagged by this linter). Filing this as a bug would contradict a design decision already made and recorded in the test suite, so it was set aside rather than filed.
Task generated
Add an ExprStmt branch to globwalkignorederror and strconvparseignorederror, mirroring the existing checkDiscardedJSONExpr pattern in jsonmarshalignoredeerror, plus one ExprStmt-shaped testdata case per linter to lock in coverage.
Issue created
globwalkignorederror + strconvparseignorederror: AssignStmt-only filter misses bare ExprStmt discards (sg68a1, labeled sergo)
Metrics this run
Historical context
Open sergo-labeled issues carried into next run (8 total): sg68a1 (new), sg67a2 (#61024, blankassigncomma allow-list gap), sg67a1 (#61023, nolint space-prefix directive still silently dropped), sg66a1 (#60738, bufioscannererunchecked block-scope gap), sg64a1 (#60367, slicemakezerolength var-vs-make), sg63a1 (#60170, bufferresetbeforereuse block isolation), sg62a1 (#59875, manualmutexunlock 2+-level selector collapse), sg61a1 (#59627, 4-linter main-guard gap).
Recommendations and next-run focus
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
api.anthropic.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
All reactions