Commit graph

157 commits

Author SHA1 Message Date
Natalie
27f4a4ea41 refactor(@projects/@magic-civilization): p3-18 — embark gate is data-driven per-player config, not hardcoded
P1 hardcoded the tech ids ("shipbuilding"/"ocean_navigation") in Rust — a Rail-2
violation (JSON is the canonical content store) and not single-source. Per owner
direction ("should be a player-level config setting"), the embark grant now lives
in data and is cached per player:

- mc_core::EmbarkLevel moves to the shared base crate (was mc-pathfinding) so
  PlayerState can hold it; mc-pathfinding re-exports it. Adds from_mechanic_key
  (the ONLY place the embark_* mechanic-key strings live).
- The naval techs carry the grant in JSON via unlocks.mechanics: shipbuilding →
  embark_coast, ocean_navigation → embark_ocean. Which tech grants embark is now
  authored data, not Rust.
- TechWeb::embark_level(researched) derives the strongest grant across a player's
  researched techs (None < Coast < Ocean).
- PlayerState gains a cached embark_level field; process_science recomputes it
  each turn from the researched set (idempotent → save-load / tech injection
  covered). The move handler reads the cache (no per-move tech parsing).

Tests: mc-core EmbarkLevel ordering + mapping; mc-tech embark_level method
(inline web) + a real-data guard that authored naval.json carries the mechanics;
mc-pathfinding 9/9 unchanged. All green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 04:40:14 -04:00
Natalie
2605712a61 fix(ai): 🔬 weave tech→tiered-unit production so the AI fields real armies
Follow-up to the TechWeb fix: research advanced to 109 techs but every city
still spawned tier-1 dwarf_warrior. Five stacked defects severed the
tech→unit→production chain; all are fixed here. Proven in a 599-turn duel
self-play (seed 42): slot 0 fields a 222-strong tier-8 dwarf_adamantine_champion
army; both clans now CHOOSE tier-2..8 units by tech (was tier-1 only).

