Repository navigation
feat(testing): scan test files a Bash call changed via bashEditDiff - #5621
Conversation
Refs #5608 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #5608 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A PostToolUse Bash row, behind test_guards_enabled, starts test-scan-bash.sh. It reads tool_response.bashEditDiff, keeps changed paths that match the adapters' test globs, and runs test-scan.sh per file as a Write (created) or an Edit (hunks as structuredPatch), so scope follows hook-precision rule 1. A payload without the field exits immediately. The README records the preconditions, limits and cost; probes.md records the latency arms and a live claude -p run. Refs #5608 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
PR body contract — issue linkage This PR body does not yet satisfy the issue-linkage contract:
Edit the body and this comment updates itself on the next run. |
…ct the bashEditDiff wording The PostToolUse Bash row has no `if`, so the node launcher starts on every Bash call whatever test_guards_enabled says. Per the hook-budget convention the README now states its k and measured cost in S, and two spawn-count ceilings register it in .performance/ratchets.json: option off (1) and option on with no bashEditDiff (3). The README Cost bullet no longer says the launcher starts only with the option on. The Precondition bullet and the CHANGELOG entry now say what the probe found: the field is absent in default, acceptEdits, auto and bypassPermissions without bashEditDiffEnabled or CLAUDE_CODE_BASH_EDIT_DIFF=1. Refs #5608 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 4m 29s —— View job Claude finished the
|
|
Claude finished @kyle-sexton's task in 2m 55s —— View job Security review (
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 751a88328d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The Bash route sent test-scan.sh's stderr to /dev/null, so a scanner that failed or timed out left no diagnostic, unlike the Write and Edit route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 1m 36s —— View job Security review (
|
|
Claude finished @kyle-sexton's task in 1m 2s —— View job Claude finished the
|
Composes main's bashEditDiff Bash route for test-scan (#5621) with this branch's task-end judge. The generator emits both: main's PostToolUse Bash row and the judge's async Write|Edit rows, Stop and SessionStart entries; hooks.json is regenerated. testing goes to 0.13.0 above main's 0.12.0, and test-scan-bash.sh passes transcript_path and cwd through so a Bash-changed test file leaves the same session record the judge reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #5608
Summary
The testing plugin's opt-in
test-scansaw only Write and Edit. Test files written through Bash (cat >,sed -i, generators) were never scanned. This probes PostToolUsebashEditDiffon Claude Code 2.1.285 and routes Bash-changed test files throughtest-scan.Fix
docs/specs/tautological-tests/probes.md: probe row. The field is absent in default, acceptEdits, auto and bypassPermissions without a setting; present only withbashEditDiffEnabledtrue (user,--settings, managed scope) orCLAUDE_CODE_BASH_EDIT_DIFF=1. Shape ischangedFiles(absolute, all),files(first 5 with hunks),moreFiles; untracked new files are listed.plugins/testing/hooks/test-scan-bash.shplus a generated PostToolUseBashrow inhooks.json: runstest-scan.shon each changed test file (max 4).gen-hook-filters.shgenerates the row.if(a Bashifmatches the command string, not the changed files), so the node launcher starts on every Bash call, whatevertest_guards_enabledsays. Per the hook-budget convention the README states the row's k and cost in S, and.performance/ratchets.jsonholds two spawn ceilings: option off (1) and option on with nobashEditDiff(3).Verification
bash plugins/testing/hooks/test-scan.test.sh: 58 passed, 0 failedbash plugins/testing/scripts/gen-hook-filters.test.sh: 14 passed, 0 failedscripts/validate-plugins.sh: all manifests and catalog validatedscripts/check-changelog-parity.sh --check,--check-order,--check-bump origin/main: passmarkdownlint-cli2on the README, CHANGELOG and probes.md: 0 issues.bash -c :p50 1.0 ms, four arms interleaved, 50 samples, p50: option off 22 ms (about 22 S, k = 1); option on with no recorded change 30 ms (about 30 S, k = 2); one-file diff 116 ms (about 115 S).scripts/hook-census.shspawns: 1, 3 and 96 (the last is the scan itself and is not ratcheted).ratchet.py check: all 14 counters at their ceilings on this host, including the two new ones. A mutant that runsjqbefore the script's substring test raised the no-diff count from 3 to 5 and the check reported it above its ceiling; the mutant is reverted.scripts/hook-census.test.sh: 18 passed..deb(strace 6.19, bash 5.3.9, jq 1.8.2) kept under the gitignored.work/. The CI runner's versions differ, so its "Check performance counter ceilings" step confirms the ceilings once this is ready.claude -prun are recorded in probes.md.Not met: the issue asks for the shape on Windows Git Bash. That needs another host and was not probed, so the owner decides whether the Linux probe suffices. Hence Refs, not Closes.
Related
#5603 (Release 2b plan), #5605 (Release 2 judge).
🤖 Generated with Claude Code