Skip to content

fix(verifier): give the judge the sentence a fragment claim was cut from - #831

Merged
Weegy merged 3 commits into
mainfrom
fix/golden-eval-judge-flake
Aug 21, 2026
Merged

fix(verifier): give the judge the sentence a fragment claim was cut from#831
Weegy merged 3 commits into
mainfrom
fix/golden-eval-judge-flake

Conversation

@Weegy

@Weegy Weegy commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Problem

Follow-up to #781. golden-eval.yml still flaked occasionally on the judge-path cases (blocked_contradiction_role, majority-of-3 caught it). Measured locally (12 runs): 2 misses — in both the extractor emitted the qualitative claim as the subject-less fragment "in die IT-Abteilung". The EvidenceJudge never sees the answer by design, so it cannot know who moved where and (correctly) returns unverified.

Whenever the claim text was the full sentence, both double-check votes said contradicted in 100 % of runs — the 2-of-2 AND gate is not the problem and is left untouched.

Fix

Layer Change
Claim.context Enclosing sentence of the answer, cut deterministically (./!/? + whitespace, or newline → 01.03.2023 stays intact; 400-char window around the span). Attached by the extractor only when it adds something beyond text.
EvidenceJudge Passes it as a CONTEXT: line; system rule: disambiguation only, judge the CLAIM as meant in that sentence.
Extractor prompt Qualitative claims must be self-contained (include their subject).

Verification

Check Result
New unit tests (claimContext boundaries/caps, extractor attaches context, judge prompt includes/omits CONTEXT) 8, red → green
Verifier test files 65/65
npm test (middleware) 7192 tests, 0 fail
npm run typecheck / typecheck:test clean / ratchet 371 = baseline
npm run eval:golden locally 15/15, all first-sample (disclaimer cases unchanged → no new false positives)
blocked_contradiction_role ×12 against claude-haiku-4-5 12/12 blocked, exactly 2 judge calls each (before: 10/12, 2–4 calls)

Review round (omadia-reviewer) → 0bc991eb

Finding Resolution
MEDIUM first occurrence wins → wrong subject attached (new false-contradiction vector) span in >1 sentence ⇒ no context (falls back to previous behaviour)
MEDIUM ordinals/abbreviations (1. März, z.B., Dr.) split the sentence dot after number/known abbreviation is not a boundary; context == claim modulo punctuation suppressed
LOW toLowerCase() can shift offsets (U+0130) bail out when lengths differ
LOW judge rule listed "date" removed; verdicts may not rest on context-only facts
LOW tests / shared constant / commit subject +6 tests; MAX_CONTEXT_CHARS shared; noted

Post-review: suite 7196/0 · golden 2×15/15 first-sample · role+status cases 8/8 each.

Weegy added 3 commits August 21, 2026 14:01
golden-eval flaked on `blocked_contradiction_role` (judge path). Measured
12 local runs: 2 misses, both with the qualitative claim extracted as the
subject-less fragment "in die IT-Abteilung". The EvidenceJudge never sees
the answer by design, so it cannot tell who moved where and correctly says
`unverified`. With the full sentence as claim text both double-check votes
agreed in 100 % of runs — the AND gate is not the problem, the fragment is.

Fix:
- `Claim.context`: enclosing sentence of the answer, cut deterministically
  (`.`/`!`/`?` + whitespace, or newline; "01.03.2023" stays intact; 400-char
  window around the span). Attached by the extractor when it adds something
  beyond `text`.
- EvidenceJudge passes it as a `CONTEXT:` line with an explicit
  disambiguation-only rule; the contradiction double-check is unchanged.
- Extractor prompt: qualitative claims must be self-contained.

Verification: +8 unit tests (claimContext boundaries/caps, extractor
attaches context, judge prompt includes/omits CONTEXT); verifier tests
65/65; middleware suite 7192/0 fail; golden corpus 15/15 first-sample;
role case 12/12 `blocked` with exactly 2 judge calls each (before 10/12).
Review findings on PR #831:

- MEDIUM: first occurrence won — a fragment present in two sentences got
  the wrong subject attached, the one new false-contradiction vector.
  Now: span in more than one sentence ⇒ no context (old behaviour).
- MEDIUM: ordinals/abbreviations ("1. März", "z.B.", "Dr.") split the
  sentence and dropped the subject. Dot after a number or a known
  abbreviation is no longer a boundary; context equal to the claim modulo
  trailing punctuation is suppressed.
- LOW: lower-casing can change code-unit length (U+0130) and shift
  offsets — bail out when lengths differ.
- LOW: judge rule no longer lists "date" as something to resolve from
  CONTEXT and forbids verdicts based on context-only facts.
- MAX_CONTEXT_CHARS shared between extractor and judge.
- Tests: multi-occurrence, z.B./ordinal/Dr., bullets, needle with
  trailing dot, U+0130.

Verification: verifier tests green, suite 7196/0 fail, golden corpus
2×15/15 first-sample, both judge cases 8/8 blocked.
@Weegy
Weegy merged commit 5ee2065 into main Aug 21, 2026
8 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