[sergo] Sergo Report: Tool-Change Detect (22nd linter lenstringzero) — Doc/Spec Sync + Precision FN — 2026-06-08 #37742
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Sergo - Serena Go Expert. A newer discussion is available at Discussion #38030. |
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 R30 detected a tool change: a 22nd custom analyzer,
lenstringzero, landed in the live linter driver (ADR-37618). Serena's own LSP toolset is unchanged (23 tools, stable since R4). Both R29 precision issues landed and were closed by the team (#37492 var-alias, #37493 nolint comma-list), confirming theprecision_fix_landspattern (single-file fixes land in ~1 day). The new linter shipped in the driver ahead of its documentation/spec surface, producing one clean self-consistency gap and one documented precision false-negative.lenstringzero); Serena LSP 23 (unchanged)lenstringzeronot enforced, lacksinternal/nolintTool / Linter Updates
main.go)lenstringzeroaddedcgo.yml:1078)lenstringzeronot enforcedinternal/nolintcoveragelenstringzerolacks itStrategy Split (50 / 50)
Cached reuse (50%) — reverify open issues
Applied the proven
reverify-landedstrategy against the R29/R26 open set:collectCaseConvAliasesnow builds amap[types.Object]ast.ExprofToLower/ToUpperresult aliases with mutation-invalidation. Issue tolowerequalfold linter: false negative when ToLower/ToUpper result is stored in a local variable before comparison #37492 closed.BuildLineIndexnow usesstrings.SplitSeq(payload, ",")+ membership (nolint.go:55–61). Issue internal/nolint: (nolint/redacted) directive only suppresses when the linter is first in a comma-separated list #37493 closed.inspectBody(lines 64–175) remains escape-blind ⇒ treated as dismissed / won't-fix. Recorded as DO-NOT-REFILE to avoid churn.New exploration (50%) — registry-diff + new-analyzer audit
Diffed the driver analyzer list (
cmd/linters/main.go) againstdoc.go,README.md, andspec_test.go. Surfaced the 22nd linterlenstringzeroand audited it end-to-end: registration ✅, documentation ❌, spec-test ❌, enforcement ❌, nolint ❌, and a precision false-negative documented in its own ADR. Newnew_linter_doc_lagpattern recorded for future runs.Run targets: ≥2 evidence-backed findings, ≥2 distinct/non-overlapping issues, all grounded in file:line evidence + an in-repo fix template. All met.
Findings
🆕 sg30a1 —
lenstringzeroregistered but undocumented (issue created)The driver runs 22 analyzers but
doc.go("All 21 active analyzers"),README.md(bullet list + table + import list), andspec_test.godocumentedAnalyzers()(21 entries) all still say 21. Consequence: the newest analyzer has zero spec-test coverage —TestSpec_PublicAPI_SubpackageAnalyzersnever validateslenstringzero.Analyzer'sName/Run/name-uniqueness.cmd/linters/main.go:29,64vsdoc.go:3, README (~28/57/122),spec_test.go:62–86🆕 sg30a2 —
lenstringzerointermediate-variable false-negative (issue created)lenstringzeroflags only directlen(s) == 0;n := len(s); n == 0slips through. This is documented as a Negative consequence in ADR-37618 and is the same var-alias class just fixed intolowerequalfold(#37492). Recommended fix mirrorscollectCaseConvAliases(alias pre-pass + mutation invalidation).pkg/linters/lenstringzero/lenstringzero.go:48–56; ADR Consequences › NegativeCarried / roadmap (not refiled this run)
internal/nolint. Path to enforcement = add nolint precondition → remediate the ADR's ~20+ direct string sites → append-lenstringzerotocgo.yml:1078. Tracked in cache; not yet filed (pre-remediation).internal/nolint(the prior 7 +lenstringzero).Generated Tasks
collectCaseConvAliases; add positive + negativeanalysistestfixtures. Medium effort.Metrics
Historical Context
Linter count trajectory: 20 (seenmapbool, R26) → 21 (tolowerequalfold, R27) → 22 (lenstringzero, R30). Enforcement: 11 → 12 (tolowerequalfold landed R29) and stable this run. The team continues to convert Sergo issues into PRs and close them within ~1–2 days; the open-
sergoset is currently empty, which is why R30 pivoted to tool-change detection and new-analyzer auditing rather than reverification alone.Recommendations / Next-Run Focus (R31)
lenstringzeroenforce roadmap once the ~20+ direct string sites are remediable: nolint integration → CI flag.main.go↔doc.go↔spec_test.goregistry-diff (newnew_linter_doc_lagguard); watch for a 23rd linter.References:
docs/adr/37618-add-lenstringzero-linter.mdBeta Was this translation helpful? Give feedback.
All reactions