day11/doc: extract stateless Doc_build primitives
New module Doc_build with clean, stateless per-package doc operations:
- compile: build layer + dep compile layers → compile layer
- link: compile layer + dep compile layers → HTML
- doc_all: build layer + dep compile layers → compile layer + HTML
- has_documentable_libs: check if a layer has installed libraries
Each function takes explicit inputs (layer paths, tool config, blessed
status) and returns a result. No hashtables, no DAG knowledge, no
shared mutable state. These are building blocks suitable for both the
existing DAG executor and potential OCurrent pipeline integration.
generate.ml's compile_package/link_package/doc_all_package become thin
wrappers that extract state from the DAG context and delegate to
Doc_build. Old helper functions (prepare_package, make_doc_mounts,
doc_prep_upper, doc_cleanup) moved into Doc_build.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>