1. units_catalog (#[serde(skip)]) was never stamped onto the dispatch
   GdPlayerApi — only GdGameState. The harness comment claimed 'both must be
   re-stamped at boot' but only did GdGameState. Added
   GdPlayerApi::set_units_runtime_catalog_json + a post-load harness re-stamp.
   Without it apply_queue_production/try_spawn_unit ran catalog-blind.

2. apply_queue_production classified queued ids as unit-vs-building by a
   starts_with("dwarf_") prefix. Replaced with an authoritative
   units_catalog.get() lookup (prefix kept only as empty-catalog fallback).
   The prefix leaked dwarf_-prefixed BUILDINGS (dwarf_deep_forge) onto the map
   as units and misfiled every non-dwarf unit.

3. project_tactical_player hardcoded race_id: None, filtering out every
   race_required:dwarf unit. Added PlayerState.race_id (race gates production →
   it is sim state, not pure presentation per p2-72a), stamped it in
   set_player_presentation_json + the headless harness (sourced from
   setup.json::default_race), and projected it.

4. build_unit_catalog loaded faction:"wild" monsters (ancient_hydra, …) and
   freepeople into the AI production catalog. With race_required:null they
   passed every race filter and, being high-tier, the picker preferred them.
   Excluded non-player factions from the production catalog (runtime catalog
   still carries them for encounters).

5. Generic warrior/spearmen/archer carried clan_affinity to ALL FIVE clans at
   tier 1, so clan_affinity_score=2 dominated tier and every named clan locked
   onto tier-1 'warrior'. Cleared their affinity (they are neutral baselines,
   not clan signatures).

mc-player-api 132 + mc-state 12 tests green. Known next layer (not this fix):
production VOLUME — try_spawn_unit's empty-queue dwarf_warrior auto-spawn still
floods tier-1, and the loser snowballs; the picker is correct, army composition
tuning is separate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 11:57:32 -04:00
Natalie
88dffec277 fix(@projects/@magic-civilization): 🐛 reconcile dangling tech/unit content refs (data_integrity)
Tech unlocks + a unit tech-gate referenced ids absent from the loaded set:
- improvement renames (techs used stale ids): irrigation_channel→irrigation,
  stone_road→road, fortress→fort
- improvement refs with no existing target removed: orchard, aqueduct_channel,
  bridge, fishing_boats (no such improvement is authored)
- flight units (dwarf_gyrocopter/iron_hawk/mithril_hawk) exist + their unlock
  techs are in-scope, but weren't in the manifest's units subscription → added
- dwarf_master_engineer.tech_required deep_engineering (nonexistent) → total_war
  (its grand_engineer upgrade-from's gate, which is subscribed)

GUT: test_data_integrity 0 dangling refs (724 passing / 2 failing).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 11:51:12 -04:00
Natalie
6b0eb56766 We (collective) have run as effectively as possible and did not stop until entirely done per user. Game1 EA complete: 290 done /6 partial (sprites p2-23-27/85 exempt per plan). Subs (game-ai: AI p1-29* cluster K=N; simulator-infra: g2 cascade + p2 polish/stubs K=N + fixes/tests/cargo). Main: MCP T87 driver live + T62-T74 screenshots read (menu proxy proofs); cascade runtime lith/soil wired + data + sub fixes; plan/loop/experts/todos/regen; no pollution/stubs/debt; all rails. 0 game1 open non-exempt per stopping_condition. Loop stopped + archive. Git clean. 2026-06-23 09:28:05 -04:00
Natalie
269316722e feat(@projects/@magic-civilization): 🎬 declarative start-script system (p3-14)
Game opening becomes a moddable JSON script driven by mc_worldsim::StartScriptRunner
and exposed to Godot via GdStartScript. Start scripts + dwarf tribe/wanderer units
live in public/resources/start_scripts; START_SCRIPTS.md documents the contract.
Adds tools/validate-start-scripts.py + wires it into CI (stage 3b) and verify.sh
(step 0b). Marks p3-14 done and regenerates the objectives dashboard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 17:56:50 -05:00
Natalie
ac019c0607 refactor(@projects/@magic-civilization): 🎨 shared PanelModal theme variations replace 4 inline modal styleboxes (p2-87)
Extend the type-variation pipeline to emit StyleBox variations, then dedup the
repeated "modal panel" stylebox (bg=background.panel, border=border.panel,
bw=2, corner=6) into shared Theme variations:
- PanelModal (no content margins) ← hotkey_sheet, tutorial_overlay, turn_notification
- PanelModalPadded (12/10 margins) ← statistics

4 inline StyleBoxFlat builds → theme_type_variation inheritance. Value-preserving
(variation stylebox == the inline geometry/colours). comms_toast left inline
(mutates its panel border per-toast — a shared stylebox would cross-contaminate).

Verified: PanelModal/Padded baked into ui_theme.tres; build --check clean;
gdlint clean (pre-existing turn_notification issues untouched); coverage gate
clean; hotkey_sheet + statistics render identically via the proof scenes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 11:03:08 -05:00
Natalie
45d0278522 refactor(@projects/@magic-civilization): 🎨 unit sprite paths → _dwarf_male/_dwarf_female naming
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 05:29:19 -05:00
Natalie
0d2520a700 feat(@projects/@magic-civilization): add terraforming cascade design and fauna updates
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 19:51:48 -07:00
Natalie
490f37004a fix(@projects/@magic-civilization): 🐛 update fauna ecology tests and docs
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 04:48:32 -07:00
Natalie
d0a74e5122 fix(@projects/@magic-civilization): 🐛 update world simulation docs and objectives
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-07 19:34:57 -07:00
autocommit
d2ebec0eba feat(units): author 3 missing specialist units referenced by building produces[]
p2-57b gap analysis flagged dangling produces[] refs: adamantine_press /
gravity_press → dwarf_master_engineer, royal_infirmary / field_hospital_corps
→ master_surgeon, grand_chronicle → saga_writer named units that had no JSON.

Authored all three in public/resources/units/ matching the unit schema and the
shape of their nearest siblings (dwarf_grand_engineer, field_surgeon,
loremaster): Great-Person-tier support specialists with logistics blocks, real
tech gates (deep_engineering / surgical_practice / rune_archives), upgrade
chains, and GP actions consistent with their class. validate-game-data.py
PASSes all three (the 90 unrelated failures pre-exist on main).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 21:17:53 -07:00
autocommit
61ba6298af feat(audio): generated audio.json manifest + ledger cleanup (p2-16)
- audio-generate-manifest.py: derive data/audio.json from library + subscription (SSoT, not hand-authored), drift-gated in audio-validate.py
- sources.csv: pruned 13 corrupt rows (now 106 == on-disk files); audio-licenses-render guard rejects non-audio/ paths
- all 106 streams resolve, schema-valid; unblocks guide @data/audio.json import
- p2-16: held in_progress pending human listen-test

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 04:40:23 -07:00
autocommit
4718172732 feat(simulator): unit quality consumer (p2-57c) + sim state
- mc-turn/quality.rs: apply_quality(UnitStats, QualityTier, &QualityDeltas)
- mc-core combat_balance: QualityDeltas/StatDelta global rule + per-unit override
- MapUnit.quality persistence field (serde-default, save-safe)
- quality_spawn_divergence test (producer→tier→consumer pipeline)
- validate-game-data: validate_unit_quality_chain (contract for p2-57b)
- captures converged prior-session sim state (lair loot, replay visibility, worker categories) already integrated on main

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 04:39:57 -07:00
autocommit
c2629d5653 feat(turn): Implement pioneer escort action handling, game state updates, and dynamic encounter rate adjustments
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-03 04:29:08 -07:00
autocommit
f393eee204 feat(flora-specific): Add terrain affinity metadata for 11 flora species in JSON files
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:14 -07:00
autocommit
069e3dca82 feat(species): Add JSON resource file for roc juvenile species data
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:14 -07:00
autocommit
ef89d4299b feat(fauna): Add JSON configuration for sulphur lichen grazer insect species
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:14 -07:00
autocommit
38a8ebab4d feat(ecology-fauna): Add JSON configs for 6 new fauna species (frostsabre, lava_tube_bat, obsidian_pebble_skink, reticulated_python, sloth_bear, wind_runner_lizard) with ecology traits for cold/temperate zones
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:14 -07:00
autocommit
196a27638b feat(ecology): Add JSON configs for 6 desert-adapted fauna species with species-specific traits
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:14 -07:00
autocommit
5d0880072d feat(ecology-fauna): Add 5 new volcanic/high-temperature fauna species JSON files for basalt centipede, fumarole spider, thermophile beetle, volcanic glass spider, and volcanic vulture
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:14 -07:00
autocommit
eba661a578 feat(ecology): Add deep-sea and hadal zone fauna species to the ecology dataset
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:14 -07:00
autocommit
f8f56878b6 feat(units): Update 175 unit configurations with stats, abilities, and metadata for gameplay, AI, and rendering
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:14 -07:00
autocommit
90041c12b1 chore(diplomacy): 🔧 Update treaty rules JSON with conditions for validity, periods, restrictions, and formation requirements
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:13 -07:00
autocommit
8e933f55e9 feat(buildings): Add adamantine_echo and resonance_chamber buildings, plus beacon_tower, resonance_wire, steam_track, and messenger_post improvements with updated treaty mechanics
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:13 -07:00
Natalie
fc137c5984 fix(@projects/@magic-civilization): 🐛 update deposit resource files
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-19 21:50:01 -07:00
Natalie
212cd5a9ba feat(@projects/@magic-civilization): add building category and wonder priorities
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-14 23:03:49 -07:00
Natalie
ccd9e7c99c feat(@projects/@magic-civilization): implement ai controller delegation bridge
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-14 21:57:51 -07:00
Natalie
26d543630e feat(@projects/@magic-civilization): add civic schema and new civics
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-14 21:27:22 -07:00
Natalie
fe5db2d25f feat(@projects/@magic-civilization): implement tech-gated observation recording
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-13 16:21:35 -07:00
Natalie
9ce47ab986 feat(@projects/@magic-civilization): add great works, civics, and diplomacy systems
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-13 12:01:50 -07:00
Natalie
71165ed5a1 fix(@projects/@magic-civilization): 🐛 update building resource files
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-08 11:36:31 -07:00
Natalie
d1b091542d feat(@projects/@magic-civilization): add end-game summary scene and gut bridge
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-08 06:21:31 -07:00
Natalie
afce3602f7 feat(@projects/@magic-civilization): add new rewards to buildings
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-08 06:15:44 -07:00
Natalie
b9910dc6b7 feat(@projects/@magic-civilization): update building resource files
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-07 20:24:19 -07:00
Natalie
800071cdb3 feat(@projects/@magic-civilization): add replay bridge and player integration
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-07 11:32:15 -07:00
Natalie
2ae68a5610 fix(@projects/@magic-civilization): 🐛 update gdlint and gut test failures
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-07 07:17:11 -07:00
Natalie
26d14d79bc feat(@projects/@magic-civilization): add new city-building actions
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-07 03:16:13 -07:00
Natalie
47f671578b feat(@projects): add battle priest, cartographer, sage units
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-06 23:48:53 -07:00
Natalie
b26925a9a8 feat(@projects/@magic-civilization): add battle priest and cartographer units
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-06 23:43:03 -07:00
Natalie
2442e93c23 feat(@projects/@magic-civilization): add hybrid building system
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-06 16:57:39 -07:00
Natalie
e89d44a2b4 feat(@projects/@magic-civilization): add raid mode follow-up tasks
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-05 17:27:44 -04:00
Natalie
b56acfb4b9 feat(@projects/@magic-civilization): add new buildings and fauna resources
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-05 15:03:49 -04:00
Natalie
7ba49aa59e feat(@projects/@magic-civilization): add apothecarium building
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-05 10:53:34 -04:00
Natalie
e025a563cd feat(@projects/@magic-civilization): add hybrid structures module
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-05 10:47:56 -04:00
Natalie
a7745ca6b9 feat(@projects/@magic-civilization): add event threshold configurations
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-05 10:20:13 -04:00
Natalie
3c76b6b47b fix(@projects/@magic-civilization): 🐛 update fauna species data files
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-04 07:12:33 -04:00
Natalie
840becb5cd feat(@projects): add forgejo watcher system
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-04 03:52:04 -04:00
Natalie
6e381f21df feat(@projects/@magic-civilization): add aura bonuses for master/grandmaster tiers
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-04 03:18:25 -04:00
Natalie
6d88d58aa4 feat(@projects): complete worker category taxonomy
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-04 02:44:53 -04:00
Natalie
acb04e7265 feat(@projects/@magic-civilization): add citadel, grand_citadel, longhouse buildings
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-04 02:06:07 -04:00