Repository navigation
fix: report target misses once, honour declared ranges, default to 10 % and 20 °C - #378
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #378 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 152 152
Lines 17991 17993 +2
Branches 3637 3638 +1
=========================================
+ Hits 17991 17993 +2
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:
|
rafatahmed
marked this pull request as ready for review
November 29, 2026 18:22
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.
NOT READY until CI is green.
Closes #377
Closes #379
Closes #380
What changes
The pH stage's review message ("incidental nutrient contributions need review; targets missed: ...") restates the formulation stage's misses. The matrix collected both, so the Target fit line named every miss twice, the second time with the engine's reason code.
_ph_findingsnow adds no Target fit finding for a review status of the pH stage; target fit is judged on the chosen recipe.Also
The pH stage judges targets strictly and ignored declared ranges, so a mix with every miss inside a 10 % range and maximums on ammonium and sodium still read "review required". A review status of that stage now adds no Target fit finding; target fit is judged on the chosen recipe, which already uses the ranges and maximums. This also removes the repeat, so the earlier parameter is gone.
Defaults (#380)
A 10 % acceptable range now applies unless
--range-percentsays otherwise (0turns it off), and the stock temperature for the solubility check is 20 °C (was 25 °C), matching the catalogue solubility values. The chemistry stays at 25 °C. Real run:flahax batch --formula "Cucumber (Howard Resh)" --water ro --volume 10000 --ph 6 --limit N_NH4=15 --limit Na=5isreadywith preparationfits; without the two maximums it still needs review. Changelog, migration table, CLI reference and API reference updated; theflahax mixprompt default and its interview-prefix fixture follow (the historical transcripts are untouched).Why
Seen in the trial of the 0.7.2.dev0 example: three Target fit findings, two of them repeating the same misses. The verdict was right; the wording was not. The status matrix is unreleased, so no changelog entry.
Tests
_ph_findings(a review status adds no finding), and a real batch with range 10 % and maximums on ammonium and sodium: target fit isready(failed before the fix).No chemistry inputs touched, so the PHREEQC fixture is unchanged.