Commit Graph

246 Commits

Author SHA1 Message Date
Adrien Eppling c1c56f24d7 style: fix cargo fmt in ls.rs assert macros
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:02:17 +02:00
aesoft 495a152059 fix(emots): replace 📊 with "Summary:" 2026-03-30 14:41:21 +02:00
Florian BRUNIAUX c54afe3da8 Merge pull request #884 from manulqwerty/fix/hook-rewrite-wc 2026-03-30 10:22:55 +02:00
aesoft 2d2f199983 Merge pull request #883 from rtk-ai/hotfix/telemetry-salt-hash
fix(security): salt device hash for telemetry
2026-03-28 14:00:26 +01:00
aesoft 8ab0f3da47 Merge pull request #706 from shwoop/go-tool-golangci
feat(go): Support golangci-lint via go tool
2026-03-28 11:47:57 +01:00
aesoft 8e42120ea3 fix(security): set 0600 permissions on salt file 2026-03-28 10:46:08 +01:00
Florian BRUNIAUX 9b9075cbb1 Merge pull request #847 from MauroDeryckere/fix/cat-flag-rewrite
Correct fix. cat flags like -A/-v/-e have no rtk read equivalent — skipping rewrite is the right behavior. cat -n correctly preserved. Well tested.
2026-03-28 02:07:23 +01:00
Florian BRUNIAUX a0d6874f7b Merge pull request #677 from TechWizard9999/fix/cargo-clippy-show-error-details
LGTM after code review. truncate() correctly imported, error_details block placed before rule frequency table, test covers the main case. Minor duplication for error[Exxxx] style but not a bug.
2026-03-28 01:57:32 +01:00
Florian BRUNIAUX 5a0144d185 Merge pull request #763 from mvanhorn/osc/759-include-finished-line-in-cargo-output
Correct. The Finished line carries useful signal (build time + profile). Defensive implementation with Option fallback.
2026-03-28 01:50:18 +01:00
Florian BRUNIAUX 0a5d5d5392 Merge pull request #650 from tobwen/fix/psql-disable-help-flag
Correct fix. disable_help_flag = true is the right pattern for passthrough commands — consistent with other commands in the codebase.
2026-03-28 01:49:32 +01:00
Florian BRUNIAUX da67c3e46a Merge pull request #562 from yogasw/fix/gain-history-utc-to-local-time
Correct fix. UTC timestamps in a local CLI history view is a UX bug — chrono::Local is already a dependency.
2026-03-28 01:48:40 +01:00
shwoop 8f985a22d1 feat(go): Support golangci-lint via go tool
As of go v1.24, tools such as golanci-lint can be managed via the mod
file and called directly on the go binary via the tool subcommand.

When called via tools, we now apply the same logic to compact the
results as in the directly called command.

Signed-off-by: shwoop <monkey.mambo.al.ferguson@gmail.com>
2026-03-27 19:53:39 +01:00
aesoft 699f68236b fix(telemetry): cache salt in-process 2026-03-27 19:36:41 +01:00
aesoft f7ec883a78 fix(telemetry): docs + real info from "rtk init -g" 2026-03-27 19:28:43 +01:00
Manuel LOpez 099a8f3e6d fix(hook): rewrite wc commands to rtk wc 2026-03-27 19:19:35 +01:00
aesoft 60cba0f5d8 fix(security): salt device hash for telemetry 2026-03-27 19:17:00 +01:00
Mauro Deryckere 2fce6bfee7 fix(rewrite): skip cat rewrite when incompatible flags are present
cat flags like -v, -A, -e, -t, -s have different semantics than
rtk read flags (-v means verbose, -n means line numbers). Blindly
forwarding flags caused incorrect behavior (e.g. cat -A file →
rtk read -A file which fails).

Only skip rewrite for incompatible flags. cat -n (line numbers) maps
correctly to rtk read -n, so it is still rewritten for token savings.
Plain `cat file` continues to rewrite to `rtk read file` as before.
2026-03-27 09:13:26 +01:00
Yoga Setiawan 140e1f5958 fix(gain): convert history timestamps from UTC to local timezone 2026-03-27 14:43:34 +07:00
Roopesh def3424eb4 fix(cargo): show clippy error details in compact output
Signed-off-by: Roopesh <roopesh1724989@gmail.com>
2026-03-27 07:18:50 +05:30
Ousama Ben Younes 6fe769cf00 refactor(ls): remove unnecessary entries.clone() in pipe branch
Avoids one allocation since entries is not used after the if/else.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
2026-03-26 19:15:44 +00:00
Ousama Ben Younes 3e1f75a8d5 fix(ls): suppress summary line when stdout is piped
rtk ls | wc -l returned N+2 instead of N because the summary line
(📊 X files, Y dirs) and blank line were always written to stdout.

Now uses std::io::stdout().is_terminal() to suppress the summary
when piped, following standard Unix convention (ls, grep, find all
do this).

