fix(epistemic): return the validated assignment without rounding - #100
Merged
Merged
Conversation
update_assignment validated the propagated assignment and then returned round(value, 12), which can move a value across an exact constraint bound (a = 0.1234567890123 came back as 0.123456789012 and violated its own constraint). Rounding and clamping afterwards would still break influence constraints such as b <= 1 - a. The function now returns exactly the values it validated, so the result satisfies the graph constraints (Hunter & Thimm 2017, P^beta). An existing test that compared 1 - 0.8 to a rounded 0.2 now uses pytest.approx. Closes #16 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V4tAVyyKcs1sYcsEzL7Bzg
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.
Closes #16
update_assignmentchecked the constraints and then returnedround(value, 12). Rounding can push a value just outside an exact bound: the reopened repro uses a == 0.1234567890123, which comes back as 0.123456789012 and failsbelief_assignment_satisfies. Rounding and then clamping would not be enough either, because it can still break coupled constraints such as b <= 1 - a. The function now returns exactly the values it validated.test_update_assignment_coarse_bound_control).pytest.approx.The fix was implemented by the gradual worker; the supervisor published it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01V4tAVyyKcs1sYcsEzL7Bzg