Add shared NeqSim Studio case lifecycle - #94
Conversation
…t-handoff-20260810 Connect Process Chat to the active Studio case
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd0fad862b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ( | ||
| model_built is not None | ||
| and session.model is not None | ||
| and not runtime_model_replaced | ||
| ): |
There was a problem hiding this comment.
Mark property-only scenarios as runtime changes
When a what-if changes only equipment properties, _handle_scenario persists the patch by mutating session.model in place but sets _last_model_built only for structural changes. Consequently the model identity is unchanged and model_built is None, so this condition skips mark_active_runtime_changed; the active portable case remains labeled solved even though its live model now has different pressures, efficiencies, or other inputs. Use an explicit successful-mutation signal, such as the scenario comparison/persistence result, rather than model_built as the change detector.
Useful? React with 👍 / 👎.
| if solver_status == "Solved": | ||
| context_status = STATUS_WARNING if draft_warnings else STATUS_SOLVED |
There was a problem hiding this comment.
Preserve dirty state when returning from Process Chat
After Process Chat marks a case dirty because it mutated or replaced the runtime model, navigating directly back to this page leaves the stored flowsheet signature and result flag unchanged. _solver_status therefore returns Solved from the old input signature, and these lines immediately overwrite the dirty context as solved even though the stored model object may contain Chat changes—or may have been detached by Reset All. The solved classification needs to account for the active context's runtime divergence or Chat must invalidate the stored flowsheet result.
Useful? React with 👍 / 👎.
| # Refresh whitelisted lifecycle/units/provenance evidence. The | ||
| # portable case specification is intentionally not forwarded. | ||
| session.set_studio_case_context(_studio_case) |
There was a problem hiding this comment.
Detach the case when sidebar actions replace the model
With an active solved Studio case, the sidebar's upload, Start New Process, Load Test Process, and DEXPI actions can replace or remove process_model without calling either lifecycle helper. The next message still forwards _studio_case here as solved evidence, so the prompt associates the active case's lifecycle and thermodynamics with an unrelated model or builder session. Mark the case dirty/detached in every sidebar model lifecycle path, or omit its evidence when the live model no longer corresponds to it.
Useful? React with 👍 / 👎.
Summary
Advances S2 — Shared case context and lifecycle as a stacked child of #93.
This tranche adds a real case workspace across the new Studio home and the inherited Process Flowsheet Studio:
Stacked PR contract
automation/web-studio-shell-202608094e2db28de200a335ca1f9cd34d994c51236e512dautomation/web-studio-shell-20260809automation/web-studio-case-context-20260810This PR is not independently mergeable to
main. PR #93 must merge first; this PR must then be safely retargeted/revalidated.Compatibility boundary
Classic remains unchanged. The shared lifecycle uses Studio-only session keys and has a regression proving unrelated Classic state survives reset.
The existing Process Flowsheet Studio JSON remains the authoritative portable format:
.neqsimand Process Chat handoff are reusedValidation before publication
Exact head:
73233f9c25854b5d8a992b93fd3f6f7439c894b1Passed locally:
PYTHONPATH=. python tests/test_studio_case_context.py -v— 13/13PYTHONPATH=. python tests/test_studio_navigation.py -v— 5/5PYTHONPATH=. python tests/test_flowsheet_editor.py -v— 120/120Hosted GitHub Actions Process Flowsheet Studio #385, run
31342601214, completed successfully on the exact head. All steps passed: compilation; 13 shared lifecycle tests; Studio navigation and shell AppTest; repeated Classic + Studio HTTP/health probes; deployment-safe and warm-JVM imports; graph editor; named streams; solver diagnostics; subflowsheets; native multi-inlet conservation; and bounded execution.Three-repository evidence
equinor/neqsimmaster atdb5b98b3contains the merged canonical diagram-topology increments through #2916. No core change is required for S2.EvenSol/NeqSim-Colabmaster at7cb7e5d4and the executed DEXPI safety-study acceptance workflow were reviewed. S2 changes UI/session lifecycle only, so no notebook change is justified.Documentation impact
Updates
docs/neqsim_web_studio_roadmap.mdand records S2 as in stack, not merged completion. No Classic documentation or calculation behavior changes.Next dependency-ready tranche
After S2 is stack-ready, integrate the inherited flowsheet workbook/results/design/study surfaces behind the active case context (S3/S4) without rewriting their calculation logic.