Skip to content

test(fact-extraction): stop judging phrasing/attribution the system already captures#2769

Merged
dcbouius merged 1 commit into
mainfrom
fix/harden-fact-extraction-quality-judges
Jul 17, 2026
Merged

test(fact-extraction): stop judging phrasing/attribution the system already captures#2769
dcbouius merged 1 commit into
mainfrom
fix/harden-fact-extraction-quality-judges

Conversation

@dcbouius

Copy link
Copy Markdown
Contributor

Two hs_llm_core fact-extraction-quality tests failed frequently on the Core LLM job (seen on #2727 and elsewhere). The judge was not the flaky part — llm_judge.py already does a temp-0 primary plus majority-vote higher-temperature confirmations. The tests were failing because they judged model output that is genuinely variable and already checked deterministically elsewhere.

test_date_field_calculation_yesterday

The resolved date lives in the structured occurred_start field, which the test already asserts is Nov 12/13. But the judged criteria additionally required the absolute date to appear in the free-text fact prose ("…state the absolute date in the fact text"). So an extraction that correctly set occurred_start = 2024-11-12 but wrote "Yesterday" in the prose still failed — that tests phrasing, not capability.

Fix: make the occurred_start assertion mandatory (require a dated fact — calculating the date is the test's point) and drop the date clause from the judged criteria. The judge now only checks the fuzzy activity-content claim; the date is verified structurally.

test_cognitive_epistemic_dimension

The judge penalised entity/speaker attribution ("Involving: She/He") — e.g. "2/3 judges agree not met … 'The meeting might not happen | Involving: She' … input states 'uncertainty about a meeting'". But this test asserts that cognitive/epistemic states survive extraction, not who they're attributed to.

Fix: scope the criteria to the dimension and instruct the judge to ignore attribution and exact wording — a state counts as preserved even if attributed to the wrong person.

Why this doesn't weaken the tests

Both still catch real regressions: a dropped/incorrect date fails the deterministic occurred_start assertion, and dropped cognitive states fail the (still-judged) dimension criteria. They just no longer flake on aspects the system either captures structurally (occurred_start) or doesn't claim to get right (entity attribution in a dimension-preservation test).

This follows the repo's own testing guidance (CLAUDE.md): assert deterministic structure directly; judge only the irreducibly-fuzzy semantic claim.

Verification

Both pass locally (extraction gpt-4o-mini, judge gpt-4.1-mini). This branch touches the API tests, so CI runs the Core LLM job against the real Gemini judge.

🤖 Generated with Claude Code

…lready captures

Two hs_llm_core quality tests failed frequently on the core-LLM job, not
because the judge flaked (it is already temp-0 primary + majority-vote
confirmations) but because they judged model output that is genuinely
variable and already checked deterministically elsewhere.

test_date_field_calculation_yesterday: the resolved date lives in the
structured `occurred_start` field, which the test already asserts is
Nov 12/13. The judge additionally required the absolute date to appear in
the free-text fact prose ("...state the absolute date in the fact text"),
so a correct extraction that wrote "Yesterday" in prose but Nov 12 in
occurred_start still failed. That tested phrasing, not capability. Make the
occurred_start assertion mandatory (require a dated fact — calculating the
date is the point of the test) and drop the date clause from the judged
criteria; the judge now only checks the fuzzy activity-content claim.

test_cognitive_epistemic_dimension: the judge penalised entity/speaker
attribution ("Involving: She/He") that is not what this test is about — it
asserts cognitive/epistemic *states* survive extraction. Scope the criteria
to that dimension and instruct the judge to ignore attribution and wording,
so a state counts as preserved even if attributed to the wrong person.

Both still catch real regressions (missing/incorrect dates, dropped
cognitive states); they just no longer flake on aspects the system either
captures structurally or does not claim to get right. Verified locally: both
pass (extraction gpt-4o-mini, judge gpt-4.1-mini).
@dcbouius
dcbouius merged commit ca87e29 into main Jul 17, 2026
101 checks passed
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