magicciv/.project/objectives/p3-05b-authority-axis-catalog.md
Natalie 72076031d6 feat(@projects/@magic-civilization): complete upgrade target bridge and tests
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-14 21:32:27 -07:00

3.1 KiB

id title priority status scope category owner created updated_at completed_at blocked_by follow_ups
p3-05b Authority axis civics catalog p3 done game1 civics unassigned 2026-05-03 2026-05-14 2026-05-14
p3-05a

Completion (4/4 acceptance bullets ✓)

Context

The Authority axis in public/games/age-of-dwarves/docs/civics/CIVICS.md covers civics governing the relationship between rulers and governed: Tribal Council, Clan Hold, Hereditary Crown, Dwarven Republic, Engineer-Magnates. Each carries unique modifiers (happiness, war-weariness, golden-age trigger amplifiers, taxation ceilings). This objective authors the JSON catalog files; modifier propagation is p3-05e.

Acceptance

  • ✓ Five files under public/resources/civics/authority/*.json — one per civic listed above. Each file carries id, axis: "authority", name, description, tech_required, modifiers: { ... }. Authored 2026-05-14: tribal_council.json, clan_hold.json, hereditary_crown.json, dwarven_republic.json, engineer_magnates.json.
  • ✓ Schema public/games/age-of-dwarves/data/schemas/civic.schema.json validates the modifier subset for the Authority axis (incl. happiness_per_city, tax_ceiling_pct, war_weariness_scalar, golden_age_amplifier). Schema enforces axis enum, snake_case ids, and rejects unknown modifier keys. Standalone Draft 2020-12 validation: 15/15 civic files pass.
  • python3 tools/validate-game-data.py now scans public/resources/civics/ via the new validate_civics method (tools/validate-game-data.py ~line 720). Run on 2026-05-14: civics block reports 15/15 PASS across authority/, labor/, economy/. Validator also cross-checks declared axis against the directory name and enforces id uniqueness across all axes. Pre-existing terrain/substrate failures (89) are unrelated to this objective.
  • cargo test -p mc-core --test civics_catalog test_load_authority_catalog (mc-civics crate not authored; loader test lives in mc-core/tests/civics_catalog.rs per the objective's "or -p mc-core" allowance) passes 2026-05-14 — typed deserialisation into a CatalogCivic struct using mc_core::civic::CivicAxis::Authority, plus invariants (5 files, 1 is_starting, all expected ids present, all modifier values number-or-bool). Companion tests test_load_labor_catalog, test_load_economy_catalog, test_all_civic_ids_unique_across_axes also green (4/4 passed, 0 failed).

Source-of-truth rails

  • Rust crate: mc-civics owns the catalog loader (typed deserialisation into Civic struct from mc-core). No GDScript-side civic list.
  • JSON path: public/resources/civics/authority/*.json (per p1-40 SSoT). No parallel data/civics/.
  • mc-core wrapper: Civic struct uses CivicId, CivicAxis::Authority from p3-05a.

Out of scope

  • Labor / Economy catalogs — p3-05c, p3-05d.
  • Modifier application math — p3-05e.
  • UI for selecting civics — separate UI ticket.

References

  • public/games/age-of-dwarves/docs/civics/CIVICS.md
  • Parent: p3-05a
  • Siblings: p3-05c, p3-05d, p3-05e