Repository navigation
Fix the Medium findings from the 2026-11-10 audit - #170
Merged
Merged
Conversation
… (audit SCF-3)
The pyscf-properties GIAO code only handles closed-shell references and
its XC kernel has no meta-GGA branch. Every UHF run (even a closed-shell
singlet), every open-shell DFT run and every M06-L / M06-2X run therefore
failed after the SCF with a cryptic error ("cannot reshape array...", an
empty message, "meta-GGA").
nmr_calc.nmr_unsupported_reason(method, multiplicity) now names the
problem (post-HF, multiplicity != 1, meta-GGA via libxc with a name-list
fallback); run_nmr_calc raises it as a ValueError before any SCF, and
the Run button refuses such an NMR run with the same message (covers the
local and batch paths). A UHF singlet runs the identical RHF reference
and takes the RHF TMS reference; scf_variant records "RHF" and the log
says so. Help text updated.
Tests: tests/test_nmr_open_shell_guard.py (reason helper, ValueError
before the SCF body, UHF singlet == RHF shieldings, Run-button gate).
Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration
Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…it SCF-4, GEOM-7) PySCF's symmetry detector rounds inertia moments, so its group is not monotonic in the tolerance. The bundled 2-decimal benzene came back D2h at 0.01 Å (it is D6h within 0.004 Å), so thermochemistry used sigma = 4 instead of 12 (S too high by R ln 3 = 9.13 J/(mol K), G 2.7 kJ/mol too low at 298 K) while the UI's point-group row said "nearly D6h". Sub-mÅ noise also dropped NH3 / CH4 / benzene to C1 / C3 / C2h. symmetry.detect_point_group now runs PySCF over a tolerance ladder (0.001 Å .. 0.05 Å, plus a 1.013-scaled copy that moves PySCF's rounding boundaries) and takes the highest-order group found at or below the working 0.01 Å tolerance; a higher group found only at a looser rung is accepted when its generators map every atom onto a same-element atom within 0.01 Å (a real distance check). New symmetry.rotational_symmetry_number(group) (PySCF's table). freq_calc._run_thermo takes sigma from detect_point_group -- the group the UI displays -- and corrects S and G by -R ln(sigma/sigma_PySCF). ThermoData gains symmetry_group (saved in the batch payload and read back), and the thermo table names it next to sigma. Tests: tests/test_thermo_symmetry_number.py (bundled benzene -> D6h, noisy NH3/CH4/benzene over 6 seeds, real distortions not upgraded, sigma table, benzene thermo sigma 12 and S = S_PySCF - R ln 3, table shows the group). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…dit SCF-6, UI-11) PYSCF_SCRIPT_TEMPLATE picked the restricted orbitals with isinstance(mf.mo_energy, list), which is never true for PySCF's (2, n) UHF/UKS array. For any open-shell run n_occ then counted occupied rows of the 2-D array: the gap print was silently skipped (UI-11), and for a one-electron UHF (H atom / STO-3G) the "gap" became an ndarray and the f-string raised TypeError after the SCF had converged -- exit 1, no results.npz. The template now uses np.asarray(...).ndim == 2 and reports the alpha channel gap labelled "HOMO-LUMO gap (alpha)", the same convention as the app's session_calc. Tests: tests/test_calculator.py :: test_exported_one_electron_uhf_script_does_not_crash and test_exported_open_shell_script_prints_alpha_gap[UHF|PBE] (run the real generated script in a subprocess; all three fail on the old template). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…audit SCF-7)
run_freq_calc and run_nmr_calc threw away maybe_apply_d3's
dispersion_applied flag ("mf, _ = maybe_apply_d3(...)") and never read
the reference SCF's scf_rescue_stage. A PBE-D3 frequency or NMR run on a
machine without a D3 backend was still labelled "PBE-D3" with only a log
line, and an SCF that converged only after a rescue looked ordinary.
Nothing in the app cards or results_storage showed either, for any
calc type.
FreqResult and NMRResult gain dispersion_applied (None / True / False,
same meaning as SessionResult) and scf_rescue_stage. results_storage's
generic save, and the batch frequency/NMR payloads, persist both (the
single-point payload already did). A shared _scf_provenance_rows adds a
"Dispersion: NOT applied" warning and an "SCF rescue" row to the live
single point / frequency / NMR cards and every History card; ordinary
runs show nothing new.
Tests: tests/test_scf_provenance_freq_nmr.py (H2/STO-3G with the D3
backend patched away and a forced rescue stage: fields, result.json,
batch payloads, live and History cards). 10 of 11 fail on old code.
Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration
Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…, LEAD-3)
The serial IR dipole loop (freq_calc), the serial Raman polarizability
loop (raman_calc) and both parallel workers (freq_ir_workers,
freq_raman_workers) called run_scf_with_rescue and took the dipole /
polarizability without reading mf.converged, then banked it to the
checkpoint. One unconverged displacement silently corrupted the finite
difference, and every resume reused the bad value.
scf_robust gains DisplacedSCFNotConverged and require_converged(mf,
item_id). Every displaced SCF is checked before its value is used or
banked; on failure the property is abandoned with a clear status ("IR
intensities unavailable: the SCF at displaced geometry d001_x_+ did not
converge ..." / the same for Raman), leaving ir_intensities /
raman_activities empty while frequencies and thermo are kept. A worker's
non-convergence propagates through the pool and is not retried by the
serial fallback.
Tests: tests/test_displaced_scf_convergence.py (serial loops abandon
both properties and bank nothing; parallel path via an in-process
executor is not retried serially; IR and Raman workers raise and write
no checkpoint item; a normal run still has intensities).
Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration
Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
raman_calc._cpu_raman_activities_fd sent every displaced SCF through try_to_gpu and then passed it to pyscf-properties' Polarizability, which is NumPy code. On a GPU host -- every open-shell frequency job takes this CPU path, since the gpu4pyscf Raman route is closed-shell only -- that hands a gpu4pyscf object to CPU code (expected outcome: "Numerical Raman activities failed"). A GPU reference SCF also supplies a CuPy dm0, which the CPU displaced SCFs and the pickled worker density cannot use. The loop now stays on CPU (no try_to_gpu; this also drops the hard-coded "RHF" label LEAD-3 noted) and copies a CuPy dm0 to the host once before the serial loop and the parallel workers. Tests: tests/test_raman_cpu_no_gpu_object.py (try_to_gpu mocked to record calls: none from the FD loop; a CuPy-like dm0 that refuses implicit NumPy conversion gives the same activities as the NumPy one). Both fail on old code. Needs a real GPU (H200) check of an open-shell Raman run. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…3 Å (audit SCF-10) perturb_along_mode assumed PySCF's norm_mode vectors are unit length and added fraction * amplitude * norm_mode. They are not: their length is 1/sqrt(reduced mass in amu) (about 0.97 for water modes, 0.38 for N2), so heavy-atom imaginary modes were under-displaced and the saddle-retry record's "displacement_angstrom: 0.3" was not what had been applied. The mode vector is now divided by its Euclidean norm (a zero vector is rejected), so the step along each mode has length fraction * amplitude (0.3 Å by default) and matches displacement_angstrom. Docstrings and the two UI tooltips now describe the step this way. Tests: tests/test_freq_mode_perturbation.py (test_step_length_is_independent_of_mode_norm for norms 0.38/0.97/2.5, test_rejects_zero_mode; test_applies_fraction_of_animation_amplitude updated -- it encoded the unnormalised step). tests/test_freq_saddle_retry.py ::test_displaces_reoptimizes_and_recomputes expected 0.3 Å per atom from a length-sqrt(2) toy mode (old behaviour); now 0.3/sqrt(2) per atom. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…OM-2) _same_structure compared interatomic distance matrices, which are identical for mirror images. The IRC verdict therefore called the two ends of an inversion or enantiomerisation path (e.g. NH3 umbrella inversion) "the same minimum" and told the student to rerun the IRC. It now superimposes the two ends with ts_guess.align_to_reference (Kabsch, proper rotations only, atom labels kept) and compares the RMSD against the same 0.05 A tolerance. Test: test_irc.py::TestResult::test_mirror_image_ends_are_two_minima (labelled NH3 up/down pyramids are different; a rotated + translated copy is the same). Fails on the old code. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…udit GEOM-3)
Angle scans failed on linear molecules and for targets >= 180 degrees,
and the UI suggested exactly such ranges: ASE's set_angle has no
rotation axis when the starting angle is 180 ("Cannot rotate:
norm(v) == 0", every point of an HCN scan), a 180-degree target makes
the angle constraint singular, and "190 degrees" is just 170 again.
- run_pes_scan raises a clear ValueError unless 0 < start, stop < 180
for an angle scan.
- validate_pes_scan_inputs reports the same problem in the UI.
- suggest_scan_range / scan_range_around_current clamp suggested angle
ranges to [1, 179]; scan_range_bounds returns those limits for angle.
- The angle is now driven by _set_bond_angle, the same rotation about
the vertex as ASE's set_angle, but a linear start is bent within an
arbitrary plane containing the i2-i1 bond. Probe: linear HCN, H-C-N
150..179, RHF/STO-3G: 3/3 points converge (all failed before).
Tests: test_pes_scan.py::TestAngleScanRange,
test_pes_scan_ui.py::TestAngleRangeClamped and
TestValidatePesScanInputs::test_rejects_angle_outside_0_180 /
test_accepts_angle_inside_0_180 (all fail on the old code).
test_allows_negative_angle_start encoded the old behaviour (a -30
degree bond angle was accepted); it is now a dihedral test.
Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration
Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…t GEOM-4) Angle and dihedral scans drove the coordinate by moving only the last atom (ASE set_angle/set_dihedral without a mask). Large steps dragged that atom through its own neighbours: an ethane H-C-C-H scan from -180 put one H on top of another (min distance 6e-7 A, "Ill geometry"), and an angle scan stretched every bond to the moved atom. New _moving_fragment() picks the atoms on the moving side from covalent-radius connectivity (quantui.connectivity.covalent_bonds): for an angle i1-i2-i3 the atoms still connected to i3 once the vertex is removed, for a dihedral the atoms on the i3 side of the i2-i3 bond. If the two sides are joined (a ring) it falls back to the single last atom, as before. The group is rotated rigidly by _set_bond_angle / set_dihedral(indices=...). Probe: ethane dihedral -180..180, RHF/STO-3G, 4 points: all converge. Tests: test_pes_scan.py::TestScanMovesWholeFragment. The two end-to-end ones (zero-force stand-in calculator, so each frame is exactly the driven geometry) fail on the old single-atom moves. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…GEOM-5) _c3v_from_cs recovered C3v labels from the Cs subgroup by calling two orbitals within 1e-4 Ha an e pair, and every other A'' "a2". A geometry symmetric only to within the 0.01 A detection tolerance splits an e pair by a few tenths of a mHa (NH3 with +-0.0006 A noise, RHF/6-31G: 0.4 mHa), so it reported an occupied "1a2" and no 1e. It also never matched PySCF's A" spelling (double quote), so any lone A" was a2. Now an e pair must be an adjacent A'/A" pair (one of each) within 5e-3 Ha; when orbital i could pair either way, the closer partner wins. A lone A' is a1. A lone A" (an e pair split beyond recognition, or a genuine a2) makes the mapping return None and label_mo_irreps keeps the honest Cs labels (group "Cs", top group C3v). Tests: test_symmetry.py::TestOrbitalLabels:: test_noisy_ammonia_pairs_split_e_levels (real SCF, the audit's noise case) and TestC3vFromCs (synthetic pairing rules); all fail on the old code. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
_xtb_gfnff_relax built XTB(method="GFN-FF", charge=...), but xtb-python's ASE calculator has no charge parameter: ASE stores the unknown keyword silently and the calculator reads the total charge from atoms.get_initial_charges().sum() (and the unpaired-electron count from the initial magnetic moments). Charged complexes, GFN-FF's main use here, were pre-relaxed as neutral (NH4: identical energy with and without charge=1.0; a +1 initial charge gives a different one). The total charge and multiplicity-1 are now set as the initial charge and magnetic moment of the first atom (only the sums are used), and the unused kwarg is dropped. Only the starting geometry was affected; the QM step always used the right charge. Test: test_preopt_gfnff.py::TestChargeAndSpin (records what a real GFN-FF calculator sees for [Fe(H2O)6]2+ quintet and MnO4-); fails on the old code (it saw charge 0, 0 unpaired). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…t GEOM-5) Follow-up to the e-pairing fix: any unpaired A" made _c3v_from_cs give up and keep the Cs labels, so a molecule with a real a2 orbital (e.g. the F lone-pair combination of CH3CF3) lost its C3v labels. A lone A" is now labelled a2 when no A' lies within the 5 mHa pairing window of it. Only when an A' is that close but could not be paired with it (possibly an e pair split by an imperfect geometry) does the mapping still fall back to Cs labels. Tests: test_symmetry.py::TestOrbitalLabels:: test_genuine_a2_keeps_c3v_labels (staggered CH3CF3, RHF/STO-3G: C3v with an occupied 1a2) and TestC3vFromCs::test_isolated_a_double_prime_is_a2 fail on the previous commit; test_ambiguous_a_double_prime_falls_back replaces test_unpaired_a_double_prime_falls_back, whose 20 mHa-isolated A" is now (correctly) a2. The noisy-NH3 test still passes. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…it DATA-3) _from_rdkit decided "2-D" from all |z| < 1e-4, so a planar molecule saved as 3-D (benzene, formaldehyde in the xy plane) was thrown away and replaced by an ETKDG+MMFF geometry with a note claiming the file was 2-D (H2CO C=O 1.347 -> 1.225 A). The same check also skipped embedding for 2-D drawings of <= 3 atoms, so a drawn water loaded with O-H 1.50 A. Now the conformer's own Is3D() flag decides (as pubchem.sdf_to_xyz already does), and every non-3-D conformer is embedded regardless of atom count. Tests: test_planar_3d_mol_keeps_its_geometry and test_small_2d_drawing_is_embedded in tests/test_upload_download.py (both fail on the old code). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…tates them (audit DATA-4) _from_rdkit always returned charge_mult_from_file=True, so the app synced the Calculation Setup widgets to the file's values even when the file recorded nothing: an O2 .mol (no radical marks) overwrote the user's triplet with a singlet, with no note. Now charge/multiplicity come from the file only when it has a nonzero formal charge or radical electrons; otherwise the caller's values are used and the usual "using the values from Calculation Setup" note is added. (The embed-every-2-D-drawing half of this finding landed with DATA-3, which changed the same check.) Tests: test_mol_without_charge_or_radicals_keeps_setup_values (fails on the old code) and test_mol_radical_sets_multiplicity_from_file (guard) in tests/test_upload_download.py. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…udit DATA-5) _calibration_worker returned only formula/converged/iterations/timings, and run_calibration's log_calculation call passed no device or density-fitting fields. The cross-device probe's forced-CPU and GPU runs of the same entry therefore produced identical perf_log.jsonl records: the analytics GPU-vs-CPU speedup table stayed empty and GPU timings were pooled with CPU ones by estimate_time. The worker now reads gpu_used / gpu_name / density_fit off the result object (SessionResult, FreqResult and OptimizationResult all carry them) and the parent forwards them to log_calculation. Tests: tests/test_calibration_perf_provenance.py drives the worker with a stubbed run_in_session and run_calibration with an inline process context; both fail on the old code. A real GPU calibration pass is still a local follow-up (GPU image). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… (audit DATA-6) resumable_checkpoints() filtered with _has_progress_in(), which looked only at points.jsonl and opt.traj, while Checkpoint.has_progress() also counted completed named item sets and nested legs. So the "Unfinished calculations" list after a restart never offered a Frequency run with banked displacements (items/freq_displacements-<digest>/) or a Reorganization Energy run (all its state lives under legs/). _has_progress_in() is now the single definition (points, trajectory, any non-empty item set, recursively any leg with progress) and Checkpoint.has_progress() delegates to it; the two private helpers that duplicated the item/leg checks are removed. Tests: test_lists_a_frequency_run_with_banked_displacements and test_lists_a_reorg_run_with_progress_only_in_a_leg in tests/test_checkpoint_wiring.py (both fail on the old code). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…fallback (audit DATA-7)
The search box was not offline-first. _library_exact matched entry ids
(formula keys) only, so "water" or "aspirin" went to the PubChem
candidate lookup, then PubChem (15 s) and CACTUS (4 s + 8 s) before the
bundled library answered. The last-resort fuzzy match was a raw
substring over keys + descriptions with first-hit-wins ("ion" ->
methionine, "ol" -> H2, "ne" -> CO2, "a" -> O2), and it was always
labelled "network unavailable", even after a genuine online miss.
- _library_exact also matches an entry's name or any synonym
(case-insensitive), via a new molecule_library.named_entries() that
exposes the full curated/preset entries (the legacy MOLECULE_LIBRARY
view drops name/synonyms).
- search_candidates() returns [] for a library exact hit, so the app's
search handler resolves it offline instead of querying PubChem for a
pick-list; genuine multi-match online queries still get the pick-list.
- _library_fuzzy needs the query to be a whole word (or run of words) of
a name/synonym and to pick out exactly one molecule (preset/curated
duplicates count once); descriptions are no longer searched.
- The fallback is labelled "library-no-online-match" when a resolver was
reached and genuinely missed, "library-offline-fallback" only when the
network was unreachable or disabled. The app gets a matching source
label and warning (two small additions in app.py, nothing else).
Tests: TestOfflineFirstLibrary in tests/test_struct_providers.py and
test_online_miss_fallback_is_not_called_offline in
tests/test_search_provenance.py (11 of the 12 new cases fail on the old
code). Existing tests that used library names as stand-ins for
"needs the network" ("water", "dihydrogen monoxide", "methane") now use
"glycol" / "tetrodotoxin" / "xylene"; their assertions are unchanged.
Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration
Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…(audit DATA-8) Several invalid inputs passed validation: - "H 0 0 nan" / "inf" in the paste box or an upload: validate_coordinates only checked float() conversion. - H2 multiplicity 5 and H charge +2 (-1 electrons) with spin validation on: only electron-count parity was checked. - An XYZ paste whose header says 5 atoms but lists 3 only logged a warning, so a truncated paste loaded as a different molecule. - np.int64 charges and numpy coordinate rows were rejected with a misleading "must be a list of 3 numbers" message, and Molecule kept references to the caller's atom/coordinate lists. Fix: - utils.validate_coordinates accepts any non-string length-3 row and requires finite values; validate_charge accepts numbers.Integral. - Molecule copies atoms and coordinate rows, then normalises charge, integer multiplicity and coordinates to plain Python numbers. With validate_spin on it rejects a negative electron count and enforces the same unpaired-electron upper bound as inorganic_guards.check_charge_multiplicity (validate_spin=False loads are unchanged). - parse_xyz_input rejects nan/inf with a line-specific message and raises on a header/atom-count mismatch. Tests: tests/test_molecule_validation_audit.py (15 of 19 fail on the old code; the rest are guards). tests/test_batch_submit.py's test_atom_count_mismatch_is_an_error now matches the shared parser's message, since the parser rejects the cut-off file before the batch backstop check (comment there updated). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…-up)
inorganic_guards.check_charge_multiplicity only checked the
unpaired-electron bound and parity, so a charge that strips every
electron got through the pre-run guard whenever the parity happened to
work out: H2 at +4 (-2 electrons, multiplicity 1) and a bare H+ (0
electrons) both returned None. Geometry-only loads (validate_spin=False)
rely on this guard, so the DATA-8 constructor check did not cover them.
The guard now refuses n_electrons < 1 with a plain-language message
("lower the charge"). The standalone batch launcher's mirrored
charge_mult_problem gets the same rule (its parity test with the guard
now also iterates over a lone H at +1..+3), and Molecule's own
validate_spin check is tightened from < 0 to < 1 to match.
Tests: test_no_electrons_left_is_refused[0,-1,-2] and
test_single_electron_still_fine in tests/test_inorganic_guards.py (the
three refusal cases fail on the old code); test_bare_proton_is_refused
replaces test_bare_proton_is_allowed in
tests/test_molecule_validation_audit.py.
Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration
Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… bgcolor (audit VIZ-3) Defect: rerender_3d_scenes_for_theme re-rendered the vibrational panel with the legacy one-mode renderer even when the persistent single viewer was active, leaving _vib_single_viewer_active = True. Later mode / amplitude / fps changes then called window.__quantuiVibSetMode, which the legacy HTML does not define, so they did nothing. Separately, the vib HTML disk cache key omitted the scene background, so toggling the theme back and forth could serve HTML baked with the other theme's background. Fix: when the single viewer is active, the theme path rebuilds it with _render_vib_single_viewer (same mode list and current mode); on build failure the flag drops to False and the legacy renderer takes over. The vib cache (has_cached / get_cached_html / save_cached_html) takes a bgcolor key stored in index.json; both py3Dmol cache readers and the writer pass the current scene background. HMAC signing is unchanged. Tests: tests/test_viz_audit_medium.py (single viewer survives a theme toggle; cache is keyed on background), tests/test_vib_cache.py TestBgcolorKey. Two existing fps-cache tests in test_vib_py3dmol_render.py now pass the bgcolor key when querying has_cached. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… (audit VIZ-4) Defect: for unrestricted results the orbital diagram, its HOMO-LUMO gap and SessionResult.homo_lumo_gap_ev (also FreqResult and the comparison loader) used the alpha channel only, with no label. OH radical, UHF/STO-3G: 28.56 eV shown vs the true frontier gap 20.08 eV. Fix: new session_calc.frontier_orbital_energies / homo_lumo_gap_hartree take restricted (n_mo,) or unrestricted (2, n_mo) arrays and return max(HOMO_a, HOMO_b) / min(LUMO_a, LUMO_b); used by run_in_session, freq_calc and comparison. OrbitalInfo keeps alpha in its MO list and n_occupied (the isosurface/gallery code relies on that) and gains mo_energies_beta_ev / n_occupied_beta; its HOMO/LUMO/gap are now the frontier values over both channels (load_orbital_info routes through orbital_info_from_arrays). The Plotly diagram draws alpha and beta columns (headers, per-MO hover "MO #k alpha/beta"), marks the frontier HOMO/LUMO with the channel they come from, and the gap arrow shows the frontier gap; the matplotlib fallback gets a beta column; the summary card labels its alpha-only counts "(alpha)". Restricted output is unchanged. Tests: tests/test_viz_audit_medium.py TestUnrestrictedFrontierGap (helper, OrbitalInfo and run_in_session gap 20.08 eV for OH, two-column diagram, restricted diagram unchanged). Updated test_orbital_visualization.py::test_uhf_uses_alpha, which encoded the alpha-only HOMO, to test_uhf_uses_frontier_over_both_spins. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…audit VIZ-5)
Defect: the orbital diagram's hover numbers MOs from 1 ("MO #5 - HOMO"
for water), but the "By index" input, the gallery captions and the
out-of-range error used 0-based indices, so typing 5 rendered the LUMO.
Fix: one convention, 1-based, converted at the input. The MO # widget
starts at 1 (min 1, tooltip updated); render_orbital_isosurface parses
"MO <n>" as a 1-based number (index n - 1); the range error says "valid
MO numbers 1-N; HOMO = MO k"; gallery_caption shows index + 1 (it still
takes the 0-based array index).
Tests: tests/test_viz_audit_medium.py TestOneBasedMoNumbers (widget is
1-based; typing 5 and the HOMO preset draw the same orbital; error text;
gallery caption). tests/test_orbital_gallery.py::test_two_lines encoded
the 0-based caption and now expects the 1-based number.
Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration
Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… pile up (audit VIZ-6) Defect: every isosurface click wrote <result_dir>/isosurfaces/<...>_<timestamp>.cube. In the Viewer (no PySCF) even showing the saved HOMO/LUMO decompressed the frontier cube into the result folder, so a read-only shared folder raised PermissionError (the mkdir alone failed). In the full app the timestamped cubes (about 14 MB per 100^3 grid) were never cleaned up and entered the export bundle; galleries added a new timestamped folder each time. Fix: _iso_cube_dir() uses <result_dir>/isosurfaces when it is writable, else a per-result scratch folder under the system temp dir (_iso_temp_dir, keyed on the resolved result path). Frontier cubes loaded for the Viewer always go to that scratch folder (they are copies of files already in the result). Generated cubes use deterministic names (<formula>_<orbital>.cube, <formula>_<surface>.cube, and a single isosurfaces/gallery/ folder with per-orbital tiles), so regenerating overwrites instead of accumulating. _last_cube_path still points at a real file, so cube export and the theme/slider redraws are unchanged. Tests: tests/test_viz_audit_medium.py TestIsosurfaceCubesStayOutOfTheResult (Viewer draws the saved HOMO from a read-only folder without writing to it; frontier cube not copied into a writable result; regenerating HOMO twice plus LUMO leaves exactly H2O_HOMO.cube and H2O_LUMO.cube). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… (audit VIZ-2) Defect: DEC-010 embedded every in-app figure with include_plotlyjs="require". plotly >= 6 (7.1.0 here) has no "require" mode: the string is just truthy, so each figure inlined the full ~4.8 MB plotly.js bundle (to_html(fig, "require") = 4,823,036 bytes vs 7,169 with False). Every slider re-render shipped megabytes; a Frequency view 15-20 MB. Fix (instructor decision: load plotly.js once per page): new quantui/plotly_embed.py. - bootstrap_html(): one <script> with the plotly.js bundle shipped in the installed plotly package (offline, never a CDN), guarded by window.__quantuiPlotly so re-rendering it never re-evaluates the bundle; module/exports/define are shadowed while it runs so a CommonJS/AMD shim on the page cannot capture it. - QuantUIApp.display() adds a zero-height Output and registers it. It stays empty until the first in-app figure fills it (no start-up work, same reasoning as the 3Dmol.js loader) and is never cleared, so a page refresh re-runs it when the widget re-renders. - figure_html(): to_html(include_plotlyjs=False) with the plotting script wrapped to wait for window.__quantuiPlotly (and use it as Plotly), so a figure that reaches the page before the bootstrap still draws; after ~60 s it says the library did not load. With no app bootstrap registered (library use in a plain notebook, tests) it falls back to a self-contained inline figure. - All 13 in-app "require" sites (app_visualization, app_analysis, visualization_py3dmol) use figure_html. The PES click-to-step hook now waits for gd.on as well as the div. Standalone exports (app.py _export_plot_figure, analytics dashboard) stay inline. Tests: tests/test_code_quality.py - the plotly guard now also rejects include_plotlyjs="require" anywhere and include_plotlyjs=True outside standalone exports / plotly_embed; new payload test: an in-app orbital diagram figure is < 200 kB, carries no bundle, waits for window.__quantuiPlotly, and the page bootstrap is filled exactly once. The wait/wrap JS was also exercised in node (waits, then calls __quantuiPlotly.newPlot rather than a foreign window.Plotly); the bootstrap passes node --check. Browser/Voila rendering is not verified here (needs a local Voila pass). DEC-010 needs amending. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…follow-up) Defect: the spin-aware frontier gap from the VIZ-4 fix gave 0.0 for a one-electron UHF (H atom). PySCF zeroes the two-electron potential when mol.nelectron <= 1, so the empty beta orbitals duplicate the alpha ones and min(LUMO_a, LUMO_b) - max(HOMO_a, HOMO_b) collapses to zero. Fix: frontier_orbital_energies (and so homo_lumo_gap_hartree) uses only the occupied channel when the total occupation is one electron; orbital_info_from_arrays leaves out the beta channel in that case, so the diagram and its gap show alpha alone. Test: tests/test_viz_audit_medium.py::TestUnrestrictedFrontierGap:: test_one_electron_uhf_uses_the_alpha_gap (H atom UHF/6-31G: helper and OrbitalInfo give the alpha gap, ~0.959 Ha, not 0). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The session fixtures in tests/conftest.py isolated only the results, settings and log dirs. Checkpoints, cluster jobs/staging, QUANTUI_HOME and calibration.json still resolved under the developer's real ~/.quantui, so a suite run replaced the real calibration record and left test checkpoints (one "running" H2O RHF with scf.chk) the app would later offer to resume. - benchmarks.py: calibration.json now goes through _calibration_json_path(), which honours a new QUANTUI_CALIBRATION_PATH override (default unchanged). - conftest.py: new session-autouse _isolate_quantui_home points QUANTUI_HOME, QUANTUI_CHECKPOINT_DIR, QUANTUI_JOBS_DIR and QUANTUI_CALIBRATION_PATH into one temp dir. The SLURM job root is isolated by moving cluster_config.DEFAULT_STAGING_ROOT rather than setting QUANTUI_STAGING_DIR, because that env var locks the job-root field in the UI and would change the behaviour under test. - test_est_calibration_resilience.py: the two tests that check the default ~/.quantui/calibration.json location now drop the session override. Test: tests/test_suite_isolation.py (every state location resolves outside the real ~/.quantui; staging is not env-locked; the calibration override round-trips save/load). Fails 8/9 without the fix. Running the related test files with HOME pointed at an empty dir left nothing under $HOME/.quantui. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… INFRA-2) The TD-DFT and NMR tests only asserted shapes and loose ranges (len(...) <= 2, -5 < delta < 15). nmr_calc monkey-patches pyscf-properties internals and pyscf-properties is unpinned, so a wrong patch or an upstream change could shift every shielding and still pass CI. New tests/test_golden_tddft_nmr.py pins, at STO-3G on fixed geometries: - H2O first three excitation energies and oscillator strengths for B3LYP (full TD-DFT) and RHF (TDHF/RPA); tolerances 1e-3 eV and 5e-4 in f. The values equal plain PySCF mf.TDDFT()/mf.TDHF() on the same input. - H2O and CH4 isotropic GIAO shieldings for RHF and B3LYP; tolerance 0.05 ppm. These come from QuantUI's patched path (unpatched pyscf-properties raises on this PySCF), so they pin current behaviour. Skips without PySCF; the NMR cases also skip without pyscf.prop.nmr. Runtime about 4 s, so the tests are not marked slow. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…udit INFRA-3) tests/test_packaging.py copytree'd the whole checkout once per test (five builds), including an in-repo .venv (~1.5 GB; CLAUDE.md tells cloud sessions to create one), which left 7.8 GB in /tmp after a suite run. Each build also used build isolation, so it needed network to download setuptools, and the fresh-venv test pip-installed runtime dependencies from PyPI, yet none of it carried the network marker. - The source copy now comes from `git ls-files --cached --others --exclude-standard`, so ignored paths never travel; outside a git checkout the copytree fallback also ignores .venv/venv/env/.tox/results/site/htmlcov. - One session-scoped `built_wheel` fixture builds with `--no-isolation --skip-dependency-check` and is shared by every test. - The dev extra gains setuptools>=70.1 (bdist_wheel built in) so that build works without the separate `wheel` package; the test skips with a reason if the env's setuptools cannot build offline. - The fresh-venv pip-install probe is kept unchanged but marked `network`. A new offline probe unpacks the (pure) wheel, imports quantui.engines with only the wheel on PYTHONPATH, and asserts the modules were loaded from the wheel, so the AUDIT F20 import regression is still caught under `-m "not network"`. Tests: TestSourceCopy (fallback and git copies skip .venv, results, site, ...), TestWheelUnpackedImport. Wheel-content assertions are unchanged. `-m "not network"` run of the file: 7 passed in 3.7 s (was ~50 s). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The dev extra allowed `mypy>=1.10,<2.5`, so `pip install -e .[dev]` pulled mypy 2.4.1 while pre-commit (rev v1.10.0) and CI (`mypy~=1.10.0`) run 1.10. 2.x rejects the configured python_version = "3.9" and, with rdkit/ase/ plotly installed locally, reported 40 errors CI never sees (CI has those packages absent, so they type as Any). - pyproject.toml: dev extra now pins `mypy~=1.10.0`. CI's mypy step is unchanged. - structure_upload._from_rdkit: declare `rdmol: Optional[Chem.Mol]` before the branches. The .sdf branch assigns `next(..., None)`; mypy inferred `Mol` from the first branch and flagged the Mol | None assignment (the one real error in the audit's list; the following `is None` check already handled it at runtime). Test: test_ci_hook_reachability.py:: test_mypy_pins_agree_across_dev_extra_precommit_and_ci checks that the dev extra, the CI pip spec and the pre-commit rev name the same mypy. Fails on the old pyproject. The structure_upload error is gone under the local mypy (2.4.1; 1.10 is not installable offline here). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
format_past_result and the shared card helpers interpolated formula, method, basis, timestamp, calc-type label, solvent, gpu_name, Mulliken atom symbols, NMR reference strings, saddle-retry step counts and reorganization-energy labels straight into HTML shown via display(HTML) and widgets.HTML. The Viewer opens other people's result folders and zips, so a crafted result.json could inject markup/script. Escape at the formatter boundary: new _esc/_formula_html helpers, _method_basis_label now returns escaped text (only used for HTML), and every free-text value read from a result or result.json goes through _esc. Numeric fields keep their float formatting. Tests: tests/test_ui_display_audit.py::TestPastResultEscaping. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Several HTML sinks interpolated user- or file-controlled text raw: - the molecule summary label (search query, upload filename) in _set_molecule; - the event-log panel (_build_events_html), which re-renders persisted event_log.jsonl messages, including typed search queries; - exception text in the Calculation Failed / Dependency Not Available cards, export/write status lines (app.py), the compare-load error, the issue-save status, spin-helper and pre-opt preview messages (app_runflow.py); - the upload error and load notes in app_xyz_input.py (an XYZ token such as <img src=x onerror=...> reached the widget via the ValueError text); - the Files-tab 3D structure preview, where py3Dmol embeds the file text as a JSON string in an inline <script> and a "</script>" in the file ended the script early. All are now html.escape'd. For the structure preview, every "<" in the embedded JSON payload is rewritten to < (the same string to JSON and JS), and the preview falls back to the text view if the payload cannot be located. Tests: tests/test_ui_display_audit.py::TestWidgetHtmlEscaping. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
format_past_result labelled every non-frequency card "SCF converged" / "Total energy": an unconverged geometry optimization read "SCF converged: No", a PES card showed its scan minimum as "Total energy" (and "nan Ha" when every point failed), and a result.json without energy_hartree raised TypeError, without formula KeyError. Use the live formatters' labels per calc type (geometry_opt: Final energy / Opt converged / max steps reached; pes_scan: Min energy / All converged; reorganization_energy: Neutral energy / All converged). _basic_rows now takes an energy label and renders missing or non-finite energy as "—"; formula/method/basis/calc_type are read with .get() and a "—" fallback, and a missing converged flag shows "—". Tests: tests/test_ui_display_audit.py::TestHistoryCardLabels. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Every viewer wired by inject_click_js (Measure on the Analysis viewer, Edit Structure and PES pick on the Calculate viewer) overwrote the single window.__quantuiMeasureHighlight, and push_highlight always called that global, so highlights went to whichever viewer rendered last, possibly showing a different molecule. Each injected viewer now registers its uid-scoped highlight function under a per-slot key (highlight_hook_name(inbox_class)); push_highlight takes a slot (default: Measure) and calls only that slot's hook. Structure edit and PES pick pass their own inbox classes as the slot. Tests: tests/test_ui_display_audit.py::TestHighlightHooksArePerSlot, including a node harness that runs the injected scripts against fake viewers and checks an Edit push reaches only the Edit viewer even when the Measure viewer rendered last. A live Voila click-through is still a local check. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…t UI-7) Several chrome strings hard-coded light-theme colours that are unreadable on the default Dark palette (bg_panel #1e293b): #166534 and #92400e (~2.1:1) in the reorganization-energy cards, #0369a1 (2.5:1) on the density-fitting row, #b22 / #b91c1c / #dc2626 (~2.3:1) on export, upload and reset-confirm error text, #6b7280 (3.0:1) on the unavailable analysis-panel note, and the help panels' fixed #f8f9fa/#ddd chrome. These now use theme tokens (ACCENT_SUCCESS/WARNING/INFO/ERROR, TEXT_MUTED, BG_PANEL/BORDER/TEXT_BODY). text_faint/text_subtle were below AA for text in both shipped default palettes (Light 3.4:1 / 2.5:1, Dark 3.1:1). Lifted to Light #707070 / #64748b and Dark #8794aa, all >= 4.5:1 on bg_panel while staying dimmer than text_muted. Tests: tests/test_theme_contrast.py gains TestRetiredValues::test_light_only_text_colours_are_gone_from_audited_chrome and TestFaintTextMeetsAA. Needs a local Voila look on Light and Dark. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…-up)
The PNG-capture _fail helpers in app_exports.py put their message,
sometimes str(exc) from export_destination, into an HTML status widget
unescaped, and downloads.offer_download did the same with {exc} in its
"Download link failed" notice. Both are now html.escape'd.
Tests: tests/test_ui_display_audit.py::TestExportAndDownloadErrorsEscaped.
Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration
Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A save_result failure (full disk, unwritable results folder) was caught and only logged to the event log: the run still ended "Done in N s", no warning was shown, and _last_result_dir kept pointing at the previous run's folder, so exports and the bundle zip went there. The same try also wrapped the thumbnail, trajectory, orbital and Molden extras, so one failing extra silently skipped the rest. Now a failed save shows a "Result NOT saved" card, the status reads "Finished in N s - NOT saved: <error>", _last_result_dir is cleared and the bundle button disabled. The extras written next to a successful save move into _persist_result_extras, each guarded on its own (failures logged as save_extra_error), so one failure no longer skips the others or marks the run unsaved. Tests: tests/test_runflow_audit_medium.py (failed save reported, folder forgotten; failing thumbnail still writes orbitals/Molden and ends Done). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Cancel stayed armed until _do_run's finally, long after the calculation had produced its result. A click during the post-result work (formatting, viewer, saving) set the cancel flag, and the next log write raised CalcCancelled (a BaseException, so none of the post-result guards caught it): the run ended "Cancelled." with the result card and a cancelled card both shown, the "View Results" banner up, and nothing saved. Once the result exists, _do_run now marks _run_result_ready, detaches the log's cancel check, disables Cancel, and, if a click already set the flag, clears it and notes in the log that the result is kept. _on_cancel ignores clicks once the result is ready; the flag is reset by _begin_run_lock and at the start of each run. Tests: tests/test_runflow_audit_medium.py (Cancel during the save, Cancel racing the end of the calculation, Cancel before the result still works). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…P-11) Three defects in "Geometry optimization before calculation": (a) When the optimization had already returned (calc_mol reassigned) and a later step failed (its required single point, or the summary line), the except path logged "Proceeding with the user-provided geometry as-is" but the calculation ran at the optimized geometry, with _pre_opt still set. Each of the three pre-opt sites (generic, Frequency, UV-Vis) now restores the starting geometry and clears _pre_opt in its except path. (b) A failed or unconverged pre-opt was only a log line; the run still ended "Done" at an unoptimized geometry (e.g. MP2 + pre-opt, where the post-HF guard raises). The run now carries a _preopt_warning that is shown as a warning strip at the top of the result card. (c) NMR Shielding and PES Scan applied their seed geometry inside their own branches, after the generic pre-opt, so the seed overwrote the optimized geometry. Both seeds are now applied before the pre-opt, which therefore starts from the seed and is kept. Tests: tests/test_runflow_audit_medium.py (input geometry used after a late pre-opt failure, failure shown on the card, NMR pre-opt starts from the seed and its geometry reaches the NMR calculation). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
do_calibration only wrapped run_calibration in try/finally for the activity badge; the panel reset ran after it. A raising run_calibration therefore left the calibration panel disabled on "Starting..." for the rest of the session. Calibration and Run were also independent: both could run at once, so the calibration timed its steps on a busy machine and stored those timings as the estimator's baseline (and the run was slowed by the calibration). do_calibration now shows "Calibration failed: <error>" (escaped) on an exception, and resets the stop/skip buttons, mode toggle, Calibrate button and Run in a finally. A new _cal_running flag makes the two mutually exclusive: on_cal_run refuses while a calculation (or SLURM job) is in flight, Run is refused with a status message while calibrating, and Run is disabled for the calibration's duration (a molecule load does not re-arm it). Tests: tests/test_runflow_audit_medium.py (error path resets the panel and Run; Run refused while calibrating; calibration refused mid-run). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…UI-5) Export XYZ/MOL/PDB read _last_result, which nothing cleared when another molecule was loaded, and wrote into _last_result_dir, which every History view reassigns. Optimise H2O, load NH3, Export XYZ: the file held H2O's optimized geometry; for a non-opt result the new molecule's geometry was stamped with the old run's method/basis; and the file landed in whichever History folder was last viewed (and so in its bundle zip). _do_run now records the loaded molecule object the run started from (_last_result_molecule) and the folder it was saved in (_last_result_run_dir). The structure exporters use the run's result only while that object is still the loaded molecule (any load or structure edit replaces it) and write into the run's own folder; otherwise they export the loaded molecule with the current method/basis to the working directory, the existing no-result fallback. Tests: tests/test_runflow_audit_medium.py (a History view does not move the export; loading another molecule exports that molecule under the current setup, outside the old run's folder). Updated six existing export tests in tests/test_app.py and tests/test_upload_download.py that set only _last_result_dir with no run and relied on it picking the destination (the old behaviour); they now set up the state of a saved run on the loaded molecule. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… UI-9) The Edit Structure panel's undo stack, atom picks and the Geometry Opt "Freeze atoms" list survived loading a different molecule: Undo swapped the previous molecule back in, and the freeze list silently held atom numbers of another structure. Deleting atoms renumbered the structure but not the freeze list, so a Geometry Opt froze different atoms. _set_molecule gains keep_edit_state (used only by the editor's own apply/undo); every other load calls reset_edit_state, which clears the undo stack and picks, and clears the freeze list unless the new structure has the same atoms in the same order (a pre-optimized or checkpoint-restored geometry of the same molecule). A delete now renumbers the freeze list (deleted atoms dropped, later atoms shifted down) and says so; each undo entry saves the freeze list with the molecule so Undo restores the matching numbering. Tests: tests/test_runflow_audit_medium.py (a load resets undo/picks/freeze; a same-atoms reload keeps the freeze list; delete renumbers, undo restores). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… UI-14) One UI-14 item: the orbital, vibrational, trajectory and reorganization PNG captures, the Analysis-viewer molecule PNG, and the reorg geometry XYZ export took method/basis from the live setup dropdowns. After a History load (or after changing the setup for the next run) the files were named and stamped with a level of theory that did not produce them. apply_analysis_context now records the displayed result's level as app._displayed_level; app_exports.displayed_level() returns it (falling back to the dropdowns before any result is shown) and those exporters use it. The Calculate/Results molecule-preview PNGs keep the dropdowns, since they show the loaded molecule. Tests: tests/test_runflow_audit_medium.py (reorg XYZ named/stamped with the displayed History result's level; dropdown fallback). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
on_export (the standalone PySCF script) still wrote into _last_result_dir, which every History view reassigns, so the loaded molecule's script could land in an unrelated result's folder and its bundle zip. It now uses the same destination rule as the structure exports: the folder of the run on the loaded molecule while that molecule is still loaded, otherwise the working directory. Tests: tests/test_runflow_audit_medium.py (test_script_export_follows_the_run_not_a_history_view). Updated tests/test_audit_defects_issue19.py::test_app_export_passes_the_settings, which set only _last_result_dir with no run and relied on it choosing the folder (the old behaviour); it now exports from a tmp working directory. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
CLAUDE.md and copilot-instructions.md still told contributors to use include_plotlyjs="require", which plotly >= 6 silently turns into a full inline bundle per figure. Point them at quantui.plotly_embed.figure_html (one plotly.js per page) and keep inline-only for standalone exports. DEC-010 is amended in the planning repo. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The SLURM monitor thread had no exception guard: one failed read (a torn job record, an squeue error) killed it before _finish_slurm_monitor was queued, so _calc_running stayed True and Run was disabled for the rest of the session. JobRegistry.save truncated and rewrote the record in place while three writers (main thread, monitor, worker on the compute node) touch it, and load() raised JSONDecodeError on a half-written file. submit_slurm_run caught only SecurityError/RuntimeError, so an OSError from writing the job folder also left the UI locked. Fix: - _monitor_slurm_job wraps the loop in try/except/finally; the finally always queues _finish_slurm_monitor. A failed poll is logged and retried; after 3 consecutive failures the monitor stops with a status message pointing to Cluster Jobs. - JobRegistry.save writes a temp file in the jobs dir and os.replace()s it over the record. - JobRegistry.load retries an unparseable record briefly, then logs and returns None; list_all skips unreadable records (OSError/ValueError). - submit_slurm_run releases the UI on OSError as on RuntimeError. Tests (tests/test_hpc_audit_medium.py): save failing mid-write leaves the old record and no temp file; torn records load as None; the monitor queues _finish_slurm_monitor after repeated poll errors, an unexpected error, and a truncated record; an OSError from dispatch resets Run. All fail on the old code. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
When Slurm requeues a job (node failure, preemption) it reruns submit.slurm under the same job id, so the job dir gets a second attempt-02_job<id>/ next to the dead attempt-01_job<id>/. JobRecord.attempt_dir_for() returned the first (oldest) match, so the record's staging_path, live log and progress pointed at the dead attempt, and on COMPLETED the record became error/ARTIFACT_MISSING although the requeued attempt wrote result.json. batch_status._attempt_for goes through the same method. Fix: attempt_dir_for() scans attempt dirs newest first. (The quantui-batch launcher already maps job id -> path with later attempts winning, so it needs no change.) Tests (tests/test_hpc_audit_medium.py::TestRequeuedAttempt): with attempt-01_job4242 and attempt-02_job4242 (result.json only in the latter), attempt_dir_for/staging_path give attempt-02, COMPLETED maps to success, and batch_status.job_view reports done. All three fail on the old code. Not exercised against a real Slurm requeue. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A tracked job that neither squeue nor sacct reports (accounting purged or not visible to users) polls as UNKNOWN, and every path skipped UNKNOWN: the record stayed active forever, held one of the concurrent-job slots, Cancel failed, Remove refused the active row, and the monitor looped until the JSON was deleted by hand. Fix (SlurmBackend.refresh_registry_statuses): - Each UNKNOWN poll is counted on the record (new JobRecord fields unknown_since / unknown_polls; cleared when Slurm reports the job again or a new attempt starts). Polls where squeue itself could not run (not installed, timed out) are not counted. - After at least STALE_UNKNOWN_POLLS (3) polls spanning at least QUANTUI_SLURM_STALE_UNKNOWN_S (default 900 s) the record is made terminal from what the attempt dir holds: result.json -> success; progress.json with stage "error" -> error with that message; otherwise error/STALE_RECORD with a message to Resubmit or Remove. Terminal rows can be removed from Cluster Jobs, and the monitor ends. - The quantui-batch launcher writes the two new record fields so its prepared records keep the same keys as the package's (tests/test_batch_submit.py). Tests (tests/test_hpc_audit_medium.py::TestJobSlurmNoLongerKnows, mock Slurm): stale after polls + margin and then removable; polls alone or time alone are not enough; result.json -> success; progress error -> error with its message; squeue failures not counted; the streak resets when the job reappears. Five of the six fail on the old code (the "time alone" one passes either way). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A request .json carries its own request_id, and SlurmBackend._create_job and the quantui-batch launcher's prepare_job both saved the new job's record under it. Submitting the same file twice (or files templated from one) silently replaced the record of the earlier job, which then kept running untracked: not counted toward the job limit, not cancellable, never ingested. Fix: - JobRegistry.create refuses an id that already has a record (FileExistsError), and gains exists(). - SlurmBackend._create_job (dispatch/prepare) gives a request whose id is taken a fresh id, registry.fresh_request_id(): the original's first 40 characters plus 8 hex digits; the original id is kept in run_context["source_request_id"]. Unique ids from files are kept as they are, so `quantui submit` still prints the file's id the first time. - The quantui-batch launcher does the same in prepare_job (unique_request), so launcher and package stay equal. Tests: tests/test_hpc_audit_medium.py::TestRequestIdReuse (create refuses a taken id and leaves the record; two dispatches of one request via mock Slurm keep two records with distinct job dirs and Slurm ids) and tests/test_batch_submit.py::TestLauncherRequestIdReuse (two prepare_job calls with one request keep both records). All fail on the old code. test_job_folder_script_and_record now deletes the launcher's record before calling QuantUI's prepare() with the same request, since that test relied on the old overwrite, and tests/slurm_ingest_helpers.make_staging_record deletes an existing record for its request id before creating one (two cl26 round-trip tests registered the same id twice). Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
slurm_ingest's general branch (single point, TD-DFT, NMR, IRC, PES scan) called save_result() without molecule=, and those worker payloads held no final_molecule. Single point / TD-DFT recovered a structure from other files, but an NMR result from SLURM opened with no structure in the Analysis viewer, and no ingested result recorded its multiplicity (the F12 fix covered frequency / TS only). Fix: - worker_payload.final_molecule_field(): the geometry a calculation ran at (explicit molecule, result.molecule, or result.calc_molecule). final_molecule is now written by the single point, frequency, IRC, TD-DFT, NMR, PES scan and reorganization-energy payload builders (geometry_opt and TS already wrote it). - The worker records the molecule it actually ran at (after any preopt_before_run) on single point, TD-DFT, NMR and PES scan results (_ran_at), since those result classes do not carry it. - slurm_ingest's general branch passes molecule= from final_molecule to save_result, as the local app passes calc_mol. Test (tests/test_hpc_audit_medium.py::TestIngestKeepsGeometry): runs the real worker on H2 RHF/STO-3G for nmr and single_point into an attempt dir, ingests it, and checks the History entry's geometry (atoms, coordinates, multiplicity). Both fail on the old code. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…rces (audit HPC-7) `quantui-batch submit --from JOB` built the chained request with solvent=args.solvent, so a frequency or IRC chained from a solvated optimization ran in the gas phase at a solvated stationary point (spurious imaginary modes, inconsistent thermochemistry). It also accepted an optimization that did not converge: Slurm's afterok is satisfied because the worker exits 0 for an unconverged optimization, and batch_chain.final_geometry used its last geometry anyway. Fix: - chained_request inherits the source request's solvent unless --solvent is given; new --no-solvent forces the gas phase (also for file inputs, and over a preset's solvent; --solvent with --no-solvent is a usage error). An inherited solvent on a calc type that cannot take one (nmr, pes_scan) is refused with a hint to add --no-solvent. The inheritance is reported as a warning. - chain_source refuses a finished geometry_opt/transition_state source whose newest result has converged == false. - batch_chain.final_geometry raises for such a source at run time, so a job queued behind a still-running optimization fails with a clear message instead of computing at a non-stationary geometry. - HELP text documents --no-solvent and both rules. Policy note: unconverged sources are refused, not warned about. Tests (tests/test_batch_submit.py): TestChainedJobs inherits Water, --no-solvent gives None, nmr from a solvated source needs --no-solvent, --solvent + --no-solvent is a usage error, unconverged finished source refused; TestFinalGeometry refuses an unconverged attempt and accepts a newer converged one. All but the usage-error test fail on the old code. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Only `quantui view` passed a token. `quantui run app`, the native launchers (launch-native.sh/.command/.bat, launch-dev.bat), the Apptainer image's `app` runscript (used by launch-app.bat) served the full app on a fixed port with no authentication, and launch-native-jupyter.sh started JupyterLab with an empty token and password. On a shared host any other local user could drive the session: read History, submit SLURM jobs as the victim, or (JupyterLab) run arbitrary code. Decision (instructor): token everywhere. Fix: - quantui run app (app_launcher.run_voila_app): --Voila.ip=127.0.0.1 and --Voila.token=<token>, printing/opening http://127.0.0.1:<port>/?token=. New app_token(): QUANTUI_APP_TOKEN when set, else a fresh secrets.token_urlsafe(24) (viewer_token()). - apptainer/quantui.def %runscript app mode: same token rule (env or python secrets), loopback bind, prints the tokenised URL (follows a --port=N argument). The JupyterLab default mode is unchanged (it keeps Jupyter's own token; its --ip=0.0.0.0 is left as is). - launch-native.sh / .command: token from QUANTUI_APP_TOKEN or python secrets, loopback bind, open the tokenised URL. - Windows .bat launchers (native, dev, app, native-jupyter): make a token with PowerShell (two GUIDs), hand it to WSL through WSLENV (not a command line), add it to the Voila options and open the tokenised URL. - launch-native-jupyter.sh: no empty token/password; exports JUPYTER_TOKEN (QUANTUI_APP_TOKEN, else an existing JUPYTER_TOKEN, else generated), binds 127.0.0.1, prints the tokenised URL. - README.md and apptainer/README.md: open the printed tokenised URL. Token on argv: standalone Voila reads no token from the environment (JUPYTER_TOKEN is ignored, as the existing `quantui view` code notes), so for Voila the token is still a command-line option, visible in `ps` on a multi-user host. A config-file route (voila.json in a private JUPYTER_CONFIG_PATH dir) was not used because it could not be verified here (no Voila installed). JupyterLab takes it from JUPYTER_TOKEN, off argv. Tests (tests/test_hpc_audit_medium.py): run_voila_app passes a fresh >=24-char token and --Voila.ip=127.0.0.1 in both exec and open modes and opens the tokenised URL; QUANTUI_APP_TOKEN is honoured; every Voila launcher passes --Voila.token and the loopback bind; the Windows launchers use WSLENV and open token=%QUANTUI_APP_TOKEN%; the Jupyter launcher has no empty token/password; the def's runscript, run with a fake voila, prints and passes the token and follows --port. All fail on the old code. bash -n passes for the shell launchers and the runscript. Not tested: real Voila/JupyterLab, Windows/WSL (.bat, WSLENV, localhost forwarding to a 127.0.0.1 bind), macOS, NCShare/OnDemand. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
test_surfaces_matrix's gallery tests read the MO number from the tile caption and expected the old 0-based index; captions now show the 1-based number (VIZ-5). Also merge the duplicate `html` import left in app_runflow.py by combining two branches. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Merging two branches left app_runflow.py with one `html` import; in
_preopt_preview_done a local variable also named `html` held the preview,
so the render-failure path called str.escape and raised UnboundLocalError
instead of showing the error. CI's mypy caught it ("str" has no attribute
"escape"). Rename the local; new test drives the failure path (fails
before, passes after); mypy 1.10 with the repo config is clean.
Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration
Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… test The Windows job (no PySCF) failed in tests added by this branch: - test_hpc_audit_medium ingest round trip and the run_pes_scan tests in test_pes_scan (angle range, whole-fragment scans) need PySCF: run_pes_scan checks for it before validating. Skip without PySCF. - test_suite_isolation: the session fixture moved the SLURM staging root by patching cluster_config.DEFAULT_STAGING_ROOT, which test_estimator_b24's importlib.reload(cluster_config) undoes, so the result depended on test order (reproduced locally by running b24 first). default_staging_root() now falls back to $QUANTUI_HOME/staging when QUANTUI_HOME is set (same meaning as app_launcher.quantui_home()), and the fixture relies on that instead of patching the constant. - test_workflows' release tag check runs `bash`; on Windows that is the WSL launcher with no distribution. Skip on win32. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
test_noisy_ammonia_pairs_split_e_levels failed on CI's Python 3.9 runner (an "a2" among the virtuals) and passes locally on 3.9 and 3.11 with the same PySCF 2.15 at 1, 2 and 4 BLAS threads. The geometry is deliberately off C3v; a virtual pair split by ~0.8 mHa then has LAPACK-dependent eigenvector mixing. The audit defect (GEOM-5: occupied 1a2 instead of 1e) is fully pinned by the occupied labels, so the assertion is scoped to those. Genuine a2 handling stays covered by test_genuine_a2_keeps_c3v_labels. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the Medium-severity findings from the 2026-11-10 codebase audit, one commit per finding (plus a few small follow-ups), each with a regression test. Most new tests fail on the old code. Full non-network suite locally: 4680 passed, 11 skipped (py3.11).
Chemistry / numerics
Structures, persistence, batch
submit --frominherits the source solvent and refuses an unconverged source.App, UI, viewer
Tests, CI, packaging
~/.quantui..venvcopy.Needs a local / HPC check before calling these done
mkdocs buildand the live changelog page.Not done: Chromium in the Apptainer image, SHA-pinning of actions, an editable σ override, contrast for the four other palettes.
Authorship
Generated by Claude Code