You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This run (R61) surfaced a significant ~3-4 week gap in Sergo's own memory (last snapshot 2026-07-08, this run 2026-08-02) coinciding with a real architecture change in the linter registry. The core deliverable is a bundled enforce-readiness issue for two already-clean, currently-unenforced custom linters (contextcancelnotdeferred, wgdonenotdeferred), backed by an exhaustive audit confirming several previously-recurring bug classes remain fully fixed across the (now much larger) analyzer set.
Strategy split (50/50)
Cached/proven half: reused the historically effective "re-audit known recurring bug classes across all linters" strategy (syntactic_stdlib_match, scope_boundary_funclit, suppression_enforce_gap, doc_sync gaps) — all previously tracked in sergo-stats.json patterns.
New-exploration half: the tool/registry delta discovery itself was novel this run — the old detection heuristic (grep -c Analyzer cmd/linters/main.go) silently broke due to a refactor, so diagnosing that and re-deriving ground truth was unplanned exploration.
Tool & Registry Updates
Architecture change: cmd/linters/main.go no longer lists analyzers directly. It's now just:
The canonical list moved to pkg/linters/registry.go (var allAnalyzers = []*analysis.Analyzer{...} + func All()).
Registry delta: 43 → 60 analyzers (+17) since the last recorded snapshot (R60, 2026-07-08). New: appendoneelement, bytesbufferstring, bytescomparestring, goroutinemissingrecover, hardcodedfilepath, ioutildeprecated, logfatallibrary, mapclearloop, mapdeletecheck, nilctxpassed, sprintfbool, stringbytesroundtrip, stringscountcontains, stringsindexhasprefix, stringsjoinone, timenowsub, trimleftright.
CI enforcement: 33 of 60 analyzers are enforced in .github/workflows/cgo.yml (LINTER_FLAGS at line 1362, plus a second wasm-scoped gate at line 1365 covering ./pkg/console ./pkg/parser ./pkg/styles ./pkg/tty ./pkg/workflow).
New detector going forward: since the main.go grep is dead, use pkg/linters/doc.go's "All NN active analyzers" header or the length of registry.go's allAnalyzers slice.
Why this matters (memory-gap note)
The cached memory (sergo-tools-list.json, sergo-stats.json) was last updated 2026-07-08 but this run is dated 2026-08-02 — a gap of roughly 3-4 weeks during which at least one architecture change and 17 new linters landed without a corresponding Sergo memory update. This suggests either skipped/failed runs or a memory-persistence issue in that window. Recommend checking whether scheduled Sergo runs executed normally during that period.
Findings
1. Two ready-to-enforce, zero-violation linters (primary finding, issue filed)
Uses filecheck.ShouldSkipFilename (line 64), which skips both test and generated files — the common ctx, cancel := context.WithCancel(...); cancel() test idiom is filtered at the file level.
Reviewed ~20 production context.With{Cancel,Timeout,Deadline} call sites across pkg/cli, pkg/workflow, pkg/modelsdev: all either defer immediately or intentionally return the CancelFunc to the caller (verified this pattern is correctly not flagged).
Only 2 production sync.WaitGroup.Done() sites in the whole tree (pkg/console/spinner.go:193, pkg/cli/forecast_compute.go:233), both already deferred.
Both are correctness-clean and violation-free — safe, low-effort additions to cgo.yml's enforced set. Filed as a single bundled issue (see Tasks below).
2. Recurring bug classes re-verified as fully closed (negative/confirmatory audit)
syntactic_stdlib_match (raw ident.Name == "pkg" instead of type-resolved matching): re-checked sortslice, ioutildeprecated, hardcodedfilepath, timenowsub, strconvparseignorederror, timeafterleak, fileclosenotdeferred — all now use types.PkgName/astutil.IsPkgSelector. No holdouts found this run.
suppression_enforce_gap (missing nolint/test-skip wiring, prior gap in largefunc/excessivefuncparams): confirmed both now wire nolint.HasDirectiveForLinter and filecheck.ShouldSkipFilename correctly.
The R60 finding (isStringType matching named string types when io.WriteString needs an exact string, causing a non-compiling SuggestedFix) was re-read this run: the fix is in place — isExactString(t types.Type) bool correctly checks *types.Basic with Kind() == types.String, and buildStringExpr wraps named types in string(...). No further action needed. (Note: did not re-run gh api to confirm issue #aw_sg60a1 is formally closed — flagged as a to-do for next run.)
Tasks Generated
Add contextcancelnotdeferred and wgdonenotdeferred to CI enforcement (issue filed, label sergo)
Before: both linters exist, are correctness-clean, and have zero production violations, but are absent from cgo.yml's LINTER_FLAGS.
After: both flags added at cgo.yml:1362; wgdonenotdeferred also added at cgo.yml:1365 (covers pkg/console, its only prod hit outside pkg/cli).
Validation: make golint-custom with new flags against ./... returns zero findings before merging the CI change.
sergo-stats.json's patterns dict now records 8 recurring bug classes; this run's audit touched syntactic_stdlib_match, scope_boundary_funclit, suppression_enforce_gap, and enforce_readiness — all with clean results except the new enforce-readiness opportunity.
The ci_enforce_14 field (stale, actually 33 enforced) has been corrected to ci_enforce_33 in memory with the current accurate list.
Memory gap noted above should be investigated — if it recurs, historical trend data (avg success score, pattern recurrence rates) becomes unreliable.
Recommendations
Merge the filed CI-enforcement issue (small, safe change).
Investigate the ~3-4 week gap in Sergo's own run cadence/memory persistence.
Re-run gh api repos/OWNER/REPO/issues?labels=sergo&state=all reconciliation at the start of the next run (skipped this run due to sandbox friction) to confirm prior issues (especially #aw_sg60a1) have actually landed, not just been filed.
Next-Run Focus (R62)
Reconcile all open sergo-labeled issues via gh api first.
Individually audit the 17 linters new since R60 for enforce-readiness and the recurring bug classes (only ioutildeprecated, hardcodedfilepath, timenowsub were spot-checked this run).
Finish the seenmapbool production-violation audit (left incomplete this run).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Executive Summary
This run (R61) surfaced a significant ~3-4 week gap in Sergo's own memory (last snapshot 2026-07-08, this run 2026-08-02) coinciding with a real architecture change in the linter registry. The core deliverable is a bundled enforce-readiness issue for two already-clean, currently-unenforced custom linters (
contextcancelnotdeferred,wgdonenotdeferred), backed by an exhaustive audit confirming several previously-recurring bug classes remain fully fixed across the (now much larger) analyzer set.Strategy split (50/50)
syntactic_stdlib_match,scope_boundary_funclit,suppression_enforce_gap,doc_syncgaps) — all previously tracked insergo-stats.jsonpatterns.grep -c Analyzer cmd/linters/main.go) silently broke due to a refactor, so diagnosing that and re-deriving ground truth was unplanned exploration.Tool & Registry Updates
cmd/linters/main.gono longer lists analyzers directly. It's now just:pkg/linters/registry.go(var allAnalyzers = []*analysis.Analyzer{...}+func All()).appendoneelement,bytesbufferstring,bytescomparestring,goroutinemissingrecover,hardcodedfilepath,ioutildeprecated,logfatallibrary,mapclearloop,mapdeletecheck,nilctxpassed,sprintfbool,stringbytesroundtrip,stringscountcontains,stringsindexhasprefix,stringsjoinone,timenowsub,trimleftright..github/workflows/cgo.yml(LINTER_FLAGSat line 1362, plus a second wasm-scoped gate at line 1365 covering./pkg/console ./pkg/parser ./pkg/styles ./pkg/tty ./pkg/workflow).main.gogrep is dead, usepkg/linters/doc.go's "All NN active analyzers" header or the length ofregistry.go'sallAnalyzersslice.Why this matters (memory-gap note)
The cached memory (
sergo-tools-list.json,sergo-stats.json) was last updated 2026-07-08 but this run is dated 2026-08-02 — a gap of roughly 3-4 weeks during which at least one architecture change and 17 new linters landed without a corresponding Sergo memory update. This suggests either skipped/failed runs or a memory-persistence issue in that window. Recommend checking whether scheduled Sergo runs executed normally during that period.Findings
1. Two ready-to-enforce, zero-violation linters (primary finding, issue filed)
contextcancelnotdeferred(pkg/linters/contextcancelnotdeferred/contextcancelnotdeferred.go):astutil.IsPkgSelector(pass, sel, "context")(line 152) — immune to the syntactic stdlib-match regression class fixed by Linter precision (regression): the syntactic stdlib-package-match migration never landed — 5 holdouts remain, 3 CI-enforced (#40 [Content truncated due to length] #43934.*ast.FuncLitboundaries (line 90-92) — immune to the ancestor-walk-crosses-closures class fixed by timesleepnocontext: enclosing-scope walk crosses arbitrary FuncLit boundaries — false positives + misleading fix for request/cal [Content truncated due to length] #42901/execcommandwithoutcontext: enclosing-scope walk crosses non-go/defer FuncLit boundaries — false positives + misleading fix (same [Content truncated due to length] #43683.filecheck.ShouldSkipFilename(line 64), which skips both test and generated files — the commonctx, cancel := context.WithCancel(...); cancel()test idiom is filtered at the file level.context.With{Cancel,Timeout,Deadline}call sites acrosspkg/cli,pkg/workflow,pkg/modelsdev: all either defer immediately or intentionally return theCancelFuncto the caller (verified this pattern is correctly not flagged).wgdonenotdeferred(pkg/linters/wgdonenotdeferred/wgdonenotdeferred.go):sync.WaitGroup.Done()sites in the whole tree (pkg/console/spinner.go:193,pkg/cli/forecast_compute.go:233), both already deferred.Both are correctness-clean and violation-free — safe, low-effort additions to
cgo.yml's enforced set. Filed as a single bundled issue (see Tasks below).2. Recurring bug classes re-verified as fully closed (negative/confirmatory audit)
syntactic_stdlib_match(rawident.Name == "pkg"instead of type-resolved matching): re-checkedsortslice,ioutildeprecated,hardcodedfilepath,timenowsub,strconvparseignorederror,timeafterleak,fileclosenotdeferred— all now usetypes.PkgName/astutil.IsPkgSelector. No holdouts found this run.scope_boundary_funclit(ancestor walks crossing closure boundaries): re-checkedhttprespbodyclose(prior httprespbodyclose: FuncDecl-only scope + FuncLit skip misses responses closed inside closures (goroutines/handlers) — false nega [Content truncated due to length] #43465, confirmed fixed —nodeFilternow treatsFuncDeclandFuncLitas independent roots and stops recursion at nestedFuncLits).suppression_enforce_gap(missing nolint/test-skip wiring, prior gap inlargefunc/excessivefuncparams): confirmed both now wirenolint.HasDirectiveForLinterandfilecheck.ShouldSkipFilenamecorrectly.pkg/linters/doc_sync_test.gonow comprehensively cross-validateslinters.All()registry vs.doc.gobullets vs.README.mdtable vs.spec_test.go— this gap is closed.3. Previously-fixed linter re-confirmed clean: writebytestring
The R60 finding (
isStringTypematching named string types whenio.WriteStringneeds an exactstring, causing a non-compilingSuggestedFix) was re-read this run: the fix is in place —isExactString(t types.Type) boolcorrectly checks*types.BasicwithKind() == types.String, andbuildStringExprwraps named types instring(...). No further action needed. (Note: did not re-rungh apito confirm issue #aw_sg60a1 is formally closed — flagged as a to-do for next run.)Tasks Generated
contextcancelnotdeferredandwgdonenotdeferredto CI enforcement (issue filed, labelsergo)cgo.yml'sLINTER_FLAGS.cgo.yml:1362;wgdonenotdeferredalso added atcgo.yml:1365(coverspkg/console, its only prod hit outsidepkg/cli).make golint-customwith new flags against./...returns zero findings before merging the CI change.Metrics
gh apireconcile pass and leavingseenmapboolpartially audited)Historical Context
sergo-stats.json'spatternsdict now records 8 recurring bug classes; this run's audit touchedsyntactic_stdlib_match,scope_boundary_funclit,suppression_enforce_gap, andenforce_readiness— all with clean results except the new enforce-readiness opportunity.ci_enforce_14field (stale, actually 33 enforced) has been corrected toci_enforce_33in memory with the current accurate list.Recommendations
gh api repos/OWNER/REPO/issues?labels=sergo&state=allreconciliation at the start of the next run (skipped this run due to sandbox friction) to confirm prior issues (especially #aw_sg60a1) have actually landed, not just been filed.Next-Run Focus (R62)
sergo-labeled issues viagh apifirst.ioutildeprecated,hardcodedfilepath,timenowsubwere spot-checked this run).seenmapboolproduction-violation audit (left incomplete this run).sprintferrdot,sprintferrorsnew,lenstringzero,errorfwrapv,excessivefuncparams,largefunc,deferinloop,errormessage.All reactions