[sergo] Sergo Report: New jsonmarshalignoredeerror Linter Audit - 2026-05-30 #35860
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Sergo - Serena Go Expert. A newer discussion is available at Discussion #36061. |
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.
-
🔬 Sergo Report: reverify-plus-new-jsonmarshal-linter-violation-audit
Date: 2026-05-30 · Run: R23 · Success Score: 9/10
Executive Summary
This run reverified the previous run's enforcement findings and discovered a newly-registered custom linter that is not yet enforced. The reverify half paid off cleanly: the three linters Sergo flagged in R22 —
regexpcompileinfunction,fprintlnsprintf, andstrconvparseignorederror— were all enforced by the maintainer within the week, appended toLINTER_FLAGSat.github/workflows/cgo.yml:1040. The enforced linter count rose from 5 → 8, and the 6strconvsites now all check their errors. There are zero open Sergo issues.The new-exploration half found that the codebase grew an 18th custom linter since R22 —
jsonmarshalignoredeerror(cmd/linters/main.go:26,57) — which flags discardedjson.Marshal/json.Unmarshalerrors. It is registered but not enforced, and a static audit surfaced 19 production violations across 11 files, concentrated in the compiler's code-generation path where a silentnil-bytes marshal failure would emit malformed workflow output. One issue was filed to triage and then enforce it.Overall code-quality posture remains strong and improving: the "audit registered-but-unenforced linter → file enforcement issue" strategy is now demonstrably landing, making it the highest-ROI Sergo loop.
🛠️ Serena Tools Update
Tools Snapshot
Codebase linter change detected (not a Serena change)
jsonmarshalignoredeerroradded)regexpcompileinfunction,fprintlnsprintf,strconvparseignorederrorappended tocgo.yml:1040)Serena tools used today
activate_project— project activation (go, typescript, bash detected)find_symbolbroad queries remain 70s+; Grep preferred per cached gotchas)📊 Strategy Selection
Cached Reuse Component (50%)
Adapted:
reverify-plus-unenforced-linter-zero-violation-audit(avg success 9/10 across R20–R22)regexpcompileinfunction+fprintlnsprintf) and sg22a2 (strconvparseignorederror) ENFORCED & RESOLVED; no re-file needed; semverutil relocatedpkg/parser/→pkg/semverutil/New Exploration Component (50%)
Novel approach: audit the newly-registered
jsonmarshalignoredeerroranalyzer for production violationsencoding/json, onlyMarshal/Unmarshal, notMarshalIndent), then Grep'd prod for both discard patternsCombined rationale
The reuse half closes the loop on prior findings (and validates the strategy's ROI); the new half catches a brand-new analyzer the moment it lands, before its violations calcify. Together they keep the custom-linter suite moving toward full enforcement.
🔍 Analysis Execution
Codebase Context
cmd/linters/main.go)pkg/workflow(code generation) andpkg/clijson.Marshaland 1-LHS-blankjson.Unmarshal)Findings Summary
json.Marshalcluster, Tier-1 site sharpest)📋 Detailed Findings
Medium —
jsonmarshalignoredeerror: 19 discardedjson.Marshalerrors (filed as issue)🔴 Tier 1 — error path exists but discarded
pkg/workflow/safe_outputs_config_generation.go:198— function returns(string, error)yetconfigJSON, _ := json.Marshal(...); failure →""+nilerror → silent empty safe-outputs config🟠 Tier 2 — nil bytes into generated output
pkg/workflow/compiler_experiments.go:457,461,compiler_pre_activation_job.go:168,172,230,compiler_yaml.go:814,cache.go:636,917,repo_memory.go:717,pkg/cli/mcp_config_file.go:59,60,mcp_config_playwright_renderer.go:80,87🟢 Tier 3 — cannot fail (annotate)
args.go:62,mcp_renderer_github.go:249,mcp_config_playwright_renderer.go:73,compiler_experiments.go:451copilot_logs.go:97—len()-only size metricNote: the lone
_ = json.Unmarshal(...)Grep hit (mcp_scripts_generator.go:334) is a string literal inside a code generator, not a real call; the AST linter correctly ignores it → zero real Unmarshal violations.Reverify confirmations (resolved since R22)
regexpcompileinfunction— ZERO prod, ENFORCED (cgo.yml:1040)fprintlnsprintf— ZERO prod, ENFORCEDstrconvparseignorederror— 6 sites now check errors, ENFORCED (semverutil relocated topkg/semverutil/)Still-unenforced linters (10) — audit backlog
jsonmarshalignoredeerror— 19 sites (filed R23)ctxbackground— 28 sites ·largefunc/excessivefuncparams— known violations ·uncheckedtypeassertion— sg18a1 effecterrormessage— opt-in--changed-files·ssljson— content validator, not Go-codefileclosenotdeferred(zero prod),contextcancelnotdeferred(6 sites),ossetenvlibrary(10 silent-setenv sites)✅ Improvement Task Generated
Task 1: Triage & enforce
jsonmarshalignoredeerror(string, error)return atsafe_outputs_config_generation.go:198//nolint:jsonmarshalignoredeerror // marshaling a string cannot fail-jsonmarshalignoredeerrortoLINTER_FLAGS(cgo.yml:1040)📈 Success Metrics
Reasoning: high-signal — caught a brand-new analyzer the run it appeared, with precise AST-accurate site triage and a clear enforcement path; reverify confirmed the strategy's ROI (3 prior findings enforced). Not a 10 only because no second independent finding was strong enough to file without diluting quality.
📊 Historical Context
🎯 Recommendations
Immediate
jsonmarshalignoredeerrorsites (Tier 1 first — it has a live error path), then enforce.Long-term
mustMarshalJSON-style helper (or consistent error propagation) would retire a whole class of these.🔄 Next Run Preview
jsonmarshalignoredeerrorgets triaged + enforced (confirm by R24).ctxbackground(28 sites) for defensibility tiers, or rechecklargefunc/excessivefuncparamscurrent counts (were 17/11 functions at R5–6).Generated by Sergo — The Serena Go Expert · Run ID: 26675080432 · Strategy: reverify-plus-new-jsonmarshal-linter-violation-audit
Beta Was this translation helpful? Give feedback.
All reactions