day11/runner: extract Run_in_layers into its own library
The runner is the intersection of day11_layer (overlayfs lowerdir
planning, stack merging, LRU touching) and day11_container (Overlay,
Runc, Oci_spec). Both leaf libraries deliberately don't depend on
each other; this small library is the explicit place where they
meet. Putting Run_in_layers into either of those libraries would
have forced that library to depend on the other, breaking its
isolation.
The new library is one file plus a dune and a README. Its dep set
is exactly day11_container, day11_exec, day11_layer — no
opam-format, no day11_graph, no day11_build, no day11_opam_layer.
Run_in_layers.run's signature dropped its Types.build_env
parameter in favour of taking ~base directly. The function only
ever used benv.base.dir, so the build_env wrapper was overkill;
removing it lets the file have zero references to anything in
day11_build, which is what made the move possible.
Callers updated:
- day11/build/build_layer.ml — calls
Day11_runner.Run_in_layers.run env ~base:benv.base ~build_dirs
~prep_upper spec
- day11/build/dune — adds day11_runner
- day11/doc/test/test_generate_docs.ml — was already a direct
caller of Run_in_layers.run; updated to use the new module path
and the new ~base signature
- day11/doc/test/dune — adds day11_runner and day11_opam_layer
(the test was already using the latter implicitly)
day11_doc and day11_jtw still go through Build_layer.build for the
opam-flavoured orchestration. They're not yet direct consumers of
the runner — that would be a follow-up refactor that lets each of
them call Day11_runner.Run_in_layers.run with their own spec
construction. The runner library is now in place to support that
when/if it happens.
12 test suites pass, 196 tests. End-to-end smoke build of
logs.0.10.0 succeeds; layer.json shows the prep_upper timing
phase, build.json sidecar is written correctly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>