diff --git a/changelog.d/1494-binding-identity-module-count.fixed.md b/changelog.d/1494-binding-identity-module-count.fixed.md new file mode 100644 index 0000000000..48945eb869 --- /dev/null +++ b/changelog.d/1494-binding-identity-module-count.fixed.md @@ -0,0 +1 @@ +The engine-free test `test_the_batterys_binding_identity_adds_only_the_leaf_and_its_imports` passes on `main` again (microcosm#1494). Since #1342, the bindings in `TRANSPORT_GATE_REGISTRY` reach two new modules without following `microcosm.build.transport.evidence_contract`: `microcosm.calibrate.hierarchy_labels`, which `microcosm.calibrate.diagnostics` imports, and `microcosm.diagnostics.catalogs`, which the `microcosm.diagnostics` package imports. The test now lists them in `BINDING_MODULES_ADDED_AFTER_BASE`, counts them with the 197 modules of its original base, and still requires `evidence_contract` to add exactly the 23 modules in `LEAF_ADDED_MODULES`. No source module, module list or implementation hash changes. diff --git a/packages/microcosm-build/tests/engine_free/shared/test_transport_evidence_kernels.py b/packages/microcosm-build/tests/engine_free/shared/test_transport_evidence_kernels.py index 60a6e26d5c..76acc03ee0 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_transport_evidence_kernels.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_transport_evidence_kernels.py @@ -127,6 +127,18 @@ "microcosm.graph.weight_update", ] ) +#: Modules the bindings reach without the leaf that base 25c8cc14 did not +#: have. Since #1342, ``microcosm.calibrate.diagnostics`` imports +#: ``microcosm.calibrate.hierarchy_labels`` and the ``microcosm.diagnostics`` +#: package imports ``microcosm.diagnostics.catalogs``. ``gate_bindings`` +#: imports ``microcosm.calibrate.solve``, whose package ``__init__`` imports +#: both ``microcosm.calibrate.diagnostics`` and ``microcosm.diagnostics``. +BINDING_MODULES_ADDED_AFTER_BASE = frozenset( + [ + "microcosm.calibrate.hierarchy_labels", + "microcosm.diagnostics.catalogs", + ] +) BATTERY = "toy.gates.terminal" @@ -527,11 +539,16 @@ def test_the_batterys_binding_identity_adds_only_the_leaf_and_its_imports( # At base 25c8cc14 the battery's binding identity held 197 modules; # w4 adds the leaf and exactly the modules it imports that the # bindings did not already reach (the graph package among them). + # Modules the bindings later reach without the leaf are listed in + # BINDING_MODULES_ADDED_AFTER_BASE. modules = set() for name, binding in TRANSPORT_GATE_REGISTRY.items(): _, digests = binding_identity.describe(binding, path=name) modules |= set(digests) - assert len(modules) == 197 + len(LEAF_ADDED_MODULES) + assert len(modules) == ( + 197 + len(BINDING_MODULES_ADDED_AFTER_BASE) + len(LEAF_ADDED_MODULES) + ) + assert BINDING_MODULES_ADDED_AFTER_BASE <= modules assert LEAF_ADDED_MODULES <= modules assert LEAF_ADDED_MODULES <= set( binding_identity.source_closure([evidence_contract.__name__])