Skip to content

Next Release#2083

Merged
aeppling merged 72 commits into
masterfrom
develop
Jun 5, 2026
Merged

Next Release#2083
aeppling merged 72 commits into
masterfrom
develop

Conversation

@github-actions

@github-actions github-actions Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Feats

Fix

Other

ashwingopalsamy and others added 11 commits April 13, 2026 10:08
git commit on an initial commit under a Chinese locale outputs:
  [master(根提交) fb597ec] Initial commit

The old code found the first space and sliced line[1..hash_start],
yielding "master(根提交)" (21 bytes).  hash.len() >= 7 was true,
so it tried &hash[..7] — but byte 7 falls inside the 3-byte '('
character, causing a panic.

Two bugs were present:
1. Logic: the code grabbed the token *before* the first space
   (branch name), not the commit hash.  The hash is always the last
   whitespace-separated token inside the [...] brackets.
2. Safety: raw byte slicing on a potentially non-ASCII string.

Fix: find ']', extract the bracket content, split_whitespace() and
take next_back() to get the hash.  Use chars().take(7) for the
short-hash slice so it is always char-boundary-safe.
…yte branch names

Extracts parse_commit_output into a testable helper function and adds 7 comprehensive unit tests covering:
- Normal branch names
- Root-commit annotations
- Multibyte branch names (Chinese, Thai) — regression test for the panic fix
- Edge cases (no bracket, short hash, empty input)

Tests verify the fix handles UTF-8 safely by anchoring on ']' and using char-safe slicing.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
rtk uses `str::floor_char_boundary()` (src/cmds/system/pipe_cmd.rs:140)
which was stabilized in Rust 1.91.0. Without `rust-version` in
Cargo.toml, packagers on older toolchains hit a confusing
`use of unstable library feature` error from rustc.

With this declaration, cargo gives the expected friendly diagnostic
up-front:

    error: rustc 1.88.0 is not supported by the following packages:
      rtk@0.34.3 requires rustc 1.91

Verified locally by switching toolchains:
- cargo +1.88 check → fails with the new clear MSRV error (intended)
- cargo +1.93 fmt/clippy/test → 1909 passed, zero warnings

Fixes #1402
Single-file `rtk grep` returned synthetic `[file] N` buckets when a
matching line contained `:`. ripgrep emits `<line>:<content>` for
single-file searches; the parser used `splitn(3, ':')` length to
disambiguate, which fails when content has `:` (e.g. `Foo::bar(...)`).

Force `--with-filename` on rg (`-H` on the grep fallback) so output is
always `file:line:content`, and replace the inline parser with a
regex-based `parse_match_line` that also handles paths with embedded
`:` (Windows drive letters).

Fixes the parser/rendering portion of #1436. The BRE-translation
portion is addressed in a follow-up PR.

Signed-off-by: Artiom Tofan <arto@queue-it.com>
- rg: switch to `-nH --null` for robust file/content separation
- grep fallback: switch to `-rnHZ` to match rg's --null contract
- Parser regex: `^([^\x00]+)\x00(\d+):(.*)$` so filenames or content
  containing `:digits:` (e.g. `badly_named:52:file.txt`,
  `debug: counter is :42: now`) can no longer fool the parser
- Use `Captures::extract` for cleaner destructuring

Adds tests for the badly-named-filename and digit-colons-in-content
cases; updates existing tests to use NUL-separated fixtures.

Addresses review on #1554.

Signed-off-by: Artiom Tofan <arto@queue-it.com>
Closes #1564.

