Skip to content

Feat/grep agent safe json - #4

Merged
isink17 merged 8 commits into
feat/cpp-msbuild-powershell-handlersfrom
feat/grep-agent-safe-json
May 28, 2026
Merged

Feat/grep agent safe json#4
isink17 merged 8 commits into
feat/cpp-msbuild-powershell-handlersfrom
feat/grep-agent-safe-json

Conversation

@isink17

@isink17 isink17 commented May 28, 2026

Copy link
Copy Markdown
Owner

No description provided.

isink17 added 3 commits May 27, 2026 16:24
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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/cmds/system/grep_cmd.rs Outdated
Comment thread src/cmds/system/log_cmd.rs Outdated
Comment thread src/cmds/system/read.rs
Comment thread src/cmds/cpp/msbuild_cmd.rs
isink17 added 5 commits May 28, 2026 18:32
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
isink17 merged commit bce24e4 into feat/cpp-msbuild-powershell-handlers May 28, 2026
@isink17
isink17 deleted the feat/grep-agent-safe-json branch May 28, 2026 20:00
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.
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.

1 participant