[sergo] Sergo Report: Stale-Cache Resync + Enforce-Readiness Trio - 2026-07-25 #47917
Closed
Replies: 1 comment
|
This discussion was automatically closed because it expired on 2026-07-26T05:04:04.859Z.
|
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 R61 opened on a 17-day-stale cache (last persisted R60 = 2026-07-08) and re-synced it against the current tree. The custom-linter registry has grown from 43 → 57 analyzers and the registration mechanism moved (
cmd/linters/main.gois now justmultichecker.Main(linters.All()...); the oldgrep -c Analyzer main.godetector returns 0). After reconciling open issues (only one open: #47704), I audited the newest autofix linters and filed one high-confidence enforce-readiness issue covering three clean checks. A tempting second finding was probed and rejected as a false positive before filing.Tool / registry updates
cmd/linters/main.gopkg/linters/registry.go→All()grep -c Analyzer main.gogrep -c '.Analyzer,' pkg/linters/registry.gocgo.yml:1227, +wasm:1230)The doc-sync vein is now fully guarded:
doc_sync_test.go::TestDocSurfacesMatchRegistryAndSpecListcross-checks registry ↔doc.go↔README.md↔spec_test.gotogether (the #47190 cross-cluster gap is closed). No doc-sync finding this run.Strategy split (50/50)
stringsjoinonethat was then disproven.Findings
1. Enforce-readiness trio — appendoneelement + timenowsub + stringsjoinone (filed)
All three are clean, type-resolved,
RunWithSuggestedFixes-golden-verified,nolint+filecheck-wired, and have zero production violations (default andjs/wasm), yet none is in CI enforcement.append(s, []T{x}...)→append(s, x). Type-gated ontypes.Universe.Lookup("append"); the surroundingappendre-imposess's element type, so no type change.time.Now().Sub(t)→time.Since(t).timeNowQualifierresolves via*types.PkgName+Imported().Path()=="time";isSafeSinceArgrestricts the argument to side-effect-free forms, neutralizing theSince-reads-arg-first evaluation-order flip (timenowsub coverage gap: isSafeSinceArg rejects side-effect-free selector/index args (e.g. time.Now().Sub(s.start)) — false nega [Content truncated due to length] #46708 coverage gap already fixed).strings.Join([]string{s}, sep)→s. Type-resolved viaastutil.IsPkgSelector; separator-drop gated on a constant separator;formatReplacementTextparenthesizes non-primary elements (the stringsjoinone autofix drops precedence: bare unparenthesized element replacement emits non-compiling / behavior-changed code in [Content truncated due to length] #47467 precedence fix).Production greps:
time.Now().Sub(→ 0 sites;strings.Join([]string{and single-elementappend(...{x}...)→ only multi-element sites (safe). Recommendation: add-appendoneelement -timenowsub -stringsjoinonetocgo.yml:1227+:1230.2. stringsjoinone named-type autofix — probed, REJECTED as false positive (not filed)
Hypothesis:
strings.Join([]string{s}, sep)always has typestring, but the autofix emits the bare elements; for a named string element (type ID string) this would drop the implicit conversion and change the expression's static / interface-dynamic type (the #44187 class).Disproven by Go assignability: a defined string type is not assignable to
string(both are named types with identical underlying — the "at least one not a named type" clause fails), so[]string{id}is a compile error. The single element must already bestringor an untyped string constant, both of which staystring-typed when emitted bare. No type change; the autofix is correct. Filing this would have been the exact false-positive class Sergo hunts — so it was dropped.Generated tasks
#47916. Small (two-line workflow edit), zero linter-code change, validation checklist included.Metrics
Historical context
61 runs, 414 cumulative findings, avg success 8.74. The autofix-correctness / named-type vein (#44187, #44653, #45037, #47467) and the enforce-readiness vein (#45629 three-linter batch, #46341, #46978) are the two most reliable landing patterns; this run leans on both. The cache had drifted 14 linters — a reminder to
push_repo_memoryevery run.Recommendations & next-run focus (R62)
grep -c '.Analyzer,' pkg/linters/registry.govs 57; watch for a 58th linter as a fresh audit target.trimleftright(trimleftright: the "repeated rune" cutset heuristic is an arbitrary discriminator that misses the most common TrimLeft/TrimRight [Content truncated due to length] #46526),bytescomparestring(bytescomparestring (new 44th linter): the "allocates" premise is inaccurate under gc — string(a) == string(b) does NOT allocate [Content truncated due to length] #44484),stringbytesroundtrip(stringbytesroundtrip: the []byte(string(b)) arm mislabels the defensive-copy idiom as a "redundant round-trip" — a false-positiv [Content truncated due to length] #47704).References:
All reactions