Judge inbox and tool-use tests use the shared test base - #527
Open
EdbertChan wants to merge 1 commit into
Open
Conversation
Replaces their hand-rolled state-folder isolation with JudgeTestCase. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013smxPCr4XeE7R77zVtN1u4 Change-Id: I10db361f66a5a832388cfddcf3d8d3e25a1dcb8f
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_a926e84f-7279-40bf-b3b0-bf229e063337) |
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
Two more judge test files built their own private setup by hand.
Hand copies drift, and one never cleared the runner list.
Both now use the shared setup, which removes the copies.
Review Claim
Two judge test files swap their hand-made setup for the shared one.
Review Lane
refactor
Review Unit
engine-runtime
Safety Invariant
Test-only. Each file keeps its own work folder; only the state and runner setup moves to the shared base. 61 judge tests pass.
Slice Rationale
Same mechanical swap in two files of one hook. Other hooks follow in their own slices.
Stack position 3 of 7, split from one bundled change. Merge bottom-up.
Non-goals
Test Plan
Test Plan
python3 -m unittest discover -s engine/hooks/llm-judge/tests—Ran 61 tests/OKpython3 -m unittest discover -s engine/hooks/wrong-check-reflect/tests—Ran 16 tests/OKpython3 -m unittest discover -s engine/hooks/diu-stop/tests—Ran 104 tests/OKuvx ruff check . --select E9,F—All checks passed!python3 engine/skills/make-pr/scripts/preflight.py --base <stack parent>—ok preflight passedRevert Plan
Revert Plan
git revert <merge-commit-sha>🤖 Generated with Claude Code
https://claude.ai/code/session_013smxPCr4XeE7R77zVtN1u4
Note
Low Risk
Test-only refactor that centralizes setup in an existing shared base with no runtime impact.
Overview
Inbox and post-tool-use judge tests stop duplicating judge state and environment setup and inherit from the shared
JudgeTestCaseinstead ofunittest.TestCase.Each file drops its own temporary state directory,
patch.dictonSTATE_ENV, and manual clearing ofCHILD_ENV/RUNNERS_ENVin favor ofsuper().setUp()/super().tearDown(). Intest_inbox.py,seed()now callsself.use_runners(...)rather than writingRUNNERS_ENVdirectly.test_post_tool_use.pyalso drops the unusedunittest.mock.patchimport and builds subprocessenvfrom the already-patchedos.environ.No production hook code changes; test behavior and assertions stay the same.
Reviewed by Cursor Bugbot for commit 79ea90f. Bugbot is set up for automated code reviews on this repo. Configure here.