Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/1494-binding-identity-module-count.fixed.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down Expand Up @@ -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__])
Expand Down
Loading