Commit Graph

996 Commits

Author SHA1 Message Date
aesoft 06476d17cb Merge pull request #2035 from rtk-ai/fix/git-status-uall
fix(git): drop -uall from compact status so output never exceeds raw
dev-0.41.0-rc.232
2026-05-22 11:51:53 +02:00
Adrien Eppling 7753e487b3 fix(git): drop -uall from compact status so output never exceeds raw
The compact `git status` path ran `git status --porcelain -b -uall`. The
`-uall` flag expands fully-untracked directories into every file, while raw
`git status` collapses them (e.g. `node_modules/`). This made rtk output
larger than raw — measured ~29x on a 200-file untracked dir (5500B vs 191B) —
violating RTK's compress-or-match-raw invariant and inflating tokens.

Remove `-uall` so untracked directories collapse exactly like raw. This keeps
#991's actual fix intact: all modified/staged/renamed/conflict paths are still
shown with no grouped summaries or `... +N more` overflow markers (`-uall`
never affected those lines). Untracked files in partially-tracked dirs and any
paths git itself expands are still preserved by the formatter.

Measured (rtk vs raw git status):
- node_modules/ (200 files): 5500B (-2780%) -> 25B (+87% savings)
- normal (8 mod + 2 untracked): +71% -> +76%
- 17 modified (#991 case): unchanged at +58%, all 17 shown, 0 overflow markers

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 10:13:00 +02:00
aesoft 7d31049c88 Merge pull request #2020 from rtk-ai/master
sync
dev-0.41.0-rc.231
2026-05-21 17:29:21 +02:00
aesoft 1e5623573d Merge pull request #1998 from rtk-ai/fix/tee-hint-trunc-quality
refacto(truncations): Set global CAPS for truncation
dev-0.41.0-rc.230
2026-05-21 13:47:36 +02:00
aesoft d5a17315c5 fix(truncate): global caps reduce (avoid underflow and 0 results)
- Avoid underflow + 0 results caused by overwrite of global constant CAPS
- Soon user will be able to apply global configuration, this will change global CAPS and should not cause any underflow or 0 results, if overwrite sub >= CAPS -> use CAPS.
2026-05-21 11:24:16 +02:00
aesoft 9c80934dab Merge branch 'develop' into fix/tee-hint-trunc-quality 2026-05-21 10:27:00 +02:00
aesoft a04aa7e848 Merge pull request #1976 from YOMXXX/fix/copilot-instructions-preserve
fix(hooks/init): preserve user content in copilot-instructions.md
dev-0.41.0-rc.229
2026-05-20 22:49:34 +02:00
李冠辰 35a540c34b refactor(hooks/init): share write_rtk_block, unify malformed handling
Address review feedback on #1976:

- Extract write_rtk_block() shared dispatcher: eliminates the duplicated
  4-arm RtkBlockUpsert match between run_claude_md_mode and the former
  upsert_copilot_instructions (now inlined). Both callers stay under the
  ~60-line guideline.
- Unify malformed handling: both paths now bail!() with a diagnostic and
  the exact recovery command. CLAUDE.md previously warned and exited 0,
  silently skipping the OpenCode plugin step; behaviour is now consistent.
- Reorder run_copilot_at: upsert copilot-instructions.md BEFORE writing
  the hook config so a malformed file aborts the install without leaving
  a stale .github/hooks/rtk-rewrite.json on disk.

Regression coverage:
- test_claude_md_mode_refuses_malformed_block mirrors the existing
  copilot malformed test against the shared dispatcher contract.
- test_copilot_init_malformed_leaves_no_hook_on_disk pins the new write
  order so a future re-order regression is caught.

cargo fmt / clippy --all-targets / test --bin rtk: clean (1909 passed).
2026-05-21 00:46:58 +08:00
aesoft 6a578214bd Merge pull request #1997 from tylerezimmerman/fix/readme-license-apache-2.0
docs(readme): fix license references to match LICENSE (Apache-2.0)
dev-0.41.0-rc.228
2026-05-20 17:32:29 +02:00
aesoft b6054a5fef refacto(truncations): Set global CAPS for truncation
Following tee and hint refacto
Add global CAP constant to be inherited , to enable easier global configuration later
2026-05-20 17:29:14 +02:00
Tylere Zimmerman f2864eb8a9 docs(readme): fix license references to match LICENSE (Apache-2.0)
The README badge and footer claimed MIT, but the LICENSE file is
Apache License 2.0. Updates both references so the README matches
the authoritative LICENSE file.

Closes #1996

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-20 08:34:17 -05:00
李冠辰 194a1b4215 refactor(hooks/init): extract run_copilot_at for parallel-safe tests
run_copilot(ctx) is now a thin wrapper around run_copilot_at(base, ctx);
tests pass a TempDir path so they no longer mutate process-global cwd.
This eliminates flakes when cargo test runs in parallel (the default).

The public API is unchanged; only the internal seam moves.

Refs #1964
2026-05-20 12:18:52 +08:00
李冠辰 544a5f446b test(hooks/init): cover idempotency, stale-block, dry-run, fresh, malformed paths
Adds five additional tests around copilot-instructions.md upsert:
- idempotent re-init (no duplicated blocks, identical content)
- stale RTK block in-place update with surrounding user content preserved
- dry-run never creates or modifies the file
- fresh install creates file with RTK marker block when no file exists
- malformed pre-existing block (opening marker without closing) is
  refused with a clear error rather than silently rewritten

Refs #1964
2026-05-20 12:15:51 +08:00
李冠辰 d10816516b fix(hooks/init): preserve user content in copilot-instructions.md
run_copilot() previously called write_if_changed() which truncated any
pre-existing .github/copilot-instructions.md, destroying user-authored
Copilot rules.

This routes copilot-instructions.md through upsert_rtk_block() (the
same idempotent marker-block helper already used for CLAUDE.md and
AGENTS.md). The COPILOT_INSTRUCTIONS constant is wrapped in
<!-- rtk-instructions v2 --> ... <!-- /rtk-instructions --> markers
so subsequent inits replace only RTK-owned content; the rest of the
file is preserved verbatim. Malformed pre-existing blocks (opening
marker without closing) are refused with a remediation message
rather than silently rewritten.

Fixes #1964, #1891
2026-05-20 12:15:05 +08:00
李冠辰 2241428673 test(hooks/init): add red test for copilot-instructions preservation
Adds a TDD red test that asserts pre-existing user content in
.github/copilot-instructions.md must survive 'rtk init --copilot'.
Currently fails because run_copilot() uses write_if_changed() which
truncates the file.

Refs #1964
2026-05-20 12:13:45 +08:00
aesoft 15a0d2e7d6 Merge pull request #1928 from rtk-ai/fix/tee-hint-trunc-quality
fix(tee): safe truncation caps and tee/hint coverage
dev-0.41.0-rc.227
2026-05-19 11:37:48 +02:00
aesoft 4acdcf29f7 docs(cmds): truncations hints and recovery guidelines 2026-05-19 10:23:04 +02:00
aesoft 49606303d6 fix(rust): multi-line blocks used with tail hint 2026-05-19 10:23:03 +02:00
Adrien Eppling 548e4dd995 fix(tee): safe truncation caps and compose-ps tee content fix
Replace all bare magic offset literals (e.g. 21 for cap=20) with named
constants (MAX_XXX + 1) so offsets stay in sync if caps change.
Fix compose_ps to tee pre-formatted lines instead of raw tab-separated
input, so tail -n +N gives the agent readable content.
All 13 affected modules updated: container, dotnet, gh, glab, go, lint,
pnpm, pytest, rubocop, cargo, aws. 1884 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 10:23:01 +02:00
aesoft 90c285c380 Merge pull request #1895 from rtk-ai/fix/aggressive-filters-batch
fix(filters): aggresivity batch fix
dev-0.41.0-rc.226
2026-05-19 09:15:39 +02:00
Adrien Eppling f21b8642de fix(filters): split docker ps/-a paths, cap ruff violations at 50
- docker ps reverts to plain (no -a augmentation)
- docker ps -a / compose ps -a wired to the running/stopped split filter
- ruff Violations: capped at 50 + force_tee_tail_hint recovery
- tests for the ruff and pytest xfail caps
2026-05-18 19:06:57 +02:00
aesoft d6c56475e8 Merge pull request #1531 from ousamabenyounes/fix/issue-963
fix(git): stream push output to avoid spurious 30s timeout (#963)
dev-0.40.1-rc.225
2026-05-17 14:01:26 +02:00
aesoft 2dd0ec91ab Merge pull request #1720 from pagarsky/fix/kubectl-get-alias
fix(kubectl): compact get pods and services aliases
dev-0.40.1-rc.224
2026-05-17 12:27:17 +02:00
pagarsky b8172e5b1d fix(kubectl): compact get pods and services aliases
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-16 22:57:02 +03:00
aesoft 3571d5293d fix: '...' ascii to unicode, remove some comments 2026-05-16 15:23:06 +02:00
aesoft 4eefe2f225 fix: re-add env python as noisy dir 2026-05-16 15:06:46 +02:00
aesoft 46fe7c4729 feat(hints): add tail hints for tee & hints + address reviews
- fix signal truncation gaps + kush reviews
- added a new tee and hints function to give an hint with tail (avoid re-ingest of the head)
- extracted patterns in constants
2026-05-16 15:00:11 +02:00
Ousama Ben Younes be5178377f fix(git): stream push output via FilterMode::Streaming (#963)
## Problem (#963)

`rtk git push` reportedly times out: users see
`bash tool terminated command after exceeding timeout 30000 ms` while
plain `git push` to the same remote completes fine. P1-critical because
every Claude Code git push goes through rtk.

## Root cause

`run_push` used `cmd.stdin(Stdio::inherit()).output()`. `Command::output()`
captures both stdout and stderr until the child exits. Git push prints
its progress (`Counting objects` / `Compressing objects` / `Writing
objects`) to stderr and may prompt for SSH passphrases or HTTPS
credentials. With stderr captured, Claude Code's bash tool saw zero
output for 30+ seconds and killed the command — exactly the 30000 ms
message in the issue.

## Fix

Rewrite `run_push` on top of the streaming infrastructure that already
exists for this exact purpose (`stream::run_streaming` +
`FilterMode::Streaming`, added in 0.37.0).

Add a counterpart to `BlockStreamFilter<H: BlockHandler>` in
`src/core/stream.rs`: `LineStreamFilter<H: LineHandler>`. Where
`BlockStreamFilter` defaults to DROP and emits only collected blocks,
`LineStreamFilter` defaults to KEEP and lets handlers opt into dropping
noise. Trait surface mirrors `BlockHandler`:

- `should_skip(&mut self, line: &str) -> bool` — default false
- `observe_line(&mut self, line: &str)` — default no-op
- `format_summary(&self, exit_code, raw) -> Option<String>`

This lets future streaming commands reuse the line-oriented pattern.

`GitPushLineHandler` then becomes a tiny `LineHandler` impl:

- `should_skip` drops the high-volume progress phases (Enumerating /
  Counting / Compressing / Writing objects, Delta compression, Total)
  and blank lines.
- `observe_line` captures the up-to-date sentinel and the first ref
  update target (e.g. `master`) for the summary.
- `format_summary` emits `ok <ref>` / `ok (up-to-date)` / `ok` on
  success; nothing on failure (raw error lines already flowed through).

Stdin is inherited (`StdinMode::Inherit`) so SSH passphrase and HTTPS
credential prompts still reach the user. Tracking now records the real
raw output and the filtered output.

## Test plan

- [x] `cargo fmt --all -- --check`
- [x] `cargo clippy --all-targets -- -D warnings` — clean
- [x] `cargo test --all` — 1880 passed, 0 failed, 6 ignored
- Six unit tests cover the push handler: progress-prefix drop,
  up-to-date summary, remote message passthrough, no-summary-on-failure,
  first-ref-wins, and token-savings (>=60% on a representative payload).
- Four unit tests cover the new `LineStreamFilter` trait:
  default-keep-all, skip-drops-matching, summary-propagates-exit-code,
  observe-only-called-for-kept-lines.

## Notes

- Behaviour change: users now see git's native output line-by-line
  (with progress phases stripped) plus a final `ok <ref>` summary,
  instead of just the compact summary. This matches plain `git push`
  more closely and is what the issue reporter expects.
- No regression for other filters: `run_pull`, `run_fetch`, `run_clone`
  are untouched; only `run_push` is modified.

Closes #963

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
_Vibe Coded by Ousama Ben Younes_
_Developed With Ora Studio (Claude Code)_

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 22:13:59 +00:00
aesoft f6b28c292b fix(filters): add test for aggressive filter batch fix 2026-05-15 19:14:37 +02:00
aesoft 16803a6cce chore(filters): remove filter-level annotations and restore compose logs tail arg 2026-05-15 19:14:36 +02:00
Adrien Eppling 62fc0e0d21 fix(filters): address adversarial test-suite findings on aggressive filtering
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.
2026-05-15 19:12:05 +02:00
patrick szymkowiak 5f1d8b0e14 Merge pull request #1885 from rtk-ai/fix/compose-logs-tail-flag-v2
fix(docker): forward --tail flag in compose logs
dev-0.40.1-rc.223
2026-05-14 22:22:22 +02:00
patrick b70b0feec6 fix(docker): forward --tail flag in compose logs
Previously `rtk docker compose logs --tail=20 web` would fall through to
the passthrough handler because clap had no `--tail` field on the `Logs`
subcommand, resulting in 0% token savings. Additionally, `run_compose_logs`
always fetched 100 lines regardless of user input.

- Add `#[arg(long, default_value_t = 100)] tail: u32` to `ComposeCommands::Logs`
- Thread the value through to the docker invocation
- Default unchanged (100 lines), so bare `rtk docker compose logs` behaves as before

Ports the core fix from #580, retargeted onto current develop layout
(`src/cmds/cloud/container.rs`). Relates to #578.

Co-authored-by: Mihir Dash <137862945+slice-mihird@users.noreply.github.com>
2026-05-14 21:41:10 +02:00
aesoft 3ba1634555 Merge pull request #991 from em0t/fix/git-completeness
fix(git): preserve full status paths and untracked files
dev-0.40.1-rc.222
2026-05-14 13:44:42 +02:00
aesoft e8271848d7 Merge pull request #1368 from ousamabenyounes/fix/issue-1250
fix(install): reject archive with path traversal before extraction (#1250)
dev-0.40.1-rc.221
2026-05-13 22:08:35 +02:00
aesoft 1e0d01b68e Merge pull request #1878 from rtk-ai/release-please--branches--master--components--rtk
chore(master): release 0.40.0
v0.40.0
2026-05-13 21:56:28 +02:00
rtk-release-bot[bot] 120d99fc91 chore(master): release 0.40.0 2026-05-13 19:40:00 +00:00
Adrien Eppling 0c6a838594 fix(cicd): set release-please target-branch to master [skip ci] 2026-05-13 21:33:11 +02:00
aesoft 90525ac688 Merge pull request #1747 from rtk-ai/develop
Next Release
2026-05-13 20:54:02 +02:00
aesoft fef1ba52f4 Merge pull request #1874 from rtk-ai/fix/cicd/spelling-branch-fr-en
cicd: spelling branch fr->en
dev-0.40.0-rc.217
2026-05-13 19:02:20 +02:00
aesoft 7e418fd664 Update pr-target-check.yml 2026-05-13 19:01:37 +02:00
aesoft 54d1f8736f Merge pull request #1871 from rtk-ai/fix/cicd-runners/insecure-tmp-lock-workflow
fix(security): replace insecure tmp, lock git perm, set sha for actions
dev-0.40.0-rc.216
2026-05-13 18:44:54 +02:00
aesoft 26b96ec6c4 fix(security): pin workflow actions to SHA, clean up tempfile on failure 2026-05-13 17:13:44 +02:00
aesoft cd6ac2f47a fix(security): replace insecure tmp, lock git workflow perm 2026-05-13 15:42:11 +02:00
aesoft 55f998d08c Merge pull request #1614 from Kayphoon/feat/hermes-integration
feat(hermes): add Hermes Agent support via rtk init --agent hermes
dev-0.40.0-rc.215
2026-05-11 19:19:12 +02:00
Kayphoon f7c4bf6ba1 style(hooks): format BOM helper assertion 2026-05-12 00:32:48 +08:00
Kayphoon 9d3b99dec8 feat(hermes): add rtk integration
Signed-off-by: Kayphoon <109347466+Kayphoon@users.noreply.github.com>
2026-05-12 00:30:39 +08:00
patrick szymkowiak 2d6e10a923 Merge pull request #1718 from kamilkaczmareksolutions/fix/cursor-hook-permission-ask
fix(hooks): make Cursor preToolUse rewrites work and stay visible
dev-0.40.0-rc.214
2026-05-10 16:27:18 +02:00
aesoft 107b3d3b2c Merge pull request #1776 from KuSh/fix-clippy-0.1.95
chore(ci): makes clippy pass, warnings included, mandatory
dev-0.40.0-rc.213
2026-05-10 13:41:09 +02:00
Nicolas Le Cam 70b9f385c7 chore(ci): deny warnings and make clippy pass mandatory in ci 2026-05-10 12:44:38 +02:00