[sergo] Sergo Report: 50-50 Registry-Refactor-Reverify + Manualpathconcat-First-Audit - 2026-08-23 #54984
Closed
Replies: 1 comment
|
This discussion was automatically closed because it expired on 2026-08-24T04:09:02.297Z.
|
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
R61 found the linter registry has grown substantially since the last recorded run (R60, 2026-07-08): 42/43 → 67 registered analyzers, via a refactor that moved analyzer registration out of
cmd/linters/main.go(now a two-linemultichecker.Main(linters.All()...)shim) into a newpkg/linters/registry.go. This broke the old delta-detection heuristic (grep -c Analyzer main.go), which is now replaced withgrep -c Analyzer pkg/linters/registry.gocross-checked against thedoc.goheader count.All 196 historical
sergo-labeled issues are closed (zero open pre-run) — the team keeps pace with findings. Cross-referencing every issue title against the 67 registered linters turned up exactly one analyzer that has never been the subject of a Sergo issue:manualpathconcat. Deep-diving it surfaced a genuine, evidence-backed coverage gap, filed as a new issue.Tool & registry changes
pkg/linters/doc.go's "67 active analyzers" header and 67 linter subdirectories underpkg/linters/.cmd/linters/main.gono longer contains per-analyzer wiring; it now delegates topkg/linters.All()inpkg/linters/registry.go. The oldgrep -c Analyzer main.godelta detector is dead and has been replaced in memory.Strategy: 50/50 split
Cached reuse (50%) — re-verify previously-filed, high-confidence bug classes rather than re-discovering them:
sg60a1(writebytestring'sisExactStringcompile-correctness bug from R60): landed correctly —isExactStringnow type-asserts*types.Basicon the raw (non-.Underlying()) type, correctly distinguishingstringfrom named string types before emitting theio.WriteStringautofix.stringbytesroundtrip(issue stringbytesroundtrip: isExactString is a no-op alias of isStringType — latent risk of the sg60a1 (writebytestring) bug class #54718, "isExactString is a no-op alias"): also fixed correctly — it resolves type aliases viatypes.Unaliasbefore the same raw-type*types.Basiccheck, matching its own doc comment precisely.New exploration (50%) — target completely unaudited territory:
sergoissue titles.manualpathconcat(flags manualdir + "/" + file-style path concatenation, suggestingfilepath.Join) had zero prior coverage — genuinely novel target.Findings
manualpathconcat: the+=(compound-assignment) form of manual path concatenation is structurally undetectable.matchSlashSeparator(pkg/linters/manualpathconcat/manualpathconcat.go:86-105) requires the left operand of the outer+to itself be a*ast.BinaryExprending in a"/"literal. This holds forX + "/" + Ychains, butx += "/" + ydesugars to anAssignStmt{Tok: ADD_ASSIGN}whose RHS is only the two-operand expression"/" + y— there is no nestedBinaryExprfor the matcher to find, because the implicitx +prefix from+=never materializes in the AST.pkg/workflow/checkout_config_parser.go:316—absPath += "/" + relPath— goes completely unflagged today.stringsconcatloop(stringsconcatloop: ADD_ASSIGN-only matcher lets contributors bypass the lint rule withx = x + y— already happening in open P [Content truncated due to length] #49046), which originally matched only theADD_ASSIGNform and missed plain+. Here the gap runs the opposite direction.manualpathconcatis not yet wired into.github/workflows/cgo.yml'sLINTER_FLAGS, so this is a good time to close the gap before CI enforcement is turned on.Task generated
manualpathconcat'sADD_ASSIGNblind spot — add an*ast.AssignStmtcase that recognizesx += "/" + y, reusing the existingisSlashLiteralhelper against the RHS'sXoperand directly (rather than requiring it to be a nestedBinaryExpr), with a new testdata case and re-audit ofpkg/for other+=-form manual joins. Effort: small, single-file.Issue created
manualpathconcat: += form of manual "/" path concatenation is never detected(labeledsergo,temporary_id: #54983)Metrics
Historical context (last 3 recorded strategies)
FuncLit-boundary audit —execcommandwithoutcontextover-attributed outer context across closure boundaries (execcommandwithoutcontext: enclosing-scope walk crosses non-go/defer FuncLit boundaries — false positives + misleading fix (same [Content truncated due to length] #43683). Score 9.ident.Nameinstead of usingastutil.IsPkgSelector(Linter precision (regression): the syntactic stdlib-package-match migration never landed — 5 holdouts remain, 3 CI-enforced (#40 [Content truncated due to length] #43934, landed). Score 9.writebytestring) audit —SuggestedFixemitted non-compiling code for named string types (#aw_sg60a1). Score 9.manualpathconcat, finding a realADD_ASSIGNcoverage gap. Score 8.Recommendations & next-run focus (R62)
grep -c Analyzer pkg/linters/registry.go(notmain.go) as the linter-count delta detector going forward.ADD_ASSIGN,IncDecStmt, composite literals) that achieve the same semantic effect as the linter's primary target pattern but bypass the AST shape it matches on.All reactions