Expand description
Chemical structure normalization — a peer to crate::enrichment, not
nested inside it or inside crate::generation. Mirrors the boundary
docs/sdsforge-architecture.md’s “chematic integration boundary” section
describes:
enrichment — resolves CAS -> candidate record(s) (PubChem)
normalize — parses/canonicalizes/flags-inconsistency on a candidate
enrichment already resolved (this module)
generation — decides whether the result is usable, records provenance
and uncertainty, maps verified data into the SDS draftA normalizer never resolves CAS numbers, never predicts finished-product
properties (flash point, vapor pressure, GHS classification, …), and
never becomes evidence for anything crate::generation’s
PRODUCT_LEVEL_POLICIES already governs — those stay exactly as commits
2ac2758/d4dd15d (“A”) left them, untouched by this module.
Structs§
- Calculated
Identity Properties - Deterministic calculations over the parsed structure — never an
invented value. Every field is
Nonewhen the underlying chematic operation wasn’t run (e.g.UnavailableNormalizer, or parsing failed). - Chemical
Normalization Result - Result of normalizing one candidate.
canonical_smilesis a deterministic transformation of the input for this chematic version, not a confirmation of chemical identity — a candidate a normalizer cannot process at all (missing/invalid structure, or thechematic-normalizationfeature disabled) still returns supplied CAS/name/concentration data untouched elsewhere in the generation pipeline; this result only ever adds information, it never causes already-resolved fields to be discarded. - Unavailable
Normalizer - Explicit behavior when chematic support isn’t compiled in — distinct from
“no SMILES was supplied” (
NormalizationStatus::MissingStructure) so a caller can tell the two situations apart.
Enums§
Traits§
- Chemical
Normalizer - A local, deterministic parse/canonicalize/consistency-check step over one
already-resolved
ChemicalIdentityCandidate. Implementations must not perform network I/O (normalization is local by design) and must not silently replace the candidate’s identity (e.g. by stripping a salt) — seeChemicalNormalizationResult’s doc comment.