8000 feat: add Steiner-inspired recipe planning and uncertainty checks by rafatahmed · Pull Request #250 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

feat: add Steiner-inspired recipe planning and uncertainty checks - #250

Merged
rafatahmed merged 37 commits into
mainfrom
fix/audit-provenance-claims
Nov 16, 2026
Merged

rafatahmed merged 37 commits into
mainfrom
fix/audit-provenance-claims

Conversation

@rafatahmed
@rafatahmed rafatahmed commented Nov 15, 2026 •
Copy link
Copy Markdown
Owner

Summary

Adapt Steiner's ratio-design method into FlahaX recipe planning:

ratios + water + products + pH reagents
  -> allocation -> rounded doses
  -> uncertainty, 5% nutrient reserve, pH/mineral checks
  -> strongest sampled candidate and observed constraint evidence

Includes preparation-record/workbook support and header/style cleanup. Fixes product-order sensitivity in redundant allocations and distinguishes the highest-SI mineral from the observed strength constraint.

Steiner supplies separate cation/anion equivalent ratios, analytical nutrient concentration and pH-reagent accounting. Real-water/product handling, uncertainty, modern mineral SI, adaptive sampling, search and the 5% reserve are FlahaX extensions; the article does not validate these additions.

Closes #248.
Closes #249.
Closes #251.
Closes #252.
Closes #253.

Closes #254.
Closes #255.
Closes #256.

