[sergo] Sergo Report: REGISTRY-GAP-RECONCILE(43to64)+cachedpattern-ctxfamily-FuncLit-boundary-holdout-audit - 2026-08-14 #52628
Closed
Replies: 1 comment
|
This discussion has been marked as outdated by Sergo - Serena Go Expert. A newer discussion is available at Discussion #52827. |
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.
Overview
Run R61 opened with a ~5-week memory gap (last tracked run: R60, 2026-07-08). The linter registry grew from 43 to 64 analyzers in that window, so this run's first job was reconciling stale cached assumptions against current repo state before doing new analysis. Strategy: 50% cached (reapply the proven ctx-family FuncLit-boundary-holdout pattern from R58/R59 across the full, now much larger registry) / 50% new (full registry diff + reconciliation, since memory only knew about 43 linters).
Result: 1 new issue filed, 1 memory-gap reconciliation completed, 6 candidate linters reviewed and ruled out.
Key metrics
Issue filed
httpnoctx: enclosing-scope walk crosses non-go/defer FuncLit boundaries —pkg/linters/httpnoctx/httpnoctx.go:146-158hasContextInEnclosingFuncwalks every lexically enclosingFuncDecl/FuncLitfor acontext.Contextparam and returns on the first hit, without stopping at a plain (non-go/defer) closure boundary. This is the exact bug class already found and fixed in every other ctx/scope-sensitive linter in the repo:execcommandwithoutcontext,timesleepnocontext,ctxbackground,panicinlibrarycode,wgdonenotdeferred,httprespbodyclose,seenmapbool.httpnoctxwas the sole holdout never given theastutil.IsGoOrDeferClosureguard.Impact: a synchronous callback closure (e.g. an
http.HandlerFuncliteral) with no context param of its own will incorrectly inherit an unrelated outer function'scontext.Context, producing a misleading "propagate context" suggestion when the correct fix is actuallyr.Context(). Currently latent — nohttp.NewRequest/Get/Postcall sites exist underpkg/today — but the fix is a direct ~4-line port of the already-landed pattern.Full evidence and before/after fix
Before (
httpnoctx.go:146-158):After (mirroring
execcommandwithoutcontext.go:68-79):Evidence:
pkg/linters/httpnoctx/testdata/src/httpnoctx/httpnoctx.gohas zero FuncLit/closure test cases in either direction — the gap has no test coverage at all. Sibling lintersexeccommandwithoutcontext.go:68-79andtimesleepnocontext.go:59-70carry the guard already.Registry gap reconciliation
What changed since the last tracked run (R60 → R61)
cmd/linters/main.gono longer listsAnalyzerliterally (now justmultichecker.Main(linters.All()...)). New detector:allAnalyzersslice count inpkg/linters/registry.go.pkg/linters/doc.goheader count confirmed in sync (64 == 64)..github/workflows/cgo.yml'sLINTER_FLAGS(two occurrences: native + wasm builds), not inmain.go. 46 of 64 registered analyzers are CI-enforced.gh apireconciliation against thesergolabel found 2 real open issues (#52429regexpdynamicpattern enforce-ready,#52428hardcodedfilepath false-positive) plus 3 strayprobeN-DELETE-MEissues (#52229-#52231) that are not Sergo findings — flagging as a repo hygiene item, not something this run created or should dedupe against.ssljson's missingnolintwiring is not a bug: it validates JSON config files rather than per-line Go source, so the suppression mechanism doesn't apply there.Candidates reviewed and ruled out
6 linters read in full, no finding filed
httpstatuscode— heuristic-based design, no new bug found.stringsconcatloop— already correctly handles both assignment forms and is FuncLit-exempt.httprespbodyclose— already correctly FuncLit-scoped via separate analysis roots (fixed previously in httprespbodyclose: FuncDecl-only scope + FuncLit skip misses responses closed inside closures (goroutines/handlers) — false nega [Content truncated due to length] #43465).excessivefuncparams— correctly usesfilecheck.ShouldSkipFilename(a stale memory note claiming otherwise was corrected).ssljson— see reconciliation note above; justified design difference, not a bug.ctxbackground/nilctxpassed— different (more conservative) design or don't perform enclosing-func walks at all; not the same bug shape.Next-run focus (R62)
aw_httpctx1(httpnoctx fix) landed.go build/go vetwere blocked by sandbox approval gating, so all analysis was static/read-only — no linter binary was actually executed).References:
execcommandwithoutcontext(fix(execcommandwithoutcontext): stop enclosing-scope walk at non-go/defer FuncLit boundaries #43692/execcommandwithoutcontext: enclosing-scope walk crosses non-go/defer FuncLit boundaries — false positives + misleading fix (same [Content truncated due to length] #43683),timesleepnocontext(timesleepnocontext: stop crossing non-go/defer FuncLit boundaries when attributingtime.Sleep#42946),ctxbackground(ctxbackground: fix false negative and unsafe autofix for closures #41187),wgdonenotdeferred(wgdonenotdeferred precision: non-deferred wg.Done() inside a goroutine launched in a loop escapes detection (FuncLit scope bound [Content truncated due to length] #40947),httprespbodyclose(httprespbodyclose: FuncDecl-only scope + FuncLit skip misses responses closed inside closures (goroutines/handlers) — false nega [Content truncated due to length] #43465),seenmapbool(fix(seenmapbool): eliminate duplicate diagnostics for set-maps in closures #40741)All reactions