fix(question_gen): gates reject_reason returns raw reason; short-circuit skips LLM
- GateReport.reject_reason now returns gate.reason directly (no [name] prefix) - verbatim short-circuit sets other 3 gates to SKIP without calling LLM - test_high_verbatim_shortcircuits asserts zero LLM calls and SKIP verdicts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -293,7 +293,7 @@ class TestRunGates:
|
||||
|
||||
@pytest.mark.asyncio()
|
||||
async def test_high_verbatim_shortcircuits(self) -> None:
|
||||
"""verbatim_ratio > 0.5 → key_verify 直接 FAIL,不调用 LLM。"""
|
||||
"""verbatim_ratio > 0.5 → key_verify 直接 FAIL,其余 SKIP,不调用 LLM。"""
|
||||
llm = MockLLM([_make_llm_response("pass", "should not be called")])
|
||||
candidate = _make_candidate()
|
||||
tree = _make_tree()
|
||||
@@ -310,3 +310,9 @@ class TestRunGates:
|
||||
assert report.passed is False
|
||||
assert report.key_verify.verdict == GateVerdict.FAIL
|
||||
assert "verbatim" in report.key_verify.reason.lower()
|
||||
# 其余三门应为 SKIP
|
||||
assert report.blind_answer.verdict == GateVerdict.SKIP
|
||||
assert report.multi_true.verdict == GateVerdict.SKIP
|
||||
assert report.leak_test.verdict == GateVerdict.SKIP
|
||||
# LLM 不应被调用
|
||||
assert len(llm.calls) == 0
|
||||
|
||||
Reference in New Issue
Block a user