8000 fix: preserve API constraints in public CLI and file contracts · Issue #181 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

fix: preserve API constraints in public CLI and file contracts #181

Closed

Description

@rafatahmed

Reproduction

At f032d19, send recommend a JSON object with packaged Potassium Nitrate, targets K=100 mg/L, water={}, and maximum_concentrations={K:0}. The CLI returns feasible=true with 0.2585983966899405 g/L. The Python recommend API with the same explicit ceiling returns feasible=false and no fertilizer dose. main does not forward maximum_concentrations and silently ignores unknown request fields. It also coerces allowCarbonates via bool(), so non-boolean strings can change permissions.

Expected / actual / impact

Every supported recommendation parameter must preserve the API's hard constraints and permissions. Unsupported/misspelled fields must fail explicitly. Current CLI silently drops a declared hard zero. P32 acceptance/archive functions also lack the documented top-level API exports needed for the new public file contract.

Acceptance criteria

  • Forward supported API parameters, including maxima, ammonium fraction and ridge, with strict JSON field/type validation and documented compatibility aliases.
  • Add public acceptance/canonical/archive exports and regenerate API documentation.
  • Exercise actual subprocess JSON recommendation, workflow, batch/plain CLI and malformed-file contracts; preserve independent stage/status qualifications.
  • Resolve the nine historical mix CLI tests tracked separately in test: align mix CLI assertions with qualified workflow results #180 without weakening scientific guards or blindly rewriting fixtures.
  • Document exit meanings, units, saved-state/result schemas and limitations. No scientific tolerance or physical-validation changes.

Activity

  1. self-assigned this
    on Oct 27, 2026
  2. added
    bugSomething isn't working
    documentationImprovements or additions to documentation
    on Oct 27, 2026
  3. rafatahmed commented on Oct 28, 2026

    @rafatahmed
    OwnerAuthor

    Resolved in PR #196, merged as f0775f43b7d185aeb94bddf205bc5a723636b1e1. Relevant implementation: 34409d0.

    Public CLI/file contracts forward hard constraints and validate fields/types, expose canonical/acceptance/archive APIs and retain documented exit/status semantics. Actual subprocess and malformed-input controls pass.

    Regression evidence:

    Hosted validation, attempt 2 passed all 10 jobs on 9386ecad56d85709c8e6a73590eac1032c8295c9: Python 3.11-3.14, native Windows/macOS/Linux, live PHREEQC, documentation/style, clean distribution checks and the exact coverage gate. The merge tree is identical to this validated head. This closes the specific issue; broader publication/final mathematical acceptance and physical validation remain separately tracked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0