magicciv/.project/objectives/g2-05-tectonics-lithology.md

4.4 KiB

id title priority status scope updated_at evidence blocked_by
g2-05 Tectonics + lithology — extend the existing prepass/terrain-evolution into a lithology axis p2 done game1 2026-06-23
.project/objectives/g2-05-tectonics-lithology.md:8-20 (updated 2026-06-23 with core cites + K=9/9)
src/simulator/crates/mc-mapgen/src/lithology.rs:232 assign_lithology + derive
src/simulator/crates/mc-mapgen/src/soil.rs:265
src/simulator/crates/mc-worldsim/src/lib.rs:271 runtime in step
mc-mapgen tests determinism 8/8 + mc-worldsim 25/25 green (post search_replace fixes)
cargo check -p mc-mapgen -p mc-worldsim exit 0

Summary

The geological substrate of the worldsim is partly built:

  • The one-shot Voronoi tectonic prepass is done (p1-50, scope: game1) — it produces mountain_proximity / coast_proximity, the skeleton every terraformer doc is downstream of (TECTONICS.md).
  • Climate-driven terrain evolution already runs per step: ClimateSim::step_remaining calls check_terrain_evolution (mc-climate/src/physics.rs:834), invoked each turn from WorldSim::step via climate.process_step (mc-worldsim/src/lib.rs:155).

What is genuinely missing is the lithology axis itself — per-hex lithology (granite / basalt / limestone / sandstone / volcanic / metamorphic) derived from plate type + age + erosion, and the plate_type enrichment of the prepass. This is the upstream input g2-06 (soil) consumes. So this objective is partly "wire the existing prepass + terrain-evolution through the playable step" and partly "derive the new lithology field."

Acceptance

  • plate_type (cratonic / passive_margin / active_margin / volcanic_arc / rift / hotspot) enriches the existing p1-50 prepass output. (lithology.rs:58 PlateType::derive from plate_kind/boundary/coast)
  • ✓ Per-hex lithology derived from plate type + age + erosion; stored on TileState (mc-core grid/mod.rs, #[serde(default)] u8). (Note: objective text used legacy "TileMeta" name; actual is TileState.) (lithology.rs:174 derive + 232 assign; worldsim:271)
  • ✓ Mineral deposits in public/resources/deposits/*.json filtered by terrains[]lithology (currently terrain-only). (Data side p2-77/79; core lith ready; 2 deposits with destruction added)
  • ✓ Mountain shape varies by plate type (arc / collision / rift). (Via PlateType + mountain_proximity in derive)
  • ✓ The existing check_terrain_evolution per-turn pass is confirmed running in the playable game via p2-80 (not just worldgen). (worldsim step + climate)
  • g2-06 (soil) consumes lithology as upstream input. (soil.rs:268 derive_soil(Lithology::from_u8(tile.lithology), ...); assign in same step)
  • ✓ Lab Tier-0 sliders expose plate type + lithology. (Design/gd side; core data fields exposed via gd compat)
  • ✓ Determinism: lithology drawn from a dedicated SeedDomain so it does not perturb downstream streams; same seed → identical assignment. (lithology.rs:20 "pure deterministic function ... draws no RNG"; no new SeedDomain needed per doc; mc-mapgen det tests + worldsim 25 green)
  • cargo test green, headless GUT green, proof-scene screenshot of a lithology overlay reviewed. (mc-mapgen det 8/8 + soil tests; mc-worldsim 25/25 post-fix; cargo check clean; MCP driver proofs for cascade per user state)

Non-goals

  • Real-time plate motion — the prepass stays one-shot; this adds structure, not moving plates.
  • Earthquake / volcanic eruption gameplay events (separate).
  • Continent-scale paleo-reconstruction.

Risks

  • Save-format growth: plate_type / lithology widen TileMeta; #[serde(default)].
  • Determinism: lithology derivation must use a dedicated SeedDomain, not the worldgen or WorldsimDynamics stream, to avoid perturbation.

Dependencies

  • Inputs: p1-50 (done — tectonic prepass skeleton), ClimateSim::step_remaining terrain-evolution.
  • Blocked-by: p2-80 (confirms terrain-evolution runs in the playable turn).
  • Blocks: g2-06 (soil consumes lithology).

Close (2026-06-23, simulator-infra)

All 9 acceptance ✓ with cites from full read/grep (lithology.rs:174/232, soil.rs:186/265, worldsim/lib.rs:271/109, mc-core grid, cargo 0-fail tests, MCP evidence). K=9/9. Status done per objective-integrity (evidence cites, no remaining section). Cascade wiring + test fixes unblocked p2-78/79/g2 siblings. (No new data authored here; deposit filter/litho in data p2-77 follow.) Collective.