From e00c0477ab3c210ba3c4c55d0dcf8e4100f4ca84 Mon Sep 17 00:00:00 2001 From: Natalie Date: Thu, 25 Jun 2026 19:39:51 -0400 Subject: [PATCH] =?UTF-8?q?docs(@projects/@magic-civilization):=20?= =?UTF-8?q?=E2=9C=85=20p3-24=20phase=203=20=E2=80=94=20climate=20HP-loss?= =?UTF-8?q?=20verified=20Rust-owned=20(bullet=203=20done)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../p3-24-rail1-economy-turn-logic-port.md | 37 +++++++++++++++---- .../games/age-of-dwarves/data/objectives.json | 8 ++-- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/.project/objectives/p3-24-rail1-economy-turn-logic-port.md b/.project/objectives/p3-24-rail1-economy-turn-logic-port.md index dfd83d43..64b662a2 100644 --- a/.project/objectives/p3-24-rail1-economy-turn-logic-port.md +++ b/.project/objectives/p3-24-rail1-economy-turn-logic-port.md @@ -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 diff --git a/public/games/age-of-dwarves/data/objectives.json b/public/games/age-of-dwarves/data/objectives.json index 36951deb..1e94b0c8 100644 --- a/public/games/age-of-dwarves/data/objectives.json +++ b/public/games/age-of-dwarves/data/objectives.json @@ -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": [