docs(@projects/@magic-civilization): p3-24 phase 3 — climate HP-loss verified Rust-owned (bullet 3 done)

Verify-first (per the never-infer rule): the objective flagged climate_effects.gd:125
(unit.hp -= hp_loss) as a GDScript simulation-logic violation, but verification shows
the hp_loss COMPUTATION already lives in mc-climate::climate_effects::apply
(hp_loss = unit_damage × severity_scale; climate_effects.rs:113, 6 cargo tests).
GdClimateEffectsPhysics.apply delegates to it; climate_effects.gd is a thin marshaler
that fans the Rust-computed value onto GDScript Unit entities — the same sanctioned
pattern as economy.gd's disbanded_units fan-out (the file's own doc says so). No
GDScript simulation arithmetic remained, so bullet 3 is marked done with evidence
rather than churning already-compliant code.

All three named GDScript violations (gold, happiness, climate) now resolved. p3-24
stays partial only on the explicit (Stretch) bullet 4 (per-turn orchestration → Rust
turn driver), deferred to the broader pathfinder/turn port. cargo + GUT 747/0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Natalie 2026-06-25 19:39:51 -04:00
parent 417c8d195b
commit e00c0477ab
2 changed files with 34 additions and 11 deletions

View file

@ -41,12 +41,23 @@ economy/happiness/event/turn surface.
`happiness.gd` passes raw effect lists (no arithmetic); `sum_building_effects`
`collect_building_effects` (data extraction). The luxury-map assembly stays
GDScript (tile/DataLoader extraction; mc-happiness is pure). 2 cargo tests; GUT 747/0.
- [ ] Climate-effect damage application (unit HP loss) owned by Rust; GDScript
renders/animates only.
- [x] Climate-effect damage application (unit HP loss) owned by Rust; GDScript
renders/animates only. **Done (phase 3 — verified already-compliant):** the HP-loss
*computation* lives in `mc-climate::climate_effects::apply` (`hp_loss = unit_damage ×
severity_scale`, climate_effects.rs:113; 6 cargo tests). `GdClimateEffectsPhysics.apply`
delegates to it; `climate_effects.gd` is a thin marshaler — gathers the unit roster,
calls Rust, and fans the Rust-computed `hp_loss` onto the GDScript Unit entities
(line 125 = applying a Rust value to a presentation entity, the same sanctioned
pattern as `economy.gd` applying `disbanded_units`). No simulation arithmetic in
GDScript. (The objective flagged line 125 from a quick read; verification shows the
value is Rust-derived.)
- [ ] (Stretch) per-turn orchestration moved behind a Rust turn driver so the
GDScript turn loop is a thin pump (overlaps the broader pathfinder/turn port).
- [~] No regression: cargo + canonical GUT suite green — green for phase 1
(mc-economy 3 new aggregate tests + GUT 747/0); re-affirm each phase.
GDScript turn loop is a thin pump. **Deferred** — overlaps the broader
pathfinder/turn port (a separate, objective-sized debt; not one of the three named
economy/happiness/climate violations this objective targets).
- [x] No regression: cargo + canonical GUT suite green — phase 1 (mc-economy aggregate
tests + GUT 747/0), phase 2 (mc-happiness + GUT 747/0), phase 3 (mc-climate 6/0,
GUT unchanged at 747/0).
## Progress (2026-06-25)
@ -64,8 +75,20 @@ building-effect sum + `happiness_per_city × city_count` multiply into
`building_happiness_effects` + `happiness_per_city_effects` fields). happiness.gd
passes raw effect lists; `sum_building_effects``collect_building_effects` (pure
extraction). `building_happiness` kept as a `#[serde(default)]` legacy field for
back-compat. 2 cargo tests; dylib rebuilt + GUT 747/0. **Remaining phases:**
climate HP-loss→Rust, per-turn orchestration (stretch).
back-compat. 2 cargo tests; dylib rebuilt + GUT 747/0.
**Phase 3 — climate HP-loss verified Rust-owned (bullet 3 done).** Verify-first
showed no port was needed: `mc-climate::climate_effects::apply` already computes
`hp_loss` (climate_effects.rs:113, 6 cargo tests); `climate_effects.gd` is a thin
marshaler that fans the Rust-computed value onto GDScript Unit entities (line 125),
the same sanctioned pattern as `economy.gd`'s `disbanded_units` fan-out. No GDScript
simulation arithmetic remained. Marked done with evidence rather than churning
already-compliant code.
**All three named GDScript simulation-logic violations (economy gold, happiness,
climate damage) are now resolved.** Status stays `partial` only on the explicit
**(Stretch)** bullet 4 (per-turn orchestration → Rust turn driver), which is
deferred to the broader pathfinder/turn port — a separate objective-sized debt.
## Code sites

View file

@ -1,12 +1,12 @@
{
"generated_at": "2026-06-25T23:15:35Z",
"generated_at": "2026-06-25T23:39:51Z",
"totals": {
"partial": 2,
"oos": 31,
"in_progress": 0,
"stub": 0,
"oos": 31,
"partial": 2,
"missing": 0,
"done": 295,
"in_progress": 0,
"total": 328
},
"objectives": [