Skip to content

Grep contract tests separate native execution from the hook deadline - #942

Merged
zlareb1 merged 1 commit into
mainfrom
fix/grep-functional-probe-budget
Nov 19, 2026
Merged

zlareb1 merged 1 commit into
mainfrom
fix/grep-functional-probe-budget

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026

Copy link
Copy Markdown
Member

Related: #940

Changelog category (leave one):

  • CI Fix or Improvement

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

  • Wire: none.
  • Operator steps: none.
  • Rollback: revert the test change; no stored data or generated files change.

Tests

  • node --test --test-name-pattern '^runLocalGrep ' integrations/claude-code-plugin/tests/code-shunt.test.mjs: both focused cases pass.
  • Prettier 3.9.9 checks the changed file without installing dependencies.
  • Full suites and Windows ARM verification remain for CI. No provider, model or server was called.

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

  • Full format, lint, typecheck and unit checks pass; they remain for CI.
  • No generated files or migrations change.
  • No shipped plugin behavior changes, so no manifest version bump is required.
  • No frontend or documentation changes require checks.
  • Public text contains no private deployment details.
  • Commits are signed off.

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]>
@zlareb1
zlareb1 merged commit 4088535 into main Nov 19, 2026
52 checks passed
@zlareb1 zlareb1 mentioned this pull request Nov 19, 2026
6 tasks done
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