Summary
timesleepnocontext (26th custom linter) is registered in cmd/linters/main.go and documented, but is not in the CI-enforced analyzer set. An enforce-readiness sweep of its entire run scope (./cmd/... ./pkg/...) shows it is essentially clean: the only production site it flags is the deferred-cleanup false positive tracked separately. Once that FP is excluded, zero production violations remain, so the analyzer can be enforced by appending one flag.
Current CI state
.github/workflows/cgo.yml:1123 runs make golint-custom with 14 enforced flags:
-errstringmatch -panicinlibrarycode -manualmutexunlock -osexitinlibrary -rawloginlib
-regexpcompileinfunction -fprintlnsprintf -strconvparseignorederror -jsonmarshalignoredeerror
-uncheckedtypeassertion -fmterrorfnoverbs -tolowerequalfold -httpnoctx -timeafterleak
-timesleepnocontext is absent.
Evidence — full-scope sweep
All 11 non-test time.Sleep calls under ./cmd/... and ./pkg/... mapped to their enclosing function's signature:
| Site |
Enclosing function |
Has context.Context param? |
pkg/workflow/docker_validation.go:219 |
validateDockerImage(image, verbose, requireDocker) |
no |
pkg/cli/run_workflow_tracking.go:73 |
getLatestWorkflowRunWithRetry(lockFileName, repo, verbose) |
no |
pkg/cli/trial_repository.go:156 |
ensureTrialRepository(...) |
no |
pkg/cli/logs_rate_limit.go:87/97/110/121 |
checkAndWaitForRateLimit(verbose) |
no |
pkg/cli/mcp_inspect_inspector.go:164/208 |
spawnMCPInspector(workflowFile, serverFilter, verbose) |
no |
pkg/cli/update_extension_check.go:411 |
cleanupStaleWindowsBackups(extDir, ownBackup) |
no |
pkg/cli/mcp_inspect.go:138 |
InspectWorkflowMCP(ctx, ...) via deferred cleanup closure |
yes — false positive (see precision issue) |
No production function with a real context.Context parameter contains a genuinely cancellable time.Sleep. (Note: checkAndWaitForRateLimit arguably should take a ctx, but that is a design change outside this analyzer's detection.)
Recommendation
- Land the precision fix first (deferred-cleanup FP carve-out) so
mcp_inspect.go:138 is no longer reported.
- Append
-timesleepnocontext to the LINTER_FLAGS in .github/workflows/cgo.yml:1123.
- Confirm
make golint-custom LINTER_FLAGS="-timesleepnocontext -test=false" reports zero violations.
This follows the proven zero-violation enforce pattern used for fileclosenotdeferred (#35390), osexitinlibrary/rawloginlib (#35130), httpnoctx (#39016), and timeafterleak (now enforced).
Blocked by: the deferred-cleanup precision fix (companion issue). Effort: small once unblocked — one CI flag append.
Validation checklist
Generated by 🤖 Sergo - Serena Go Expert · 280.5 AIC · ⌖ 13.9 AIC · ⊞ 5.3K · ◷
Summary
timesleepnocontext(26th custom linter) is registered incmd/linters/main.goand documented, but is not in the CI-enforced analyzer set. An enforce-readiness sweep of its entire run scope (./cmd/... ./pkg/...) shows it is essentially clean: the only production site it flags is the deferred-cleanup false positive tracked separately. Once that FP is excluded, zero production violations remain, so the analyzer can be enforced by appending one flag.Current CI state
.github/workflows/cgo.yml:1123runsmake golint-customwith 14 enforced flags:-timesleepnocontextis absent.Evidence — full-scope sweep
All 11 non-test
time.Sleepcalls under./cmd/...and./pkg/...mapped to their enclosing function's signature:context.Contextparam?pkg/workflow/docker_validation.go:219validateDockerImage(image, verbose, requireDocker)pkg/cli/run_workflow_tracking.go:73getLatestWorkflowRunWithRetry(lockFileName, repo, verbose)pkg/cli/trial_repository.go:156ensureTrialRepository(...)pkg/cli/logs_rate_limit.go:87/97/110/121checkAndWaitForRateLimit(verbose)pkg/cli/mcp_inspect_inspector.go:164/208spawnMCPInspector(workflowFile, serverFilter, verbose)pkg/cli/update_extension_check.go:411cleanupStaleWindowsBackups(extDir, ownBackup)pkg/cli/mcp_inspect.go:138InspectWorkflowMCP(ctx, ...)via deferred cleanup closureNo production function with a real
context.Contextparameter contains a genuinely cancellabletime.Sleep. (Note:checkAndWaitForRateLimitarguably should take a ctx, but that is a design change outside this analyzer's detection.)Recommendation
mcp_inspect.go:138is no longer reported.-timesleepnocontextto theLINTER_FLAGSin.github/workflows/cgo.yml:1123.make golint-custom LINTER_FLAGS="-timesleepnocontext -test=false"reports zero violations.This follows the proven zero-violation enforce pattern used for
fileclosenotdeferred(#35390),osexitinlibrary/rawloginlib(#35130),httpnoctx(#39016), andtimeafterleak(now enforced).Blocked by: the deferred-cleanup precision fix (companion issue). Effort: small once unblocked — one CI flag append.
Validation checklist
-timesleepnocontextadded tocgo.ymlLINTER_FLAGS.