day11: library reorganization and API cleanup
Several independent cleanups bundled together:
- layer: delete Layer_info (dead parallel serialization path) and
Query (untyped JSON wrapper, redundant with Layer_meta.load_build).
Type Layer_meta.kind as Build | Compile | Link | Doc_all instead of
a raw string. Make Layer_meta.timing an open (string * float) list
so phases can evolve additively. Refactor Stack.plan_lowerdir to
take pre-computed byte costs instead of four path parameters.
Default created_at in save_build so callers don't need now_iso8601.
Add Last_used for LRU bookkeeping (separate sentinel file so touch
doesn't rewrite JSON). Rewrite the library README to reflect the
current modules and document the error-handling convention.
- layer/cli: new day11-layer-cli standalone binary for low-level
inspection of the cache (list, show, tree, stats, package, log).
Depends only on day11_layer and its transitive deps — no solver,
no build, no doc pipeline.
- solver: split opam-specific code out of day11/solver into new
day11/opam library (git_packages, git_utils, opam_env, local_repo,
deps). Extract solver worker-pool orchestration into standalone
day11/solver_pool library.
- exec: delete unused modules (atomic_publish, reporter, retry,
safe_rename, wait, worker_pool). Simplify fork_client to use an
Atomic-based singleton (was a Mutex that deadlocked under Eio).
- build: thread ?kind through Build_layer.build as a typed value.
Hybrid lowerdir plan in run_in_layers: keep as many dep layers as
possible as separate overlayfs lowerdirs, cp-merge only the excess
to stay under the 4K mount-options limit. Touch dep layers via
Last_used before mounting. Tools.ml simplification.
- doc: generate.ml passes typed kind constructors to build_layer.
Doc pipeline cache-hit path touches layers for LRU tracking.
sync.ml and combine.ml migrate off Query.metadata (inlined raw
JSON read — these modules are dead code to be removed separately).
- container/tests: new integration tests for Stack.plan_lowerdir
that actually mount overlayfs with varying layer counts and verify
every dep's file is visible inside a running container. Gated on
DAY11_INTEGRATION=true.
- bin, batch, benchmark, jtw, graph: adapt to the new library layout.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>