When a link's target path cannot be resolved, the raw KeyError from
_resolve_path() propagates to the caller (or a raw TypeError when a
path segment hits a list), without saying which link or which
document location caused the failure. The parse-and-resolve
sequence is also duplicated in the jw.link and jw.inplace-link
branches of _expand_links_recursive().
Extract the sequence into _resolve_link() and wrap navigation
failures in ValueError naming the link kind, the spec, and the
location in the document. Document that path navigation operates on
the unexpanded tree, so intermediate segments must not be link nodes
themselves. Update the tests that pinned KeyError and add coverage
for the list-navigation case and the error message content.
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>