[sergo] Sergo Report: reverify-plus-unenforced-linter-zero-violation-audit - 2026-05-27 #35132
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-05-28T05:16:52.782Z.
|
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.
-
Executive Summary
Run 20 audited the gap between Sergo's 15 registered custom analyzers and the 2 currently enforced in CI (
errstringmatch,panicinlibrarycode). Two analyzers —osexitinlibraryandrawloginlib— have zero production violations inpkg/, making them the safest possible CI hardening candidates (no refactor, no risk, pure discipline lock-in). Sergo also re-filed#aw_sg19a1(manualmutexunlock) with an updated count of 13 → 16 prod sites, after the previous tracker auto-expired under the 7-day rule.Success Score: 9/10 — Two distinct, high-quality findings with concrete actionable fixes. One zero-cost CI hardening upgrade and one re-filed open finding with refreshed evidence.
Serena Tools Update
Tools Snapshot
Tools Used Today
activate_project(6.5s cold) — confirmed project activationfind_symbolfor broad patterns)Strategy Selection
Cached Reuse Component (50%)
Previous Strategy Adapted:
reverify-plus-manual-mutex-unlock-audit(R19, 2026-05-26, score 9)#aw_sg19a1but the auto-expire (7d) closed it; needed refresh with updated counts.agentdrain/coordinator.go:115,parser/virtual_fs_wasm.go:37— both trivial RLock-read-RUnlock).#aw_sg14a1(10 sites unchanged),#aw_sgbo1(2 different-shape sites still defensible).New Exploration Component (50%)
Novel Approach:
unenforced-linter-zero-violation-audit— systematically audit each registered-but-unenforced analyzer to find ones with zero prod violations (= safe to enforce immediately).pkg/!_test.gofiltered by analyzer-specific symbol patterns (os.Exit(,log.Fatal|log.Print|log.Println|log.Panic,fmt.Fprintln([^,]+,\s*fmt.Sprintf()Combined Strategy Rationale
The two components complement each other: reverify provides continuity (don't lose tracked-but-expired findings), zero-violation audit provides discovery (find cheap wins). Together they cover the state-management (what to keep tracking) and discovery (what to add) axes of an audit cycle.
Analysis Execution
Codebase Context
cmd/linters/main.go:38-52)-errstringmatch -panicinlibrarycodepercgo.yml:1041)cmd/linters/,.github/workflows/cgo.yml, allpkg/excluding_test.goandtestdata/Findings Summary
Detailed Findings
High Priority
1.
osexitinlibraryanalyzer registered but unenforced — ZERO prod violationscmd/and*_test.goautomatically)cmd/linters/main.go:46rg 'os\.Exit\(' pkg/ -g '!*_test.go'→ ZERO hits (1 hit inpkg/linters/osexitinlibrary/testdata/is expected analyzer-test fixture)2.
rawloginlibanalyzer registered but unenforced — ZERO prod violationsPrint/Printf/Println/Fatal/Fatalf/Fatalln/Panic/Panicf/Panicln)cmd/linters/main.go:49rg 'log\.(Fatal|Print|Println|Panic)' pkg/ -g '!*_test.go'→ ZERO hits in actual code (onlytestdata/anddoc.go/README.mdexample snippets)Medium Priority
3.
manualmutexunlockanalyzer registered but unenforced — 16 prod sites (refiled #aw_sg19a1)Updated counts vs R19's 13 sites:
Full 16-site breakdown
agentdrain/miner.goagentdrain/miner.goagentdrain/miner.goconsole/spinner.goconsole/spinner.goconsole/spinner.goconsole/spinner.gocli/compile_watch.gocli/compile_watch.gocli/docker_images.gocli/docker_images.goagentdrain/coordinator.goconsole/spinner.goparser/virtual_fs.goparser/virtual_fs_wasm.goNew sites added since R19:
agentdrain/coordinator.go:115,parser/virtual_fs_wasm.go:37— both trivial (defensible-by-exemption category).Low Priority — Reverification
Line-drift checks
#aw_sg14a1(10 silent syscall discard sites): unchanged. Still 4os.Setenv(engine_secrets.go:329/377/430,add_interactive_orchestrator.go:73) + 6os.Chdir(deploy_command.go:131,update_command.go:224,trial_repository.go:217/236/545,trial_helpers.go:332). Tracker Silent error discards on os.Setenv / os.Chdir in pkg/cli (10 prod sites) #33459 remains open.#aw_sg17a1(panicinlibrarycode enforcement): stays enforced viacgo.yml:1041 LINTER_FLAGS=-panicinlibrarycode.#aw_sgbo1(filepath.Join workflow shape variants): 2 sites unchanged and intentional —cli/git.go:303(trailing slash forgit addshape),cli/fix_command.go:410(Separator-suffixed prefix-match).Improvement Tasks Generated
Task 1: Enforce osexitinlibrary + rawloginlib in CI (zero-cost hardening)
Issue Type: CI linter enforcement
Location:
.github/workflows/cgo.yml:1041Before:
After:
Validation:
make golint-custom LINTER_FLAGS="-osexitinlibrary -rawloginlib -test=false"should pass with zero diagnostics.Estimated Effort: Trivial (1 line change).
Severity: High (pure discipline lock-in with zero refactor risk).
Task 2: Address
manualmutexunlock(refiled #aw_sg19a1) — 16 prod sitesIssue Type: Mutex panic-safety refactor + linter exemption refinement
Recommendation: 3-pronged fix —
-manualmutexunlocktoLINTER_FLAGSEstimated Effort: Medium (multi-file refactor, ~11 wrapper conversions, similar in scale to R19's panic linter refinement).
Success Metrics
This Run
cgo.yml+pkg/audit (osexit, rawlog, mutex, syscall scopes)#aw_sg20a1,#aw_sg19a1re-file)Reasoning for Score
Positives:
Deductions:
fileclosenotdeferred,regexpcompileinfunction, etc.) — left for R21/R22.Historical Context
Strategy Performance
manualmutexunlockfinding now refreshed in R20 (cycle: file → expire → re-file).Cumulative Statistics
reverify-plus-*(9 consecutive scores ≥8)Recommendations
Immediate Actions
#aw_sg20a1fix (one-line LINTER_FLAGS append) — zero risk, locks in 2 disciplines.#aw_sg19a1(manualmutexunlock) — 11 high-risk sites, similar effort to R19's panic linter refinement.#aw_sg14a1(silent syscall discards, tracked by Silent error discards on os.Setenv / os.Chdir in pkg/cli (10 prod sites) #33459 open since 2026-05-20).Long-term Improvements
ossetenvlibraryjoins. Once sg19a1 fixed,manualmutexunlockjoins.Next Run Preview
Suggested Focus Areas
fprintlnsprintf(already confirmed zero hits in R20 — likely enforce candidate)fileclosenotdeferredfor prod violationsStrategy Evolution
The
zero-violation-auditsub-strategy is highly productive (high-impact, zero-risk findings). Consider running a broad sweep across all 13 unenforced analyzers in R21 to identify all zero-violation candidates at once.Generated by Sergo — The Serena Go Expert
References:
Beta Was this translation helpful? Give feedback.
All reactions