magicciv/.project
autocommit cea53e1ee4 feat(p2-73): 🎨 generate ui_theme.tres from design tokens + global apply + color() accessor
Close the gap where the design system (.project/designs/design-tokens.json)
drove the React guide but not the Godot game.

- tools/build-ui-theme.py: compiles the W3C/style-dictionary token SoT into a
  complete Godot Theme (7 StyleBoxFlat sub-resources, Button/Label/Panel/
  PanelContainer/ItemList/RichTextLabel colors + font sizes + corner radii/
  border widths per UI_DESIGN_SYSTEM.md §3/§4/§6). ui_theme.tres is now a
  GENERATED artifact; tokens are the single source of truth. Deterministic
  output (sorted keys, fixed float fmt, preserved uid://ui_theme_fantasy) with
  a --check drift gate. Idempotent; --import does not rewrite it.
- project.godot [gui] theme/custom: applies ui_theme.tres at viewport level so
  every non-overriding default Control renders the copper fantasy styling.
- ThemeAssets.color(name) -> Color: resolves dotted token names (accent.gold,
  semantic.positive, text.primary, …) against the metadata/tokens JSON blob
  baked into the .tres by the generator. Fully data-driven from the SoT, no
  hardcoded color map. (Godot rejects dots in Theme color item names, so the
  token table ships as resource metadata.) Unknown names return an explicit
  fallback. This is the API p2-74 will de-hardcode 45 scripts onto.
- ui_theme_proof.{tscn,gd}: bare-widget + color()-swatch proof scene.
  test_theme_assets_color.gd: GUT accessor coverage (5/5 headless).

Proof captured on apricot under weston, reviewed in conversation:
.project/screenshots/p2-73-ui-theme-proof.png. Workspace green — full unit
(16==16) and integration (18==18) suites show identical HEAD-baseline-vs-patch
failure counts, zero regressions; patch adds +5 passing tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 19:42:01 -07:00
..
designs
experiments
future-games
handoffs docs(docs): 📝 Update Phase 3 military communications and resources documentation with handoff notes for data schema drift 2026-05-26 02:21:14 -07:00
history docs(history): 📝 Add markdown entry documenting the "odd-q axial consistency" fix in project history 2026-05-26 02:21:13 -07:00
objectives feat(p2-73): 🎨 generate ui_theme.tres from design tokens + global apply + color() accessor 2026-06-04 19:42:01 -07:00
reports
screenshots feat(p2-73): 🎨 generate ui_theme.tres from design tokens + global apply + color() accessor 2026-06-04 19:42:01 -07:00
tasks
team-leads feat(sprites): OSS standin coverage p2-23..27 (536 PNGs) + xi-v11 charter 2026-06-04 04:40:14 -07:00
AGE-OF-DWARVES-FEATURES.md
audio-sourcing-checklist.md
audio-status.md
CHANGELOG.md docs(core): 📝 document technical audit findings and AI milestones in CHANGELOG.md 2026-05-26 02:21:13 -07:00
FINISH_GAME1_PLAN.md docs(p2-65): 📊 Phases 1/3a/3b landed — status stub→partial, Phase-4 resume note 2026-06-04 19:20:40 -07:00
gdlintrc.local
README.md
ROADMAP.md
SCREENSHOT_REGISTRY.md
TERMINOLOGY.md

.project/ — Directory Map

Build-process docs for Magic Civilization. Each file owns exactly one responsibility. Status of work-in-flight is tracked only in objectives/ (SSoT).

File / dir → responsibility

Path Responsibility Rule
README.md This map Maintained by hand when structure changes
ROADMAP.md Phase sequence + scope per milestone Never carries status; references objective IDs only
TERMINOLOGY.md Glossary (terms, acronyms, design vocabulary) Facts only, no status
CHANGELOG.md Dated narrative events (append-only) References objective IDs; never restates status
objectives/ Single source of truth for current state One .md per objective, YAML frontmatter status: field
objectives/README.md Dashboard index (grouped by P0/P1/P2) Generated by tools/objectives-report.py — do not hand-edit
tasks/milestones/ Per-milestone work packages (scoping docs) HOW, not WHAT-DONE
tasks/topics/ Cross-cutting topic work (balance tuning etc.) HOW, not WHAT-DONE
tasks/deferred/ Parked work packages HOW, not WHAT-DONE
handoffs/ Agent-to-agent context transfer YYYYMMDD_slug.md
history/ Archived one-off docs (reports, snapshots, obsolete plans) YYYYMMDD_slug.md; immutable once filed
reports/batches/ Autoplay batch output Tool artifacts
reports/simulation/ Simulator reports Tool artifacts
reports/screenshots/ Proof screenshots Tool artifacts
future-games/ Game 2 design drafts Out of scope for Game 1
gdlintrc.local Local gdlint overrides Config

Invariants

  1. Status lives in objectives/*.md frontmatter, nowhere else.
  2. ROADMAP, CHANGELOG, tasks/ may reference objective IDs; they may not restate status.
  3. objectives/README.md is machine-generated from frontmatter. Regenerate after any objective edit: python3 tools/objectives-report.py.
  4. history/ is append-only. Archived files get a YYYYMMDD_ prefix and are never edited in place; if a superseding doc is needed, create a new one.

Quick regen

python3 tools/objectives-report.py     # rebuilds objectives/README.md from frontmatter