Skip to content

fix(filter-quality): preserve error signal in go test/vet/golangci filters#2311

Open
aeppling wants to merge 1 commit into
developfrom
fix/go-filters-signal-preservation
Open

fix(filter-quality): preserve error signal in go test/vet/golangci filters#2311
aeppling wants to merge 1 commit into
developfrom
fix/go-filters-signal-preservation

Conversation

@aeppling
Copy link
Copy Markdown
Contributor

@aeppling aeppling commented Jun 7, 2026

Problem

These three Go filters all caused agent retries with the same root cause: RTK kept the cosmetic summary but dropped the one actionable line (the error/failure message), then advertised a verbose tee-log. So agents retried — cat/tail/grep-ing the firehose or re-running with --out-format overrides — pulling back more bytes than the unfiltered output.

Fixes (all in src/cmds/go/)

Filter Before After
go test summary + [full output: …go_test.log] pointer to the raw go test -json dump (3–8× verbose); agents cat'd it on failure drop the tee — build errors & per-test failures are already inline
go vet only .go: lines kept → location-less fatal error: pcap.h: No such file or directory dropped, then "No issues found" on a hard failure; message truncated mid-line keep every finding line; never claim success on failure; no mid-message truncation
golangci-lint counts grouped by linter/file — the violation message (Text) was parsed and discarded standard file:line:col: message (linter) findings, linter counts as a header
golangci-lint force-parsed JSON even when the user passed --out-format, emitting golangci-lint (JSON parse failed: …) (reads as a tool failure) passthrough verbatim on user --out-format/--output.* flags

Compression

Savings stay high vs raw — golangci 78–84% (was a misleading ~93% that omitted the message). go vet passes tiny failures through at ~0% by design: compressing 323 B costs a retry turn for no gain. go test compression slightly improved (pointer removed). The lost percentage points are repaid many times over by eliminating the 12–169 KB retry reads the missing signal caused.

Out of scope

Cross-cutting idempotency items (pipe-awareness, re-run escalation, full-path basename matching) live in the hook/rewrite + session-state layer, not these filters — left for a follow-up.

Testing

  • cargo fmt --all · cargo clippy --all-targets (clean) · cargo test --all2073 passed, 0 failed, 7 ignored
  • New tests: cgo build-failure surfaces inline (go test); location-less cgo error + no mid-message truncation (go vet); message+location surfaced + clean parse-failure passthrough + format-flag detection (golangci)

…lters

Every retry these filters caused had the same root: RTK kept the cosmetic
summary but dropped the one actionable line (the error/failure message), then
advertised a verbose tee-log -- so agents retried and pulled back more bytes
than the unfiltered output.

- go test: drop the tee for 'go test'. The [full output: ...go_test.log]
  pointer handed out the raw 'go test -json' dump (3-8x verbose); agents cat'd
  it on failure. Build errors and per-test failures are already inline.
- go vet: keep every finding line, not just '.go:' lines. Location-less
  compiler/cgo failures (fatal error: pcap.h: No such file or directory) were
  dropped, then reported as 'No issues found' on a hard failure. Stop
  truncating the message tail mid-line.
- golangci-lint: emit standard 'file:line:col: message (linter)' findings. The
  violation message (Text) was parsed and discarded, leaving only counts.
- golangci-lint: passthrough verbatim when the user supplies --out-format /
  --output.* instead of force-parsing JSON and emitting a parse-error string
  that reads as a tool failure.

Savings stay high vs raw (golangci 78-84%); go vet passes tiny failures
through by design (compressing 323 B is negative value).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant