Repository navigation
Description
Three filters that lose or misattribute the one fact their output exists to convey.
Provenance: AI-assisted source audit, human-directed, at v0.44.2 (700bdde). All three run side by side against the real tools; outputs verbatim.
1. git stash list deletes the branch each stash came from
$ git stash list
stash@{0}: On main: main-side edit
stash@{1}: On hotfix: hotfix edit
$ rtk git stash list
stash@{0}: main-side edit
stash@{1}: hotfix edit
src/cmds/git/git.rs:1854-1873 strips everything up to the second ": ", which removes On <branch>: / WIP on <branch>:.
That prefix is the field that makes a stash list actionable. Someone — or an agent — choosing an entry to git stash pop now cannot tell which branch it was taken from, and popping a stash from another branch applies unrelated work onto HEAD. The failure is silent: either it merges cleanly and produces wrong code, or it conflicts for reasons the reader cannot explain from what rtk showed them.
Note the unit test at git.rs:2348-2351 asserts the stripped form, so a fix would need that test updated.
2. wc labels files by the last whitespace-separated token
$ wc -l "alpha report.txt" "beta report.txt" "gamma report.txt"
1 alpha report.txt
5 beta report.txt
2 gamma report.txt
8 total
$ rtk wc -l "alpha report.txt" "beta report.txt" "gamma report.txt"
1 report.txt
5 report.txt
2 report.txt
Σ 8
src/cmds/system/wc_cmd.rs:178-179,199 do line.split_whitespace() then take .last() as the filename. Three distinct files become three rows labelled report.txt carrying three different counts — so the output does not merely lose the names, it attributes counts to a file that does not exist.
Filenames with spaces are ordinary on Windows and macOS.
3. rtk env prints the AWS secret and drops the database URL
With AWS_SECRET_ACCESS_KEY, DATABASE_URL and MY_API_KEY all set:
$ rtk env
… AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI_FAKE_TEST_VALUE ← printed in full
Total: 74 vars (showing 27 relevant)
DATABASE_URL: absent. MY_API_KEY: absent.
To be fair about what this is and is not: plain env prints all of them, so this is not a leak relative to the tool being wrapped. The problem is the selection. src/cmds/system/env_cmd.rs:140-152 routes AWS* into a category that is printed with no redaction, while is_interesting_var (:176-179) limits the general case to HOME/USER/LANG/LC_*/TZ/PWD/OLDPWD.
So a command that presents itself as filtered ("showing 27 relevant") keeps the credential and discards the connection string. Asking "is DATABASE_URL set?" through rtk returns no — which is wrong — while the AWS secret is surfaced to whatever reads the output, including an agent transcript.
Suggested directions (untested — no programmer has reviewed these)
- Keep the
On <branch>:prefix — it is short and it is the point of the line. If compression is needed, the commit subject is the better thing to shorten. - Reconstruct the filename by removing the leading count fields rather than taking the last token, or invoke
wcin a mode with an unambiguous separator. - Either redact values in the credential categories, or stop treating
AWS*as automatically printable, and widenis_interesting_varsoDATABASE_URL-shaped variables are not dropped. Printing secrets while hiding non-secrets is the worst of both.
Not verified
A related claim from the same review — that rtk env miscounts PATH entries because it splits an already-truncated 50-character preview on : — I could not confirm. My output had a different shape from the one described (PATH Variables: rather than PATH (N entries)), so I could not compare a count and am not asserting it. The value-truncation code at env_cmd.rs:36-41 is real; the miscount is not something I demonstrated.
Activity
pszymkowiak commentedon Aug 4, 2026
🔍 Automated Triage
bughighSummary
Three independent output-correctness bugs:
git stash listdrops the source branch,wcmislabels multi-file space-containing filenames with the wrong name, andenv's relevance filter prints AWS secrets unredacted while dropping DATABASE_URL — fix each filter (git.rs:1854-1873 incl. test at 2348-2351, wc_cmd.rs:178-199, env_cmd.rs:140-179).📁 Relevant files
src/cmds/git/git.rssrc/cmds/system/wc_cmd.rssrc/cmds/system/env_cmd.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
HetCreep commentedon Sep 16, 2026
Re-verified against
develop@5e0f92c— verified by reading the code at this commit, not by building or running it. All three findings are still fully live; nothing here is fixed. Two of the three citations are unchanged, the stash one moved because of a file rename — corrected below.1.
git stash liststrips the originating branch — still live, citation moved.filter_stash_listnow lives atsrc/cmds/git/git_cmd.rs:3327-3346(originally cited atgit.rs:1854-1873). The function itself hasn't changed at all:git log -p 0de9610..5e0f92con this path shows zero commits touchingfilter_stash_listacross the full 468-commit range. It still splits each line on the first": ", and if a second": "follows, keeps only the text after it — sostash@{0}: On main: main-side editstill becomesstash@{0}: main-side edit, with the branch name gone. The pinning test moved with the file, not away from the bug:test_filter_stash_listis now atgit_cmd.rs:4811-4816and still asserts the stripped form ("stash@{0}: abc1234 fix login", no branch).The move is a straight rename,
git.rs→git_cmd.rsin70ec493, a 0-line diff on the rename itself (the same rename was already confirmed under #3408, for that issue's git-related half). In between, roughly 60 unrelated commits reworked git diff/show/log/stash patch-mode-flag parsing — a different code path thanlist— adding about 1,470 lines ahead of this function, which is the entire reason the citation drifted from ~1860 to ~3330.Correction to the original report: please re-cite this as
src/cmds/git/git_cmd.rs:3327-3346(test at:4811-4816), not the oldgit.rsline numbers.2.
wcmislabels space-containing filenames by their last token — still live, no drift.src/cmds/system/wc_cmd.rshas zero commits in0de9610..5e0f92c, so the original citations are still exactly right::178-179(line.split_whitespace().collect(), thenparts.last().copied()) and:199(strip_prefix(parts.last().unwrap_or(&""), &common_prefix)).wc -l "alpha report.txt" "beta report.txt"still labels both rowsreport.txt, since only the last whitespace-split token of each line survives as the filename.3.
rtk envprints the AWS secret while droppingDATABASE_URL/API-key vars — still live, no drift.src/cmds/system/env_cmd.rshad exactly one commit in range,d00c514('refactor: adopt let-chains'), and it's a pureif let→ let-chain syntax rewrite on the unrelated filter-arg branch (lines 30-34) — the categorization logic is untouched.is_cloud_var(:140-156) still matches"AWS"; the categorization loop still routes cloud matches to output (:50-51) and prints them unredacted (:87-92), with truncation only kicking in past 100 characters (:36-41) — well beyond the length of a typical AWS secret. Meanwhileis_interesting_var(:176-178) is still exactly["HOME", "USER", "LANG", "LC_", "TZ", "PWD", "OLDPWD"]matched viastarts_with, soDATABASE_URLandMY_API_KEYmatch none of the four category functions (path/lang/cloud/tool) oris_interesting_var, and both are silently omitted fromrtk env's output entirely — the same gap as originally reported.Please don't close this — nothing here is fixed. The only actionable change is the citation correction on finding 1.
fix(wc): keep a file name with spaces whole