Fix doc layer cache misses, failure markers, and query visibility
Three bugs caused doc layers to rebuild on every run instead of hitting cache:
1. Parent-child hash inconsistency: inline hash computation differed from
Container.doc_layer_hash, causing cache misses. Unified to use
Container.doc_layer_hash everywhere.
2. Non-deterministic doc_map_ht: was keyed by package name, but the same
package can appear in multiple solutions with different build hashes.
Changed to key by build_hash for deterministic dep_doc_hash lookups.
3. Missing failure markers: container cleanup deleted the doc layer directory
before the exception handler could write layer.json. Re-create the
directory in the exception handler if needed.
Also fixes query command not showing failed doc layers:
- Create package symlinks for both successful and failed doc layers
- Record history entries for doc layers in the fork batch path
Additional changes: local repo pinning with writable copy for dune subst,
examined_packages tracking in dir_context, patches for lwt_ppx and
ppx_deriving_yojson on oxcaml, and failure categorization scripts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>