magicciv/.project/objectives/p2-10e-data-integrity.md
Natalie 7a9e89b5c8 feat(@projects/@magic-civilization): add design tokens and culture system updates
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-26 08:05:10 -07:00

2 KiB

id title priority status scope owner updated_at evidence
p2-10e Data: resolve duplicate IDs and dangling unlock refs in game data p2 done game1 2026-04-26
test_data_integrity.gd:158 — test_tech_unlocks_resolve implemented (was pending); removed 9 dangling unlock refs from advanced_metallurgy.json, advanced_ecology.json, advanced_military.json
test_data_integrity.gd:220 — test_no_duplicate_ids_per_category implemented as intra-pack-only check; cross-source overlap (resources/ vs games/) is intentional DataLoader override behaviour
tools/validate-game-data.py: 203 PASSED, 0 FAILED after changes
Python verification: 0 intra-pack duplicates, 0 dangling unlock refs remaining

Summary

test_data_integrity.gd had two pending() stubs and the data had real dangling refs:

  1. Duplicate IDs: public/resources/ is the Games 2/3 master library; public/games/age-of-dwarves/data/ overrides it for Game 1. DataLoader loads resources first, then game data overwrites — this is intentional. The test was rewritten to check for intra-pack duplicates only (same ID in two files within the same category directory), which is the correct failure mode to guard against.
  2. Dangling unlock refs: 9 tech unlocks referenced buildings/improvements that don't exist in either source (grand_forge, steam_foundry, mithril_mine, adamantine_vault, deep_garden, mushroom_farm, deep_quarry, root_sanctum, citadel_of_ages). These are unported Game 1 content. Unlock entries removed from tech JSON files.

Acceptance

  • ✓ Cross-source overlap is clarified as intentional: DataLoader second-pass (game data) overwrites first-pass (resources); test scoped to intra-pack duplicates only
  • ✓ All 9 tech unlock refs to missing IDs removed from advanced_metallurgy.json, advanced_ecology.json, advanced_military.json
  • test_no_duplicate_ids_per_category implemented with 0 intra-pack duplicates found
  • test_tech_unlocks_resolve implemented with 0 dangling refs remaining