Repository navigation
fix: qualify mathematical-engine contracts and enforce exact CI coverage - #196
Merged
Merged
Conversation
Enforce issue-first dependencies and distinguish reproduced defects from verified repairs so incomplete evidence cannot be reported as completion. Add independent contract oracles, preserved regression controls, numeric source dispositions, and source-bound statement and branch coverage gates. Include numeric strings in the inventory and reject stale evidence, missing review context, and adoption of unqualified values. Document the evidence workflow and collect native CI coverage artifacts. Validate 45 foundation checks and nine independent reference checks while retaining 16 failing product controls for their assigned fixes. Runtime calculations remain unchanged. Product defects, scientific qualification, full coverage and hosted acceptance remain unresolved. Refs: #159, #160, #161, #162
Remove the implicit ammonium fraction and hidden absolute cap. Preserve caller-supplied limits and update examples and integration expectations to declare their intended ammonium policy. Version the retained atomic-mass convention, expose source and assumption status in material provenance, and reject malformed molecular masses and boolean stoichiometry. Add independent mass, hydrate, oxide and provenance checks without changing atomic values or chemistry databases. Validate material and solver checks, affected integrations, documentation, and clean wheel and source-distribution installations. The full suite has 681 passing tests and 14 known audit failures assigned to remaining work. The changed recipe path does not constitute a repair of joint-fit fallback. Refs: #161, #163
Replace the batch adapter's implicit litre-to-kilogram substitution with an explicit final solvent basis. Accept declared solvent mass and volume, or solution density with complete nonwater mass; reject incomplete or conflicting bases. Normalize detection limits and volumetric blends consistently. Add reversible mg/L and molality conversions and a disjoint source-water, reagent-carrier and dissolved-hydrate water ledger. Carry the basis into workflow and report outputs, disclosing legacy assumptions and unquantified uncertainty. Add independent rational inventory and integration tests, preserve the original regression control and historical CLI transcripts, and update unit, input and generated API documentation. Keep the final-solvent inventory fixed and explicit; do not infer carrier water or physical uncertainty from elemental assays. Refs: #161
Infer missing inorganic carbon from the supported total proton balance, including phosphate, borate, ammonia, sulfate and major-ion complexes. Reject unqualified proton references instead of attributing their alkalinity to carbonate. Preserve explicit zero and fixed carbon inventories. Keep titrated alkalinity fixed during balance-ion reconciliation. Store interactive titration inputs separately from legacy equivalent-HCO3 carbon, carry the solvent basis through unit conversion, and disclose legacy assumptions. Add independent species-inventory, charge/proton titration, carbon-free buffer and measurement-preservation tests. Update the public API, water input guides, report wording and error catalogue without changing chemistry databases. Refs: #161
Include supported counterion nutrients in the fitting matrix and forward sums so sodium-bearing chelates can affect recipe selection and concentration limits. Share analytical-component nutrient projection across materials, water and pH reagents. Expose incomplete inventories and label/component discrepancies. Add independent stoichiometric and input-order regressions, preserve historical CLI transcripts, and update material accounting documentation and API reference. Fixes #164
Return explicit model-domain and selected-profile qualifications with aqueous results, including positive ligand/metal pairs missing from the reaction set. Preserve numerical results and all reference constants and database bytes. Add read-only source, atom, charge and basis-transform checks for all selected reactions, independent sensitivity/domain tests, and updated documentation. Refs #161
Add exact bounded-fit and high-precision acid references with adversarial controls. Require matched comparison conditions and record numerical error and shared-data limitations. Document reproducible verification. Refs #161
Require valid root brackets and attained stopping criteria, equilibrate Jacobian rows, and reject unrepresentable NNLS products. Bound pH error alongside charge closure and expose residual and optimality diagnostics. Add independent scaled and high-precision regression controls. Refs #165
Pin retained reference bytes and budgets, require fresh capture destinations, and reject nonfinite or malformed evidence. Verify all current live families against pinned binaries and databases while preserving historical limits. Refs #166
…ibria Replace cycling calcium-sulfate pairing with a stable quadratic solve. Reject exhausted legacy iterations and unresolved phase allocation; preserve reference tolerances while allowing enough pairing sweeps to converge. Add conservation, domain, phase, retry and independent numerical controls, and document current versus retained model scope. Refs #167, #168, #161
Exclude prohibited nutrient carriers, constrain targeted nutrients alongside their fitting rows, and remove absolute slack from hard-limit assessment. Report water excess, contradictory targets and blocked nutrient sources. Preserve original example inputs and add independent constraint regressions. Refs #160
Remove hidden dose and incidental-nutrient fitting penalties. Preserve hard limits and reject nonzero ridge arguments. Handle reagent direction crossings with verified recipe blending and rebuild final nutrient assessments. Add independent objective, mass-balance and fail-closed regression checks. Refs #160, #158
Compare every product-removal trial with the original fit, reject primary loss increases, and recheck zero requirements and nutrient maxima. Include all positive internal doses and add drift, tie and scaling regressions. Refs #160
Add qualified fertilizer/reagent search, precision-preserving sensitivities, bounded charge restoration and independent numerical verification. Integrate explicit joint inputs and approved zero-reagent recovery into the public workflow. Rebuild diagnoses from actual quantities and independently check final pH, hard limits and acceptance. Add regression and qualification coverage, generated API reference and workflow documentation. Refs #158, #162.
This was referenced Oct 28, 2026
rafatahmed
added a commit
that referenced
this pull request
Nov 7, 2026
…age (#196) Merge the validated mathematical-engine changes and full-path coverage XML repair.
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 si
3070
ngle 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.
The mathematical-engine audit identified gaps in nutrient constraints, coupled fertilizer/reagent fitting, chemistry applicability, delivery calculations and result acceptance. This change implements the accumulated corrections, adds regression and independent numerical qualification, and binds public reports and saved results to the evaluated calculation.
Changes cover solver termination and interacting hard constraints; material and water accounting; joint fertilizer/reagent fitting; condition-qualified conductivity, phase and stock results; dilution and delivery conservation; exact-result acceptance; API/CLI and terminal behavior; and documentation/migration guidance.
CI checks the candidate revision and tracked inputs, requires native Linux/Windows/macOS coverage bundles from the same run, rejects failed or stale evidence, and enforces zero missing statements and branch destinations before a single candidate-bound Codecov upload. Existing required job names are retained.
Validation and limitations
Latest CI changes: 24 focused tests passed with no skips; Ruff lint/format, diff whitespace and warning-as-error Sphinx build passed.
New CI tool: 119/119 statements and 44/44 branch destinations covered.
Local source-hash-qualified coverage union: 114 files, 12,791 statements and 5,172 branch destinations, zero gaps. Prior measurements are reused only for unchanged sources; this is not a fresh full-suite run or hosted native-platform result.
Numerical/mutation qualification and earlier package evidence remain in the local audit ledger. They are not substituted for checks against this PR head.
Draft pending fresh hosted jobs, confirmation that Codecov reports the same SHA/counts, and final clean-package/publication consistency work. Branch protection activation requires separate approval.
No physical validation claim or release-readiness claim is made. Physical validation remains a separate later stage.
Tracking
Related tracking issues (no automatic closure is requested at draft creation):
fix: joint recipe–acid fit stalls and regresses final nutrient accuracy #158
test: enforce mathematical-engine foundation tracking and evidence gates #159
fix: preserve explicit constraints and canonical recipe outputs #160
test: complete scientific qualification follow-up #161
fix: refresh joint-fit diagnosis after product-switch fallback #162
fix: include material counterions before nutrient fitting #164
fix: qualify numerical stopping and scale-dependent singularity checks #165
fix: protect golden references and reject invalid comparison evidence #166
fix: search permitted available substitutions before rejecting an empty recipe pool #170
fix: distinguish solubility screening floors from qualified limits #172
fix: enforce delivery mass and channel-volume conservation #175
fix: bind public outputs to immutable canonical calculation results #177
feat: evaluate scoped catalogue treatment and equipment remedies #178
feat: bind result acceptance and saved sessions to exact content #179
fix: preserve API constraints in public CLI and file contracts #181
fix: restore terminal state and terminate disconnected input #182
fix: preserve constraints and scientific qualifications in grower outputs #184
test: close runtime statement and branch coverage gaps #186
test: close maintained tools examples and benchmark coverage gaps #192
test: audit numerical qualification and consequential mutation detection #195
test: account for Darwin pending-input state in terminal restoration witness #197
ci: prevent Codecov from overwriting validated coverage XML #198