Ordering of pum items when completing include directives

I am a YCM user on Vim, and YCM uses clangd for autocompletion. Is there a way to control the ordering of the completions of #include directives? For instance, if I write #include <boost/range/itm , the list is the following

 istream_range.hpp> f
 algorithm/         f
 algorithm.hpp>     f
 algorithm_ext/     f
 algorithm_ext.hpp> f

whereas I’d like it like this

 algorithm/         f
 algorithm_ext/     f
 istream_range.hpp> f
 algorithm.hpp>     f
 algorithm_ext.hpp> f

with all directories preceding all files. I’ve asked in the forum, and I was told there isn’t an option to govern this in clangd.

So the question becomes, can this be implemented?

This is actually YCM’s caching/filering at play here. Clangd and YCM has different fuzzy matching implementations. By default YCM pre-fetches some results from clangd and does its own filtering/reranking client side as you keep typing, if you wanted changes in this behaviour (which looks like the case) you should file that to Issues · ycm-core/ycmd · GitHub.
You can also try switch off YCM’s client side filtering with let g:ycm_clangd_uses_ycmd_caching = 0 and see if this behaviour helps your workflow more (spoilers, it also doesn’t output what you expect in this case).