Fixes #482

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
2026-03-26 19:15:44 +00:00
Matt Van Horn 72b1e592d9 fix: include Finished line in cargo build success output
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 11:58:29 -07:00
aesoft d9be630bef Merge branch 'develop' of https://github.com/rtk-ai/rtk into refacto-folders-and-documentation 2026-03-26 18:11:34 +01:00
Florian BRUNIAUX 23f4fee2a7 chore: fix fmt + add CHANGELOG entries for truncation fixes
- Run cargo fmt on diff_cmd.rs and init.rs (line length violations)
- Add Unreleased section to CHANGELOG.md with the two bug fixes
  from this PR (required by doc review CI gate)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-26 10:06:43 +01:00
Florian BRUNIAUX 6a5ae1484b fix(merge): resolve conflict with develop in diff_cmd.rs
Keep truncation accuracy fix (HEAD) — accurate overflow counts in
condense_unified_diff. Drop test_condense_unified_no_truncation from
develop (incompatible). Add test_no_truncation_large_diff and
test_long_lines_not_truncated from develop (test compute_diff, no conflict).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 09:49:45 +01:00
patrick szymkowiak 599ad25deb Merge pull request #767 from zerone0x/fix/issue-765-swift-test
fix: rewrite swift test commands
2026-03-26 09:21:56 +01:00
Florian BRUNIAUX 185fb97061 fix(git): replace vague truncation markers with exact counts
Two silent truncation bugs in git.rs:

1. compact_diff: hunk truncation showed "... (truncated)" with no count.
   An LLM had no way to know if 5 or 450 lines were dropped. Replace
   with "... (N lines truncated)" by tracking hunk_skipped separately
   from hunk_shown — flush the count at each hunk/file boundary.

2. filter_log_output: commit body beyond 3 lines was silently dropped.
   A 20-line body explaining a breaking change would show 3 lines with
   no indicator that 17 were omitted. Now appends "[+N lines omitted]"
   when body_omitted > 0.

Adds 2 RED-then-GREEN tests to lock in the new behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-25 22:30:22 +01:00
Florian BRUNIAUX 5399f836a5 fix(diff): correct truncation overflow count in condense_unified_diff
The overflow message "+N more" in condense_unified_diff was lying.
The `changes` vec was capped at 15 entries, so `changes.len() - 10`
could only reach 5 — reporting "+5 more" when 190 lines were actually
truncated. Fix: track `added + removed` directly and compute true
overflow as `(added + removed) - 10`.

Adds 7 accuracy tests across 4 modules to lock in correct overflow
reporting:
- diff_cmd: overflow count matches true total (200 changes → "+190 more")
- diff_cmd: no spurious overflow message for 8 changes
- git: format_status overflow count is exact (25 staged → "+10 more")
- git: compact_diff recovery hint present when hunk is truncated
- grep: documents uncapped-vector invariant that prevents the diff bug
- filter: smart_truncate kept + reported_more == total_lines

Closes the test gap flagged in testing-patterns.md backlog for diff_cmd.rs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-25 21:59:43 +01:00
Patrick szymkowiak 5e0f3ba774 fix(read): default to no filtering — show full file content
Changed default filter level from "minimal" to "none". RTK read now
shows complete file content by default. Filtering is opt-in:

  rtk read file.rs              # full content (was: minimal filter)
  rtk read file.rs -l minimal   # light filtering (opt-in)
  rtk read file.rs -l aggressive # signatures only (opt-in)

Also adds fallback: if a filter produces empty output on non-empty
file, show raw content with a warning.

