Repository navigation
fix: composed plans refuse contradictory stage values, with the H5 rejection corpus (#348) - #354
Merged
Merged
Conversation
…tradict each other, add the H5 rejection corpus (#348)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #354 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 151 151
Lines 17779 17816 +37
Branches 3584 3599 +15
=========================================
+ Hits 17779 17816 +37
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 27, 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.
Closes #348 once the
build/twinepinning (H8) lands; this PR is H5 only, so it says Part of #348 and does not close it.Part of #348 (roadmap H5).
Method. I altered one field at a time in a valid composed plan and probed the stage planners with inconsistent records.
plan_phrejected all 25 inconsistent water, curve and reagent records I tried (mismatched ids, changed assays, bad curves, missing measurements), andplan_pump_commandrejected stale (inclusive 30-day limit), future, unreadable and unusable calibrations. These are now pinned by tests.compose_delivery_planaccepted pH plans, pump commands and stock plans changed after planning, as long as volumes and channels still matched. For example a pH plan with a blank water id, a target of 99, a positive reagent volume with zero mass, orpost_mix_measurement_required=False; a command with an empty calibration id or zero runtime; a stock plan with status 'garbage' or approved with an incomplete search.Fixed. The check shared by
compose_delivery_plan,delivery_reportandtransition_plannow raisescross_stage_constraintfor:Left as it was on purpose
requires_operator_verification=Falseon a command is still accepted: an existing test documents that the explicit transition is the approval.Known limit (documented). A stage value does not keep the records it was planned from, so a plan altered consistently (for example a reagent mass doubled with its volume) cannot be detected at composition. Closing that needs the source records or a digest on the stage values, which changes saved results; I left it out.
For your decision: a measured pH curve whose first point (demand 0) is at 7.4 is accepted with a water record whose pH is 7.9. The curve is a titration of that water, so the two should agree, but any tolerance would be a number I choose. I have not added one.
Added:
tests/test_composed_plan_rejections.py(18 tests). Without the source change 27 of its checks fail.Verified locally: the new tests on Python 3.11, 3.13 and 3.14; 108 delivery, stock, pH, pump, site and example tests; changelog, manifest, release-hygiene and documentation tests; ruff check and format; 100% coverage of the new lines.
Not run: the full pre-push suite (hours); CI runs the full gate.