Feat/grep agent safe json - #4
Merged
isink17 merged 8 commits intoMay 28, 2026
Merged
Conversation
Add agent-focused grep ergonomics: - parse RTK grep flags before or after the search path - add files-only, count-by-file, top-files, and JSON output modes - add agent-safe preset via CLI, RTK_AGENT_SAFE, and agent.safe_mode - support explicit caps for total matches, per-file matches, and line length - keep legacy default grep behavior unless safe mode or new modes are used - improve summaries with concrete rtk read hints - ensure JSON mode emits one stable object across grep modes Also harden UTF-8 clipping, tiny max-line handling, no-match behavior, unknown rg-arg forwarding, docs, and tests.
There was a problem hiding this comment.
Code Review
This pull request introduces significant enhancements to the command-line tool, including a new PowerShell-compatible gci command, advanced grep options (such as JSON output, file counting, and token-safe presets), binary file detection in read, and structured MSBuild diagnostic parsing. The review feedback highlights a critical logic bug in the JSON grep output where a static match count causes premature truncation, a byte-length versus character-count mismatch in log truncation, an overly restrictive odd-length check in UTF-16 detection, and a double-lookup performance issue in MSBuild diagnostic deduplication.
…lers' into feat/grep-agent-safe-json
Resolve remaining PR review feedback after merging the C++/MSBuild handler branch: - avoid double HashSet lookup in MSBuild diagnostic deduplication - fix grep JSON capped output to use a running current_count counter - avoid empty normal JSON file entries after early total-cap breaks - use Unicode character counts for log truncation thresholds - allow UTF-16 no-BOM detection to ignore one trailing odd byte Includes tests for capped grep JSON output, Unicode-safe log truncation, and odd-length UTF-16 no-BOM samples.
Document the new agent-friendly grep modes in README: - files-only, count-by-file, and top-files locator modes - agent-safe preset and RTK_AGENT_SAFE PowerShell usage - JSON output, full-lines, and all-matches controls Also keeps the grep JSON current_count cleanup by removing leftover temporary cap state.
isink17
added a commit
that referenced
this pull request
May 30, 2026
Add agent-focused grep ergonomics: - parse RTK grep flags before or after the search path - add files-only, count-by-file, top-files, and JSON output modes - add agent-safe preset via CLI, RTK_AGENT_SAFE, and agent.safe_mode - support explicit caps for total matches, per-file matches, and line length - keep legacy default grep behavior unless safe mode or new modes are used - improve summaries with concrete rtk read hints - document agent-safe grep usage in README Also harden: - UTF-8 clipping and tiny max-line handling - no-match behavior - unknown rg-arg forwarding - capped JSON output using a running current_count counter - JSON mode stability across grep modes Add Windows-focused diagnostics for C++/MSBuild and PowerShell workflows. Address review feedback: - avoid double HashSet lookup in MSBuild diagnostic deduplication - use Unicode character counts for log truncation thresholds - allow UTF-16 no-BOM detection to ignore one trailing odd byte Includes tests for Unicode-safe log truncation and odd-length UTF-16 no-BOM samples.
isink17
added a commit
that referenced
this pull request
May 31, 2026
Add agent-focused grep ergonomics: - parse RTK grep flags before or after the search path - add files-only, count-by-file, top-files, and JSON output modes - add agent-safe preset via CLI, RTK_AGENT_SAFE, and agent.safe_mode - support explicit caps for total matches, per-file matches, and line length - keep legacy default grep behavior unless safe mode or new modes are used - improve summaries with concrete rtk read hints - document agent-safe grep usage in README Also harden: - UTF-8 clipping and tiny max-line handling - no-match behavior - unknown rg-arg forwarding - capped JSON output using a running current_count counter - JSON mode stability across grep modes Add Windows-focused diagnostics for C++/MSBuild and PowerShell workflows. Address review feedback: - avoid double HashSet lookup in MSBuild diagnostic deduplication - use Unicode character counts for log truncation thresholds - allow UTF-16 no-BOM detection to ignore one trailing odd byte Includes tests for Unicode-safe log truncation and odd-length UTF-16 no-BOM samples.
isink17
added a commit
that referenced
this pull request
May 31, 2026
Add agent-focused grep ergonomics: - parse RTK grep flags before or after the search path - add files-only, count-by-file, top-files, and JSON output modes - add agent-safe preset via CLI, RTK_AGENT_SAFE, and agent.safe_mode - support explicit caps for total matches, per-file matches, and line length - keep legacy default grep behavior unless safe mode or new modes are used - improve summaries with concrete rtk read hints - document agent-safe grep usage in README Also harden: - UTF-8 clipping and tiny max-line handling - no-match behavior - unknown rg-arg forwarding - capped JSON output using a running current_count counter - JSON mode stability across grep modes Add Windows-focused diagnostics for C++/MSBuild and PowerShell workflows. Address review feedback: - avoid double HashSet lookup in MSBuild diagnostic deduplication - use Unicode character counts for log truncation thresholds - allow UTF-16 no-BOM detection to ignore one trailing odd byte Includes tests for Unicode-safe log truncation and odd-length UTF-16 no-BOM samples.
isink17
added a commit
that referenced
this pull request
May 31, 2026
Add agent-focused grep ergonomics: - parse RTK grep flags before or after the search path - add files-only, count-by-file, top-files, and JSON output modes - add agent-safe preset via CLI, RTK_AGENT_SAFE, and agent.safe_mode - support explicit caps for total matches, per-file matches, and line length - keep legacy default grep behavior unless safe mode or new modes are used - improve summaries with concrete rtk read hints - document agent-safe grep usage in README Also harden: - UTF-8 clipping and tiny max-line handling - no-match behavior - unknown rg-arg forwarding - capped JSON output using a running current_count counter - JSON mode stability across grep modes Add Windows-focused diagnostics for C++/MSBuild and PowerShell workflows. Address review feedback: - avoid double HashSet lookup in MSBuild diagnostic deduplication - use Unicode character counts for log truncation thresholds - allow UTF-16 no-BOM detection to ignore one trailing odd byte Includes tests for Unicode-safe log truncation and odd-length UTF-16 no-BOM samples.
isink17
added a commit
that referenced
this pull request
Jun 4, 2026
Add agent-focused grep ergonomics: - parse RTK grep flags before or after the search path - add files-only, count-by-file, top-files, and JSON output modes - add agent-safe preset via CLI, RTK_AGENT_SAFE, and agent.safe_mode - support explicit caps for total matches, per-file matches, and line length - keep legacy default grep behavior unless safe mode or new modes are used - improve summaries with concrete rtk read hints - document agent-safe grep usage in README Also harden: - UTF-8 clipping and tiny max-line handling - no-match behavior - unknown rg-arg forwarding - capped JSON output using a running current_count counter - JSON mode stability across grep modes Add Windows-focused diagnostics for C++/MSBuild and PowerShell workflows. Address review feedback: - avoid double HashSet lookup in MSBuild diagnostic deduplication - use Unicode character counts for log truncation thresholds - allow UTF-16 no-BOM detection to ignore one trailing odd byte Includes tests for Unicode-safe log truncation and odd-length UTF-16 no-BOM samples.
isink17
added a commit
that referenced
this pull request
Jun 4, 2026
Add agent-focused grep ergonomics: - parse RTK grep flags before or after the search path - add files-only, count-by-file, top-files, and JSON output modes - add agent-safe preset via CLI, RTK_AGENT_SAFE, and agent.safe_mode - support explicit caps for total matches, per-file matches, and line length - keep legacy default grep behavior unless safe mode or new modes are used - improve summaries with concrete rtk read hints - document agent-safe grep usage in README Also harden: - UTF-8 clipping and tiny max-line handling - no-match behavior - unknown rg-arg forwarding - capped JSON output using a running current_count counter - JSON mode stability across grep modes Add Windows-focused diagnostics for C++/MSBuild and PowerShell workflows. Address review feedback: - avoid double HashSet lookup in MSBuild diagnostic deduplication - use Unicode character counts for log truncation thresholds - allow UTF-16 no-BOM detection to ignore one trailing odd byte Includes tests for Unicode-safe log truncation and odd-length UTF-16 no-BOM samples.
isink17
added a commit
that referenced
this pull request
Jul 5, 2026
Add agent-focused grep ergonomics: - parse RTK grep flags before or after the search path - add files-only, count-by-file, top-files, and JSON output modes - add agent-safe preset via CLI, RTK_AGENT_SAFE, and agent.safe_mode - support explicit caps for total matches, per-file matches, and line length - keep legacy default grep behavior unless safe mode or new modes are used - improve summaries with concrete rtk read hints - document agent-safe grep usage in README Also harden: - UTF-8 clipping and tiny max-line handling - no-match behavior - unknown rg-arg forwarding - capped JSON output using a running current_count counter - JSON mode stability across grep modes Add Windows-focused diagnostics for C++/MSBuild and PowerShell workflows. Address review feedback: - avoid double HashSet lookup in MSBuild diagnostic deduplication - use Unicode character counts for log truncation thresholds - allow UTF-16 no-BOM detection to ignore one trailing odd byte Includes tests for Unicode-safe log truncation and odd-length UTF-16 no-BOM samples.
isink17
added a commit
that referenced
this pull request
Jul 5, 2026
Add agent-focused grep ergonomics: - parse RTK grep flags before or after the search path - add files-only, count-by-file, top-files, and JSON output modes - add agent-safe preset via CLI, RTK_AGENT_SAFE, and agent.safe_mode - support explicit caps for total matches, per-file matches, and line length - keep legacy default grep behavior unless safe mode or new modes are used - improve summaries with concrete rtk read hints - document agent-safe grep usage in README Also harden: - UTF-8 clipping and tiny max-line handling - no-match behavior - unknown rg-arg forwarding - capped JSON output using a running current_count counter - JSON mode stability across grep modes Add Windows-focused diagnostics for C++/MSBuild and PowerShell workflows. Address review feedback: - avoid double HashSet lookup in MSBuild diagnostic deduplication - use Unicode character counts for log truncation thresholds - allow UTF-16 no-BOM detection to ignore one trailing odd byte Includes tests for Unicode-safe log truncation and odd-length UTF-16 no-BOM samples.
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.
No description provided.