[sergo] Sergo Report: Stale-Cache Reconcile + New-Linter Full Audit (43→51) - 2026-07-18 #46342
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Sergo - Serena Go Expert. A newer discussion is available at Discussion #46528. |
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
The tool cache was stale by ~10 days: the analyzer registry jumped 43 → 51 (+8) while the strategy/stats memory files were last written at R60 (2026-07-08). Nine untracked runs (R61–R69) filed issues #44187...#46131 but never pushed their memory updates. This run reconciled that gap: audited all 8 new linters (44–51), confirmed they are uniformly clean and type-resolved, and filed one high-confidence enforce-readiness issue for the single genuine gap found —
mapclearloop.mapdeletecheckautofix drops comments). Not re-filed.mapclearloopenforce-readiness (temporary_idaw_sg61a1).Tool / registry updates
LSP tools stable; linter registry surged
grep -c 'Analyzer' cmd/linters/main.go= 51 (was 43 at R60).pkg/linters/doc.goheader also reads 51 — doc-sync is current (doc-sync: pkg/linters/doc.go says "45 active analyzers" but 51 are registered — 6 newest linters omitted #46131 closed).bytescomparestring,stringscountcontains,bytesbufferstring,mapdeletecheck,mapclearloop,ioutildeprecated,logfatallibrary,nilctxpassed..github/workflows/cgo.yml:1208(prod gate) and:1211(wasm gate).Strategy (50/50 split)
Cached component — new-linter / registry-delta audit + enforce-readiness (proven, scored 9 at R60/R59/R58). Applied the established new-linter playbook to each of the 8 additions: type-resolution vs syntactic package-match, SuggestedFix compile-correctness, RWSF golden verification, and comment/shadow guards.
New-exploration component — comment-preservation guard vein + stale-cache reconciliation. Generalized the #46130 finding (block-replacing autofix drops comments) across the SuggestedFix family, and reconciled the 43→51 registry drift that the cache had missed.
Findings (evidence)
All 8 new linters audited CLEAN (type-resolved)
nilctxpassed— prior variadic-spread FP (nilctxpassed: spread call f(nil...) to a variadic context.Context param is a false positive — nil variadic slice misreported as [Content truncated due to length] #45903) is fixed:f(nil...)spread calls are now skipped (nilctxpassed.go:60-64). UsesTypesInfo+ exactcontext.Contextnamed-type match.ioutildeprecated— complete replacement map for all 8 exportedio/ioutilidentifiers; resolves package identity viaTypesInfo.ObjectOf/Uses(pathio/ioutil), handles both qualified and dot-imports. Diagnostic-only (no autofix, no autofix risk).bytesbufferstring— correctly excludes pointer receivers to avoid the nil-*bytes.Bufferpanic-vs-"(nil)" semantic difference (:90-96, :124-131).stringscountcontains— all six comparison forms (>0/>=1/!=0/==0/<1/<=0) map to the mathematically correctContains/!Contains; empty-substring edge is consistent.mapclearloop/mapdeletecheck— the only two block/statement-replacing autofixers.mapclearloopcarries both a shadow guard (builtinVisibleAtPosforclear) and a comment guard (hasOverlappingComment);mapdeletechecklacks the comment guard (that gap is already tracked in mapdeletecheck: autofix silently deletes comments inside the if body — no comment guard, unlike its sibling mapclearloop #46130).The recurring "syntactic stdlib-package-match" defect class (FP on shadowing, FN on alias) did not reappear in any new linter — all use
IsPkgSelector/Pkg().Path()/TypesInfo.Generated task → issue
mapclearloopenforce-readiness (aw_sg61a1). The analyzer is production-ready — type-resolved detection, shadow-safe + comment-safe autofix,analysistest.RunWithSuggestedFixesgolden verification — with zero production violations (repo-wide search for arange-over-map loop whose sole body isdelete(m, k)matches only testdata;pkg/cli/devcontainer.go:316is guarded by an innerifand correctly not flagged). Yet its siblingmapdeletecheckis CI-enforced whilemapclearloopappears nowhere incgo.yml. Recommendation: add-mapclearloopto bothLINTER_FLAGSstrings next to-mapdeletecheck.Metrics
aw_sg61a1)Historical context
This run corrected a memory-persistence gap: R61–R69 filed issues but never updated
sergo-strategies.jsonl/sergo-stats.json(likely failed memory pushes). Cache files were re-synced to registry=51, enforce-set=23, and trimmed to the 12 KB limit (dropped the R58 strategy entry and supersededtool_change_R59/R60fields per the keep-3-recent rule).Recommendations & next-run focus (R62)
aw_sg61a1lands (add-mapclearlooptocgo.yml).nilctxpassedenforce-readiness — diagnostic-only, catches a real anti-pattern; verify zero nil-context production sites, then propose enforcement.grep -c Analyzer cmd/linters/main.go.hasOverlappingComment→internal/astutilextraction (already recommended in mapdeletecheck: autofix silently deletes comments inside the if body — no comment guard, unlike its sibling mapclearloop #46130).gh apireconcile first — the team closes sergo issues same-day.References:
Beta Was this translation helpful? Give feedback.
All reactions