Imported from seamuss1/Thorium_Molten_Salt_Reactor (
AGENTS.md). Install upstream withnpx skills add seamuss1/Thorium_Molten_Salt_Reactor. Copyright stays with the author.
AGENTS
Runtime
- Use the repo-local runtime in
.runtime-envfor all Python work in this repository. - Do not rely on system
python,pytest, or global conda installs. - On this Windows host, PowerShell script execution is restricted. Use the
.cmdwrappers as the default entrypoints. - Open a fresh configured shell with:
.\scripts\Enter-PytbknShell.cmd
- If
.runtime-envis missing, bootstrap it with the checked-in micromamba tool:
.\scripts\Enter-PytbknShell.cmd -Bootstrap
This sets PYTHONPATH=src, points temp/cache directories into the repo, and exposes:
pythonpytestreactor
Running The Repo
Interactive PowerShell after bootstrapping:
python -m thorium_reactor.cli build example_pin
python -m thorium_reactor.cli run example_pin --no-solver
reactor render tmsr_lf1_core
reactor report example_pin
One-shot wrapper without entering an interactive shell:
.\scripts\Run-Reactor.cmd build example_pin
.\scripts\Run-Reactor.cmd run example_pin --no-solver
.\scripts\Run-Reactor.cmd render tmsr_lf1_core
Web Interface
- The browser lab interface is a single-port FastAPI + React app at
http://localhost:18488. - Start it with the Windows wrapper:
.\scripts\Run-Web.cmd
- The wrapper builds
web/ui/distwhen needed, then starts the Docker Composewebservice. Use.\scripts\Run-Web.cmd -SkipUiBuildonly when the production UI build is already current. - Keep the normal browser runtime on one public port. Do not reintroduce a separate required browser-facing frontend port; Vite is only an optional hot-reload tool while editing
web/ui, and it proxies/apitohttp://localhost:18488. - For frontend changes, run commands from
web/uiwithnpm.cmd, especially:
npm.cmd run build
npm.cmd run test
- Browser-launched simulation runs must write isolated bundles under
results/<case>/<run_id>/and must not modify canonicalconfigs/cases/*/case.yaml. - The web job allowlist is intentionally limited to
build,run --no-solver,transient,transient-sweep,validate,render, andreport. Solver-backed OpenMC benchmarks and external integrations can be shown as artifacts, but should not be browser-launchable unless the safety model is deliberately expanded. - The Science view indexes
README.mdanddocs/*.md. Use H1 headings for readable titles, and write formulas as Markdown math with$...$or$$...$$so the React/KaTeX renderer can display them. - After web UI changes, verify
http://localhost:18488/api/healthand click through Dashboard, Cases, Builder, Runs, Science, and 3D in the browser.
GitHub Issues And Projects
- Use the repo Project
Thorium Reactor Workboard:https://github.com/users/seamuss1/projects/1. - Issue lifecycle is:
Inbox->Needs Info/Needs Design->Triaged->Ready->In Progress->Review->Done. - Use Project
Statusfor lifecycle. Use labels/fields for classification:type:*,area:*,priority:p*,size:*,roadmap:*,blocked, andneeds:design. - When adding an issue, use the closest issue template, include acceptance criteria and verification, add it to the Project, and set
StatustoInboxunless it is already actionable. - Move an issue to
Readyonly when scope, acceptance criteria, priority/size/area, verification, and blockers are clear. - When starting work, set
StatustoIn Progress, work from a branch, and keep the issue updated if scope or blockers change. - Open PRs with
Closes #<issue>orFixes #<issue>, and set the issue/Project item toReview. - Close issues only after acceptance criteria are met and verification is recorded. Prefer merge-linked auto-close; otherwise close manually with
completed,not planned, orduplicate. - Do not close parent/tracking issues until their required child issues are done or explicitly deferred.
Testing
Run the full suite:
.\scripts\Run-Tests.cmd
Run focused tests:
.\scripts\Run-Tests.cmd tests\test_flow.py -q
.\scripts\Run-Tests.cmd tests\test_geometry.py tests\test_reporting.py
Interactive after bootstrapping:
pytest
pytest tests\test_flow.py -q
python -m pytest tests\test_config_and_build.py
Notes
- The default Windows workflow is geometry, reporting, reduced-order flow, and dry-run neutronics. Solver-backed OpenMC runs still require a supported host or Docker path documented in
README.md. - Keep generated caches under
.tmpand.pip-cache.