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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a8e0aad
test: add traceable regression controls and numeric review gates
rafatahmed Oct 25, 2026
3916558
fix: make ammonium limits explicit and qualify material provenance
rafatahmed Oct 25, 2026
9e8e944
fix: preserve solvent mass when converting solution concentrations
rafatahmed Oct 25, 2026
012eb39
fix: preserve measured alkalinity and account for noncarbonate buffers
rafatahmed Oct 25, 2026
46ff98f
fix: account for material counterions before nutrient fitting
rafatahmed Oct 25, 2026
fa39a10
fix: report omitted ligand competition and verify reaction provenance
rafatahmed Oct 25, 2026
2bb9991
test: add independent numerical oracles and reference error accounting
rafatahmed Oct 25, 2026
d8dfc02
fix: reject false numerical convergence and report solver residuals
rafatahmed Oct 26, 2026
b740b36
test: protect golden references and reject invalid comparison evidence
rafatahmed Oct 26, 2026
6f0a0eb
fix: conserve retained chemistry balances and reject unfinished equil…
rafatahmed Oct 26, 2026
cbf0a98
fix: enforce zero nutrient requirements and all hard maxima
rafatahmed Oct 26, 2026
9310284
fix: prioritize target accuracy and verify coupled recipe transitions
rafatahmed Oct 26, 2026
c7d02d6
fix: preserve original nutrient accuracy during recipe simplification
rafatahmed Oct 26, 2026
420b304
fix: preserve dose precision and reassess weighed quantities
rafatahmed Oct 26, 2026
9b81d80
fix: distinguish charge inventory and nutrient feasibility diagnostics
rafatahmed Oct 26, 2026
49b4081
fix: search available nutrient substitutions through recovery closure
rafatahmed Oct 26, 2026
e89209f
feat: define joint fertilizer and reagent problem contract
rafatahmed Oct 26, 2026
71acde9
feat: add safeguarded joint fertilizer and reagent solver
rafatahmed Oct 26, 2026
36ce642
fix: integrate joint fitting and rebuild final recipe diagnostics
rafatahmed Oct 27, 2026
3f87391
fix: enforce phosphate conductivity applicability and verify coeffici…
rafatahmed Oct 27, 2026
ed20136
fix: retain partial conductivity results and preserve uncertainty qua…
rafatahmed Oct 27, 2026
678be81
fix: require condition-qualified evidence for phase applicability
rafatahmed Oct 27, 2026
b89ad65
fix: distinguish solubility floors from qualified limits
rafatahmed Oct 27, 2026
06baeba
fix: qualify stock assignments and preserve weighed chemistry
rafatahmed Oct 27, 2026
a3b2cc4
fix: conserve material across stock dilution and delivery channels
rafatahmed Oct 27, 2026
c08a220
fix: bind public outputs to immutable calculation results
rafatahmed Oct 27, 2026
5e1efdb
feat: evaluate catalogue treatment and equipment remedies
rafatahmed Oct 27, 2026
f032d19
feat: bind result acceptance and saved sessions to exact content
rafatahmed Oct 27, 2026
34409d0
fix: preserve hard limits across public CLI contracts
rafatahmed Oct 27, 2026
6ff3798
fix: restore terminal state and handle disconnected input
rafatahmed Oct 27, 2026
80bfc42
fix: preserve constraints and scientific evidence in grower outputs
rafatahmed Oct 27, 2026
9904c6b
docs: align migration guidance and release claims with current contracts
rafatahmed Oct 27, 2026
2b89f72
fix: reject stalled water reconciliation and close runtime coverage gaps
rafatahmed Oct 28, 2026
48739af
fix: preserve partial EC reports and validate support tools
rafatahmed Oct 28, 2026
4f8dd89
ci: enforce candidate-bound statement and branch coverage
rafatahmed Oct 28, 2026
a49292b
test: account for Darwin pending-input state in terminal restoration
rafatahmed Oct 28, 2026
0856ec6
test: cover missing optional benchmark package metadata
rafatahmed Oct 28, 2026
6cc9341
ci: preserve validated coverage reports through Codecov upload
rafatahmed Oct 28, 2026
9386eca
ci: preserve full coverage paths and verify XML file contents
rafatahmed Oct 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 83 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ on:
permissions:
contents: read

env:
CANDIDATE_SHA: ${{ github.event.pull_request.head.sha || github.sha }}

jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
Expand All @@ -40,31 +45,39 @@ jobs:
python-version: "3.13"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: python -m pip install -e . build
- name: Unit tests
if: matrix.python-version != '3.13' || runner.os != 'Linux'
if: matrix.python-version != '3.13'
run: python -m unittest discover -s tests -t .
- name: Unit tests with coverage (coverage is a CI tool only, not a dependency)
if: matrix.python-version == '3.13' && runner.os == 'Linux'
- name: Install coverage and support-test dependencies
if: matrix.python-version == '3.13'
run: python -m pip install coverage==7.17.0 PyYAML==6.0.3 -r benchmarks/requirements.txt -r tools/requirements-benchmark-report.txt
- name: Candidate-bound native coverage
if: matrix.python-version == '3.13'
shell: bash
env:
COVERAGE_FILE: build/.coverage
COVERAGE_FILE: build/coverage/.coverage
run: |
python -m pip install coverage==7.17.0
mkdir -p build
python -m coverage run --source=src/flahax -m unittest discover -s tests -t .
python -m coverage xml -o build/coverage.xml
python -m coverage report
- uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
if: matrix.python-version == '3.13' && runner.os == 'Linux'
python -m tools.ci_coverage record --candidate "$CANDIDATE_SHA" --output build/coverage
set +e
python -m coverage run -m tools.ci_coverage run --candidate "$CANDIDATE_SHA" --output build/coverage 2>&1 | tee build/coverage/tests.log
test_status=${PIPESTATUS[0]}
set -e
python -m tools.ci_coverage report --candidate "$CANDIDATE_SHA" --output build/coverage
exit "$test_status"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always() && matrix.python-version == '3.13'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/coverage.xml
flags: unittests
fail_ci_if_error: false
name: coverage-evidence-${{ matrix.os }}-${{ matrix.python-version }}
include-hidden-files: true
if-no-files-found: error
path: build/coverage/
- name: Clean wheel and sdist verification
run: python tools/verify_distribution.py
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand All @@ -78,6 +91,8 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
Expand All @@ -89,7 +104,7 @@ jobs:
- name: Required live reference replay and runtime equivalence
shell: pwsh
run: |
python -m unittest tests.test_product_phreeqc tests.test_acid_reference -v 2>&1 | Tee-Object -FilePath phreeqc-validation.log
python -m unittest tests.test_product_phreeqc tests.test_acid_reference tests.test_preserved_chemistry_evidence tests.test_live_reference_policy tests.test_reference_integrity -v 2>&1 | Tee-Object -FilePath phreeqc-validation.log
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
Expand All @@ -101,10 +116,62 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
- name: Install package and docs tooling
run: python -m pip install . -r docs/site/requirements.txt
- name: Build documentation (warnings are errors)
run: python -m sphinx -W --keep-going -b html docs/site build/docs-html

coverage-gate:
name: coverage-gate
needs: [style, test, phreeqc-live, docs]
if: always() && !cancelled()
runs-on: ubuntu-latest
steps:
- name: Require every prerequisite to pass
env:
REQUIRED_RESULTS: ${{ toJSON(needs) }}
run: |
python -c 'import json, os; results = json.loads(os.environ["REQUIRED_RESULTS"]); assert results and all(v["result"] == "success" for v in results.values()), results'
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
- name: Install exact coverage reporter
run: python -m pip install coverage==7.17.0
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: coverage-evidence-*
path: build/native-coverage
- name: Enforce revision, native shards and exact statement/branch counts
id: aggregate
run: python -m tools.ci_coverage aggregate --candidate "$CANDIDATE_SHA" --inputs build/native-coverage --output build/coverage-gate
- name: Verify validated upload input
run: python -m tools.ci_coverage verify-upload --candidate "$CANDIDATE_SHA" --output build/coverage-gate
- uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/coverage-gate/coverage.xml
flags: unittests
name: native-aggregate
override_commit: ${{ env.CANDIDATE_SHA }}
plugins: noop
disable_search: true
disable_file_fixes: true
fail_ci_if_error: true
- name: Verify uploaded report was preserved
if: always() && steps.aggregate.outcome == 'success'
run: python -m tools.ci_coverage verify-upload --candidate "$CANDIDATE_SHA" --output build/coverage-gate
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
name: coverage-gate-${{ env.CANDIDATE_SHA }}
include-hidden-files: true
if-no-files-found: error
path: build/coverage-gate/
Loading
Loading
0