[sergo] Sergo Report: Two-New-Linter Tool Change + Precision Audit — 2026-06-12 #38790
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Sergo - Serena Go Expert. A newer discussion is available at Discussion #39018. |
Beta Was this translation helpful? Give feedback.
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 R34 detected a tool change: the custom-linter registry grew from 24 → 26 analyzers —
hardcodedfilepath(#38742) andtimesleepnocontext(#38704) both landed via bot PRs since the last run. This run combined the provennew_linter_doc_lag+syntactic→type-identitycached patterns with a fresh precision audit of the two new linters, and surfaced a notable process finding: last run's recorded issues never actually existed.main.go,README+spec_test, anddoc.go.timesleepnocontextclean;hardcodedfilepathhas a latent false-positive in its format-template guard.#38787,#38788,#38789), all single-file, all on unenforced linters (zero CI-break risk).sg33a1/sg33a2issues do not exist — the R33 safe-output never posted. The ctxbackground finding was therefore refiled.Critical Findings
#38787) —cmd/linters/main.goregisters 26 analyzers, butpkg/linters/doc.go:3still says "All 24" with only 24 bullets (missing both new linters), andREADME.md+spec_test.go documentedAnalyzers()are at 25 (missingtimesleepnocontext).timesleepnocontextis therefore not covered by the spec suite despite shipping in the driver.hardcodedfilepathfalse positive (#38788) —hasFormatVerb(hardcodedfilepath.go:88-93) is a substring check that misses flag/width/precision verbs (%05d,%-10s,%8.2f) and 9 verb letters (%x %t %c %b %o %e %g %p %U). Format-template paths like/tmp/run-%05d/outget flagged as hard-coded paths — directly contradicting ADR Add hardcodedfilepath linter to detect hard-coded file path string literals #38742, which states the linter "skips format-template strings."ctxbackgroundprecision (#38789) —isContextBackgroundCall(ctxbackground.go:86) matchesident.Name == "context"syntactically, while the same file detects the ctx parameter by type identity (types.Identical+ import scan). Internal inconsistency ⇒ false positive on a locally-namedcontextand false negative on an aliased importctxpkg "context". Mirrors the landed sortslice precision: match sort.Slice/SliceStable via package identity (pass.TypesInfo), not the syntactic identifier name "sort [Content truncated due to length] #38029 sortslice fix.Strategy — 50/50 Split
Cached reuse (proven, fast-landing patterns)
new_linter_doc_lag(landed lenstringzero (22nd custom linter) is registered in the driver but undocumented — sync doc.go, README, and spec_test to 22 analy [Content truncated due to length] #37740, sortslice (23rd custom linter) is registered in the driver but undocumented — sync doc.go, README, and spec_test to 23 analyzers #38028): applied to the two newly-registered linters →#38787.syntactic→type-identityswap (landed sortslice precision: match sort.Slice/SliceStable via package identity (pass.TypesInfo), not the syntactic identifier name "sort [Content truncated due to length] #38029,astutil.IsFmtErrorf): refiled the never-posted R33 ctxbackground finding →#38789.precision_fix_lands(≈1-day landings).New exploration (audit of the two brand-new linters)
timesleepnocontext— audited and found clean: usesObjectOf → *types.PkgName → Imported().Path()=="time"for the call,types.Identicalfor the ctx param, skips test files, and emits no autofix. No issue filed.hardcodedfilepath— found a latent FP inhasFormatVerb; strongest land-argument is that the implementation contradicts the linter's own ADR →#38788.Tool / Registry Changes
cmd/linters/main.gohardcodedfilepath, +timesleepnocontextREADME.md+spec_test.gotimesleepnocontextdoc.gocgo.yml:1122)Generated Tasks
#38787#38788hasFormatVerb#38789*types.PkgNameMetrics
Historical Context
Recent runs
sortslice— doc-sync + type-identity precision (sortslice (23rd custom linter) is registered in the driver but undocumented — sync doc.go, README, and spec_test to 23 analyzers #38028/sortslice precision: match sort.Slice/SliceStable via package identity (pass.TypesInfo), not the syntactic identifier name "sort [Content truncated due to length] #38029, landed).execcommandwithoutcontext— nil-guard FP (execcommandwithoutcontext precision: false positive on nil-guarded exec.Command fallback — autofix injects a nil context that pa [Content truncated due to length] #38281) + enforce-readiness (execcommandwithoutcontext enforce-readiness: propagate context in connectStdioMCPServer (2 sites), add nolint support, then enfo [Content truncated due to length] #38282), still open after 2 days (complex control-flow = slow to land).Recommendations
#38787first — it is pure docs/test and unblocks spec coverage oftimesleepnocontext.execcommandwithoutcontextissues (execcommandwithoutcontext precision: false positive on nil-guarded exec.Command fallback — autofix injects a nil context that pa [Content truncated due to length] #38281/execcommandwithoutcontext enforce-readiness: propagate context in connectStdioMCPServer (2 sites), add nolint support, then enfo [Content truncated due to length] #38282) have now been open 2+ days; if they stay open ~5+ days, consider a land-rate note rather than re-engaging.Next-Run Focus (R35)
#38787/a2/a3landed (by label and title).hardcodedfilepathaudit:unquoteStringLitignores escape sequences (const-match edge case);isLogOrPrintCallrejects variable-receiver loggers (logger.Infof) despite its own doc example.References:
Beta Was this translation helpful? Give feedback.
All reactions