Centralize diff filtering at retrieval (#867)