check_cell_symmetry: the Le Bail cell / space-group gate (PR C) - #15
Merged
Merged
Conversation
The Rietveld skill's Stage 0 gate, computed instead of narrated: before any structural refinement, does the cell index every peak, and does the data respect the space group's systematic absences? core/workflow/cellSymmetryCheck.ts: a Le Bail fit refines the cell from peak positions alone; the pattern is extracted with the ALLOWED reflections and the leftover (minus a running-median baseline) is read in σ, with a 5 % model-error floor so shape mismatch under strong peaks does not count. - each forbidden family is tested at its position: violated at ≥ 5σ, untestable within 1.5 widths of an allowed reflection (or an extra phase's); - leftover peaks (apex over a whole width) near no reflection are unindexed; - pseudo-Voigt for constant wavelength (a Gaussian's missing tails read as shoulders on GaNb₄Se₈), Gaussian with TOF-scaled widths for time of flight; - reads d ≥ 0.7 Å by default (dense below; also keeps Le Bail fast on TOF); - `limits` states what it cannot see (a too-large cell, too few absences). Evidence: - synthetic (pseudo-Voigt Caglioti peaks, Poisson noise): correct CsCl passes; declared Im-3m → 100 violated at 87σ plus 210/111/300…; a tetragonal crystal declared cubic → 32 unindexed; a second phase's lines index once named; - GaNb₄Se₈ 28-ID (local data): published F-43m passes (143 absences tested); declared Fd-3m → the d-glide's forbidden 200 (16σ) and 420 (6σ) caught; - Mn₃Ga POWGEN 600 K (committed): MnO (111) unindexed alone, indexed with MnO named; P6₃/mmc absences hold. The skill's Stage 0 now calls the tool (its "Dependency (MCP)" note is gone). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lection A skipped describe's body still runs when vitest collects it; on CI the git-ignored data/ folder is absent and the top-level reads threw ENOENT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
PR C of the LLM-usage plan. The Rietveld skill's Stage 0 gate becomes a computed check instead of a judgement stated in words.
The question
Before any structural refinement, the tool answers two questions:
A low Le Bail wR can't answer either, because free intensities will fit a wrong group happily.
How (
core/workflow/cellSymmetryCheck.ts)leBailCellPrefit).limitsnames what the check can't see: a cell that is too large (a supercell indexes anything), and a group with too few absences.The MCP tool
check_cell_symmetrywraps the check. It takesextraPhases,fitRange,dMinandsignificance. The skill's Stage 0 now calls it, and its "Dependency (MCP)" note is removed. LIMITATIONS and the generated AGENT_TOOLS table are updated.Evidence (
src/mcp/cellSymmetry.test.ts)Synthetic data (pseudo-Voigt peaks with Caglioti widths, a sloping background, Poisson noise):
extraPhasesReal data:
data/)Full suite: 195 files, 1,483 tests pass.
tsc -bandeslint .are clean.Worth knowing
🤖 Generated with Claude Code