Record and validate dep compile layers in doc sidecar
Problem: a doc layer cached from a run with incomplete dep compile
layers produces HTML with unresolved cross-references (e.g.
Stdlib.Format.formatter). A later run reuses the stale layer
because the hash matches, even though the deps are now available.
Fix:
- Record dep compile layer hashes in doc.json deps field
(was always [])
- Add validate_cached_doc: checks that all recorded deps exist
on disk with exit_status=0
- In generate.ml is_cached: invalidate doc layers whose deps
are missing (delete and rebuild)
- In day11_prep.ml Op.build: same validation for OCurrent path
- Add test_xref_resolution.sh: builds docs and checks for
xref-unresolved spans in the HTML output
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>