Fixes #822

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-25 21:08:07 +01:00
Patrick szymkowiak 8886c14c9c fix(read): detect binary files and prevent empty output on filter failure
- Detect binary files (null bytes in first 8KB) before filtering
- Show clear message: [binary file] path (size) instead of empty output
- Fallback to raw content if filter produces empty output on non-empty file
- Prevents LLM from concluding a 70MB file is "empty" (was #822)

Fixes #822

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-25 20:53:43 +01:00
Patrick szymkowiak 80fc29a839 fix(diff): never truncate diff content — show all changes in full
Silent truncation caused a user to make irreversible decisions on
incomplete data. rtk diff was capping at 50 changes and 70-80 char
lines without clear warning to the LLM.

- Remove all line truncation (70/80 char limits)
- Remove change count limit (was 50, now unlimited)
- Remove truncate import (no longer needed)
- Same fix for condense_unified_diff (stdin/git diff path)
- Add 3 tests verifying zero truncation on large inputs

The only compression remaining is the summary header
(+N added, -N removed, ~N modified) and stripping diff metadata.

Fixes #827

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-25 20:10:35 +01:00
aesoft 135fea693e fix(refacto): conflict w/ dev 2026-03-25 19:56:53 +01:00
aesoft 967d2bfcf9 Merge branch 'develop' of https://github.com/rtk-ai/rtk into refacto-folders-and-documentation 2026-03-25 19:55:42 +01:00
aesoft 0925cf21e0 fix(docs): last review 2026-03-25 19:12:46 +01:00
Patrick szymkowiak 9e19aac75e feat(init): add --copilot flag for GitHub Copilot integration
- Add `rtk init --copilot` that creates .github/hooks/rtk-rewrite.json
  and .github/copilot-instructions.md in the current project
- Hook routes through `rtk hook copilot` (auto-detects VS Code vs CLI)
- VS Code Copilot Chat: transparent rewrite via updatedInput
- Copilot CLI: deny-with-suggestion (CLI limitation)
- Update README: split Copilot VS Code/CLI, add Vibe status, 10 tools

Closes #823

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-25 17:45:12 +01:00
aesoft 46fa31c4b8 chore(refacto-codebase): Folders + Technical docs
- codebase more clear for humans and AI agents
- alignement on vision and filter quality in technical docs
2026-03-24 22:14:35 +01:00
Patrick szymkowiak 36a6f48229 fix: strip trailing stderr redirects before rewrite matching (#530)
Commands like `git status 2>&1` or `cargo test 2>/dev/null` were not
rewritten because the redirect suffix prevented pattern matching.

Now strips redirects (2>&1, 2>/dev/null, etc.) before matching,
then re-appends them to the rewritten command.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-24 12:35:26 +01:00
patrick szymkowiak a051a6f5e5 Merge pull request #576 from rtk-ai/fix/hook-bypass-permission
fix(hook): respect Claude Code deny/ask permission rules on rewrite
2026-03-24 10:45:00 +01:00
aesoft f1ac236e46 fix: start folder & docs refacto 2026-03-23 19:00:52 +01:00
patrick szymkowiak 0eecee5bf3 fix: add telemetry documentation and init notice (#640) (#788)
- Add "Privacy & Telemetry" section to README explaining what is
  collected, what is NOT, and how to opt-out
- Show telemetry notice during rtk init so users are informed

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-23 11:52:26 +01:00
Matt Van Horn 2ef0690767 fix(gh): skip compact_diff for --name-only/--stat flags in pr diff
When `gh pr diff` is called with output-format-changing flags like
--name-only, --stat, --name-status, --numstat, or --shortstat, the
output is a plain filename/stat list rather than a unified diff.
compact_diff() expects diff headers and hunks, so it produces empty
output from these formats.

Skip filtering and passthrough directly when any of these flags are
present. The output is already compact and doesn't benefit from diff
compaction.

Fixes #730

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-03-21 19:12:50 -07:00
aesoft 75cd2232e2 Merge pull request #775 from mvanhorn/osc/720-issue-pr-view-comments-passthrough
fix(gh): passthrough --comments flag in issue/pr view
2026-03-22 00:08:15 +01:00
aesoft dc6b0260ab Merge pull request #729 from ousamabenyounes/fix/test-failure-error-message-truncation
fix(formatter): show full error message for test failures (#690)
2026-03-21 22:47:18 +01:00
Matt Van Horn fdeb09fb93 fix(gh): passthrough --comments flag in issue/pr view
Add --comments to the passthrough trigger list in should_passthrough_pr_view().
The --comments flag changes gh output to include comments, but the rtk
filter hardcodes a JSON field list without 'comments', silently
discarding all comment data. This misleads AI agents into concluding
issues have no responses.

Add should_passthrough_issue_view() for view_issue(), which previously
had no passthrough check at all. Both functions now passthrough on
--comments, --json, --jq, and --web.

Fixes #720

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-03-21 13:54:17 -07:00
aesoft 8eefef1b49 Merge pull request #746 from danielmarbach/dotnet-test
fix(dotnet): TRX injection for Microsoft.Testing.Platform projects
2026-03-21 17:22:23 +01:00
Ousama Ben Younes b4ccf046f5 fix(playwright): add tee_and_hint pass-through on failure (#690)
Add crate::tee::tee_and_hint call to playwright_cmd::run(), matching
the pattern used by all other test runners (vitest, pytest, cargo,
go, rspec, rake). When playwright fails, the full raw output is saved
to ~/.local/share/rtk/tee/ and a one-line hint is appended so the
LLM can read the complete output without re-running.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
2026-03-21 15:58:32 +00:00
Ousama Ben Younes f7b09fc86a fix(formatter): show full error message for test failures (#690)
format_compact() was truncating error messages to 2 lines via .take(2).
Playwright (and vitest, pytest, cargo test) errors contain the critical
expected/received diff and call log starting at line 3+, so agents saw
only the error type with no actionable debug information.

Fix: iterate all lines of error_message for each failure instead of
taking the first 2. Summary line stays compact; only the per-failure
detail is preserved in full.

Affects all test runners using TestResult (playwright, vitest, cargo,
pytest, dotnet) — any test failure is now fully visible.

Closes #690

Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
2026-03-21 15:51:55 +00:00
zerone0x 941a057016 fix: rewrite swift test commands
Fixes #765

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: zerone0x <hi@trine.dev>
2026-03-21 22:58:48 +08:00
Daniel Marbach cadbb231af Fix trx injection for dotnet tests running with various Microsoft Testing Platfform modes
Signed-off-by: Daniel Marbach <danielmarbach@users.noreply.github.com>
2026-03-20 20:27:34 +01:00
aesoft 95a4961e4a Merge pull request #722 from apowis/fix/golangci-lint-v2-compatibility
fix(golangci-lint): add v2 compatibility with runtime version detection
2026-03-20 16:41:44 +01:00