Commit Graph

590 Commits

Author SHA1 Message Date
Florian BRUNIAUX cb30d174f7 Merge pull request #525 from zerone0x/fix/docs-branch-naming-474
Docs correct — branch names use slash prefixes, not conventional-commit format in parentheses.
2026-03-28 01:46:47 +01:00
Florian BRUNIAUX fb35e23952 Merge pull request #865 from timeshift92/fix/windows-startup-stack-849
LGTM. Correct fix — Clap's command graph can overflow the default 1MB Windows stack. /STACK:8388608 is a standard mitigation.
2026-03-28 01:46:45 +01:00
Florian BRUNIAUX b79623c3a6 fix(ls): suppress summary line when stdout is piped
fix(ls): suppress summary line when stdout is piped
2026-03-28 01:15:21 +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
aesoft eae2fee0c2 fix(security): missing toml pkg 2026-03-27 19:20:15 +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 6e0f52b192 docs: update ARCHITECTURE.md module count from 60 to 64
Fixes Documentation Validation CI check (main.rs=64, ARCHITECTURE.md was 60).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
2026-03-26 19:16:06 +00:00
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
Ousama Ben Younes 4ce95a321f test: add subprocess test for RTK_DISABLED=1 stderr warning
Verifies that `rtk rewrite "RTK_DISABLED=1 git status"` emits the
warning on stderr, not just that rewrite_command returns None.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
2026-03-26 19:03:09 +00:00
Ousama Ben Younes 08d1abc4a8 warn: emit stderr warning when RTK_DISABLED=1 is detected
When the rewrite hook sees RTK_DISABLED=1, it now prints a warning to
stderr before skipping the rewrite. This educates AI agents to stop
overusing the bypass — a real session showed 30% of commands using
RTK_DISABLED=1 unnecessarily, dropping savings from ~65% to 48%.

The warning is on stderr (not stdout) so it doesn't affect command
output or piping. The bypass still works exactly as before.

Fixes #508

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
2026-03-26 19:03:09 +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
sveitser bec18c40a2 fix: use /usr/bin/env shebangs for portability across systems 2026-03-26 19:46:28 +01:00
aesoft 2efe860f45 Merge pull request #826 from rtk-ai/refacto-folders-and-documentation
feat(refacto-codebase-onboarding): partie 1 - folders and technical docs
2026-03-26 19:36:50 +01:00
aesoft bacff347b7 Merge pull request #868 from rtk-ai/release-please--branches--master--components--rtk
chore(master): release 0.34.0
dev-0.34.1-rc.72 dev-0.34.1-rc.79 v0.34.0 dev-0.34.1-rc.80 dev-0.35.0-rc.82 dev-0.35.0-rc.81 dev-0.34.1-rc.71
2026-03-26 19:13:24 +01:00
github-actions[bot] 153f9e0459 chore(master): release 0.34.0 2026-03-26 18:10:56 +00:00
aesoft 966bcbe638 Merge pull request #859 from rtk-ai/develop
fix: truncation accuracy + Copilot init + binary file detection
2026-03-26 19:10:08 +01:00
aesoft b7b2ef50fe Merge branch 'master' into develop 2026-03-26 18:28:06 +01: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
Ахмедов Нурбек Медетбаевич 12276c1743 fix(build): increase Windows startup stack
Signed-off-by: Ахмедов Нурбек Медетбаевич <n.akhmedov@uzdc.uz>
2026-03-26 21:39:11 +05:00
patrick szymkowiak 58a9633474 Merge pull request #833 from rtk-ai/fix/truncation-accuracy-tests
fix(truncation): accurate overflow counts and omission indicators
2026-03-26 10:20:17 +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
patrick szymkowiak 5e8626d6aa Merge pull request #824 from rtk-ai/docs/readme-copilot-vibe
docs(readme): fix Copilot setup + add Vibe
2026-03-26 08:50:11 +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
aesoft 91992fd8dc fix(refacto): rm old tmp file 2026-03-25 20:27:53 +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
Patrick szymkowiak 19d35f57d3 docs(readme): fix Copilot setup instructions + add Vibe status
- Split Copilot into VS Code (transparent rewrite) and CLI (deny-with-suggestion)
- Use --copilot flag (consistent with --gemini, --codex, --opencode)
- Add Mistral Vibe as planned (blocked on upstream #531)
- Fix Copilot section with VS Code vs CLI details
- Update tool count from 9 to 10
- Verified all 10 tools against actual codebase

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-25 17:36:16 +01:00
patrick szymkowiak a00560aa05 Merge pull request #817 from rtk-ai/release-please--branches--master--components--rtk
chore(master): release 0.33.1
dev-0.34.0-rc.66 dev-0.34.0-rc.65 dev-0.34.0-rc.67 dev-0.34.0-rc.68 v0.33.1
2026-03-25 13:12:30 +01:00
github-actions[bot] d6425c311d chore(master): release 0.33.1 2026-03-25 12:08:28 +00:00
patrick szymkowiak 522bd648c8 Merge pull request #816 from rtk-ai/develop
fix(cicd): dev- prefix for pre-release tags
2026-03-25 13:07:47 +01:00
patrick szymkowiak 9c212752fc Merge pull request #814 from rtk-ai/fix/cicd-prerelease-tags
fix(cicd): use dev- prefix for pre-release tags
2026-03-25 13:00:19 +01:00
Patrick szymkowiak 32c67e0132 fix(cicd): use dev- prefix for pre-release tags to avoid polluting release-please
Pre-release tags on develop used v* prefix (e.g. v0.33.1-rc.60) which
release-please interpreted as the latest version, causing it to generate
wrong release versions. Changed to dev- prefix (e.g. dev-0.34.0-rc.61)
so release-please only sees stable v* tags.

Cleaned up: 42 RC releases and tags deleted.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-25 12:47:18 +01:00
Patrick szymkowiak 0649e974fb fix: hook security + stderr redirects + version bump (#807)
* fix(hook): respect Claude Code deny/ask permission rules on rewrite
* fix(permissions): check deny rules before rewrite + flush stdout
* fix(permissions): support *:* and leading/middle wildcards
* fix: strip trailing stderr redirects before rewrite matching (#530)
* chore: bump version to 0.33.0

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
dev-0.33.1-rc.62
2026-03-25 11:37:02 +01:00
Patrick szymkowiak 76ce711484 chore: merge master into develop (resolve version conflicts)
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-25 10:09:26 +01:00
patrick szymkowiak c0bd16573e Merge pull request #804 from rtk-ai/fix/version-bump-033
chore: bump version to 0.33.0
2026-03-25 09:44:23 +01:00