Repository navigation
feat(game): add native NeqSim Plant Operator challenge - #129
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
It introduces runtime-affecting issues around JVM option handling and input validation that should be corrected before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a new Streamlit-based NeqSim Plant Operator workflow to NeqSim Studio, introducing a native NeqSim “game” scenario where users tune operating controls, run a bounded native solve, and receive transparent engineering checks plus a score.
Changes:
- Registers the new
plant_operatorStudio destination and adds navigation/page-level regression tests. - Introduces
process_chat.plant_operator_gameimplementing the challenge spec, bounded execution, evidence collection, scoring, and guidance. - Adds a new Streamlit page (
36_NeqSim_Plant_Operator) plus README/docs describing the scenario contract and reproducibility.
File summaries
| File | Description |
|---|---|
| tests/test_studio_navigation.py | Adds navigation coverage for the new Studio destination key. |
| tests/test_plant_operator_page.py | Adds regression tests for page discoverability, accessibility markers, and non-solving initial render. |
| tests/test_plant_operator_game.py | Adds unit tests for spec generation, control validation, and scoring/check behavior. |
| studio/navigation.py | Registers the plant_operator workflow destination. |
| README.md | Documents the new Plant Operator workflow and links to detailed docs. |
| process_chat/plant_operator_game.py | Implements the native challenge spec, bounded run orchestration, evidence extraction, and scoring. |
| process_chat/init.py | Updates module index docstring to include plant_operator_game. |
| pages/36_NeqSim_Plant_Operator.py | Adds the Streamlit UI for running and reviewing Plant Operator attempts, exporting JSON, and handing off to Process Chat. |
| docs/neqsim_plant_operator_game.md | Adds scenario contract, win conditions, scoring rules, and reproducibility details. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d81991b77
ℹ️ 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".
There was a problem hiding this comment.
🟡 Changes recommended
Two validated runtime-contract issues remain (JAVA_TOOL_OPTIONS clobbering and timeout_ms validation raising unintended exception types) that can break execution in real deployments.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
process_chat/plant_operator_game.py:520
- timeout_ms validation calls int(timeout_ms) inside the condition; non-int-convertible values (e.g., None or 'abc') will raise a raw TypeError/ValueError instead of the intended ValueError contract. Convert once under try/except and validate the converted value.
if isinstance(timeout_ms, bool) or int(timeout_ms) <= 0:
raise ValueError("Challenge timeout must be a positive integer.")
timeout_ms = int(timeout_ms)
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Lite
| if "add-opens" not in os.environ.get("JAVA_TOOL_OPTIONS", ""): | ||
| os.environ["JAVA_TOOL_OPTIONS"] = _JVM_OPENS |
Summary
ProcessBuilder/NeqSimProcessModelthermodynamics, equipment calculations, solver constraints, and conservation evidenceEngineering contract
The synthetic SRK gas-compression train is:
feed -> inlet scrubber -> compressor 1 -> intercooler -> interstage scrubber -> compressor 2 -> export coolerThe player controls feed flow, both discharge pressures, intercooling, and export cooling. A win requires all published checks to pass: throughput, export pressure/temperature, compressor discharge temperature, total power, specific energy, cooling duty, mass balance, energy balance, and all other native NeqSim constraints. The score cannot override a failed engineering check.
Validation
Tested with NeqSim Python package 3.18.0 and Streamlit 1.62.0.
.venv/bin/python -m unittest tests.test_plant_operator_game tests.test_plant_operator_page tests.test_studio_navigation tests.test_studio_shell— 19 passed.venv/bin/python -m unittest tests.test_process_execution tests.test_process_chat_studio_handoff tests.test_runtime_imports— 33 passedpython -m py_compile process_chat/plant_operator_game.py pages/36_NeqSim_Plant_Operator.py studio/navigation.py— passedgit diff --check— passedRepresentative native winning attempt:
Documentation impact
Updated the README and added
docs/neqsim_plant_operator_game.mdwith units, assumptions, win conditions, scoring, reproducibility, interoperability, and limitations.Current limitations
This first increment is a steady-state synthetic training case. Dynamic controllers, trips, hydrate-margin calculation, economics/emissions, and persistent leaderboards remain future separately validated challenges. Results support education and engineering screening; they are not design certification.