Repository navigation
Bind numerical library versions into gap and bridge kernel identity; make monotonicity properties non-vacuous (G7 review nits) - #1182
Merged
Conversation
Declare NumPy, pandas and SciPy for takeup gaps, and NumPy and pandas for counterfactual and zero-solving bridges while preserving engine declarations. Keep bands independent of numerical libraries and test version changes, stable identities and unused dependencies. Require positive, representable monotonicity increments and add explicit income and cost examples that catch wrong-direction toy entitlement mutants. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Contributor
Author
|
Merged by the NZ hub (session local_e407a527) at ed760d9 with --merge. Gates: |
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1181 (NZ graph G7, merged). It fixes the two non-blocking nits from that PR's round-2 independent review.
1. Numerical library versions in kernel identity
This reuses the repo's existing mechanism: a kernel declares installed distributions in
Capabilities.dependencies(graph/kernel.py), andsource_hashbinds their reported versions into its implementation hash.takeup.gap@1now declares NumPy, pandas and SciPy. It compiles the target matrix with them and computes weighted totals with them.simulate.counterfactual@1andsimulate.solve_zero@1add NumPy and pandas to any caller-supplied dependencies, because bridge arithmetic and person/group reductions use them. Superclass validation is unchanged.takeup.bands@1declares none, and a comment says why: it decodes canonical artifacts and compares Python numbers with Python's sort, min and negation. No numerical library computes its outputs.Tests check three things: changing a declared library's reported version changes the identity; otherwise the identity is stable; and an undeclared library's version does not affect it.
These kernels' implementation hashes change, so their nodes and descendants re-key once. Identity hashes whole defining modules, so
simulate.rules_by_ref@1, which sharesrules_kernels.py, andtakeup.bands@1, which changed only by a comment, also re-key once. The hub knows of no production store holding these nodes yet.2. Non-vacuous monotonicity properties
In
test_transport_entitlement_graph.py, the income and cost monotonicity properties could draw zero increments, or increments too small to represent. A mutant that replaced toy AS with income survived under the default seed.@examples kill that mutant.Tests
test_transport_takeup_kernels.py30,test_transport_entitlement_graph.py23,test_counterfactual_kernels.py37,test_transport_composed_graph.py137. All passed.tools/ci_test_plan.py verify, ruff check and format, andgit diff --checkpass.Review
r1 (GPT-6.1 Sol at ed760d9): APPROVE_WITH_NITS, Needs Max: no. 242 tests passed and 20 distinct mutants were killed. Each of the 18 new identity cases fails under a matching mutant. The monotonicity mutant now fails under seeds 1, 42 and 20261010. Nits: the historical and provenance statements here are reported by the hub, not checkout evidence; the module-wide re-key is now stated above.
Part of Microcosm NZ v0 (d962). Built on a GPT-6.1 Sol Subfleet lane; verified, committed and opened by the NZ hub.
🤖 Generated with Claude Code