Skip to content

fix(grounded): case-insensitive claim annotation + verify causal CRITICAL path (#11248) - #11285

Merged
mrveiss merged 1 commit into
Dev_new_guifrom
fix-causal-grounded-11248
Jul 8, 2026
Merged

mrveiss merged 1 commit into
Dev_new_guifrom
fix-causal-grounded-11248

Conversation

@mrveiss

@mrveiss mrveiss commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Thinking Path

The two #11248 items you asked me to decide (biggest-gain wins):

grounded_agent (real robustness bug) — _reconstruct_response matched claims
case-sensitively (claim_text in reconstructed), so an LLM-extracted claim
whose case differs from the source (e.g. claim "Latency increased" vs response
"the latency increased") silently got no KB-source annotation. Biggest gain:
match case-insensitively and preserve the response's original casing in the
output (don't rewrite the user's text). Fixes the production bug; source text stays
intact.

causal severity (zero-risk path fix) — test_critical_severity expected CRITICAL,
but _assess_severity intentionally downgrades CRITICAL→DEGRADED when a
high-confidence fix exists (documented in code). Rather than change that documented
semantics (a separate product call), make the test verify the true CRITICAL path
with a sub-threshold intervention — zero behaviour change.

What Changed

  • services/grounded_agent.py — case-insensitive re.search(..., IGNORECASE),
    preserve matched (response) casing; annotate first match. (import re added.)
  • tests/services/test_grounded_agent.py — assert the annotation fired + claim
    present case-insensitively (was asserting the claim's exact capitalisation).
  • tests/services/test_causal_inference_engine.py — intervention 0.9/0.9 → 0.6/0.6
    so the documented high-confidence-fix downgrade doesn't fire.

Verification

Model Used

Opus 4.8 (1M context)

Refs #11248.

…ICAL path (#11248)

Two #11248 items, biggest-gain fixes:

grounded_agent._reconstruct_response used case-SENSITIVE 'claim_text in
reconstructed', so LLM-extracted claims whose case differs from the source text
(the common case) silently got no KB-source annotation. Match case-insensitively
via re.search(IGNORECASE) while preserving the response's original casing in the
output (don't rewrite the user's text). Real robustness fix; test updated to the
new (correct) output. Verified on py3.10 and py3.12.

test_causal_inference_engine::test_critical_severity expected CRITICAL but the
code intentionally downgrades CRITICAL->DEGRADED when a high-confidence fix
exists (documented behaviour). Lower the test's intervention below that threshold
so it verifies the true CRITICAL classification path with zero behaviour change.

No regressions (test_grounding_mixed + test_resolve_conflict already fail on base
— separate pre-existing #11248-class issues). black/isort/compile clean.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

@mrveiss
mrveiss merged commit 99b5e85 into Dev_new_gui Jul 8, 2026
34 of 36 checks passed
@mrveiss
mrveiss deleted the fix-causal-grounded-11248 branch July 8, 2026 10:14
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