diff --git a/server/src/atlas/region_profile.rs b/server/src/atlas/region_profile.rs index a2befac71..0d1c88d08 100644 --- a/server/src/atlas/region_profile.rs +++ b/server/src/atlas/region_profile.rs @@ -133,7 +133,11 @@ pub enum VegetationClass { /// only — see `derive_temperature_c`. #[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct BodyParams { - /// `bodies.hydrosphere` — "ocean" | "ice" | "rivers" | "none" | "subsurface" | NULL + /// `bodies.hydrosphere` — the real vocabulary in systems.db: "ice", + /// "liquid_water", "none", "rivers", "moderate", "ocean", "minimal", "trace", + /// "subsurface_liquid", "rivers-lakes", "extensive", "subsurface_ice", + /// "subsurface", "ocean-coastal" | NULL. The `[hydrosphere_maritime]` table + /// keys on these for temperature moderation (D-240). pub hydrosphere: Option, /// `bodies.atmosphere` — "breathable" | "thin" | "toxic" | "none" | "dense" | NULL pub atmosphere: Option, @@ -1359,21 +1363,27 @@ mod tests { // Sweep sea level AND high altitude so the lapse term + clamp // are exercised jointly against the cold end, not just lat alone. for elev in [0.0_f64, 6.0] { - for seed in seeds { - let params = BodyParams { - planet_class: Some((*class).into()), - atmosphere: Some((*atmo).into()), - region_latitude_deg: lat, - elevation_km: elev, - ..Default::default() - }; - let t = derive_temperature_c(¶ms, &climate, seed) - .expect("non-airless body must have temperature"); - assert!( - t >= cold && t <= warm, - "class={class} atmo={atmo} lat={lat} elev={elev} seed={seed}: \ - temperature {t}°C outside band [{cold}, {warm}]" - ); + // Sweep hydrosphere too, so the maritime-compressed gradient + // path is covered by the band invariant (not just None/1.0). + for hydro in ["none", "ocean", "liquid_water", "rivers", "ice"] { + for seed in seeds { + let params = BodyParams { + planet_class: Some((*class).into()), + atmosphere: Some((*atmo).into()), + hydrosphere: Some(hydro.into()), + region_latitude_deg: lat, + elevation_km: elev, + ..Default::default() + }; + let t = derive_temperature_c(¶ms, &climate, seed) + .expect("non-airless body must have temperature"); + assert!( + t >= cold && t <= warm, + "class={class} atmo={atmo} hydro={hydro} lat={lat} \ + elev={elev} seed={seed}: temperature {t}°C outside \ + band [{cold}, {warm}]" + ); + } } } }