Skip to content

Judge inbox and tool-use tests use the shared test base - #527

Open
EdbertChan wants to merge 1 commit into
split/judge-tests-2-stub-defaultfrom
split/judge-tests-3-llm-judge-tests
Open

Judge inbox and tool-use tests use the shared test base#527
EdbertChan wants to merge 1 commit into
split/judge-tests-2-stub-defaultfrom
split/judge-tests-3-llm-judge-tests

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Sep 13, 2026

Copy link
Copy Markdown
Owner

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

  • Pass unchanged for existing assertions.
  • No runtime code changes.

Test Plan

Test Plan
$ per-slice checks on split/judge-tests-3
ruff: All checks passed!
[llm-judge: Ran 61 tests in 6.333s OK ] [wrong-check-reflect: Ran 16 tests in 3.327s OK ] [diu-stop: Ran 104 tests in 0.025s OK ]
gate-tests: Ran 8 tests in 0.281s OK
gate: check_hook_test_coverage: OK (37 hook(s) checked)
preflight: ok      preflight passed
  • python3 -m unittest discover -s engine/hooks/llm-judge/testsRan 61 tests / OK
  • python3 -m unittest discover -s engine/hooks/wrong-check-reflect/testsRan 16 tests / OK
  • python3 -m unittest discover -s engine/hooks/diu-stop/testsRan 104 tests / OK
  • uvx ruff check . --select E9,FAll checks passed!
  • python3 engine/skills/make-pr/scripts/preflight.py --base <stack parent>ok preflight passed

Revert Plan

Revert Plan
  • Safe to revert? Yes, after reverting any later slice in this stack first.
  • Revert command: git revert <merge-commit-sha>
  • Post-revert steps: None.
  • Data migration? No.

🤖 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 JudgeTestCase instead of unittest.TestCase.

Each file drops its own temporary state directory, patch.dict on STATE_ENV, and manual clearing of CHILD_ENV / RUNNERS_ENV in favor of super().setUp() / super().tearDown(). In test_inbox.py, seed() now calls self.use_runners(...) rather than writing RUNNERS_ENV directly. test_post_tool_use.py also drops the unused unittest.mock.patch import and builds subprocess env from the already-patched os.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.

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
@cursor

cursor Bot commented Sep 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant