fix: make grep truncation exhaustively recoverable - #905
Open
kvandre12-commits wants to merge 3 commits into
Open
fix: make grep truncation exhaustively recoverable#905kvandre12-commits wants to merge 3 commits into
kvandre12-commits wants to merge 3 commits into
Conversation
…agination # Conflicts: # code_puppy/tools/file_operations.py # code_puppy/tools/tools_content.py # tests/tools/test_grep_live_behavior.py
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
Follow-up to #904. That PR made the 50-match cap visible through
truncated; this PR makes the remaining results recoverable without changing query semantics.next_offsetto bounded grep resultsoffseton the registered grep tool and both local/backend implementationsnext_offsetuntil it is nullWhy
truncated=Trueprevents a false completeness claim, but “narrow the search” changes the query and cannot prove that every result from the original search was observed. Offset pagination preserves the bounded response while allowing exhaustive traversal of the unchanged search field.Verification
287 passed in 5.68sruff format --checkcleanruff check --fix --select Icleangit diff --checkcleanDirect 441-match A/B receipt against current
origin/maintruncated=Truetruncated=True,next_offset=50TypeError)50 x 8 + 41truncated=False,next_offset=NoneEnvironment notes
Verification ran on Android/Termux with Python 3.14.6. Ruff 0.15.13 (the repository CI pin) cannot build on Android; the available Ruff 0.16.3 reports pre-existing full-tree findings, so Linux CI remains authoritative for the pinned lint job. A broad non-browser test run reached platform-specific failures unrelated to grep; all directly affected coverage passes in the focused 287-test run.