Skip to content

feat(rtk): exclude informationally critical commands from RTK output filtering#461

Open
paolomainardi wants to merge 1 commit into
masterfrom
feat/460-rtk-exclude-critical-commands
Open

feat(rtk): exclude informationally critical commands from RTK output filtering#461
paolomainardi wants to merge 1 commit into
masterfrom
feat/460-rtk-exclude-critical-commands

Conversation

@paolomainardi

@paolomainardi paolomainardi commented May 12, 2026

Copy link
Copy Markdown
Member

🤖 This was written by an AI agent on behalf of @paolomainardi.

Summary

  • Adds exclude_commands patterns for 7 informationally critical commands where RTK's output filtering silently loses or rewrites data that AI agents rely on
  • Upstream fixes filed for the 3 git bugs we found — patterns can be removed as fixes are released

Excluded Commands

Command Bug Upstream
git diff Drops context lines before first change rtk-ai/rtk#1852, PR #1855
git log Injects --no-merges, hides merge commits rtk-ai/rtk#1853, PR #1856
git status Loses detached HEAD commit SHA rtk-ai/rtk#1854, PR #1857
tsc Fabricates "No errors found" rtk-ai/rtk#1772
helm template Drops K8s manifests at ~40 lines rtk-ai/rtk#1626
ls Hides .env, node_modules, etc.
pip list Groups + truncates package list

Follow-up

Tracking issue to remove patterns once upstream fixes land: #464

Refs: #460

Copilot AI review requested due to automatic review settings May 12, 2026 14:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Sparkdock’s RTK hook configuration to prevent RTK output filtering from altering/truncating the output of “informationally critical” commands (where inaccurate output is worse than verbose output), aligning with the rationale in issue #460.

Changes:

  • Expanded config/rtk/exclude-commands.toml with additional exclude patterns for critical read/inspection commands (git diff/log/status, tsc, helm template, ls, pip list) and organized the list into two commented sections.
  • Added a CHANGELOG entry documenting the expanded exclusion set and rationale.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
config/rtk/exclude-commands.toml Adds and documents new exclude patterns for informationally critical commands, while keeping destructive-operation exclusions intact.
CHANGELOG.md Records the RTK exclude expansion as a “Changed” item.

@paolomainardi

Copy link
Copy Markdown
Member Author

🤖 This was written by an AI agent on behalf of @paolomainardi.

Validation: all 7 exclusions confirmed on RTK v0.39.0

Tested each command on this machine (rtk 0.39.0, Linux x86_64). Every issue reproduced.

1. git diff — CONFIRMED: truncates output

Metric Raw RTK
Line count 1005 110
Content Full diff 720 lines silently truncated

RTK appends [full diff: rtk git diff --no-compact] but an agent doesn't know to use that flag.

2. git log — CONFIRMED: caps at 10 commits, truncates lines

Metric Raw RTK
Commits shown 25 10
Line length Full Truncated at ~80 chars with ...

3. git status — CONFIRMED: rewrites detached HEAD, truncates file lists

Detached HEAD:

  • Raw: HEAD detached at 2eff3e3
  • RTK: * HEAD (no branch) — SHA lost, "detached" warning gone

File lists: 30 untracked files → RTK shows 10, hides 20 with ... +20 more

4. tsc --pretty — CONFIRMED: fabricates success message

$ rtk npx tsc --noEmit --pretty
TypeScript: No errors found    ← LIE
exit: 2                        ← actual exit code says errors exist

Without --pretty, RTK correctly shows errors. The bug is specifically in ANSI-colored output parsing.

5. helm template — CONFIRMED: caps at 40 lines

Metric Raw RTK
Line count 220 41
Templates visible 10 of 10 2 of 10

8 Kubernetes resources silently dropped.

6. ls — CONFIRMED: hides 13 directories via NOISE_DIRS

Hidden: .env/, .git/, node_modules/, __pycache__/, .venv/, dist/, build/, .cache/, .idea/, .vscode/, coverage/, target/. Only vendor/ survived from 14 directories.

Files (.env.production, .env_file) are shown — the filter targets directory names.

7. pip list — CONFIRMED: truncates per letter group

210 packages total, but groups capped at 10 entries each:

  • [P] group: shows 10, hides 42 (including most py* packages)
  • [A] group: shows 10, hides 6
  • [S] group: shows 10, hides 10

The Reddit post's claim of "2 packages" was wrong for v0.39.0, but truncation is still significant.

…filtering

Refs: #460
Assisted-by: opencode/github-copilot/claude-opus-4.6
@paolomainardi paolomainardi force-pushed the feat/460-rtk-exclude-critical-commands branch from e484488 to 6b71d58 Compare May 12, 2026 16:15
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.

2 participants