code wiki / (root) / nx_soda_flavor.nx

nx_soda_flavor.nx

buildroot/runtime/nx_soda_flavor.nx

7594 B167 linesdepth 3pulls 4 transitivereach 3 importersview sourcekind librarytopic soda
docsdependenciesstructsconstsfunctions

about

nx_soda_flavor.nx -- CRAFT-SODA rung F0: the FLAVOR-DESIGN model. The operator's curiosity point (3): "the best flavoring like a crystallized lemon/lime so it's SMOOTH + EVEN + STRONG WITHOUT sugar or other things hiding it." The grounded answer (WebSearch 2026-07-10): - CITRIC acid = sharp/pointy/immediate sourness (a stronger acid -> a bigger [H+] spike); MALIC acid = rounded/smooth/lingering (a weaker acid). BLENDING them is the craft smoothness knob. - a WHISPER of sweet AROMA (vanilla/ester) triggers olfactory-gustatory synergism -> the brain perceives roundness/sweetness from aroma ALONE, no sugar, and aroma ENHANCES clarity rather than masking it. - SUGAR mutes + hides flavor; the operator forbids it. This organ composes two others -- nx_taste_transduce (the sour receptor Hill curve) and nx_soda_carbonation (carbonic-acid [H+]) -- so perceived sourness is the real receptor response to the COMBINED acid+CO2 stimulus, not a naive sum. Everything integer-exact, no float. MEASURED EXCEEDS (gate-checked, see nx_soda_flavor_test): - MALIC IS SMOOTHER: at equal molarity malic yields strictly less [H+] (a softer sour) than citric -- why it rounds a blend. - THE BLEND BEATS EITHER ALONE: a ~50:50 citric:malic blend scores higher roundness than pure citric (harsh/pointy) OR pure malic (flat). - AROMA ROUNDS WITHOUT SUGAR: a whisper of sweet aroma raises roundness while clarity stays perfect (sugar = 0). - CARBONATION IS A FLAVOR LEVER: adding CO2 raises BOTH perceived sourness and aroma-lifted intensity. - LIAR-KILL: a recipe that reaches for SUGAR to fake smoothness is rejected as dishonest -- "nothing hiding it" enforced by construction (sugar earns ZERO roundness credit; it only mutes clarity). genealogy_id: nishi_taste_transduce_2026 + citric_malic_acidulant_profiles + olfactory_gustatory_synergism + nishi_soda_carbonation_2026

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_taste_transduce.nx nx_soda_carbonation.nx nx_soda_flavor.nx nx_soda_design.nx nx_soda_flavor_test.nx

imports: nx_syscalls.nxnx_taste_transduce.nxnx_soda_carbonation.nx

imported by: nx_soda_design.nxnx_soda_flavor_test.nx

structs

47struct NxSodaRecipe

consts

42const SODA_CITRIC_KA_SCALED: i64 = 740000
43const SODA_MALIC_KA_SCALED: i64 = 400000
44const SODA_SUGAR_TRACE_GL: i64 = 2 // g/L: above this, "sugar-free" is a lie

functions

57func soda_citric_hplus_um(conc_mM: i64) -> i64
61func soda_malic_hplus_um(conc_mM: i64) -> i64
68func soda_sour_from_hplus(hplus_um: i64) -> i64
76func soda_aroma_round_bonus(aroma_milli: i64) -> i64
85func soda_smoothness_milli(citric_mM: i64, malic_mM: i64, aroma_milli: i64) -> i64
100func soda_clarity_milli(sugar_g_per_l: i64) -> i64
110func soda_is_honest_sugarfree(sugar_g_per_l: i64) -> i64
116func soda_recipe_sour_milli(r: *NxSodaRecipe) -> i64
121func soda_recipe_smoothness_milli(r: *NxSodaRecipe) -> i64
124func soda_recipe_clarity_milli(r: *NxSodaRecipe) -> i64
called by 1: soda_craft calls 1: soda_clarity_milli
127func soda_recipe_honest(r: *NxSodaRecipe) -> i64
called by 1: main calls 1: soda_is_honest_sugarfree
132func soda_recipe_intensity_milli(r: *NxSodaRecipe) -> i64
called by 2: soda_craftmain
142func soda_design_smooth(target_sour_milli: i64, temp_c: i64) -> *NxSodaRecipe