Metadata-Version: 2.4
Name: openflowsheet
Version: 0.3.0
Summary: OpenFlowsheet: an agent-native open process simulator
Author-email: Frank Peters <e.a.j.f.peters@tue.nl>
License-Expression: Apache-2.0
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: numpy==2.2.4
Requires-Dist: scipy==1.15.3
Requires-Dist: pyyaml==6.0.2
Requires-Dist: jsonschema==4.26.0
Requires-Dist: casadi==3.8.0
Provides-Extra: dev
Requires-Dist: pytest==8.3.5; extra == "dev"
Requires-Dist: mypy==1.15.0; extra == "dev"
Requires-Dist: ruff==0.12.11; extra == "dev"
Requires-Dist: types-PyYAML==6.0.12.20260906; extra == "dev"
Requires-Dist: types-jsonschema==4.26.0.20260518; extra == "dev"
Requires-Dist: mpmath==1.3.0; extra == "dev"
Provides-Extra: server
Requires-Dist: mcp==1.30.0; extra == "server"
Requires-Dist: starlette==1.7.0; extra == "server"
Requires-Dist: uvicorn==0.54.0; extra == "server"
Provides-Extra: coolprop
Requires-Dist: CoolProp==8.0.0; extra == "coolprop"
Provides-Extra: nlp
Requires-Dist: pyomo==6.10.1; extra == "nlp"
Requires-Dist: cyipopt==1.7.0; extra == "nlp"
Requires-Dist: packaging==26.3; extra == "nlp"
Provides-Extra: lca
Requires-Dist: bw2data==4.7; extra == "lca"
Requires-Dist: bw2calc==2.5.0; extra == "lca"
Dynamic: license-file

# OpenFlowsheet

An agent-native open process-engineering runtime, in which models, equations, numerical strategies,
validity limits and evidence are explicit objects. Humans and coding agents work against the same
scientific contracts. The project owns solver orchestration and process-specific numerical methods,
and reuses established differentiation, linear-algebra and optimization infrastructure.

## Status

**Early development. Version 0.2.0 is released** (20 October 2026, on PyPI and as a GitHub release).
Work toward v0.3 continues on `main`; nothing merged after the `v0.2.0` tag is released.

| | |
| --- | --- |
| Released in 0.2.0 | The application contract (local, HTTP and MCP), the unit-model library, the planner, the verifier with its certificate or typed failure, and the replay bundle; the Peng–Robinson property route of the ammonia-synthesis loop (M01); the pinned PyMRM reactor as a unit model (M02); parametric sensitivities, studies and the NLP bridge (M03); surrogate evidence (M04); the trust-region study of the loop (M05); the diagnostic web shell (M06); the reference journey and the release gate (M07). The supported envelope is `docs/support-matrix.md`: unlisted is unsupported |
| On `main`, not released | Countercurrent equilibrium-stage columns (S01, S02, S08); IAPWS-95 water (S05); CoolProp as an optional pure-fluid provider (S07); the Wilson liquid-mixture method with TP flash (S10) and its PH flash and column (S10-C); blind comparisons of columns with IDAES, DWSIM and BioSTEAM (S03, S09) |
| Established | Numerical verification against independent references, for example the P01 oracle against 20-digit reference values (7.1e-15 worst relative deviation); agreement with IDAES and DWSIM on shared cases, which share the equations and are therefore not validation |
| Validation against data | **0.2.0:** none against experiment; the C1 loop and its reactor results are not empirically validated. **`main`:** the Wilson method is within its pre-registered bands against measured vapour–liquid equilibrium of methanol–ethanol–water (ternary at 101.3 kPa; binaries with water at 323–333 K), and methanol's liquid enthalpy and heat capacity are not within band against CoolProp (`docs/s10-validation-report.md`) |
| **Not** established | Optimality evidence; human numerical or process-modeling review — `review.numerical` and `review.process_model` are `pending` in every evidence manifest and no agent may set them |

What the project has and has not shown is recorded per package in `evidence/<ID>/<commit>/manifest.json`;
what each release claims is in `CHANGELOG.md`, and the current position is `docs/progress.md`.

## Authorities

Read these before changing anything they cover.

| Document | Role |
| --- | --- |
| `docs/blueprint-v3.1.md` | Architectural authority. Its SHA-256 is recorded in the implementation plan's header and checked by the test suite |
| `docs/implementation-plan.md` | Execution authority: work packages, order, acceptance evidence, gates |
| `docs/adr/` | Normative decisions. ADR 0001 state/units/zero-flow, 0003 backend, 0006 distribution, 0008 transient-extension readiness |
| `docs/decision-register.md` | What was chosen, what was rejected, and why — the index that makes the ADRs findable by the question they answer |
| `CLAUDE.md` | Working rules for the two coding agents that share this repository |

## Diagnostic web shell

A browser view of one project — revisions, validation and degrees of freedom, runs and traces,
certificates and failure bundles, streams, comparisons and the audit history — served beside the
HTTP API and reading nothing but the application contract:

```bash
openflowsheet project grant --project ./plant --principal me --rights read,execute   # prints a token once
openflowsheet serve-http --project ./plant --ui    # web shell at http://127.0.0.1:8765/ui/
```

`--ui` is off by default; loopback by default; every data request needs the bearer token, which
the page keeps in session storage and sends only in the `Authorization` header. The shell edits
nothing — Solve and Cancel are its only actions — and judges nothing: what each screen shows and
does not claim is `docs/web-shell.md` (design: `docs/design/M06-web-shell.md`, ADR 0030).

## Development

Requires Python 3.13.

```bash
make venv                                  # create .venv and install with dev extras
make check                                 # ruff, ruff format, mypy --strict, pytest
make lock                                  # regenerate requirements.lock from the environment
```

`make check` is the gate. It must be green before any merge, and a failed gate stays failed — it is
never relaxed, narrowed or worked around to let a change through.

## Third-party notices

This software uses **CasADi 3.8.0**, which is licensed under the **GNU Lesser General Public License,
version 3 or later (LGPL-3.0-or-later)**. CasADi is a separate work, obtained by the installer from
PyPI as a pinned dependency; this project distributes none of its bytes. It is used through its
Python API only — the interpreter loads the library at run time, nothing is compiled against its
headers or linked against it at build time, and a user may substitute their own build of CasADi
3.8.0 by replacing the installed package.

The full licence text ships inside the CasADi distribution at `casadi/LICENSE/LICENSE.txt` in the
installed package, together with notices for its bundled components at `casadi/include/licenses/`.

An exact inventory of what that distribution contains — every binary with its SHA-256, the bundled
plugin inventory including the bytes that cannot run, and the notices — is
**`docs/p03-binary-audit.md`**, with the machine-readable record in `spikes/p03/results/`. The terms
on which this project may and may not redistribute any of it are **`docs/adr/0006-distribution-data-rights.md`**.
Changing the CasADi pin re-runs that audit before the change merges.

Further attributions are in `NOTICE`.

## Licence

The core licence is **Apache-2.0**, declared in `pyproject.toml` and stated in `LICENSE` and
`NOTICE`. The maintainer confirmed the project's rights to distribute its contributions under it on
2026-09-23 (`120acb4`). Why Apache-2.0 rather than MIT is recorded in `docs/decision-register.md`
R-005.
