8000 fix: qualify mathematical-engine contracts and enforce exact CI coverage by rafatahmed · Pull Request #196 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

fix: qualify mathematical-engine contracts and enforce exact CI coverage - #196

Merged
rafatahmed merged 39 commits into
mainfrom
test/mathematical-engine-foundations
Oct 28, 2026
Merged

rafatahmed merged 39 commits into
mainfrom
test/mathematical-engine-foundations

Conversation

@rafatahmed
@rafatahmed rafatahmed commented Oct 28, 2026 •
Copy link
Copy Markdown
Owner

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):

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0