Expand description
yomitoki: fast, explainable, route-free molecular synthesizability diagnostics, built on chematic.
See docs/architecture.md for the full design contract and current
implementation status.
Structs§
- Analysis
Config - Analysis configuration.
#[non_exhaustive]so new fields (e.g.abstention_policyfrom AGENTS.md §12’s full sketch) can be added later without breaking existing callers — they’re omitted for now rather than included as inert placeholders, since nothing reads them yet. - Applicability
Report - AGENTS.md §5.6. Kept distinct from
OverallAssessmentso applicability is never conflated with score or confidence. - Atom
Index - A yomitoki-owned atom index, decoupled from chematic’s internal
AtomIdxrepresentation (AGENTS.md §11: don’t over-couple the public API to chematic internals). - Component
Score - One component’s score, in isolation, before aggregation.
- Component
Scores - Per-component scores that feed
overall.difficulty. Each field isOption—Nonemeans “not evaluated in this version,” not “evaluated, found nothing” (a fabricated zero would be dishonest); every field here is alwaysSome.fragment_precedentdoes not appear in this struct (round 21 / option C) — its signal doesn’t contribute tooverall.difficulty, so it doesn’t belong among components that do; seeSynthesizabilityReport::fragment_precedentfor where it now lives. - Confidence
Score - A score in
0.0..=1.0describing how reliable an assessment is. Kept as a distinct type fromProbabilityLikeScoreeven though the underlying representation is identical, because AGENTS.md §6 treats confidence and score as semantically separate fields that must never be conflated. - Contribution
- A named factor’s contribution to the overall assessment, used in
dominant_penalties/dominant_supports(AGENTS.md §4.1). - Finding
- One diagnostic finding.
explanationis generated fromcode+evidencebyexplain::render— never authored by hand per instance (AGENTS.md §8.3: structured data is the source of truth). - Finding
Evidence - Structured, numeric evidence backing a
Finding(AGENTS.md §8.2). Fields areNonewhen not applicable to a given finding code. - Finding
Ref - Index into
SynthesizabilityReport.findings, used byComponentScore.findingsto reference findings without duplicating them. - Fragment
Corpus - A loaded fragment-frequency corpus, as produced by
tools/build-fragment-corpus. Attach one viacrate::config::FragmentModelConfigto enable thefragment_precedentcomponent. - Fragment
Corpus Provenance - Provenance for the fragment-precedent reference corpus a report was
produced under (AGENTS.md §5.4; round 18). Exists so a report can be
traced back to which corpus — and which chemical domain — actually
produced its
fragment_precedentsignal: “rare in ChEMBL” and “hard to synthesize” are not the same claim (seerules.rs’s “Fragment precedent” section), and a report reader needs the corpus’s own domain declaration to tell them apart. This is a provenance declaration, not a correctness guarantee, and (deliberately, this round) not yet wired into scoring or confidence — seesynthesis_focused’s own doc. - Fragment
Model Config - Fragment model configuration (AGENTS.md §12’s
fragment_modelfield).corpus: None(the default) disables thefragment_precedentcomponent entirely —SynthesizabilityReport.fragment_precedentstaysNone(round 21 moved this field out ofComponentScores, since the signal no longer contributes tooverall.difficulty— seerules.rs’s “Fragment precedent” section), the same default-off behavior as every v0.1 release. No corpus ships with yomitoki itself (AGENTS.md §5.4 forbids embedding one directly in the library); load one withFragmentCorpus::load_dirand attach it here to enable the component. - Fragment
Precedent Evidence - How well-precedented this molecule’s fragments are relative to the
configured reference corpus (
AnalysisConfig.fragment_model) — an explanatory reference-corpus signal, not a direct synthetic-difficulty term.Noneunless a corpus is configured, same as before round 21. - Overall
Assessment - AGENTS.md §6.
synthesizability/difficultyare complementary in v0.1 as an implementation choice, not a permanent API guarantee. - Probability
Like Score - A score in
0.0..=1.0describing how synthesizable/difficult a molecule is judged to be.1.0= maximally synthesizable / no difficulty burden, depending on which field it appears in — seeOverallAssessment. - Provenance
- AGENTS.md §16.
- Simplification
Suggestion - AGENTS.md §9. Heuristic and diagnostic-only — derived from findings that
already exist, not from actually rewriting the structure.
confidenceis deliberately flat across every v0.1 suggestion (seerules::SUGGESTION_CONFIDENCE_HEURISTIC), since none of them are calibrated against real synthesis outcomes. - Synthesizability
Report - The top-level report returned by
analyze/analyze_smiles.
Enums§
- Expected
Effect - How likely a
SimplificationSuggestionis to actually reduce difficulty, if followed. Every v0.1 suggestion usesMayReduceDifficulty— nothing is calibrated yet, soLikelyReducesDifficultyis never emitted. - Finding
Code - Machine-readable finding code (AGENTS.md §8.1). Only variants the currently-implemented components emit exist so far; codes for not-yet-implemented components are added alongside those components.
- Scoring
Profile - Scoring profile. Only
GeneralOrganicis implemented — AGENTS.md §12 explicitly forbids publishing unimplemented profiles as dummies, so noMedicinalChemistry/Customplaceholder variants exist yet. - Severity
- Author-assigned finding severity. A schema field today, not yet a
calibrated signal — see
docs/architecture.md’s Confidence contract. - Strictness
- How aggressively borderline molecules are pushed toward abstention
(
Verdict::Indeterminate/Verdict::OutOfDomain). Affects the applicability component’s confidence-penalty weighting. - Suggestion
Code - AGENTS.md §9. Heuristic, never a guarantee that a change will help.
- Verdict
- AGENTS.md §7. All six variants exist for schema stability even though
only a subset is reachable with today’s two implemented components (see
docs/architecture.md). - Yomitoki
Error - Only the variants reachable by code that exists today. The rest of
AGENTS.md §17’s sketch (
UnsupportedMolecule,InternalInvariantViolation) is added alongside the code that can actually raise them.
Functions§
- analyze
- Analyze an already-parsed molecule. Infallible in practice —
Resultis kept for API-signature symmetry withanalyze_smiles, but every branch below returnsOk; parsing (upstream, inanalyze_smiles) is the only fallible step (AGENTS.md §17). - analyze_
batch - Analyze many molecules with one shared config (AGENTS.md §18).
result[i]corresponds tomolecules[i]— input order is preserved regardless of any other molecule’s outcome, and one molecule’s result never depends on another’s (each is an independentanalyzecall), so this is safe to parallelize (e.g. viarayon’spar_iter) without changing output. Sequential here since nothing in this crate’s own benchmarks has shown a need for it yet — AGENTS.md §18 itself only asks that parallelism be possible (“Rayon利用はfeature flagでもよい”), not that v0.1 ship it. - analyze_
smiles - Parse
smiles(via chematic) and analyze it.Erronly ifsmilesfails to parse — a hard-to-synthesize or out-of-domain molecule is never an error (AGENTS.md §17).