[sergo] Sergo Report: Helper-Adoption Followup + Error-Comparison Audit - 2026-05-17 #32753
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-05-18T05:11:00.043Z.
|
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 12 confirmed four of five outstanding Sergo findings from Runs 10–11 are now fixed in
main: context propagation toResolveSHA(#aw_sgar1),AWFProxyLogsDirliteral (#aw_sgar2),filepath.Joinenv-override bypass (#aw_sgbo1), and stubinit()functions (#aw_sgbo2). The lone holdout is Run 8#aw_sg8a2(HTTP30 * time.Secondliteral at 4 sites, 13+ days unfixed) — cache tracks it, not re-filing.New error-comparison audit found healthy sentinel-error discipline (4 sentinels, all checked via
errors.Is, zero direct==) but two cases of helper-underadoption for gh-CLI error detection:isPermissionError(inpkg/cli/audit.go) duplicated across 3+ sites, andisNotFoundError(inpkg/parser/remote_fetch.go, unexported) reimplemented inline at 4pkg/clisites — with one site (outcome_eval_comment.go:34) silently buggy due to case-sensitive matching.Serena Tools Update
activate_project,find_symbol(with--relative_pathfor fast single-file lookups, ~100ms),think_about_collected_informationfind_symbolwith--relative_pathconstraint is fast (~100ms) — useful for chasing one symbol through one file without paying broad-query cost.Strategy Selection
Cached Reuse (50%): Extended the long-running helper-underadoption thread (Runs 8/9/10/11) by re-auditing every outstanding finding from the last three runs. Theme has scored 9/10 for four consecutive runs.
New Exploration (50%): Error-comparison audit — sentinel error definitions,
errors.Is/errors.Asadoption,err == sentinelanti-patterns, error type assertions, andstrings.Contains(err.Error(), ...)fragile matching. This dimension had not been audited in prior runs.Combined rationale: Cached half verifies that the helper-underadoption findings actually drive fixes (closing the feedback loop). New half checks the previously-unscanned error-comparison axis — finding fits the same theme (helpers exist, are bypassed), which strengthens the pattern.
Analysis Execution
Cached-followup findings (verification)
#aw_sg8a2HTTP 30s timeoutDefaultHTTPClientTimeoutinpkg/constantsafter 13+ days. Cache tracks; not re-filing.#aw_sgar1context.Background→ResolveSHA#aw_sgar2AWFProxyLogsDir literalengine_firewall_support.go:104now uses constant.#aw_sgbo1filepath.Join env-override bypassfix_command.go:410remains as a search needle (defensible).#aw_sgbo2stub init() functionsinit()count in pkg/ dropped from 11 → 8; all 8 remaining are legitimate.New error-comparison findings
var Err... = errors.New(...)sentinel definitionserrors.Is— excellenterr == sentinelcomparisonserr.(*Foo))errors.Is/errors.Ascallsitesstrings.Contains(err.Error(), ...)fragile matching== context.Cancelled/== context.DeadlineExceeded/!= http.ErrServerClosedDetailed Findings
High Priority
Finding 1 —
isPermissionErrorhelper underadoption → Issue#aw_sgcr1Centralized helper exists at
pkg/cli/audit.go:250with five signal substrings. 3 prod sites bypass it:pkg/cli/logs_download.go:312— single-substring check (exit status 4), narrower than helperpkg/cli/logs_download.go:802— same pattern, second site in same filepkg/cli/logs_github_api.go:286-291— inlines its own five substrings, with a different superset (adds"To use GitHub CLI in a GitHub Actions workflow"not in the helper)The inline lists have already drifted, which is exactly the drift-cost the helper exists to prevent. Issue body proposes consolidation + optional
errors.As(err, &exitErr)+ExitCode()upgrade path thatenrichGHError(atpkg/workflow/github_cli.go:81) already partially demonstrates.Finding 2 —
isNotFoundErrorwrong-package + underadoption → Issue#aw_sgcr2Helper at
pkg/parser/remote_fetch.go:610is unexported and takes astring(forces callers to callerr.Error(), losing wrapping). Fourpkg/clisites reimplement inline:audit.go:1037-1042err.Error()"Could not resolve")outcome_eval_comment.go:34"404","Not Found"gateway_logs_mcp.go:28"not found"only"404"substringlogs_download.go:316"not found"+"410"The
outcome_eval_comment.gocase is a real silent-bug today.Medium Priority
Finding 3 — Run 8
#aw_sg8a2HTTP 30s timeout still open13+ days since first filed. Still 4 sites:
parser/remote_fetch.go:522,cli/agent_download.go:45,cli/mcp_registry.go:50,cli/deps_security.go:139. NoDefaultHTTPClientTimeoutinpkg/constants. Cache tracks; not re-filing per cache policy on long-open findings.Low Priority (observed, not filed)
pkg/cli/mcp_server_http.go:89:err != http.ErrServerClosed— modern idiom iserrors.Is(err, http.ErrServerClosed). Single-line fix, too small to track.pkg/cli/secrets.go:113: comment says "if we get a 403, skip silently" but code isif !strings.Contains(err.Error(), "403") { continue }— comment/code mismatch but logic may be intentional. Flagging for human review.Low Priority Observations (raw)
ctx.Err() == context.DeadlineExceededatactionlint.go:310,320,mcp_validation.go:205— defensible per stdlib contract.strings.Contains(err.Error(), ...)sites in pkg/ non-test — all gh-CLI related; helper consolidation covers them.ErrInterrupted,ErrNoArtifacts,ErrNpmNotAvailable,ErrNotGitRepository— all consumers useerrors.Is; one (isErrNpmNotAvailable) wraps it in a predicate helper — exemplary pattern.Improvement Tasks
Task 1 — Adopt
isPermissionErroracross pkg/cli (Issue#aw_sgcr1)Issue Type: Helper underadoption (gh-CLI auth-error detection)
Severity: Medium
Effort: Small
Widen
isPermissionErrorto the union of inline substring sets, then replace 3 sites atlogs_download.go:312,logs_download.go:802,logs_github_api.go:286-291. Optionally extract*exec.ExitError.ExitCode()so consumers can branch viaerrors.Asinstead of substring.Validation: existing user-facing messages preserved;
go test ./pkg/cli/...passes; no new"exit status 4"substring matches outside the helper.Task 2 — Export and consolidate
isNotFoundError(Issue#aw_sgcr2)Issue Type: Helper underadoption + silent bug (wrong package, wrong signature, case-sensitivity drift)
Severity: Medium (silent false-negative at
outcome_eval_comment.go:34)Effort: Small-Medium
Move the helper to a shared package (
pkg/ghapi/errors.goorpkg/errorutil), change signature tofunc IsNotFoundError(err error) bool, lower-case once internally, replace 4 sites.Validation: case-sensitivity behavior unified to lowercase; 4 sites preserve current branch behavior;
go test ./pkg/cli/... ./pkg/parser/...passes.Success Metrics
#aw_sgcr1,#aw_sgcr2)Reasoning: High-confidence verification of prior findings (4 confirmed fixed) closes the feedback loop and validates the helper-underadoption theme. New audit dimension (error comparison) discovered two clean helper-underadoption issues including one silent bug. Lost a point only because no truly novel finding category emerged — the new dimension fed back into the existing dominant theme rather than opening a new one.
Historical Context
Recommendations
Immediate
#aw_sg8a2(addconstants.DefaultHTTPClientTimeout).Longer term
pkg/ghapi(orpkg/errorutil) package that hostsIsPermissionError,IsNotFoundError, and an eventual structuredGHError{ExitCode, HTTPStatus}derived inenrichGHError. Two helpers cohabiting one package is the natural endpoint of the helper-underadoption thread.strings.Contains(err.Error(), "exit status ")outside the canonical helper, since the substring pattern is the load-bearing fragile point.Next Run Preview
Suggested Focus Areas
make([]T, 0, knownLen)adoption), string-building patterns (strings.Buildervs+=vsfmt.Sprintf), orsync.Poolcandidates in hot paths.#aw_sg8a2if it remains unfixed past 30 days — escalate via different framing.Strategy Evolution
The helper-underadoption theme has matured: now well-cataloged with three failure modes. Consider a one-off "helper coverage scan" as a single pass, then retire the theme for several runs to avoid pattern fatigue. The high success rate (5×9/10) suggests the theme is still productive but may be approaching saturation.
Generated by Sergo - The Serena Go Expert
Run ID: 25981825933
Strategy: helper-adoption-followup-plus-error-comparison-audit
References:
Beta Was this translation helpful? Give feedback.
All reactions