Skip to content

feat(rewrite): #2721 prepend rtk for TOML filters invoked via binary paths.#2722

Open
denis-peshkov wants to merge 11 commits into
rtk-ai:developfrom
denis-peshkov:feat/toml-path-rewrite-fallback
Open

feat(rewrite): #2721 prepend rtk for TOML filters invoked via binary paths.#2722
denis-peshkov wants to merge 11 commits into
rtk-ai:developfrom
denis-peshkov:feat/toml-path-rewrite-fallback

Conversation

@denis-peshkov

@denis-peshkov denis-peshkov commented Jun 29, 2026

Copy link
Copy Markdown

Add TOML-aware rewrite fallback so hooks prepend rtk for commands like node_modules/.bin/make that match built-in TOML filters but have no rules.rs prefix entry.

After #2719

Closes #2721

Why

run_fallback already resolves basename for TOML lookup; rtk rewrite did not. Path invocations were never rewritten → no token savings in Cursor/Claude agents.

Changes

  • lookup_command_for_filter() in toml_filter.rs
  • TOML-match fallback in registry.rs::rewrite_segment_inner()
  • Tests using the existing make built-in filter

@denis-peshkov denis-peshkov changed the title Add TOML-aware rewrite fallback so hooks prepend rtk for commands like node_modules/.bin/make that match built-in TOML filters but have no rules.rs prefix entry. feat(rewrite): #2721 prepend rtk for TOML filters invoked via binary paths. Jun 29, 2026
@denis-peshkov
denis-peshkov force-pushed the feat/toml-path-rewrite-fallback branch from 234ed90 to 3ed8f0a Compare June 30, 2026 13:09
kimi-cli has no .kimirules convention — that file is never read. It loads
project instructions from AGENTS.md (same as Codex). Rewrite run_kimi_mode
to inject the RTK instructions block into AGENTS.md via write_rtk_block,
and thread InitContext through to match the other agent modes.

- run_kimi_mode/run_kimi_mode_at now take InitContext (was verbose: u8)
- remove dead .kimirules write path
- drop duplicate run_codex_mode left by an earlier merge conflict
- main.rs: call run_kimi_mode(ctx); remove spurious run_antigravity_mode
- delete embedded hooks/kimi/rules.md (no longer used)
- tests assert AGENTS.md is written and .kimirules is never created
williamkoller and others added 2 commits July 9, 2026 11:35
…ike `node_modules/.bin/make` that match built-in TOML filters but have no `rules.rs` prefix entry.

Closes rtk-ai#2721

## Why
`run_fallback` already resolves basename for TOML lookup; `rtk rewrite` did not. Path invocations were never rewritten → no token savings in Cursor/Claude agents.

## Changes
- `lookup_command_for_filter()` in `toml_filter.rs`
- TOML-match fallback in `registry.rs::rewrite_segment_inner()`
- Tests using existing `make` built-in filter
@denis-peshkov
denis-peshkov force-pushed the feat/toml-path-rewrite-fallback branch from 3ed8f0a to 4b0ef69 Compare July 10, 2026 04:46
pszymkowiak and others added 3 commits July 18, 2026 13:27
…ike `node_modules/.bin/make` that match built-in TOML filters but have no `rules.rs` prefix entry.

Closes rtk-ai#2721

## Why
`run_fallback` already resolves basename for TOML lookup; `rtk rewrite` did not. Path invocations were never rewritten → no token savings in Cursor/Claude agents.

## Changes
- `lookup_command_for_filter()` in `toml_filter.rs`
- TOML-match fallback in `registry.rs::rewrite_segment_inner()`
- Tests using existing `make` built-in filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(rewrite): auto-rewrite TOML-only commands invoked via binary paths (.bin/, absolute paths)

3 participants