Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
8fbcd0d
Fix misleading SCF status and stale constant/schema docs (audit SCF-11)
NCCU-Schultz-Lab Nov 12, 2026
7b43070
Engines: case/notation-insensitive basis match, PyFock ECP guard and …
NCCU-Schultz-Lab Nov 12, 2026
2a34473
SCF hygiene: one GPU opt-out parser, one host-array helper, locked vi…
NCCU-Schultz-Lab Nov 12, 2026
9c9c97c
Tests: IRC descent-then-BFGS fallback keeps every descent frame (audi…
NCCU-Schultz-Lab Nov 12, 2026
ec54bdc
TS verdict: soft imaginary mode is inconclusive; empty check not "ski…
NCCU-Schultz-Lab Nov 12, 2026
4c43fac
Promote open-shell RHF to UHF in TD-DFT, TS search and IRC (audit GEO…
NCCU-Schultz-Lab Nov 12, 2026
1833fc6
Reorg: a channel is converged only if the neutral opt converged too (…
NCCU-Schultz-Lab Nov 12, 2026
4ec4cc4
PES scan: show calculator notices, keep log-grid direction, honest ra…
NCCU-Schultz-Lab Nov 12, 2026
37aced7
Optimizer: right atom in the frozen-index error, GPU banner once (aud…
NCCU-Schultz-Lab Nov 12, 2026
b8a9882
Batch worker: required final single point, traceback, elapsed/warning…
NCCU-Schultz-Lab Nov 12, 2026
604059d
Batch script: tie PySCF max_memory to the Slurm allocation (audit HPC…
NCCU-Schultz-Lab Nov 12, 2026
5186e8a
Apptainer CPU image: PYTHONPATH, Voila bounds, build freeze; drop sta…
NCCU-Schultz-Lab Nov 12, 2026
ba40940
Launchers: trailing backslash, apostrophes, set -u, port probe (audit…
NCCU-Schultz-Lab Nov 12, 2026
cb93904
Validate the SLURM partition before it reaches submit.slurm (audit HP…
NCCU-Schultz-Lab Nov 12, 2026
ea41bc1
Document the job limit for multi-file quantui submit (audit HPC-10)
NCCU-Schultz-Lab Nov 12, 2026
b018ad9
Check batch input at submit instead of in the job (audit HPC-11)
NCCU-Schultz-Lab Nov 12, 2026
e8d1d11
Clamp quantui-batch rerun --more-memory/--more-time to the limits (au…
NCCU-Schultz-Lab Nov 12, 2026
569fc77
Escape SLURM text in the app's error box and Cluster Jobs table (audi…
NCCU-Schultz-Lab Nov 12, 2026
6002290
Make the mock Slurm behave like Slurm where QuantUI relies on it (aud…
NCCU-Schultz-Lab Nov 12, 2026
c541417
quantui-batch: cancel/rerun app-queued jobs, guard record path (audit…
NCCU-Schultz-Lab Nov 12, 2026
c34f273
Read live.log incrementally and reuse the app's SlurmBackend (audit H…
NCCU-Schultz-Lab Nov 12, 2026
d43efe5
Create job roots and job folders owner-only (audit HPC-22)
NCCU-Schultz-Lab Nov 12, 2026
6837237
Type the cached SlurmBackend for mypy (audit HPC-21)
NCCU-Schultz-Lab Nov 12, 2026
3b95e7a
Ignore the local .plans planning-repo symlink (audit INFRA-20)
NCCU-Schultz-Lab Nov 12, 2026
03e3b6e
SessionStart hook: build a 3.11 venv when python is unsupported (audi…
NCCU-Schultz-Lab Nov 12, 2026
ce193e4
Align local-setup/environment.yml with pyproject ranges (audit INFRA-10)
NCCU-Schultz-Lab Nov 12, 2026
1b85546
Guard vendored 3Dmol.js against py3Dmol drift; cap py3Dmol <2.6 (audi…
NCCU-Schultz-Lab Nov 12, 2026
a67b8e8
Packaging metadata: PEP 639 licence, provenance data, rdkit/psutil (a…
NCCU-Schultz-Lab Nov 12, 2026
572b5f6
Bring agent/contributor docs back in line with the code (audit INFRA-21)
NCCU-Schultz-Lab Nov 12, 2026
b422820
CI: run network tests weekly, cap xdist OMP threads, scope Pages perm…
NCCU-Schultz-Lab Nov 12, 2026
dbf15e5
Tests: let the glucose PubChem network test fail (audit INFRA-14)
NCCU-Schultz-Lab Nov 12, 2026
63b885b
Tests: widen and harden the code-quality guards (audit INFRA-15)
NCCU-Schultz-Lab Nov 12, 2026
cc111a2
Tests: drop log-module reloads, put heartbeat timing on a fake clock …
NCCU-Schultz-Lab Nov 12, 2026
617f7d1
Tests: replace 7 source-text assertions with behavioural checks (audi…
NCCU-Schultz-Lab Nov 12, 2026
5d79150
Tests: cover app_pes_pick and backends/local (audit INFRA-22)
NCCU-Schultz-Lab Nov 12, 2026
432bd9b
Cube export: load results.npz without pickle (audit VIZ-7)
NCCU-Schultz-Lab Nov 12, 2026
f4227d5
Viewers: PES click drives only the trajectory stepper; placeholder ig…
NCCU-Schultz-Lab Nov 12, 2026
5ea54c1
Isosurface Cancel ends its activity once, not twice (audit VIZ-9)
NCCU-Schultz-Lab Nov 12, 2026
d2f8a10
Isosurface viewer: placeholder and cube share a scene key (audit VIZ-10)
NCCU-Schultz-Lab Nov 12, 2026
98189ba
Analysis plots: a failed re-render shows an error instead of the old …
NCCU-Schultz-Lab Nov 12, 2026
8589c50
Viz: escape exception and path text before it reaches HTML (audit VIZ…
NCCU-Schultz-Lab Nov 12, 2026
bafba72
Viewer packaging: smoke test loads the app, checksums, isosurface doc…
NCCU-Schultz-Lab Nov 12, 2026
1abf209
Viz nits: NMR δ axis and merge window, auto backend, frontier index, …
NCCU-Schultz-Lab Nov 12, 2026
d66ff64
Show the in-session comparison chart and close its figure (audit APP-14)
NCCU-Schultz-Lab Nov 12, 2026
5304f71
Fix the smaller run-flow/app items (audit APP-15)
NCCU-Schultz-Lab Nov 12, 2026
ecba1d2
Plot reloaded PES/IRC profiles whose first point failed (audit UI-10)
NCCU-Schultz-Lab Nov 12, 2026
c77db4b
Drop literal <b> tags from an unavailable-panel message (audit UI-12)
NCCU-Schultz-Lab Nov 12, 2026
66ae550
Correct help/label text against behaviour and chemistry (audit UI-13)
NCCU-Schultz-Lab Nov 12, 2026
974a999
Fix remaining UI robustness items (audit UI-14)
NCCU-Schultz-Lab Nov 12, 2026
d7cf02b
Fix small-module nits in measurement and pick highlights (audit LEAD-4)
NCCU-Schultz-Lab Nov 12, 2026
2f0e4ae
UV-Vis/ECD tables: S1… only for a singlet manifold (audit UI-13 follo…
NCCU-Schultz-Lab Nov 12, 2026
cb9f263
Calibration worker: non-daemonic so freq steps can use the IR pool (a…
NCCU-Schultz-Lab Nov 12, 2026
7b4cb92
save_result: serialise first, atomic write, strict JSON (audit DATA-11)
NCCU-Schultz-Lab Nov 12, 2026
462b50e
UserSettings: survive corrupt files, keep unknown sections on save (a…
NCCU-Schultz-Lab Nov 12, 2026
f09af5c
calc_log: numpy-safe writers, skip non-object lines, safer prune (aud…
NCCU-Schultz-Lab Nov 12, 2026
6dfe8b0
Tests: stop-path source check follows _terminate_worker_tree (audit D…
NCCU-Schultz-Lab Nov 12, 2026
b12c48c
Estimator: DF in freq model/replay, real thread provenance, opt steps…
NCCU-Schultz-Lab Nov 12, 2026
7a38f88
Checkpoints: prune unreadable dirs by mtime, sign-free coords digest …
NCCU-Schultz-Lab Nov 12, 2026
32a5d91
Tests: collision source check reads all of save_result (audit DATA-11)
NCCU-Schultz-Lab Nov 12, 2026
d654712
Parsers: BOM/UTF-16/CR, Fortran D, Unicode minus, D/T, alt-locs, head…
NCCU-Schultz-Lab Nov 12, 2026
07379a9
Smaller data-layer fixes (audit DATA-17)
NCCU-Schultz-Lab Nov 12, 2026
0f7f9cc
quantui-batch: dedupe job ids without a side-effect comprehension (CI…
NCCU-Schultz-Lab Nov 12, 2026
2568886
Merge fixups: annotate reported bond fallbacks; pes-pick test uses br…
NCCU-Schultz-Lab Nov 12, 2026
4ad24de
Fix Windows CI: PySCF-free stubs, POSIX path keys, LF log bytes
NCCU-Schultz-Lab Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 additions & 4 deletions .claude/hooks/session-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,50 @@ fi

cd "${CLAUDE_PROJECT_DIR:-$(dirname "$0")/../..}"

# QuantUI supports Python 3.9-3.11 only; on 3.12+ the install fails
# (pyscf-properties does not build). The cloud image's default `python` can be
# newer (3.13 at the time of audit INFRA-11), which left sessions with nothing
# installed. In that case build a 3.11 venv in .venv (uv preferred, else a
# system python3.11) and install there instead.
PY="python"
_supported() {
"$1" -c 'import sys; sys.exit(0 if (3, 9) <= sys.version_info[:2] <= (3, 11) else 1)' \
>/dev/null 2>&1
}
if ! _supported "$PY"; then
if [ -x .venv/bin/python ] && _supported .venv/bin/python; then
echo "Reusing existing .venv ($(.venv/bin/python --version 2>&1))." >&2
elif command -v uv >/dev/null 2>&1; then
echo "Default python is outside 3.9-3.11; creating .venv with uv (3.11)." >&2
# --seed puts pip into the venv so the `-m pip` calls below work unchanged.
uv venv --seed -p python3.11 .venv
elif command -v python3.11 >/dev/null 2>&1; then
echo "Default python is outside 3.9-3.11; creating .venv with python3.11." >&2
python3.11 -m venv .venv
else
echo "WARNING: default python is outside 3.9-3.11 and neither uv nor python3.11 is available; the install below will probably fail." >&2
fi
if [ -x .venv/bin/python ] && _supported .venv/bin/python; then
PY="$PWD/.venv/bin/python"
# Make the venv the session's interpreter for every later Bash call.
if [ -n "${CLAUDE_ENV_FILE:-}" ]; then
{
echo "export VIRTUAL_ENV=\"$PWD/.venv\""
echo "export PATH=\"$PWD/.venv/bin:\$PATH\""
} >> "$CLAUDE_ENV_FILE"
fi
fi
fi

# Best-effort: a newer pip resolves faster, but some base images ship a
# distro-managed pip that can't self-upgrade — don't let that abort setup.
python -m pip install --upgrade pip || true
"$PY" -m pip install --upgrade pip || true

# Ensure a modern setuptools/wheel. Some base images ship a distro-patched
# setuptools that breaks source builds of pyscf-properties with
# "AttributeError: install_layout". --ignore-installed sidesteps the
# distro-managed copy (which has no RECORD and so can't be uninstalled).
python -m pip install --upgrade --ignore-installed setuptools wheel || true
"$PY" -m pip install --upgrade --ignore-installed setuptools wheel || true

# Editable install with the same extras CI uses. Editable + plain `install`
# (not `ci`-style clean installs) so the resolved deps are cached in the
Expand All @@ -34,8 +69,9 @@ python -m pip install --upgrade --ignore-installed setuptools wheel || true
# (the distro Python) while `python` is /usr/local/bin/python. The setuptools
# upgrade above targets `python`, so a bare `pip` install used the distro
# setuptools and failed to build pyscf-properties, which left the session
# with nothing installed.
python -m pip install -e ".[pyscf,ase,dev,xtb,ts]"
# with nothing installed. ($PY is the venv interpreter when one was created
# above.)
"$PY" -m pip install -e ".[pyscf,ase,dev,xtb,ts]"

echo "QuantUI cloud env ready: package + [pyscf,ase,dev,xtb,ts] installed." >&2

Expand Down
37 changes: 19 additions & 18 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ QuantUI/
├── notebooks/
│ ├── molecule_computations.ipynb ← Student-facing Voilà app (thin launcher)
│ └── tutorials/ ← 01–05 step-by-step tutorial notebooks
├── tests/ ← pytest suite (~4,100 tests; PySCF-gated tests skip on native Windows)
├── tests/ ← pytest suite (~4,700 tests; PySCF-gated tests skip on native Windows)
├── .github/
│ └── copilot-instructions.md ← This file
├── apptainer/
Expand Down Expand Up @@ -224,7 +224,8 @@ _PANEL_REGISTRY = {
"single_point": [Energies, Isosurface, Populations],
"geometry_opt": [Energies(False), Isosurface(True), Trajectory(True), Populations],
"frequency": [Vibrational, IR Spectrum, Raman Spectrum, Trajectory (pre-opt), Energies, Isosurface, Populations],
"transition_state": [Vibrational, IR Spectrum, Trajectory, Energies, Isosurface, Populations],
"transition_state": [Vibrational, IR Spectrum, Trajectory, Energies, Isosurface, Populations,
PES Scan (_pop_ts_guess_profile — reactant+product searches only)],
"irc": [PES Scan (energy profile via _pop_irc_profile), Trajectory],
"tddft": [UV-Vis, ECD, Energies, Isosurface, Populations],
"nmr": [NMR],
Expand Down Expand Up @@ -399,8 +400,6 @@ Unavailable panels show a "Not available — run a X calculation first" placehol
`_activate_ana_panel()` swaps the placeholder for real content and expands the accordion.
`_deactivate_all_ana_panels()` restores placeholders and collapses — never hides.

| Panel | Accordion attr | Activated by calc types |
|---|---|---|
Source of truth: `_PANEL_META` / `_PANEL_REGISTRY` in `app.py`.

| Panel | Accordion attr | Activated by calc types |
Expand All @@ -411,7 +410,7 @@ Source of truth: `_PANEL_META` / `_PANEL_REGISTRY` in `app.py`.
| Vibrational | `vib_accordion` | Frequency, Transition State |
| IR Spectrum | `_ir_accordion` | Frequency, Transition State |
| Raman Spectrum | `_raman_accordion` | Frequency |
| PES Scan | `_pes_scan_accordion` | PES Scan, IRC (energy profile) |
| PES Scan | `_pes_scan_accordion` | PES Scan, IRC (energy profile), Transition State (interpolated-path profile, reactant + product searches only) |
| Isosurface | `_iso_accordion` | Single Point, Geometry Opt, Frequency, Transition State, UV-Vis, Reorganization Energy (Linux/WSL) |
| Geometries | `_reorg_geom_accordion` | Reorganization Energy |
| UV-Vis | `_tddft_accordion` | UV-Vis (TD-DFT) |
Expand Down Expand Up @@ -482,8 +481,10 @@ Source of truth: `_PANEL_META` / `_PANEL_REGISTRY` in `app.py`.
It loads the installed package's plotly.js once per page and embeds each
figure with `include_plotlyjs=False`. Never use `"cdn"` (fails silently
offline) or `"require"` (plotly ≥ 6 has no such mode: it inlines the full
~4.8 MB bundle per figure). Standalone exported HTML files keep
`include_plotlyjs=True` so they work on their own. Enforced by
~4.8 MB bundle per figure). Inlining plotly.js (`include_plotlyjs=True`)
is allowed **only** for standalone exported files (which must work on
their own) and `plotly_embed`'s own no-app fallback — the same rule as
`CLAUDE.md` (DEC-010 as amended 2026-11-12). Enforced by
`tests/test_code_quality.py`.

9. **All `.observe()` callbacks must be wrapped with `_safe_cb`.** Exceptions in
Expand Down Expand Up @@ -687,8 +688,9 @@ jupyter lab notebooks/molecule_computations.ipynb
# Run tests
python -m pytest tests/ -q --no-cov

# Install/update package
pip install -e ".[dev]"
# Install/update package (same extras as CI; without pyscf/xtb/ts the PySCF,
# GFN-FF and Sella tests skip silently)
pip install -e ".[pyscf,ase,dev,xtb,ts]"

# Verify app.py import
python -c "from quantui.app import QuantUIApp; print('OK')"
Expand Down Expand Up @@ -742,32 +744,31 @@ The table above lists the core files only; `tests/` has many more (one per
feature area, e.g. `test_backends_worker.py`, `test_checkpoint_*.py`,
`test_ts_search.py`, `test_irc.py`, `test_cli.py`).

**Baseline (Linux, Python 3.11, 2026-11; `pytest -m "not network"`):** ~4120
passed, 24 skipped.
**Baseline (Linux, Python 3.11, 2026-11; `pytest -m "not network"`):** ~4680
passed, 11 skipped.

---

## Dependency Groups

| Group | Packages | Notes |
| --- | --- | --- |
Source of truth: `pyproject.toml`.

| Group | Packages | Notes |
| --- | --- | --- |
| Core (always installed) | `jupyter`, `ipywidgets`, `notebook`, `numpy`, `requests`, `matplotlib`, `plotly`, `plotlymol`, `kaleido`, `py3Dmol` | Base UI + visualization stack |
| Core (always installed) | `jupyter`, `ipywidgets`, `notebook`, `numpy`, `requests`, `matplotlib`, `plotly`, `plotlymol`, `kaleido`, `py3Dmol<2.6`, `rdkit`, `psutil` | Base UI + visualization stack; py3Dmol capped at the vendored 3Dmol.js minor |
| `pyscf` extra | `pyscf>=2.13.0`, `pyscf-properties`, `pyscf-dispersion` | SCF/frequency/TDDFT/NMR/PES backends; NMR + Raman; PBE-D3 |
| `pyfock` extra | `pyfock>=0.1.7,<0.3` (+ ase, scipy, numba) | Native-Windows PBE subset |
| `ase` extra | `ase>=3.22.0` | Geometry optimization and structure I/O |
| `xtb` extra | `xtb` | GFN-FF pre-optimization for metals (Linux wheels) |
| `ts` extra | `sella>=2.6`, `ase>=3.26` | Transition State and IRC |
| `xtb` extra | `xtb>=22.1,<23`, `ase` | GFN-FF pre-optimization for metals (Linux wheels) |
| `ts` extra | `sella>=2.6,<3`, `ase>=3.26` | Transition State and IRC |
| `app` extra | `voila>=0.5.0,<0.6`, `ipykernel>=6.0.0` | Student-facing Voilà deployment |
| `gpu-cuda12x` / `gpu-cuda13x` | gpu4pyscf + cupy + cutensor | GPU offload (match the driver's CUDA version) |
| `pyfock-gpu-cuda12x` / `-cuda13x` | cupy | PyFock GPU path |
| `notebook` extra | `nbmake>=1.4.0`, `ipykernel>=6.0.0` | Notebook smoke-testing support |
| `dev` extra | `pytest`, `pytest-cov`, `pytest-mock`, `pytest-xdist`, `build`, `mypy`, `types-requests`, `ruff`, `black`, `pre-commit` | Development tooling |
| `dev` extra | `pytest`, `pytest-cov`, `pytest-mock`, `pytest-xdist`, `build`, `setuptools>=77`, `mypy~=1.10.0`, `types-requests`, `ruff`, `black`, `pre-commit` | Development tooling |

Install all runtime + dev extras: `pip install -e ".[pyscf,ase,app,notebook,dev]"`
CI / cloud install (what the SessionStart hook runs): `pip install -e ".[pyscf,ase,dev,xtb,ts]"`.
Everything incl. the app server and notebook smoke tests: `pip install -e ".[pyscf,ase,xtb,ts,app,notebook,dev]"`.

---

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ jobs:

- name: Run non-PySCF tests
# PySCF tests are skipped automatically via skipif guards when pyscf
# is not installed. network tests also skipped.
# is not installed (no --ignore needed: every test file must skip
# cleanly without PySCF). network tests also skipped.
# Single line: PowerShell does not support backslash line continuation.
run: pytest -m "not network" --ignore=tests/test_session_calc.py --ignore=tests/test_optimizer.py --ignore=tests/test_preopt.py --no-cov --no-header -q
run: pytest -m "not network" --no-cov --no-header -q

# ── Windows: real PyFock calculation ───────────────────────────────────────
test-windows-pyfock:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/network-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Network tests

# The `network`-marked tests (live PubChem lookups, installing the built wheel
# from PyPI into a fresh venv) are deselected by every job in ci.yml, so
# without this workflow they ran nowhere (audit INFRA-12). They depend on
# outside services, so they run on a weekly schedule (and on demand) instead of
# gating pull requests: a red run here means "PubChem/PyPI changed or broke",
# not "this PR broke something".

on:
schedule:
# Mondays 06:41 UTC (off the hour to dodge the scheduler's top-of-hour rush).
- cron: "41 6 * * 1"
workflow_dispatch:

permissions:
contents: read

jobs:
test-network:
name: Network tests (ubuntu-24.04, Python 3.11)
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v7

- name: Set up Python 3.11
uses: actions/setup-python@v7
with:
python-version: "3.11"
cache: pip

- name: Install package and dev dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[pyscf,ase,dev]"

- name: Run network tests
run: pytest -m network --no-header -q -n0
9 changes: 7 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ on:
types: [published]
workflow_dispatch:

# Least privilege: the default is read-only. Only the deploy job, which does
# nothing but publish the uploaded artifact, gets the Pages-write and OIDC
# permissions; the build job (which runs third-party build tooling) does not
# (audit INFRA-12).
permissions:
contents: read
pages: write
id-token: write

# Only one deployment at a time; don't cancel in-progress runs.
concurrency:
Expand Down Expand Up @@ -72,6 +74,9 @@ jobs:

deploy:
name: Deploy to GitHub Pages
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/viewer-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,8 @@ jobs:
TAG: ${{ github.event.release.tag_name }}
run: |
ls -la installers
gh release upload "$TAG" installers/QuantUI-Viewer-* \
# Unsigned installers: publish checksums so a download can at least
# be checked against what CI built.
(cd installers && sha256sum QuantUI-Viewer-* > SHA256SUMS.txt && cat SHA256SUMS.txt)
gh release upload "$TAG" installers/QuantUI-Viewer-* installers/SHA256SUMS.txt \
--repo "$GITHUB_REPOSITORY" --clobber
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@ nul
.claudeignore
.apptainer-build-tmp/
quantui-gpu.sif

# Local symlink to the private planning repo (see CLAUDE.md / DEV-ENVIRONMENT);
# never commit it — `git add -A` would otherwise add the symlink (audit INFRA-20).
.plans
7 changes: 4 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ pip install -e ".[pyscf,ase,dev,xtb,ts]"
This mirrors the Linux job in `.github/workflows/ci.yml`. A `SessionStart`
hook (`.claude/hooks/`) does this automatically on cloud sessions so the suite
and linters are runnable immediately. If the container's default `python` is
outside 3.9–3.11 (e.g. 3.13), that install can fail (`pyscf-properties` does
not build); create a 3.11 env instead, e.g.
outside 3.9–3.11 (e.g. 3.13), a plain install fails (`pyscf-properties` does
not build), so the hook creates a 3.11 venv in `.venv` (via `uv`, else
`python3.11`), installs there and puts it on `PATH` for the session. By hand:
`uv venv -p python3.11 .venv && . .venv/bin/activate` and install as above.

**Local (conda):** use [`local-setup/environment.yml`](local-setup/environment.yml)
Expand All @@ -62,7 +63,7 @@ pytest tests/test_foo.py -n0 # one test, serial (breakpoints work; -n=auto is o
pre-commit run --all-files # file hygiene + nbstripout + black (26.5.1) + ruff (v0.16.0); mypy runs on pre-push and in CI
```

Test baseline (see STATUS): **~4120 passed / 24 skipped** for
Test baseline (see STATUS): **~4680 passed / 11 skipped** for
`pytest -m "not network"` (cloud, Python 3.11, 2026-11). `network`-marked tests
need internet (live PubChem) — skip them in the cloud.

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,11 @@ switch to def2-SVP before the calculation starts.
## Running tests

```bash
pip install -e ".[dev]"
# Same extras as CI. With only ".[dev]" there is no PySCF/ASE/xtb/Sella, and
# the numerical suite skips silently instead of running.
pip install -e ".[pyscf,ase,dev,xtb,ts]"

# All tests (Linux/macOS — PySCF available)
# All tests (Linux/macOS — needs the extras above)
pytest -m "not network"

# Skip PySCF-dependent tests (Windows without container)
Expand Down Expand Up @@ -627,7 +629,7 @@ quantui/ Main package
notebooks/
molecule_computations.ipynb Main user-facing interface (3-cell launcher)
tutorials/ Step-by-step guided notebooks (01–05)
tests/ pytest test suite (~4,100 tests; run in parallel via pytest-xdist)
tests/ pytest test suite (~4,700 tests; run in parallel via pytest-xdist)
apptainer/ Container definition for reproducible deployment
local-setup/ Conda environment definition
pyproject.toml Package metadata and tool config
Expand Down
33 changes: 29 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

QuantUI is an educational teaching tool designed for classroom and local
research use. By default it runs calculations inside your own Python session —
there is no hosted server and no user accounts, and results stay on the
machine (or cluster account) you run it on. The optional SLURM batch mode
there is no hosted server and no user accounts, and results, logs, settings
and checkpoints stay on the machine (or cluster account) you run it on. The optional SLURM batch mode
writes job folders under your own cluster home and submits them with your own
`sbatch`.

Expand Down Expand Up @@ -41,10 +41,35 @@ within **30 days** for confirmed vulnerabilities.
## Scope

This project is a local teaching tool. The threat model is limited — there is
no multi-user server, no authentication layer, and no persistent user data.
no multi-user server and no user accounts. It does keep **persistent data in
the user's own account**, protected only by its file permissions: saved
results (`./results/` by default, `QUANTUI_RESULTS_DIR` in the Apptainer
image and Viewer), and under `~/.quantui/` logs (`logs/perf_log.jsonl`,
`logs/event_log.jsonl`), user settings (`settings.json`), calculation
checkpoints (`checkpoints/`), SLURM job folders and staging (`jobs/`,
`staging/`) and the generated launcher notebook. The log, settings and
checkpoint paths can be redirected with `QUANTUI_LOG_DIR`,
`QUANTUI_SETTINGS_PATH` and `QUANTUI_CHECKPOINT_DIR`.

The primary security concerns are:

- **Path traversal** in file I/O (molecule XYZ parsing, script export)
- **Access to the running app.** `quantui run app`, `quantui view`, the native
launchers and the Apptainer image's `app` runscript bind Voilà to
`127.0.0.1` and require a per-run token (`QUANTUI_APP_TOKEN` when set,
otherwise a fresh random one); the printed/opened URL carries it
(`?token=...`). Standalone Voilà reads no token from the environment, so on
a shared host the token is visible to other local users in the process
list (`ps`). `launch-native-jupyter.sh` uses `JUPYTER_TOKEN` (off the
command line). The Apptainer image's default JupyterLab mode keeps
Jupyter's own token handling. Anyone holding the token can drive the
session as you — read History, submit SLURM jobs with your account.
- **Untrusted files the app reads:** the Viewer's `.zip` upload of a results
folder (`quantui/app_viewer.py`), structure-file upload
(`quantui/structure_upload.py`: XYZ/PDB/CIF/MOL/SDF/MOL2/Gaussian), and
ingestion of SLURM job folders and result data written outside the session
(`quantui/backends/slurm_ingest.py`, `quantui/results_storage.py`).
- **Path traversal** in file I/O (the uploads/ingest above, molecule XYZ
parsing, script and bundle export)
- **Unsafe subprocess calls** — PySCF runs in-process via the Python API, but
`subprocess` is used for SLURM (`sbatch`, `squeue`, `sacct`, `scancel`; see
`quantui/backends/slurm.py` and the `quantui-batch` launcher), for starting
Expand Down
1 change: 0 additions & 1 deletion apptainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ air-gapped or restricted-network classroom.
| `verify-gpu.sh` | Seven-step (0–6) check that a GPU image really reaches the GPU |
| `_build_env.sh` | Shared build-scratch setup sourced by both build scripts (moves scratch off a small `/tmp`) |
| `slurm/quantui-gpu-test.sbatch` | Batch template for verifying on a cluster |
| `slurm/quantui-batch.sbatch` | Batch template for running a QuantUI calculation |
| `slurm/README.md` | SLURM batch guide: `quantui-batch`, job folders, operator variables |
| `ncshare-gpu-diagnostic.ipynb` | Interactive diagnostic to run **inside** the image on a GPU node |
| `make_ncshare_diagnostic.py` | Generates that notebook (edit here, not the `.ipynb`) |
Expand Down
Loading
Loading