[sergo] Sergo Report: Gap-Recovery & Named-Type Message Audit - 2026-08-15 #52827
Closed
Replies: 1 comment
|
This discussion has been marked as outdated by Sergo - Serena Go Expert. A newer discussion is available at Discussion #53032. |
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
This run (R61) opened with a major memory-gap discovery: the
pkg/linters/registry grew from 43 to 64 analyzers (+21) since the last recorded Sergo memory update (R60, 2026-07-08), via thelinter-minerdaily automation, with issue numbers climbing from roughly #43465 to #52627 in between — meaning many runs happened without repo-memory being persisted. This run prioritized (1) reconciling all currently-opensergo-labeled issues against live code before doing any new exploration, and (2) a fresh finding instringbytesroundtrip, following a strict 50/50 cached-reuse / new-exploration split. One new issue was filed; three existing open issues were verified still valid and were not re-filed.Tool Updates
pkg/linters/registry.go: 64 analyzers registered (was 43 at last recorded check).doc.go's "All 64 active analyzers" header was cross-checked line-by-line against theallAnalyzersslice and confirmed accurate — no doc-sync bug this run, despite that being a historically recurring bug class.internal/filecheck.ShouldSkipFilenamenow callsIsTestFileinternally and is used uniformly across linters — this obsoletes the oldsuppression_enforce_gapmemory pattern (previously: some linters were missing test-file skip checks). Memory updated to reflect this.Strategy & Split (50/50)
Cached-reuse (50%): Pulled the 3 currently-open
sergoissues viagh api .../issues?labels=sergo&state=openand re-read the exact flagged code paths to confirm each is still unfixed before deciding whether to act on them further:httpnoctx) — confirmed still present.hasContextInEnclosingFunciterates all enclosingFuncDecl/FuncLitancestors viacursor.Enclosingwithout breaking at the nearestFuncLitboundary, unlike the corrected siblingexeccommandwithoutcontextpattern (fixed under execcommandwithoutcontext: enclosing-scope walk crosses non-go/defer FuncLit boundaries — false positives + misleading fix (same [Content truncated due to length] #43683) and unlike this repo's own correctly-implementedstringsconcatloop.enclosingLoop/goroutinemissingrecover.containsRecoverCall. Valid, left open.regexpdynamicpattern) — confirmed code is clean and type-resolved; still just awaiting a CILINTER_FLAGSwire-up. Valid, left open.hardcodedfilepath) — confirmed theExported()-only filter incollectKnownPathConstsstill excludes same-package unexported constants. Valid, left open.probeN-DELETE-MEissues (probe3-DELETE-ME #52229-52231) identified as test artifacts, not real findings — ignored.New exploration (50%): Read ~15 linter implementations not previously covered in recent memory (
stringbytesroundtrip,mapclearloop,stringsconcatloop,regexpdynamicpattern,goroutinemissingrecover,nilctxpassed,internal/nolint,internal/coverage,httpnoctx, plus re-verifyingwritebytestring's prior fix) looking for the recurringexact-type-vs-Underlying()assignability bug class first surfaced in sg60a1.Findings
New issue filed:
stringbytesroundtrip'sreportRedundantRoundTriphardcodes the literal diagnostic text"string([]byte(...))"regardless of the actual outer/inner conversion's type names, because its type check (roundTripUnderlyingTypes) only compares.Underlying(). A round-trip built from named types (e.g.myString([]byte(ms))) is flagged with a message that doesn't match the source and implies both conversions can be bare-removed — which fails to compile for named types, per Go assignability rules. This is the same root-cause bug class assg60a1(writebytestring, already fixed viaisExactString), but here it has noSuggestedFixto catch it at compile time, so it manifests purely as an inaccurate/misleading diagnostic message. Distinct from the already-closed #47704, which covered the other round-trip arm ([]byte(string(b)), a false-positive-verdict bug, not a message-accuracy bug).testdata/.../stringbytesroundtrip.go:30-36'sbadNamedTypescase only assigns the flagged expression to_, so this gap has no golden-file coverage.Verified clean (no finding filed):
mapclearloop(Go-version gating of theclearbuiltin — theoretical, non-actionable since this repo'sgo.modalready targets go1.26.5),stringsconcatloop(enclosingLoopcorrectly stops atFuncLitboundaries),regexpdynamicpattern(constant-pattern and package-identity detection both correct),goroutinemissingrecover(containsRecoverCallcorrectly FuncLit-scoped),nilctxpassed(correct variadic + exact-type nil/context handling),internal/nolintandinternal/coverage(no defects found).Generated Tasks
stringbytesroundtrip.reportRedundantRoundTripto use the actual outer/inner conversion type names in its message (mirroringwritebytestring.isExactString), and add a named-outer-type testdata case. (New issue filed this run.)httpnoctxFuncLit-boundary crossing) using the sameisGoOrDeferClosure-style guard already proven inexeccommandwithoutcontext(execcommandwithoutcontext: enclosing-scope walk crosses non-go/defer FuncLit boundaries — false positives + misleading fix (same [Content truncated due to length] #43683).regexpdynamicpattern(regexpdynamicpattern: zero-violation, type-resolved linter ready for CI enforcement — missing from LINTER_FLAGS #52429) into.github/workflows/cgo.yml'sLINTER_FLAGS— it is clean and CI-enforcement-ready.Metrics
Historical Context
The registry has nearly doubled in analyzer count since the last memory checkpoint (43→64), which strongly suggests several Sergo runs occurred in the interim without their strategy/stats being persisted back to
memory/sergo. This run's memory writes prioritize correcting that drift (registry count, obsoletesuppression_enforce_gappattern, current open-issue state) within the 10KB total patch-size budget, using surgical edits and an append-only strategy log rather than full-file rewrites.Recommendations & Next-Run Focus (R62)
exact-type-vs-Underlying()assignability bug class (now confirmed to recur across at least two linters:writebytestring,stringbytesroundtrip).All reactions