Evidence

  • Split precipitation fixtures preserve both real recipes and all five assertions; local replay passes. Immediate timeout reporting and missing-summary rejection are tested. All 24 runner/coverage tests pass. Three unsuccessful macOS runs remain recorded as failures, not acceptance.

  • Current CI scope (ci: avoid unavailable macOS ARM64 runner pool #256): macOS removed by explicit user instruction after hosted runner shortages and Intel timeouts. Linux (4 native shards) and Windows (6) remain required. Exact coverage, every scientific case and the 45-minute gate remain enforced. No current macOS compatibility claim.

  • Current head abae632: Linux/Windows CI pending in run 43930040699. Removes two duplicate tests, splits one coverage rejection test, reuses identical witnesses/states, strengthens documentation output/configuration and error assertions. All 12 allocation and 27 stress cases remain.131 selected regression tests pass with zero skips; five witness outputs are exactly unchanged; controlled broken-config/no-output/unrelated-error probes are rejected. Shared-kernel evidence is explicitly qualified. Standards and Spec reviews report no actionable findings. Closes test: remove redundant work and strengthen audited assertions #255 only on merge.

  • Before: four of 37 N1 evaluations failed for feasible redundant-product orders. After: all 37 pass without relaxing limits.

  • Before: highest-SI mineral could be mistaken for the strength constraint. After: adjacent failures report constraint values and effective ceilings, with unknown/incomplete cases explicit.

  • Recorded N5 validation: 276 tests across 37 modules, zero skips; matched PHREEQC witnesses and source-table audit. Historical follow-up counts overlap and are not additive.

  • Pure-salt gravimetric-stock example: strongest sampled candidate 1.263981819153 mmol/L passes the 5% reserve, 128 uncertainty scenarios and 6,400 pH evaluations across 6.28-6.32; the adjacent higher candidate exceeds nitrate-N. Personal evidence stays outside Git.

  • Previous-head CI PASS: run 43846758485, head 981b299, completed in 32m36s, below the 45-minute acceptance limit. All 29 reported PR checks pass, including Python 3.11–3.14, native Linux/Windows/macOS coverage, clean distribution checks, docs and live PHREEQC.

  • Previous-head exact coverage PASS: 16,171 statements and 6,574 branch destinations; zero missing. Fourteen native coverage artifacts are bound to the candidate and workflow attempt; XML/upload integrity checks pass.

  • CI corrections: balanced native and compatibility partitions with isolated workers; complete-inventory rejection gates; four duplicate delivery-test discoveries removed; explicit coverage startup preserves measurements from coverage-aware workers. Every unique scientific case remains. Python 3.13 reuses its native Linux evidence instead of running twice.

  • CI follow-ups change tests, scheduling and evidence recording only. They retain the 5% reserve, all uncertainty and saturation checks, exact coverage thresholds and required check names. The real worker-recording regression fails before/passes after the fix; 23 focused tests pass through the actual parallel runner. No new lab features or physical tests.

Merge Danger

Door: two-way

Blast Radius: planning

Finite sampling and local search do not prove global extrema or universal solver reliability. Matched reference agreement is not experimental validation. Steiner's +0.13 pH discrepancy remains unresolved. Laboratory testing stays deferred. No merge or release is authorized.

Share charge derivatives for chemically identical product directions while
preserving separate product and uncertainty records. Distinguish the highest-SI
mineral from observed strength constraints, including pure-salt uncertain
nutrient bounds. Add independent allocation, stress and refinement regressions.

Retain the 5% nutrient reserve, uncertainty bounds, saturation margins and
sampled/local qualifications. Laboratory testing remains deferred.

Validation: retained source-bound N5 evidence covers 276 tests; review follow-up
passes 39 affected tests, Ruff, compileall and diff checks. Eight touched Python
headers are corrected. Existing repository header/dunder failures remain open;
this is not release acceptance.

Refs #248, #249
Add the required SPDX/disclaimer headers to 38 Python files, move package
metadata before imports without changing their relative order, and resolve
nine whitespace warnings in the Steiner reference tests.

Verify unchanged ASTs for header/whitespace edits, unchanged public exports and
exact numerical outputs. Retain the full 128-scenario/6400-pH anchor replay,
39 header-cleanup regression methods and eight fresh focused passing tests.
Ruff passes all 39 changed files. Lab testing remains deferred.

Tracked in user-authorized local header and whitespace issue drafts while
remote issue creation is unavailable. No numerical thresholds changed.
@rafatahmed rafatahmed added bug Something isn't working enhancement New feature or request labels Nov 15, 2026
@rafatahmed rafatahmed self-assigned this Nov 15, 2026
Resolve the unused allocation-test binding and pinned formatting differences. Refs #251.
@rafatahmed rafatahmed changed the title feat: add validated Steiner recipe planning and uncertainty checks feat: add Steiner-inspired recipe planning and uncertainty checks Nov 15, 2026
Regenerate CLI and public API references and explain fixed-ratio error codes. Refs #252.
@read-the-docs-community
read-the-docs-community Bot commented Nov 15, 2026 •
Copy link
Copy Markdown

Documentation build overview

📚 Flahax | 🛠️ Build #35936058 | 📁 Comparing abae632 against latest (31c1e8e)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

Address #254 by balancing four shards per native platform, running isolated test workers, rejecting incomplete test inventories, and enforcing the PR time budget. Preserve every unique numerical case and remove duplicate discovery of delivery tests.
Complete #254 scheduling correction after all native coverage shards passed but two single-runner compatibility jobs exhausted the job budget. Preserve required check names and reject incomplete compatibility evidence.
Use six Windows shards and reuse complete native Linux evidence for Python 3.13 instead of running that suite twice. Keep twenty long-running jobs, preserve complete-inventory gates, and allow job headroom within the unchanged 45-minute acceptance limit. Addresses #254.
Explicitly measure child workers when a parent collector is active. Coverage-aware tests disable automatic subprocess autosaving when they construct Coverage objects; a real subprocess regression now verifies those executed statements are retained. Addresses #254 without exclusions or threshold changes.
@codecov
codecov Bot commented Nov 16, 2026 •
Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff             @@
##              main      #250     +/-   ##
===========================================
  Coverage   100.00%   100.00%             
===========================================
  Files          116       136     +20     
  Lines        13798     16175   +2377     
  Branches      2733      3287    +554     
===========================================
+ Hits         13798     16175   +2377     
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.

Closes #255. Preserve scientific scenarios and reserve/uncertainty checks while reusing identical reference calculations and testing semantic output and rejection behavior.
Closes #256. Preserve all native partitions and acceptance gates; record macOS coverage on Intel instead of the unavailable ARM64 pool.
Refs #256. Preserve both real recipes and all five scientific assertions, balance six Intel macOS partitions, and report worker timeouts immediately without relaxing the 45-minute gate.
Refs #256. Remove macOS from CI at the user's request while retaining complete test inventories, exact coverage and all scientific acceptance limits on Linux and Windows.
@rafatahmed
rafatahmed merged commit ddfb785 into main Nov 16, 2026
27 checks passed
@rafatahmed
rafatahmed deleted the fix/audit-provenance-claims branch November 16, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
0