Dk0.Closure, Dk1.Closure, and TestPkg.Closure are generated by the CommonsLang_OCaml.Dk.OpamLock.GenerateDriver dialog from the opam lock that Dk0.MlFrontSource carries (mlfront/dk.opam-lock.jsonc, and the with-test dk-opam-lock-test.jsonc). Since Dk.OpamLock@1.1.8 each driver stamps its parameters into a top-level generated member, so a routine bump of the per-package build rule is a Refresh, not a hand-edit. mode=check compares each driver's stamped rule versions against the pinned CommonsLang_OCaml import and fails with the fix command when one is stale; it runs in distribute-0.1.yml before the build:
dk0 dialog CommonsLang_OCaml.Dk.OpamLock.Refresh@1.1.8 mode=check drivers[]=etc/dk/v/CommonsBase_Dk/Dk0.Closure.values.jsonc drivers[]=etc/dk/v/CommonsBase_Dk/Dk1.Closure.values.jsonc drivers[]=etc/dk/v/CommonsBase_Dk/TestPkg.Closure.values.jsonc
The lock lives inside Dk0.MlFrontSource/TestPkg.LockSrc and is not checked in, so the default Refresh (drop mode=check) rewrites the rulefn in place, which equals a full regeneration for a rule-version-only move and avoids reformatting drift from a newer GenerateDriver. A change to the lock CONTENT (not just the rule version) needs a full regeneration with the lock materialized from its source object. <DRIVER_VER> is the GenerateDriver version from the import; Dk1 differs only in out, formid, pkgpath, and roots[]=DkOne_Exec:
dk0 dialog CommonsLang_OCaml.Dk.OpamLock.GenerateDriver@<DRIVER_VER> lock=<dk-opam-lock.jsonc from Dk0.MlFrontSource> out=etc/dk/v/CommonsBase_Dk/Dk0.Closure.values.jsonc formid=CommonsBase_Dk.Dk0.Closure@2.4.2 pkgpath=CommonsBase_Dk.Dk0.Pkg version=2.4.2 rulefn=CommonsLang_OCaml.Dk.OpamBuild.F_BuildLockedPackage@1.0.18 localsrc=CommonsBase_Dk.Dk0.MlFrontSource@2.4.2 locksrcpath=./dk-opam-lock.jsonc roots[]=DkZero_Exec
TestPkg.Closure builds the MlFront --with-test external closure (astring, tezt, crowbar, sedlex, ...) as one merged-prefix object so the gate imports it instead of building that closure cold. It uses the test lock, skiplocal=t, mergedprefix=t, an import partition against Dk0.Pkg, and its own TestPkg.LockSrc source:
dk0 dialog CommonsLang_OCaml.Dk.OpamLock.GenerateDriver@<DRIVER_VER> lock=<dk-opam-lock-test.jsonc from Dk0.MlFrontSource> out=etc/dk/v/CommonsBase_Dk/TestPkg.Closure.values.jsonc skiplocal=t mergedprefix=t formid=CommonsBase_Dk.TestPkg@2.4.2 pkgpath=CommonsBase_Dk.TestPkg.Pkg version=2.4.2 rulefn=CommonsLang_OCaml.Dk.OpamBuild.F_BuildLockedPackage@1.0.18 localsrc=CommonsBase_Dk.TestPkg.LockSrc@2.4.2 locksrcpath=./dk-opam-lock-test.jsonc implib[]=CommonsBase_Dk.Dk0.Pkg impver[]=2.4.2 impsrclock[]=dk.opam-lock.jsonc roots[]=DkZero_Exec roots[]=DkOne_Exec ... (the same roots as the gate's TestDeps)
dist/Linux_x86_64.u and dist/Windows_x86_64.u get-object the TestPkg object so it is built and published for the gate to import (Darwin slots pending the M4 macOS gate).