[sergo] Sergo Report: reverify-plus-seenmapbool-20th-linter-escape-precision-audit - 2026-06-02 #36407
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-06-03T05:24:46.691Z.
|
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.
-
🔬 Sergo Report — Run R26
Date: 2026-06-02 · Strategy:
reverify-plus-new-seenmapbool-20th-linter-escape-precision-audit· Success Score: 9/10Executive Summary
The reverify half confirmed a milestone: last run's finding sg25a1 (
fmterrorfnoverbs) landed — the maintainer appended-fmterrorfnoverbstocgo.yml:1040(now 11 enforced linter flags) andutc_offset.go:24/29/33now useerrors.New. This is the 5th consecutive run where a registered-but-unenforced linter was audited, fixed-to-zero, and enforced within the week (R22→R26).The exploration half found the predicted trigger: a 20th custom linter,
seenmapbool, freshly registered (cmd/linters/main.go:35/59) and unenforced. It flags localmap[string]boolused as a set (only ever= true) and recommendsmap[string]struct{}. Crucially, it breaks the near-zero streak: there are 60+ non-test local set declarations, and the analysis is escape-blind — it reports maps that are returned/passed/captured, where thestruct{}fix is non-local and occasionally an outright false positive. One scoped, single-file linter-precision issue (sg26a1) was filed.Overall code quality remains high. The custom-linter framework continues to grow (~1 new analyzer every few runs) and the enforcement discipline is strong, but
seenmapboolis the first analyzer in five runs that is not trivially enforceable.🛠️ Serena Tools Update
Tools Snapshot
Custom linter registry change (the meaningful delta)
seenmapbool)cgo.yml:1040): 10 → 11 (NEW:-fmterrorfnoverbs)Serena capabilities used today
activate_project— project activation (~1.3s warm)Readon analyzer + flagged sites; repository-wide pattern scan for magnitude📊 Strategy Selection
Cached Reuse Component (50%)
Adapted: the proven
reverify-plus-*loop (R22→R25, avg 9/10). Reverified sg25a1 by checkingcgo.yml:1040for-fmterrorfnoverbsand confirmingutc_offset.goswitched toerrors.New. Result: RESOLVED & ENFORCED.New Exploration Component (50%)
Novel approach: rather than assuming the registry was static, scanned
cmd/linters/main.gofor a new analyzer and foundseenmapbool. Then applied an escape-analysis lens to the linter itself — auditing whether its single-function-body scan can be satisfied locally. Hypothesis (registry would grow ~1 linter / few runs): confirmed.Combined Rationale
Reverify guarantees a high-value confirmation each run (closing the loop on prior findings) while exploration adapts to the moving registry. This run, exploration surfaced a qualitatively different linter — high-violation + imprecise — which the older "fix-to-zero then enforce" playbook does not fit, so the recommendation pivoted to a linter-precision improvement.
🔍 Analysis Execution
Codebase Context
pkg/linters/seenmapbool, plusmap[string]boolusage acrosspkg/workflow,pkg/cli,pkg/parsermake(map[string]bool)/map[string]bool{}occurrences across 156 files (incl. tests); 60+ non-test local set declarationsFindings Summary
seenmapboolprecision/readiness) · Low/Informational: rest📋 Detailed Findings
✅ Reverify — sg25a1 RESOLVED (Informational)
fmterrorfnoverbsenforced:cgo.yml:1040now carries 11 flags ending-fmterrorfnoverbs;pkg/workflow/utc_offset.go:24/29/33useerrors.New(thefmtimport is retained viaSprintfat:27). 5th consecutive enforce-landing.seenmapboolis escape-blind and not near-zeroFull analysis
What it flags:
inspectBody(seenmapbool.go:128-157) collects localmap[string]booldeclared via:=/var, then reports any whosem[k] = ...writes are all the literaltrue— recommendingmap[string]struct{}.Problem 1 — not near-zero / no suppression: no
nolintimport → no//nolintescape hatch, so fix-to-zero is the only enforce path. But there are 60+ non-test local set declarations (domains.go9,on_needs_validation.go6, and manyseen/visiteddedup maps). Enforcing as-is = large cross-cutting refactor.Problem 2 — escape-blindness (root cause): the scan only sees the declaring function body. It cannot tell whether the map escapes via return, argument, struct field, or closure. For escaping maps,
struct{}requires changing the signature and every caller read site — not local — and if a caller writes a non-truevalue, the report is a false positive the linter can never observe.Confirmed escape sites (returned directly):
toImportSet→pkg/parser/import_topological.go:48→return:52managedPatternsWithInlineComment→pkg/workflow/dependabot.go:614→return:625buildForbiddenFieldsMap→pkg/parser/schema_validation.go:37findCycleNodes→pkg/parser/import_topological.go:190computeEnabledToolNames→pkg/workflow/safe_outputs_tools_computation.go:10DetectKnownCredentialLeakingActions[/FromYAML/FromWorkflowData]→pkg/workflow/known_action_credentials.go:120/165/205✅ Improvement Task Generated
Task 1 — sg26a1: add escape detection to
seenmapbool.inspectBodybefore enforcingseenmapbool.go+ testdata)*ast.ReturnStmt), passed as a call arg, assigned to a struct field, or captured by a*ast.FuncLit. Re-measure residual local-only violations, then append-seenmapbooltocgo.yml:1040.nolint.BuildLineIndexfor per-site suppression parity (shared gap withfmterrorfnoverbs).sergo, 7d auto-expiry).📈 Success Metrics
This Run
seenmapbool+ 3 packages scanned📊 Historical Context
Cumulative statistics
regexp/fprintln/strconv(R23),jsonmarshalignoredeerror(R24),uncheckedtypeassertion(R25),fmterrorfnoverbs(R26)🎯 Recommendations
Immediate
seenmapboolescape-aware, re-measure, then enforce. Frame as a single-file precision fix, not a 60-site refactor.Long-term
seenmapboolis the first non-near-zero registered linter in 5 runs — the fast "fix-to-zero then enforce" loop may stall here. Consider incremental, file-by-file conversion of the truly local residual sets once escape filtering lands.fmterrorfnoverbs,seenmapbool) now lack//nolintsupport; addingnolint.BuildLineIndexparity would unblock pragmatic suppression.🔄 Next Run Preview
seenmapboolescape-filter land? Recount residual violations.errormessageopt-in scoping or a scopedctxbackground(28 sites) refactor proposal.Generated by Sergo — The Serena Go Expert · Run ID: 26799873398 · Strategy: reverify-plus-new-seenmapbool-20th-linter-escape-precision-audit
References: §26799873398
Beta Was this translation helpful? Give feedback.
All reactions