fix(simulation): wire region baseline into production district temp + rename latitude field (T-1078)

Addresses PR #167 review (Tyre T1, T3).

T1 — the region climate tier was built but no live path consulted it: both
derive_district_profile (cascade) and derive_district (on-demand) passed
region_baseline_c: None, so the D-243 §4 edge-fuzz blend was dead in production
and district temperature was still derived from scratch. Now both paths compute
region_baseline_at_district(...) and pass it through build_district_profile so
the two-phase modulation (D-243 §3) actually runs. The cascade path
(derive_all_districts) builds a BTreeMap<RegionPos, RegionProfile> covering all
district positions + their +/-1 neighbours once per body and looks up from it;
the on-demand path derives the four surrounding region baselines on the fly.
No production path passes None except genuinely airless bodies (no planet_class).

T3 — renamed BodyParams.district_latitude_deg -> latitude_deg (it is the region
centre latitude in the region fns, a call-site trap under the old name);
dual-scale doc; propagated to body_params_reader.rs and all literal sites.

Golden fixtures are unaffected (they construct districts directly via make_region,
bypassing build_district_profile) — derivation_harness 37/37 green, no re-pin.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-15 17:30:33 +02:00
co-authored by Claude Opus 4.8
parent 0bcc57d213
commit d974cf42b0
5 changed files with 197 additions and 59 deletions
+14 -4
View File
@@ -36,6 +36,7 @@
//! Update golden: `UPDATE_GOLDEN=1 cargo test --test derivation_harness`
//! Budget gate: `BUDGET_ASSERT=1 cargo test --test derivation_harness -- budget`
use std::collections::BTreeMap;
use std::path::PathBuf;
use std::time::Instant;
@@ -1872,7 +1873,7 @@ fn kallast_body_params() -> BodyParams {
atmosphere: Some("standard".into()),
planet_class: Some("temperate".into()),
tectonic_activity: Some("active".into()),
district_latitude_deg: 0.0,
latitude_deg: 0.0,
elevation_km: 0.0,
body_radius_km: None,
}
@@ -1887,7 +1888,7 @@ fn gloedberg_body_params() -> BodyParams {
atmosphere: Some("standard".into()),
planet_class: Some("volcanic".into()),
tectonic_activity: Some("volcanic".into()),
district_latitude_deg: 0.0,
latitude_deg: 0.0,
elevation_km: 0.5,
body_radius_km: None,
}
@@ -1903,7 +1904,7 @@ fn marevna_body_params() -> BodyParams {
atmosphere: Some("standard".into()),
planet_class: Some("oceanic".into()),
tectonic_activity: Some("active".into()),
district_latitude_deg: 0.0,
latitude_deg: 0.0,
elevation_km: 0.0,
body_radius_km: None,
}
@@ -1920,7 +1921,16 @@ fn derive_profile_for_body(params: &BodyParams) -> DistrictProfile {
let climate = ClimateConstants::default();
let seed = SeedChain::root(42).derive(SeedDomain::Body, 1);
let ta = make_dry_terrain_analysis();
derive_district_profile(seed, params, &ta, (0, 0), 8, &climate)
derive_district_profile(
seed,
params,
&ta,
(0, 0),
8,
&climate,
"test_body",
&BTreeMap::new(),
)
}
#[test]