`rtk hook check` rejected commands that began with a bash line
continuation (`\<NL>`) because the matcher saw the literal `\`
as the first token and bailed out:

    $ rtk hook check $'\\\ngit diff HEAD~1'
    No rewrite for: \\ngit diff HEAD~1

Bash collapses `\<NL>` (and `\<CRLF>`) plus surrounding horizontal
whitespace to a single space before dispatching the command, so
the matcher should do the same. Internal continuations (e.g.
`git diff \<NL>HEAD~1`) are equally common when Claude Code
formats long invocations.

Add a small `collapse_line_continuations` helper that runs a
single regex over the input before `cmd.trim()`. The regex eats
the trailing whitespace on the previous line and the leading
indentation on the next line so the no-double-space invariant
holds. The fast path returns `Cow::Borrowed` when no continuation
is present, so commands without `\<NL>` allocate nothing.

Six regression tests pin: leading \\<NL\>, leading \\<CRLF\>, internal
\\<NL\> between subcommand and args, \\<NL\> followed by indentation,
the no-op fast path, and the helper-level Cow::Borrowed contract.
fix(pkg): rtk is Apache 2.0 and no MIT
aeppling and others added 18 commits May 25, 2026 12:13
fix(docs): replace remaining MIT license references with Apache 2.0
Closes #1672

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
aeppling and others added 6 commits May 31, 2026 16:31
fix(provider): sanatize more chars when encoding claude code project pathes
atomic_write() replaced symlinked settings.json with a regular file.
Now resolves symlink targets before the tempfile+rename so the link
itself is preserved and the real file gets updated.

Covers both absolute and relative symlink targets.

Closes #653
Simplify resolve_atomic_target() per review feedback — fs::canonicalize
handles chained symlinks, relative paths, and all edge cases.

Co-authored-by: Roopesh <roopesh1724989@gmail.com>
When `filter_markdown_body()` strips a PR or issue body to empty
(body contained only badges, images, HTML comments, or horizontal
rules), `format_pr_view` and `format_issue_view` previously skipped
the body section silently. Users had no indication that body content
had been present and filtered.

Now both views emit a fallback note when the filtered body is empty
but the raw body was not:

  PR view:    (body contained only badges/images/comments)
  Issue view: Description: (body contained only badges/images/comments)

The 4 added tests cover:
- PR body with only badges/images/comments -> fallback note appears
- PR body with real content -> no fallback note (sanity)
- PR body empty (raw) -> no fallback note (no signal to give)
- Issue body badges-only -> fallback note appears

Closes #235

Co-authored-by: polaminggkub-debug <polaminggkub-debug@users.noreply.github.com>
Gate go build success output on the child exit code and surface unrecognized non-zero build output instead of reporting success.

Closes #2185.
@aeppling

aeppling commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Heads up: this release carries a git diff regression from #1823.

The new restore_double_dash rebuilds args by value membership against the whole command line, so a positional whose value equals a command/subcommand token (diff, git, log, test, ...) gets the command word duplicated back in. RTK then sends a malformed command to git.

Reproduction (real repo, file named diff):

$ git diff -- diff       # native: shows the diff, RC 0
$ rtk git diff -- diff   # reconstructs `git diff diff -- diff`
fatal: bad revision 'diff'   (exit 128)

Confirmed regression: rtk 0.40.0 handles the same input correctly. Full analysis and fix direction (positional tail alignment instead of value membership) in #1823. Worth fixing before this ships, or at least noting in the release.

pszymkowiak and others added 4 commits June 1, 2026 15:16
fix(go): respect build failure exit status
chore(cargo): declare MSRV via rust-version = "1.91"
fix(grep): command token duplication in output withsame value filename or positional arg
@aeppling

aeppling commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Heads up about #1823 fixed in #2239

aeppling and others added 12 commits June 3, 2026 17:20
fix(git): fix panic on multibyte chars in commit output
- Decompose compound commands for permission checks (newline, background &, subshell `( )`) in addition to &&, ||, ;, | so hidden segments are checked.
- `contains_unattestable_construct`: flag command/process substitution and file-target redirects (fd-dup `2>&1` and /dev/null exempt) — RTK can't decompose these, so they are never auto-allowed.
- Route every host hook (Claude, VS Code, Gemini, Cursor, Copilot CLI) through a single decision flow. Precedence: Deny → (defer if unattestable) → Allow → Ask → Default. Auto-allow only on a positive Allow; otherwise defer to the host's own engine.
- Gemini: ask_user instead of hardcoded allow. Cursor: empty `{}` delegation, since permission:"ask" is not enforced on its sandboxed shell.
fix(security): port permission hardening from master + Copilot CLI adaptation
@aeppling

aeppling commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

LGTM

@aeppling aeppling merged commit ab2038f into master Jun 5, 2026
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.