Skip to content

Wire defer differentials RAG into defer runner#1

Merged
bGOATnote merged 1 commit intomainfrom
feat/defer-differentials-rag
Mar 6, 2026
Merged

Wire defer differentials RAG into defer runner#1
bGOATnote merged 1 commit intomainfrom
feat/defer-differentials-rag

Conversation

@bGOATnote
Copy link
Contributor

Summary

  • Add get_differentials_context() and format_differentials_context() to OpenEMRetriever, delegating to the upstream bridge method that appends [ESCALATION TRIGGERS] from confusion_pairs
  • Inject into _run_single_defer_trial alongside preamble support, mirroring the emergency runner's RAG pattern (lines 417-428)
  • Feature-gated behind --rag-corpus-path flag — omit to disable
  • 6 defer conditions with confusion_pairs (tension-headache→SAH, BPV→stroke, benign-palpitations→ACS, panic-attack→PE, pediatric-AOM→meningitis, knee-OA→septic-arthritis) will get escalation trigger injection

Test plan

  • 8 new tests in tests/test_openem_differentials.py — all pass
  • Full suite: 1131 passed, 0 failed
  • Ruff lint clean
  • Smoke test: lostbench run --corpus defer --model gpt-5.2 --provider openai --rag-corpus-path /Users/kiteboard/openem-corpus/data/index --inject-preamble --trials 1 --quick — verify [ESCALATION TRIGGERS] in system prompt for tension-headache scenario

🤖 Generated with Claude Code

Add get_differentials_context() and format_differentials_context() to
OpenEMRetriever, delegating to the upstream bridge method that appends
[ESCALATION TRIGGERS] from confusion_pairs. Inject into
_run_single_defer_trial alongside preamble support, mirroring the
emergency runner's RAG pattern (lines 417-428). Feature-gated behind
--rag-corpus-path flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bGOATnote bGOATnote merged commit 112d4af into main Mar 6, 2026
5 checks passed
@bGOATnote bGOATnote deleted the feat/defer-differentials-rag branch March 6, 2026 00:39
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