8000 feat: support volumetric stocks with water and product uncertainty by rafatahmed · Pull Request #258 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

feat: support volumetric stocks with water and product uncertainty - #258

Merged
rafatahmed merged 2 commits into
mainfrom
feat/volumetric-product-stocks
Nov 16, 2026
Merged

rafatahmed merged 2 commits into
mainfrom
feat/volumetric-product-stocks

Conversation

@rafatahmed
Copy link
Copy Markdown
Owner

Summary

Fixed-ratio recipes previously rejected volumetric stocks with real-water/product uncertainty. This adds an explicit supplied-product g/L basis and replays rounded mL doses through the existing inventory and chemistry checks.

rounded mL × product g/L → delivered product grams
  → water + fertilizer + pH-reagent inventory
  → assay/delivery/physical uncertainty
  → reserved nutrient ceilings + adaptive pH saturation checks

Closes #257. Legacy pure-compound stocks remain supported. No lab-management features added; laboratory testing remains deferred.

Evidence

  • Before: public workflow rejected the requested combination; a product named dose_error_ml also incorrectly rejected zero dispensing uncertainty.
    After: gram/mL equivalence, invalid/overfilled preparation rejection, dose rounding, uncertainty and name-collision regressions pass.
  • Ten-litre illustrative example: 128 uncertainty scenarios, 6,400 pH evaluations across 6.28–6.32. Nitrate-N maximum 5.394077187 mg/L < reserved 5.7 mg/L; all declared nutrient/Na/Cl limits pass. Largest sampled SI: brushite -2.002409288, monetite -1.722390472, hydroxyapatite -1.434103854, all below -0.3000001.
  • 5% reserve and all original uncertainty/saturation thresholds retained. Stock assumptions are illustrative, not measured. No continuous-extrema/global-optimum or physical-stability claim.
  • Focused regression and style checks pass; full CI is being run for this branch. Fresh-context spec review found no actionable defects; standards review found no documented violations and one optional routing-refactor suggestion.

Merge Danger

Door: two-way

Opt-in stock contract; no data migration or thermodynamic-constant changes. Do not merge during this validation task.

Blast Radius: planning

Shared uncertainty mass bounds and stock validation also serve existing recipe modes. Compatibility and exact-coverage checks remain required. Stock evidence integration and laboratory testing are deferred.

Preserve real-water, assay and physical bounds through rounded stock delivery. Retain nutrient reserve and pH-range saturation checks. Refs #257.
@rafatahmed rafatahmed added the enhancement New feature or request label Nov 16, 2026
@rafatahmed rafatahmed self-assigned this Nov 16, 2026
@read-the-docs-community
read-the-docs-community Bot commented Nov 16, 2026 •
Copy link
Copy Markdown

Documentation build overview

📚 Flahax | 🛠️ Build #35940284 | 📁 Comparing 8afc8a4 against latest (ddfb785)

  🔍 Preview build  

3 files changed
± changelog.html
± reference/errors.html
± reference/manual.html

The new product-stock path reaches analytical validation instead of the former blanket rejection. Update that assertion and document the three new error codes. Refs #257.
@codecov
codecov Bot commented Nov 16, 2026 •
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ddfb785) to head (8afc8a4).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #258   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          136       137    +1     
  Lines        16175     16235   +60     
  Branches      3287      3302   +15     
=========================================
+ Hits         16175     16235   +60     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rafatahmed
rafatahmed marked this pull request as ready for review November 16, 2026 22:19
@rafatahmed
rafatahmed merged commit 11dd6f3 into main Nov 16, 2026
27 checks passed
@rafatahmed
rafatahmed deleted the feat/volumetric-product-stocks branch November 16, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support volumetric stocks with water and product uncertainty

1 participant

0