Skip to content

Commit f06b7f4

Browse files
committed
merge: resolve master conflicts keeping acetylcholine VFX + glow_sinusoidal
2 parents 71eaf33 + 9820ab3 commit f06b7f4

4 files changed

Lines changed: 49 additions & 20 deletions

File tree

backend/neuromodulation.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ class ClassificationResult(TypedDict):
5151
# Canonical glow hex for API echo / UI sync (plan 3.3a); cortisol uses piecewise in build_vfx_profile
5252
NEUROMOD_GLOW_HEX: dict[str, str] = {
5353
"adrenaline": "#FF4500",
54-
"noradrenaline": "#FF4500",
54+
"noradrenaline": "#FF8C00",
5555
"dopamine": "#FFD700",
56-
"acetylcholine": "#FFD700",
57-
"serotonin": "#E0FFFF",
56+
"acetylcholine": "#32CD32",
57+
"serotonin": "#40E0D0",
5858
"baseline": "#E0FFFF",
5959
"gaba": "#8A2BE2",
6060
"cortisol": "#FFBF00",
@@ -77,7 +77,7 @@ class SnnModulationSpec:
7777
"adrenaline": SnnModulationSpec(1.35, 1.25, -0.06, 0.85, 0.75, 1.1, 1.3),
7878
"noradrenaline": SnnModulationSpec(1.45, 0.85, -0.04, 0.9, 0.85, 1.05, 1.15),
7979
"dopamine": SnnModulationSpec(1.25, 1.05, -0.03, 0.95, 0.9, 1.15, 1.25),
80-
"serotonin": SnnModulationSpec(1.05, 1.0, 0.04, 1.15, 1.15, 0.95, 0.85),
80+
"serotonin": SnnModulationSpec(0.95, 1.0, 0.04, 1.15, 1.15, 0.95, 0.85),
8181
"gaba": SnnModulationSpec(0.75, 0.7, 0.08, 1.25, 1.2, 0.75, 0.7),
8282
"acetylcholine": SnnModulationSpec(1.4, 0.75, -0.02, 0.95, 1.0, 1.1, 1.1),
8383
}
@@ -361,22 +361,22 @@ def _vfx_cortisol_piecewise(u: float) -> VfxProfileDict:
361361
"tween_in_ms": 900,
362362
"tween_out_ms": 1200,
363363
"idle_breath_speed_mult": 0.55,
364-
"idle_breath_amp_mult": 1.25,
364+
"idle_breath_amp_mult": 0.72,
365365
"vertex_wave_mult": 0.6,
366366
"burst_threshold": 0.72,
367367
"active_lobe_bloom_scale": 1.0,
368368
"glow_sinusoidal_amp_mult": 0.0,
369369
},
370370
"acetylcholine": {
371-
"bloom_mult": 1.05,
372-
"bloom_activity_boost_mult": 1.08,
373-
"tween_in_ms": 520,
374-
"tween_out_ms": 680,
375-
"idle_breath_speed_mult": 0.95,
376-
"idle_breath_amp_mult": 0.8,
377-
"vertex_wave_mult": 1.12,
378-
"burst_threshold": 0.55,
379-
"active_lobe_bloom_scale": 1.12,
371+
"bloom_mult": 1.2,
372+
"bloom_activity_boost_mult": 1.22,
373+
"tween_in_ms": 400,
374+
"tween_out_ms": 560,
375+
"idle_breath_speed_mult": 1.1,
376+
"idle_breath_amp_mult": 0.95,
377+
"vertex_wave_mult": 1.25,
378+
"burst_threshold": 0.48,
379+
"active_lobe_bloom_scale": 1.2,
380380
"glow_sinusoidal_amp_mult": 0.0,
381381
},
382382
"baseline": {

frontend/js/ui.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,16 @@ export function mergeVfxProfile(raw) {
2929

3030
export function neuromodPillTextClass(hex) {
3131
const h = (hex || "").toUpperCase();
32-
if (h === "#E0FFFF" || h === "#FFD700" || h === "#FFBF00" || h === "#FFF8F0") return "text-slate-900";
32+
if (
33+
h === "#E0FFFF" ||
34+
h === "#40E0D0" ||
35+
h === "#FFD700" ||
36+
h === "#32CD32" ||
37+
h === "#FFBF00" ||
38+
h === "#FFF8F0"
39+
) {
40+
return "text-slate-900";
41+
}
3342
return "text-white";
3443
}
3544

tests/test_neuromodulation.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,31 @@ def test_validate_rationale_too_long() -> None:
168168

169169
def test_glow_hex_per_modulator() -> None:
170170
assert NEUROMOD_GLOW_HEX["adrenaline"] == "#FF4500"
171+
assert NEUROMOD_GLOW_HEX["noradrenaline"] == "#FF8C00"
171172
assert NEUROMOD_GLOW_HEX["dopamine"] == "#FFD700"
173+
assert NEUROMOD_GLOW_HEX["acetylcholine"] == "#32CD32"
174+
assert NEUROMOD_GLOW_HEX["serotonin"] == "#40E0D0"
172175
assert NEUROMOD_GLOW_HEX["baseline"] == "#E0FFFF"
173176
assert NEUROMOD_GLOW_HEX["gaba"] == "#8A2BE2"
174177

175178

179+
def test_glow_hex_all_non_cortisol_modulators_distinct() -> None:
180+
non_cortisol = [m for m in NEUROMOD_GLOW_HEX if m != "cortisol"]
181+
hexes = [NEUROMOD_GLOW_HEX[m] for m in non_cortisol]
182+
assert len(hexes) == len(set(hexes))
183+
184+
176185
def test_build_vfx_includes_glow_hex() -> None:
177186
v = build_vfx_profile("noradrenaline", 0.8)
178-
assert v["glow_hex"] == "#FF4500"
187+
assert v["glow_hex"] == "#FF8C00"
179188
assert v["tween_in_ms"] < 600
180189

181190

191+
def test_gaba_idle_breath_amp_mult_at_full_intensity() -> None:
192+
v = build_vfx_profile("gaba", 1.0)
193+
assert v["idle_breath_amp_mult"] == pytest.approx(0.72, abs=1e-9)
194+
195+
182196
def test_gaba_resolves_lower_rates_than_adrenaline() -> None:
183197
g = resolve_snn_modulation("gaba", 1.0)
184198
a = resolve_snn_modulation("adrenaline", 1.0)

tests/test_neuromodulation_parametric.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# ---------------------------------------------------------------------------
2121
_SNN_FULL = {
2222
"dopamine": (0.77, 19.0, 4.5, 0.46, 125.0, 10.5),
23-
"serotonin": (0.84, 23.0, 5.75, 0.38, 105.0, 10.0),
23+
"serotonin": (0.84, 23.0, 5.75, 0.38, 95.0, 10.0),
2424
"acetylcholine": (0.78, 19.0, 5.0, 0.44, 140.0, 7.5),
2525
"noradrenaline": (0.76, 18.0, 4.25, 0.42, 145.0, 8.5),
2626
"baseline": (0.80, 20.0, 5.0, 0.40, 100.0, 10.0),
@@ -32,12 +32,12 @@
3232
# Format: (glow_hex, bloom_mult, tween_in_ms, burst_threshold, active_lobe_bloom_scale)
3333
_VFX_FULL = {
3434
"dopamine": ("#FFD700", 1.12, 480, 0.52, 1.05),
35-
"serotonin": ("#E0FFFF", 0.95, 720, 0.68, 1.00),
36-
"acetylcholine": ("#FFD700", 1.05, 520, 0.55, 1.12),
35+
"serotonin": ("#40E0D0", 0.95, 720, 0.68, 1.00),
36+
"acetylcholine": ("#32CD32", 1.2, 400, 0.48, 1.2),
3737
"adrenaline": ("#FF4500", 1.25, 350, 0.45, 1.00),
3838
"gaba": ("#8A2BE2", 0.80, 900, 0.72, 1.00),
3939
"baseline": ("#E0FFFF", 1.00, 600, 0.60, 1.00),
40-
"noradrenaline": ("#FF4500", 1.20, 420, 0.50, 1.35),
40+
"noradrenaline": ("#FF8C00", 1.20, 420, 0.50, 1.35),
4141
}
4242

4343

@@ -124,3 +124,9 @@ def test_zero_intensity_bloom_equals_baseline_for_all_mods(self) -> None:
124124
for mod in _VFX_FULL:
125125
p = build_vfx_profile(mod, 0.0)
126126
assert p["bloom_mult"] == pytest.approx(baseline_bloom, abs=1e-9), mod
127+
128+
def test_gaba_idle_breath_amp_mult_reduced_for_inhibitory_profile(self) -> None:
129+
gaba_amp = build_vfx_profile("gaba", 1.0)["idle_breath_amp_mult"]
130+
assert gaba_amp == pytest.approx(0.72, abs=1e-9)
131+
assert gaba_amp < build_vfx_profile("adrenaline", 1.0)["idle_breath_amp_mult"]
132+
assert gaba_amp < build_vfx_profile("baseline", 1.0)["idle_breath_amp_mult"]

0 commit comments

Comments
 (0)