Replace over-broad on_chain_start with on_retriever_start to capture
the query embedding as late and as safely as possible in the RetrievalQA
flow, minimizing framework footprint.
Addresses maintainer review feedback for minimal & safe implementation.
LangChain: Add on_chain_start to capture query embedding before
on_retriever_end fires in RetrievalQA flow. on_llm_start retained
as fallback for non-chain invocations.
LlamaIndex: Double guard on source_nodes — check both attribute
existence AND non-empty list before computing average ΔS, preventing
ZeroDivisionError on responses without retrieved nodes.
Addresses Codex automated review feedback