8000 feat: declared equipment, equipment-aware search, unverified solubility and saved inputs (D3-D7, C6) by rafatahmed · Pull Request #298 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

feat: declared equipment, equipment-aware search, unverified solubility and saved inputs (D3-D7, C6) - #298

Merged
rafatahmed merged 10 commits into
mainfrom
fix/equipment-qualification
Nov 25, 2026
Merged

rafatahmed merged 10 commits into
mainfrom
fix/equipment-qualification

Conversation

@rafatahmed
Copy link
Copy Markdown
Owner

Closes #293. Closes #294. Closes #295. Closes #296. Closes #297.

Equipment and stock qualification (contract Q19-Q23, Q27), items D3-D7 and C6 of the contract audit.

Not done here: the PHREEQC golden fixture was not re-captured, and no pH solver code was changed.

Local checks: ruff clean; the 22 new tests and 301 of 303 related tests pass locally. Heavy grower, mix and ratio tests did not all finish under the 5-minute limit, so CI is the verifier for them.

…fit (D3)

summarize_batch and flahax batch take the tanks you have (--available-tanks) and
their sizes (--tank-capacity). The recipe and grouping do not change with the
equipment. The report lists the tanks the recipe needs against yours, and a tank
too small for its stock is reported and blocks, without altering the recipe or the
equipment. Without a declaration two tanks are assumed and the summary says so
(available_tanks_declared false).
…erature (D5, D6)

Each stock solubility row now carries a qualification: it is a single-product
value, whether its source temperature equals the tank temperature, and what is
unverified (temperature, mixture). A value recorded at another temperature is
still used as recorded and never extrapolated, doses are unchanged, and the batch
warnings name the products and their source temperatures.
…ssary (D7)

Stock assignment, required tanks, available tanks, equipment fit and single-product
solubility are defined once, with the words to avoid, and a test keeps them tied to
the summary fields they name.
… record the mode (D4)

available_product_search(on_equipment_miss=True) runs when the declared equipment
cannot hold the recipe (the stocks stage failed with an error), adding the
requirement equipment:fit. Candidates keep the declared tanks, ratio, temperature and
separation rules and change only products. Nothing runs unless requested. The
remedies result records the mode (analyze_supplied_doses or find_suitable_doses) and
the declared equipment so a saved result shows what the search was held to.
…ame what a recalculation changes (C6)

The summary keeps supplied_inputs, bound by calculation_identity.input_sha256, and
load_result rejects inputs that no longer match it. Older saved results still load
without inputs. saved_input_differences lists each input path that differs between
two results.
…t covers the temperature (D5, D6)

plan_stocks no longer raises missing_solubility_limit. A product with no recorded
solubility limit at the requested temperature keeps its concentration and tank
assignment and is listed in StockPlan.unverified with its recorded ranges; the plan
stays requires_review and nothing is approved on the missing evidence. A known limit
that is exceeded still raises solubility_exceeded. The workflow stocks stage says which
products are unverified.
…ks (D4, Q23)

--fit-equipment, with --alternative-products, runs the equipment-aware search from the
batch command. The batch hands its own equipment check (tank count, capacities and
stock solubility, the same judgement as its report) to plan_fertilizer_workflow, so the
search sees a miss. Tanks, ratio and separation rules are never changed, the search
runs only when asked, and the declared equipment is saved in remedies and the saved
inputs. A stock whose solubility is unverified at the temperature now counts as an
unresolved equipment requirement, so keeping its quantities never reads as a fit.
@rafatahmed rafatahmed added the enhancement New feature or request label Nov 25, 2026
@rafatahmed rafatahmed self-assigned this Nov 25, 2026
@read-the-docs-community
read-the-docs-community Bot commented Nov 25, 2026 •
Copy link
Copy Markdown

…parser

The exact coverage gate found the batch equipment check's problem paths, the
capacity and callable guards and the whole-number flag parser unexecuted.
@codecov
codecov Bot commented Nov 25, 2026 •
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (76ceda1) to head (1be2fae).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #298    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          140       140            
  Lines        17015     17180   +165     
  Branches      3455      3493    +38     
==========================================
+ Hits         17015     17180   +165     
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 25, 2026 15:04
@rafatahmed
rafatahmed merged commit fa37a10 into main Nov 25, 2026
29 checks passed
@rafatahmed
rafatahmed deleted the fix/equipment-qualification branch November 25, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
0