feat: collapse a mixture into a single equivalent molecule - #231
Merged
Merged
Conversation
The inverse of a recipe: average a blend's component taste+aroma PROFILE vectors, dose-weighted by each ingredient's ppm, into one target profile, then find the single molecules whose own profile is closest — one molecule that tastes and smells like the whole blend. Reuses the profile index from #213. Validated: a 3:1:1 vanilla-dominant blend (vanillin weighted 3x by dose, plus 1 part each cinnamaldehyde + citral) collapses to ethyl vanillin (0.86 profile match), then anisaldehyde / coniferaldehyde (spicy+vanilla) — chemically sensible: the heavy vanillin dose pulls the blend profile toward vanilla, so the closest single molecule is the stronger vanilla. Wired across surfaces: predict.mixture_to_molecule, POST /api/mixture_to_molecule, the Formulation Studio ('equivalent single molecule' section under the analysis, click-to-open), MCP tool mixture_to_molecule, skill 'collapse' command. 24 unit tests pass (2 new). Closes #228. Signed-off-by: Austin L. <86896075+rvnminers-A-and-N@users.noreply.github.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.
Closes #228. The inverse of a recipe: dose-weighted mean of a blend's taste+aroma profiles → the single molecule whose own profile is closest. A 3:1:1 vanilla-dominant blend collapses to ethyl vanillin (0.86). Wired across predict/API/Formulation Studio/MCP/skill. 24 unit tests pass.