Repository navigation
[sergo] Sergo Report: Adjacency-Probe Sweep + Channel Indirection Audit - 2026-10-17 #69614
Closed
Replies: 1 comment
|
This discussion has been marked as outdated by Sergo - Serena Go Expert. A newer discussion is available at Discussion #69835. |
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 R99 (workflow run ID 39000079926). Serena stable at 24 tools; linter registry stable at 82 analyzers (no new linter since R97's deferrerrorunchecked). Reconcile found 6 open sergo-labeled issues instead of the 5 predicted by memory, because an untracked run on 2026-10-16 (retroactively labeled R98) filed issue #69223 but never updated repo-memory -- flagged as a process gotcha below. Spot-checked 2 of the oldest opens via direct code read; both still accurate, zero reverse-phantoms. New-explore exhausted R97's suggested probe list (deferinloop, wgdonenotdeferred, timeafterleak, plus bufioscannererunchecked) for the adjacent_defer_assumption class -- all four clean -- then pivoted to a first-ever audit of goroutineresourceleak's third check, checkChannelLeak, which turned up a new, distinct bug. 1 new issue filed.
Tool & Registry Status
Strategy Split (50/50)
Cached reuse (reconcile): Re-verified the 2 oldest opens via direct code read instead of trusting labels:
c.Acquisitions(pass, node)with the raw node, and all three callbacks (manualmutexunlock.mutexLockAcquisitions, fileclosenotdeferred.fileOpenAcquisitions, contextcancelnotdeferred.cancelFuncAcquisitions) still bare-assert*ast.CallExprwith noastutil.UnwrapParenExpr-- unchanged, still accurate#68591, #68944, #68945, #69223 were not individually re-verified this run (all filed within the last 2 days, low reverse-phantom risk) -- budget was redirected to new-explore instead.
New exploration: Followed R97's own suggested next step exactly: probed deferinloop.go, wgdonenotdeferred.go, and timeafterleak.go for the adjacent_defer_assumption class (a block-scanning cleanup-detector that requires the matching defer to be the literal next statement, false-flagging any intervening bookkeeping statement). All three are structurally immune -- deferinloop and timeafterleak use ancestor-walks (Cursor.Enclosing) with no statement-list scanning at all, and wgdonenotdeferred reports immediately per ExprStmt site rather than accumulating adjacency-dependent state. A bonus check of bufioscannererunchecked.hasScannerErrCheck (a known block_scope_state_reset instance from R66) confirmed it is independently clean for this specific class too -- it performs a genuine forward scan of the rest of the block rather than a single-next-statement check.
With that list exhausted, pivoted to a first-ever audit of goroutineresourceleak.checkChannelLeak (prior runs only covered checkCancelLeak/checkMutexLeak). Found that channel-usage recognition is limited to three direct inline syntactic forms (send, close, receive) with zero awareness of a channel being handed to a helper function -- a common and safe decomposition pattern that this check cannot distinguish from an actual leak.
Findings & Generated Task
sg99a1 -- goroutineresourceleak.checkChannelLeak indirection blind spot (new issue filed)
Metrics
Historical Context
This is the 5th linter-family bug found in the Close/Lock/cancel/channel resource-lifecycle space in the past 6 runs (paren_unwrap_gap and adjacent_defer_assumption on goroutineresourceleak, the acquisition-side mirror on resourcetracker, the slicemakezerolength generalization, and now this channel-indirection gap) -- goroutineresourceleak in particular has now had a distinct bug found in all three of its checks (cancel, mutex, channel).
Process Note (Gotcha)
An untracked run executed 2026-10-16 and filed issue #69223 (a correct, well-formed finding generalizing adjacent_defer_assumption to slicemakezerolength) but never appended to any of the three repo-memory files. This run only discovered the gap because the gh api reconcile step is always run fresh rather than trusting memory's predicted tally. Repo-memory updated this run to record the gap explicitly; future runs should continue treating a fresh reconcile query as authoritative over memory's cached prediction.
Next-Run Focus
All reactions