8000 fix: one source for status text; review only what the products add by rafatahmed · Pull Request #384 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

fix: one source for status text; review only what the products add - #384

Merged
rafatahmed merged 2 commits into
mainfrom
fix/status-single-source
Nov 29, 2026
Merged

rafatahmed merged 2 commits into
mainfrom
fix/status-single-source

Conversation

@rafatahmed
Copy link
Copy Markdown
Owner

NOT READY until CI is green.

Closes #382

Closes #383

What changes

  • One source for the verdict and its explanations (A ready recipe still lists in-range target misses in the stage statuses and warnings #382). The matrix reasons (target misses outside the declared ranges, incidental nutrients with no maximum) are derived once in batch_summary._target_reasons. The formulation and pH stage statuses and messages, statuses['formulation'], statuses['ph'], statuses['stock'] and the warnings are written from them, so a ready recipe has no stage under review and no "targets missed" warning, and a review reason is listed once (the repeated formulation: and ph_adjustment: warnings are gone). statuses['formulation'] is infeasible only for a miss outside the range or a declared maximum; statuses['stock'] is qualified when the preparation fits.
  • Review only for what the products add (Sodium and chloride that come only from the water still need a declared maximum #383). An incidental nutrient needs a declared maximum only for the part the products add (nutrient_acceptance.review_rows). An ion that comes only from the water, or whose product share is under 1 % of its concentration, no longer keeps a recipe under review; a declared maximum is still checked against the total.
  • Docs: reading-results, ADR 0004 amendment, migration table, changelog. One prose use of "owner" in the physical validation protocol replaced.

Decision for review

The 1 % product-share threshold (NEGLIGIBLE_PRODUCT_SHARE) is my choice; it narrows rule R4 as proposed in #383.

Checked before this commit

  • New tests/test_status_consistency.py: three real mixes (ready, misses outside the range, incidental review) checked for agreement between verdict, statuses, stage statuses and messages, and warnings. It failed 11 ways before the change.
  • New tests/test_water_only_incidental.py: unit tests of review_rows and a real hard-water batch (ready without Na/Cl maximums; a maximum below the water still blocks).
  • Real runs of flahax batch (Cucumber with and without maximums, a hard-water case) and flahax mix --plain: statuses, stages, warnings and sheet agree; the interview notes dropped from 9 to 7.
  • Run locally and passing (logs in outputs/test-runs/2026-11-29-fix-status-single-source/): wiring, consistency, water-only, result wording, canonical result, status matrix (92 tests); grower outputs, grower sheet, mix results, mix TUI, Sonneveld, default range and temperature, deviation ranges (146 tests). Lint, format, API reference and CLI reference clean.

Not covered

The full suite, coverage gate and strict docs build run in CI. Default ammonium and sodium maximums, the calcium and nitrate conflict, the history rewrite, gypsum and the untracked follow-ups from the audit are not part of this PR.

@rafatahmed rafatahmed added the bug Something isn't working label Nov 29, 2026
@rafatahmed rafatahmed self-assigned this Nov 29, 2026
@read-the-docs-community
read-the-docs-community Bot commented Nov 29, 2026 •
Copy link
Copy Markdown

Documentation build overview

📚 Flahax | 🛠️ Build #36248943 | 📁 Comparing dfc02d3 against latest (df1258f)

  🔍 Preview build  

3 files changed
± changelog.html
± agronomist/reading-results.html
± start/migration.html

@codecov
codecov Bot commented Nov 29, 2026 •
Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #384   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          152       152           
  Lines        17992     18022   +30     
  Branches      3637      3642    +5     
=========================================
+ Hits         17992     18022   +30     
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 29, 2026 21:51
@rafatahmed
rafatahmed merged commit f8bf0c8 into main Nov 29, 2026
29 checks passed
@rafatahmed
rafatahmed deleted the fix/status-single-source branch November 29, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

1 participant

0