Files
Adrien Eppling 861a46dee5 fix(core): never-worse output guard so RTK never exceeds the raw command
RTK could emit more tokens than the underlying command on small inputs:
filters that add headers, summaries, re-indentation, or a tee hint, plus
synthetic no-result messages ("0 matches", "No stashes", "[docker] 0
containers") printed where the raw command emitted nothing. Both break the
Transparency principle and inflate tokens instead of saving them.

- core::guard::never_worse(raw, filtered) returns raw when the filtered form
  has more tokens (reuses tracking::estimate_tokens), so RTK output is never
  larger than the real command.
- runner::emit_guarded(filtered, hint, raw) composes body + tee hint, guards
  the whole, prints, and returns what was shown so printed == tracked.
- run_captured_filter guards the run_filtered* family centrally; per-site
  guards cover the remaining single-string filters.
- On empty raw, emit empty and preserve the exit code instead of a synthetic
  no-result message (the messages were cosmetic with no dependents; #2461
  reports the grep one as actively harmful).
- git stash show now propagates its exit code instead of masking a real
  failure as Ok(0).

Resolves #2551.
2026-06-23 21:53:35 +02:00
..
2026-05-10 12:44:38 +02:00

.NET Ecosystem

Part of src/cmds/ — see also docs/contributing/TECHNICAL.md

Specifics

  • dotnet_cmd.rs uses DotnetCommands sub-enum in main.rs
  • Internal helper modules (dotnet_trx.rs, dotnet_format_report.rs, binlog.rs) are only used by dotnet_cmd.rs -- they parse specialized .NET output formats (TRX XML, binary logs, format reports)
  • Test fixtures are in tests/fixtures/dotnet/ (JSON and text formats)