fix(filters): aggresivity batch fix#1895
Open
aeppling wants to merge 3 commits into
Open
Conversation
…iltering Several filters dropped or rewrote information an agent needs, producing output that was misleading rather than merely compressed. This fixes the clear-cut cases surfaced by the TheDecipherist/rtk-test suite: - ls: stop hiding the `.env` file (removed `.env`/`env` from NOISE_DIRS). - git status: restore the explicit "HEAD detached at <sha>" line instead of the opaque "* HEAD (no branch)". - log/docker logs: recognise CRITICAL/FATAL/ALERT/EMERGENCY/SEVERE (and NOTICE) as severities so those lines are no longer silently filtered; expose `log` as a `rtk pipe` filter and accept a positional filter name. - wc: forward stdin to the child so `cat file | rtk wc` counts the pipe instead of reporting 0 (new RunOptions::inherit_stdin). - jest/vitest: include skipped/pending test count in the compact summary. - pytest: surface xfailed/xpassed counts and list XFAIL/XPASS entries with their reasons (adds `-rxX`). - ruff/eslint: list individual violations with file:line:col, not just rule/file group counts. - pnpm/npm list: render the actual package list instead of the false-positive "All packages up-to-date" when there's no upgrade info. - git add: stay silent on a no-op instead of printing an ambiguous "ok". - git stash: pass git's own message through instead of collapsing to "ok". - docker ps: keep the Status column (health/restart info) and list stopped/exited containers; docker images: show all images with full names; docker compose ps: use `-a` so crashed services stay visible. All 1870 unit tests pass; cargo fmt + clippy clean.
KuSh
approved these changes
May 15, 2026
Collaborator
KuSh
left a comment
There was a problem hiding this comment.
Minor nitpicks and questions. Otherwise LGTM!
| } | ||
| } | ||
| if running.len() > 20 { | ||
| rtk.push_str(&format!(" ... +{} more\n", running.len() - 20)); |
Collaborator
There was a problem hiding this comment.
nitpick, prefer utf8 character …
Suggested change
| rtk.push_str(&format!(" ... +{} more\n", running.len() - 20)); | |
| rtk.push_str(&format!(" … +{} more\n", running.len() - 20)); |
| if count > 15 { | ||
| rtk.push_str(&format!(" ... +{} more", count - 15)); | ||
| if stopped.len() > 20 { | ||
| rtk.push_str(&format!(" ... +{} more\n", stopped.len() - 20)); |
Collaborator
There was a problem hiding this comment.
Suggested change
| rtk.push_str(&format!(" ... +{} more\n", stopped.len() - 20)); | |
| rtk.push_str(&format!(" … +{} more\n", stopped.len() - 20)); |
| if lines.len() > 15 { | ||
| rtk.push_str(&format!(" ... +{} more", lines.len() - 15)); | ||
| if lines.len() > MAX_IMAGES { | ||
| rtk.push_str(&format!(" ... +{} more\n", lines.len() - MAX_IMAGES)); |
Collaborator
There was a problem hiding this comment.
Suggested change
| rtk.push_str(&format!(" ... +{} more\n", lines.len() - MAX_IMAGES)); | |
| rtk.push_str(&format!(" … +{} more\n", lines.len() - MAX_IMAGES)); |
|
|
||
| // Porcelain `-b` reduces a detached HEAD to "## HEAD (no branch)"; restore | ||
| // the explicit "HEAD detached at <sha>" from the plain status we captured. | ||
| if let Some(detached) = extract_detached_head(&raw_output) { |
Collaborator
There was a problem hiding this comment.
Wouldn't it be better to check that before calling format_status_output and pass it detached instead of replacing the result afterward?
| if pkgs.len() > 10 { | ||
| result.push_str(&format!(" ... +{} more\n", pkgs.len() - 10)); | ||
| if pkgs.len() > MAX_PER_LETTER { | ||
| result.push_str(&format!(" ... +{} more\n", pkgs.len() - MAX_PER_LETTER)); |
Collaborator
There was a problem hiding this comment.
while you're at it:
Suggested change
| result.push_str(&format!(" ... +{} more\n", pkgs.len() - MAX_PER_LETTER)); | |
| result.push_str(&format!(" … +{} more\n", pkgs.len() - MAX_PER_LETTER)); |
| } | ||
| if diagnostics.len() > MAX_VIOLATIONS { | ||
| result.push_str(&format!( | ||
| " ... +{} more violations\n", |
Collaborator
There was a problem hiding this comment.
Suggested change
| " ... +{} more violations\n", | |
| " … +{} more violations\n", |
| lines.push(format!(" {} {}{}", dep.name, dep.current_version, dev)); | ||
| } | ||
| if self.dependencies.len() > 50 { | ||
| lines.push(format!(" ... +{} more", self.dependencies.len() - 50)); |
Collaborator
There was a problem hiding this comment.
Suggested change
| lines.push(format!(" ... +{} more", self.dependencies.len() - 50)); | |
| lines.push(format!(" … +{} more", self.dependencies.len() - 50)); |
Comment on lines
+131
to
+134
| for dep in self.dependencies.iter().take(50) { | ||
| let dev = if dep.dev_dependency { " (dev)" } else { "" }; | ||
| lines.push(format!(" {} {}{}", dep.name, dep.current_version, dev)); | ||
| } |
Collaborator
There was a problem hiding this comment.
Isn't there a hierarchy in deps? dep > dev dep > opt dep > ... shouldn't we first print dependencies, then if < 50 pick dev dependencies until we reach 50?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary