Repository navigation
[sergo] Sergo Report: Fresh-Linter Audit (Registry Delta 77->79) - 2026-10-11 #67610
Closed
Replies: 1 comment
|
This discussion has been marked as outdated by Sergo - Serena Go Expert. A newer discussion is available at Discussion #67867. |
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 R93. The registry grew by 2 analyzers since yesterday's run (77 -> 79):
consolestderr(78th) andunchecked_deferredclose(79th), both merged 2026-10-10. A full day-one audit of both turned up two distinct, code-verified findings, and the standing reconcile check confirmed all 6 previously-open sergo issues are tracked accurately with zero drift. 2 new issues filed.Tool & Registry Updates
serena --helpreconfirmed live, exact match against cache).grep -c 'Analyzer,\$' pkg/linters/registry.go).consolestderr(PR Fix console formatter stream contracts and guard stderr usage #67423) - requires destination-aware console formatting for directfmt.Fprint*(os.Stdout/os.Stderr, ...)writes.unchecked_deferredclose(PR [linter-miner] Add unchecked-deferred-close linter #67481,pkg/linters/unchecked-deferred-close/) - reportsdefer x.Close()calls that ignore the returned error.Strategy: 50/50 Split
gh apireconcile against all 6 previously-filed open issues (65753, 66009, 66436, 66773, 67102, 67336). All matched the prior run's prediction exactly - zero reverse-phantom flips, and deferinloop: range-over-func (Go 1.23+ iterators) false-positives defer-does-not-run-per-iteration, which is backwards for that #67336 confirmed as the prior run'sdeferinloopfiling landing cleanly. No refile work was needed, so no issue budget was spent here this run.Findings
1.
unchecked_deferredclosecontradictscloseerrorunchecked's documented policyunchecked_deferredcloseflags every baredefer x.Close()whoseClose()returns an error. But the sibling lintercloseerrorunchecked- already in the registry - has test fixtures that explicitly label the identical code shape as correct:Evidence
closeerrorunchecked/testdata/.../closeerrorunchecked.go:74-79- comment: "GoodDeferClose uses defer, which is the best practice — not flagged."closeerrorunchecked/testdata/.../closeerrorunchecked.go:132-136- comment: "GoodCustomCloserDefer defers custom type Close — not flagged."closeerrorunchecked's ownnodeFilteris{AssignStmt, ExprStmt}only - it structurally never even visitsDeferStmtnodes.unchecked_deferredclose/testdata/src/basic/bad.go:20-28reproduces the exact sameos.Open+ err-check +defer f.Close()idiom and expects it to be flagged.A grep found roughly 150+ live production call sites of this exact shape across
pkg/cli,pkg/parser,pkg/workflow,pkg/fileutil. Neither linter is currently in a shared CI gate together, so there's no live breakage yet - but the two linters hold opposite, testdata-documented opinions on the same idiom.Filed as a new issue. New pattern class added to memory:
cross_linter_policy_contradiction- distinct from every prior finding class because both analyzers are independently well-implemented; the conflict is one of policy, not of a missed AST shape or lost state.2.
consolestderrhas the same native/wasm CI asymmetry as a previously-filed bugconsolestderrgets its own dedicated CI step incgo.yml:1530-1531, but that step only runs in the native job. The wasm job (cgo.yml:1554-1555) has no equivalent step or flag, even though itsLINTER_PACKAGESlist explicitly includes./pkg/console- the very package this linter targets.This is the third occurrence of the
ci_target_asymmetryclass already tracked in memory (originallycontextcancelnotdeferred, filed at #55932, refiled at #65753 which is still open today) - but the first time it's shown up on a linter's very first day rather than being found later via a retrospective sweep.Tasks Generated (2)
unchecked_deferredclosevscloseerroruncheckeddefer-Close() policyconsolestderrto the wasm custom-linters CI stepBoth issues were dedup-checked via
gh api search/issuesbefore filing (zero prior coverage beyond the original creation PRs).Metrics
consolestderrhelper audited clean).Historical Context
This is the 9th registry-delta run (after R66, R67, R70, R74, R77(dbl), R82, R84, R85, R89) and the first to add two linters in a single delta. It's also the first run where a brand-new linter's CI wiring was checked for native/wasm parity on day one rather than being caught later - worth keeping as a standing day-one check per the updated memory notes.
Recommendations
unchecked_deferredclose/closeerroruncheckedpolicy conflict beforeunchecked_deferredcloseis ever wired into CI enforcement.consolestderr's native CI step into the wasm job, and consider a direct diff test between the twoLINTER_FLAGSstrings (not just the registry-union test) given this is now a 3-time-recurring gap.Next-Run Focus (R94)
fileclosenotdeferred,closeerrorunchecked,unchecked_deferredclose) for any further 3-way conflicts if no new registry delta appears.wc -con both memory files before writing (strategies file is at ~98.7 KB of a 102.4 KB cap).All reactions