[sergo] Sergo Report: Reverse-Phantom Refile + Presnapshot-Position-Blind Sweep - 2026-09-28 #63920
Closed
Replies: 1 comment
|
This discussion was automatically closed because it expired on 2026-09-29T04:03:09.611Z.
|
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 R80 §36375544768. Registry held steady at 73 analyzers (no new linter since R74). Reconcile caught one more reverse-phantom closure (httprespbodyclose, the 10th confirmed instance of a closed-not_planned issue whose bug was never actually fixed) and new-exploration confirmed the brand-new presnapshot_position_blind pattern class (discovered in lenstringzero at R79) is a recurring design flaw, not a one-off, by finding a second instance in tolowerequalfold. 2 issues filed, both code-verified with concrete repros.
Tool and Registry Status
Strategy: 50/50 Split
Cached component (reconcile): Re-ran the standing gh api reconcile-before-strategy discipline against all 15 pre-run open sergo issues. One flipped closed/not_planned since R79: #62115 (httprespbodyclose branch_state_merge). Re-read the code and confirmed the bug is fully present, so it was refiled rather than accepted as fixed.
New-exploration component: R79 ended by suggesting a sweep of other whole-pass-precomputed lookup tables for the same presnapshot_position_blind shape as lenstringzero. Grepped pkg/linters for every collect-then-query helper (collectKnownPathConsts, collectLenStringAliases, collectPackageLevelSliceMapVars, collectSeenMapCandidates, collectSprintfBoolCandidates, collectCaseConvAliases) and did a full read of the closest structural match, tolowerequalfold.collectCaseConvAliases. Confirmed it shares the identical design flaw.
Findings
Finding 1: httprespbodyclose branch_state_merge (reverse-phantom, 10th instance overall)
Location: pkg/linters/httprespbodyclose/httprespbodyclose.go lines 61-73 and 111.
respVars is one flat map[types.Object]*respVarState per function, populated by a single ast.Inspect with no branch scoping. A manual Body.Close() in one if/else arm and a defer Body.Close() of the same variable in the sibling arm write into the same state entry, so the manual-close arms violation gets masked by the sibling defer. CI-enforced on both native and wasm. Same root-cause family as the still-open resourcetracker branch_state_merge issue (#62304), but this is httprespbodyclose own standalone copy of the flaw.
Finding 2: tolowerequalfold presnapshot_position_blind (2nd confirmed instance of a brand-new pattern class)
Location: pkg/linters/tolowerequalfold/tolowerequalfold.go, collectCaseConvAliases at line 147, queried by run() at line 41 before the comparison walk at line 47.
The alias map is built once for the whole file before any comparison is checked. A later ASSIGN, IncDecStmt, or range-with-assign deletes the alias entry during that same up-front pass, so a variable used validly as a ToLower/ToUpper alias in an EARLY comparison, then reassigned LATER in the same function, has its alias silently deleted before the early comparison is ever evaluated. Zero testdata coverage for this ordering. CI-enforced on both native and wasm.
Generated Tasks and Issues
Both filed with the sergo label, code citations, concrete repro snippets, and effort estimates.
Metrics
Historical Context
This is run 80 of an ongoing series (started informally well before R58). Running totals: roughly 500 cumulative findings and 142 generated tasks across all runs, average self-assessed success score around 8.76 out of 10. Ten confirmed reverse-phantom closures have now been caught overall, confirming that issues in this repository are sometimes auto-expired without any corresponding code change, so the gh api reconcile-before-strategy step remains essential every run. presnapshot_position_blind is only two runs old and already has two confirmed instances, suggesting it is a systemic pattern worth a dedicated sweep rather than a single fix.
Recommendations and Next-Run Focus
References:
All reactions