[sergo] Sergo Report: Enforce-Readiness Reconciliation & Registry Migration Audit - 2026-08-05 #50482
Closed
Replies: 3 comments
|
This discussion was automatically closed because it expired on 2026-08-06T05:01:13.467Z.
|
0 replies
|
This discussion was automatically closed because it expired on 2026-08-06T05:01:13.467Z.
|
0 replies
|
This discussion was automatically closed because it expired on 2026-08-06T05:01:13.467Z.
|
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.
Summary
Run §30976061315 (R61) reconciled the linter registry after an architectural migration, confirmed several historical bugs are now fixed in code, and found a fresh, evidence-backed gap: 19 of 62 registered linters are absent from the CI enforcement gate, including 2 whose "add to CI" recommendations were previously closed but never actually applied. One issue was filed.
Strategy (50/50 split)
nolintwiring, and zero current production violations before recommending CI enforcement.cmd/linters/main.gotopkg/linters/registry.go(the old detector,grep -c Analyzer main.go, now silently returns 0 — a stale-tool trap avoided this run), reconciled all 157 historicalsergo-labeled issues (all closed), and cross-referenced the full registered-linter list against.github/workflows/cgo.yml'sLINTER_FLAGSto surface the enforcement gap.Key finding: CI-enforcement gap (issue filed)
[aw_sg61a1] fileclosenotdeferred, timesleepnocontext, sprintferrorsnew are clean and enforce-ready, but unenforced
nolintwiredLINTER_FLAGStodayfileclosenotdeferredtimesleepnocontextsprintferrorsnewEvidence detail
fileclosenotdeferred: tracks file variables bytypes.Object(shadow-safe), stops traversal atFuncLitboundaries, matchesos.*viaastutil.IsPkgSelector. All ~20 productionos.Open/Create/OpenFilesites alreadydefer Close()immediately, includingpkg/fileutil.CopyFile's internalcopyFileContentshelper.timesleepnocontext: already carries theFuncLit-boundary fix (astutil.IsGoOrDeferClosure) from earlier remediation. All 4 productiontime.Sleepsites (ensureTrialRepository,getLatestWorkflowRunWithRetry,cleanupStaleWindowsBackups,validateDockerImage) live in functions that don't acceptcontext.Context.sprintferrorsnew: matcheserrors.New(fmt.Sprintf(...))viaastutil.IsPkgSelectorfor botherrorsandfmt. No production sites match.cgo.ymlenforces 43 linters (host + wasm builds); registry now has 62 → 19-wide gap. These 3 are the most immediately safe to add.Notable process gap: #35390 and #39324 were previously closed as resolved recommendations to add these exact linters to CI enforcement — but
cgo.yml'sLINTER_FLAGSwas never actually updated. This is the same "phantom close" pattern historically seen with code-fix issues (closed without the fix landing), now confirmed to also apply to CI-config recommendations. Future enforce-readiness closes should be verified with a directgrepofcgo.ymlbefore trusting them as done.Verified already fixed (no new issue needed)
Ruled-out findings from this run's audit sweep
uncheckedflushreturn: theDeferStmtcase (fix for uncheckedflushreturn: node filter omits DeferStmt —defer w.Flush()(the most common discard pattern) is never flagged #49902) is present and correct in code.httprespbodyclose:nodeFilternow includes both*ast.FuncDecland*ast.FuncLit(fix for httprespbodyclose: FuncDecl-only scope + FuncLit skip misses responses closed inside closures (goroutines/handlers) — false nega [Content truncated due to length] #43465) is present and correct.excessivefuncparams: the old Threshold linters: excessivefuncparams lints test files (every sibling FuncDecl linter skips them); largefunc & excessivefuncpar [Content truncated due to length] #40734 test-file-skip gap no longer applies — it now uses the sharedinternal/filecheck.ShouldSkipFilename, which bundlesIsTestFile.walkfuncerrshadow: zero production violations (all ~30filepath.Walk/WalkDirsites use non-collidingwalkErr/errnaming). A named-callback-variable (non-FuncLit) false-negative gap exists in the code but has zero live production sites — not worth filing.Registry migration note
cmd/linters/main.gois now a 25-line stub (multichecker.Main(linters.All()...)); the canonical registry moved topkg/linters/registry.go'sallAnalyzersslice (62 entries), andpkg/linters/doc.go's header is in sync at 62. This means the historical detector (grep -c Analyzer cmd/linters/main.go) is now stale and was updated in this run's memory cache.Metrics
.gofiles scanned (excluding_test.go, prioritizingpkg/): ~1,181sprintferrorsnew,walkfuncerrshadow,uncheckedflushreturn,fileclosenotdeferred,timesleepnocontext,httprespbodyclose,excessivefuncparams)sergoissues created all-time, 0 currently open pre-runRecommendations for next run (R62)
ctxbackground,deferinloop,largefunc,sortslice,seenmapbool,hardcodedfilepath,httpstatuscode,lenstringzero,sprintferrdot,ssljson,stringsconcatloop,appendbytestring,errorfwrapv,errormessage.sg60a1,writebytestringSuggestedFixcompile-correctness bug) actually landed.cgo.yml'sLINTER_FLAGSdirectly rather than trusting issue-close status.References:
All reactions