feat(filter): preserve important comments for AI context & multi-area improvements#1077
Open
saoqixiaomm wants to merge 3 commits intortk-ai:masterfrom
Open
feat(filter): preserve important comments for AI context & multi-area improvements#1077saoqixiaomm wants to merge 3 commits intortk-ai:masterfrom
saoqixiaomm wants to merge 3 commits intortk-ai:masterfrom
Conversation
Author
|
@aeppling Hi! Could you please review this PR when you have a moment? This PR improves the MinimalFilter to preserve important comments (TODO/FIXME/NOTE/etc.) for AI context, adds a TOML filter safety rail against false-positive success messages, raises config defaults for richer AI workflows, and adds Codex session log support to Thanks! |
ad22e35 to
9373d19
Compare
Author
|
recheck |
… improvements - MinimalFilter now keeps TODO/FIXME/NOTE/HACK/etc. comments instead of stripping all - Unknown languages handled conservatively (no comment patterns assumed) - TOML filter safety rail: skip success short-circuit when output contains error signals - Config defaults raised: status_max_files 15→30, status_max_untracked 10→20, passthrough_max_chars 2000→6000 - Analytics: adaptive precision formatting, token-tracked vs passthrough breakdown - Discover: Codex session support (exec_command parsing, session_meta CWD filter) - Registry: shell variable assignment, command substitution, heredoc tokenization - New TOML filter: poetry-api-test (tail-based) - Codex awareness hook: prefer RTK-native commands, proxy+tail pattern Made-with: Cursor
Made-with: Cursor
9373d19 to
50bc444
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MinimalFilter comment preservation: Instead of stripping all comments, the minimal filter now preserves comments containing important markers (
TODO,FIXME,NOTE,HACK,BUG,WARNING,SECURITY,PERF,WHY, etc.). This gives AI agents better context when reading filtered code. Unknown file types are now handled conservatively (no comment patterns assumed) to avoid stripping semantically important content.TOML filter safety rail: Added
ERROR_SIGNAL_REcheck to prevent success short-circuit messages (e.g., "ok") from being emitted when the raw output clearly contains error signals (error,failed,panic,traceback, etc.).Config defaults raised: Increased
status_max_files15→30,status_max_untracked10→20,passthrough_max_chars2000→6000 to keep more context in AI/code-review workflows.Analytics improvements: Adaptive precision for percentage formatting, comma-separated exact token counts alongside compact notation, and separate tracking of token-tracked vs passthrough/fallback commands in
rtk gain.Codex session support:
rtk session/rtk discovernow parse Codex (~/.codex/sessions/) JSONL logs alongside Claude Code logs. Supportsexec_command/function_call_outputevent types andsession_metaCWD-based project filtering.Registry hardening: Improved shell tokenizer to handle variable assignments, command substitutions, heredocs, and complex quoting — reducing false-positive rewrite suggestions.
New TOML filter:
poetry-api-test(tail-based, strips ANSI, keeps last 10 lines).Codex awareness hook: Expanded guidance to prefer RTK-native commands and the
rtk proxy <cmd> | rtk tailpattern for bounded output.Test plan
cargo test --all)cargo fmt --all --checkpassescargo clippy --all-targets— 0 errors, 4 pre-existing warningsrtk read -l minimal <file>preserves TODO/FIXME commentsrtk gainshows token-tracked vs passthrough breakdownMade with Cursor