Repository navigation
Grep contract tests separate native execution from the hook deadline - #942
Merged
Merged
Conversation
The native output checks use an explicit finite process budget. A separate injected failure checks the unchanged default deadline without relying on process startup speed. Signed-off-by: zlareb1 <[email protected]>
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.
Related: #940
Changelog category (leave one):
Why
The native grep contract test uses the hook's two-second process deadline while checking matching output. A platform run returned an empty result after about 2.5 seconds, while the same test and helper passed on the same platform from main. The helper intentionally suppresses subprocess failures, so the log does not establish their exact cause.
Give the real-process matching and no-match checks an explicit finite ten-second input through the existing timeout parameter. A separate injected execution-error case checks that the production default remains two seconds and returns an empty result without retrying. This separates the output contract from the production deadline contract. Platform CI must verify the native-process change.
Scope and risk
Only the grep helper's test file changes. Matching output, no-match output, shell-free arguments and shim handling keep their assertions. The native fixture directory is removed when its test ends. No shipped helper, hook, manifest or runtime deadline changes.
Compatibility, rollout and rollback
Tests
node --test --test-name-pattern '^runLocalGrep ' integrations/claude-code-plugin/tests/code-shunt.test.mjs: both focused cases pass.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated: Codex compared the failing log with passing main logs, inspected the unchanged helper and its callers, and wrote the focused test changes.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist