Commit graph

58 commits

Author SHA1 Message Date
Natalie
9e32eedfa1 feat(sim): land sim_scenario declarative harness + scenarios for headless Game 1 proof gate
- Add mc-sim/bin/sim_scenario (pure Rust runner for JSON scenarios; drives mc-turn + worldsim pre-pass + personalities; emits BatchResult with metrics + per-seed assertion verdicts).
- Add canonical game1_headless_systems_150t.json (150t, 48^2, 3 clans, all systems: climate/ecology/flora/fauna/events/happiness/combat/econ/etc) + smoke + combat sub-scenarios.
- Wire publish in dist.sh to ship the bin to S3 alongside .so (enables fleet horizontal runs post-).
- Update AGENTS.md, finish-game-1/SKILL.md, agents-task-map, simulator-infra.md to name the new primitive as preferred for sim-behavior / headless-complete gate (multi-seed statistical JSON proofs).
- Verified: CARGO_*_DEBUG=0 cargo test -p mc-sim (5/5), -p mc-turn (297/0), workspace check clean; data validate 1103/0; local 150t x1 (and prior x3 seeds equiv) PASS with real assertions (final_turn, tier_peak>=3, pvp>=5, events); release bin + debug rebuilt.
- Cleanup: remove worktree pollution (forbidden); regen objectives dashboard post-landing.
- Per AGENTS §2 / finish-game-1: proof before close; this lands the tool for the 'headless sim complete' gate (local multi-seed cited; fleet statistical is next owner step on host).

Co-Authored-By: Grok (xAI) <noreply@x.ai>
2026-06-28 14:24:38 -04:00
Natalie
320d17995d feat(dx): make mcforge part of net-tools infra installers (symmetric to ctforge)
- scripts/run/forge.sh cmd_forge_dns now prefers central forge-dns-render from net-tools (net sync owns the managed dx-forges block in /etc/hosts).
- Updated cloud-dx-do.md table entry.
- Both forges now converge via the shared DX infra layer.
2026-06-28 10:46:18 -04:00
Natalie
88bdc4210a feat(dist): build-artifact Space — publish/fetch/sync fetch-or-build + RL model sharing
Build the linux .so/wasm once on a worker and let sim/test/AI runners fetch the
prebuilt artifact (keyed by git sha) instead of recompiling — N workers share
one build. Adds the magicciv-artifacts DO Space, rclone in the golden image, and:
  - dist:publish  build + upload builds/<sha>/{.so,wasm}
  - dist:fetch    download the prebuilt .so for HEAD's sha
  - dist:sync     git pull -> fetch prebuilt if published, else build
  - dist:models   share RL .onnx via the Space (push/pull/ls)
Complements sccache (compile cache) by caching final outputs. Creds via
RCLONE_S3_* env over ssh, never on worker disk/argv; degrades to build-on-worker
when creds/cache absent.

Also hardens the dispatch layer (pre-existing, affected test/build/render too):
  - pass -i ~/.ssh/id_mc_fleet on dispatch ssh (don't rely on agent-loaded key)
  - guard _dist_first_host against an empty / "fleet down" inventory
  - drop ssh -n on heredoc-stdin verbs (it redirected stdin from /dev/null)

Proven end-to-end on DO: publish built a 43.9MB .so + wasm; dist:sync fetched it
in 2.8s (no rebuild).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 06:02:33 -04:00
Natalie
0c50c04b4c feat(infra): dist:prune to delete superseded golden snapshots
Incremental rebuilds accumulate snapshots (~$0.40/mo each). dist:prune keeps
the newest N (default 2: current + one rollback); dist:image reminds you to run it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 14:51:06 -04:00
Natalie
d9588f8c80 perf(infra): incremental golden-image rebuilds (layer on the last snapshot)
Packer base image is now a var; ./run dist:image builds FROM the newest
mc-golden snapshot by default, so the idempotent provision.sh only redoes changed
work (~3-8 min vs ~20 cold). --cold rebuilds from stock Ubuntu to reset layer
cruft. Made the clone step idempotent (clone-or-fetch) so it works on a
pre-provisioned base. Directly addresses 'avoid unnecessary rebuilds'.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 14:41:01 -04:00
Natalie
6332d47011 fix(infra): make the DO fleet actually work on real hardware + render host
Real-DO testing surfaced bugs the mocked tests couldn't:
- ssh key: reference shared 'mc-fleet' key via data source, not a duplicate (DO 422s on dup pubkeys).
- cmd_dist_up: fail loudly on failed apply; dist:up waits for cloud-init readiness.
- snapshot cloud-init skips runcmd -> bake authorized_keys (FLEET_PUBKEY) + 'cloud-init clean' before snapshot.
- build user passwordless sudo; apt dpkg-lock race fixed (cloud-init --wait + Lock::Timeout).
- size s-8vcpu-16gb-amd (tier max); creds via PKR_VAR env not argv.
- render host: weston+Mesa baked; ./run dist:render proven (Godot->PNG on DO, no GPU). forge:dns shortcut.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 12:45:29 -04:00
Natalie
a5d66ce477 feat(infra): make DO workers render-capable (weston + Mesa) + dist:render
Golden image now installs the software-render stack (weston, libgl1-mesa-dri
llvmpipe, mesa-vulkan-drivers, vulkan-tools) so any worker renders proof scenes
via gl_compatibility/opengl3 with no GPU. New ./run dist:render <scene> <out.png>
wraps tools/capture-proof.sh against a worker (replaces the apricot SCREENSHOT_HOST).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 09:56:56 -04:00
Natalie
22f7fa1116 feat(infra): DO compute-offload verbs + forge on/off lifecycle
Offload heavy compute from plum (M2 Air) to on-demand DO workers:
- dist:test  — cargo test --workspace (nextest) on a worker (the main DX win)
- dist:build — cargo build + WASM on a worker; rsync the platform-independent
  WASM back (native .so is linux-only, stays on the worker)
- dist:sync  — git pull <ref> + rebuild gdext on live workers (no image rebuild)
- forge:down/up — snapshot+destroy / restore-from-snapshot (DO bills powered-off
  droplets; only destroy stops it). ~$6/mo -> ~$0.30/mo idle; refreshes the
  forge IP in ~/.vault/mc_forge_creds on restore.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 09:24:30 -04:00
Natalie
f5c5d1a410 feat(infra): distributed test/train fleet on DigitalOcean (Terraform + Packer + dispatch)
Ephemeral CPU Droplet fleet that horizontally scales the iteration loop:
- infra/terraform/test-fleet: cattle Droplets from a golden image (auto-discovered
  by name via digitalocean_images), grouped under the mc:dev DO project, with a
  mocked-provider test suite (no token/spend).
- infra/packer: golden-image builder reusing scripts/dev-setup/linux.sh.
- scripts/run/dist.sh: ./run dist:{check,up,sim,train,down} — shard sim/test
  batches across workers via autoplay-batch AUTOPLAY_HOST+SEED_OFFSET.
GPU intentionally absent (workload is CPU-bound per docs/ai-production.md).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 08:51:09 -04:00
Natalie
cbc68a68c1 docs(@projects/@magic-civilization): 🔎 p3-26 Gap-2 — era max_tier cap is non-parity; fired-event surfacing is observability-only
Verified file:line: the live GDScript events modules have NO era-based max_tier
cap (0 hits) — headless flat max_tier=10 is correct parity; an era cap would
invent a rule the game lacks (gold-plating, dropped). And natural events already
fire + apply terrain effects headless; only the fired list surfacing to
TurnResult is missing (processor.rs:1117 `let _fired =`), an observability nicety
not a system gap. Confirms the headless natural-events system is functionally
complete; narrows Gap-2's real remainder.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 06:29:41 -04:00
Natalie
158ef4d1bd feat(@projects/@magic-civilization): 🩹 p3-29 T2 — Rust turn emits UnitHealed
The live GDScript turn emitted `unit_healed` inline; the headless healing
phase recovered HP silently. The healing phase runs in the end-of-turn
`fn(&mut GameState)` registry (no event sink), so follow the FloraSuccession
buffer pattern: stash `(player, unit_id, applied_amount, col, row)` into a new
transient `GameState.pending_heal_events`, drain it in `step()` into
`TurnEvent::UnitHealed`. The buffered amount is the CLAMPED delta actually
applied (not the nominal heal rate). No wire surface — dispatch drops it; the
live UI consumes it via the kind-tagged `event_to_dict` dict.

Verified headless: mc-replay 19/0 (unit_healed_serde), mc-turn 289/0
(healing_buffers_unit_heal_event_with_applied_amount +
healing_buffers_clamped_amount_near_full_hp + event_collector_wiring).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 06:12:07 -04:00
Natalie
d49993e3dd test(@projects/@magic-civilization): 🚦 Rail-1 verify gate — no game-data transform logic in GDScript
Add tools/check-no-gdscript-sim-logic.py and wire it as verify step 18 (TOTAL
20→21). Fails if presentation GDScript (src/game/engine/src/**/*.gd) re-introduces
catalog yield aggregation (`yield_production += …`) or hand-built spec dicts
(`"yield_production": …`) — the exact drift class just moved to Rust. Verified to
flag the pre-7e2baa25d aggregation and pass clean on the current tree. Logic
belongs in the mc-* crates, reached via the GDExtension bridge (Rail 1).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 23:55:39 -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
0c2d7c6d4a feat(@projects/@magic-civilization): colour-SoT coverage gate locks in the migration (p2-87)
Add tools/check-ui-color-sources.py: fails if a hardcoded numeric Color()/Color8()
is applied to a widget in a scene (add_theme_*_override / StyleBox *_color).
Allows computed Color(accent.r,…), transparent, named constants, and var-init
fallbacks; excludes scenes/tests + the 3 precursor deletion files. Passes clean
on live scenes (exit 0). Wired into ./run verify as step 17 so a hardcoded
colour can't creep back in.

Capstone for the override→inheritance / single-colour-system work: colours in
live scenes now provably come from the design-token source.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 10:27:56 -05:00
Natalie
c88e136469 fix(@projects): 🐛 update deployment and guide workflows
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-10 03:38:03 -07:00
autocommit
0f24c80f1b perf(player-api): Add systemd slice integration to enforce CPU/memory limits for player API workers during RL training
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:13 -07:00
Natalie
4bcae0a13f 🔥 remove combat & audio components
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-28 17:39:46 -04:00
Natalie
89784e2331 feat(@projects/@magic-civilization): add audio pipeline script
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-28 16:47:13 -04:00
Natalie
91ee619f25 feat(@projects/@magic-civilization): add hex terrain palette system
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-26 21:08:49 -07:00
Natalie
2fd9eced63 feat(@projects/@magic-civilization): add combat system components
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-26 16:08:21 -07:00
Natalie
2e6b0fdefe feat(@projects/@magic-civilization): add designs server subcommand
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-26 15:11:35 -07:00
Natalie
f775c02c36 fix(@projects/@magic-civilization): 🐛 restore weather/climate telemetry exports
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 23:50:11 -07:00
Natalie
98402e156e feat(@projects): add climate and ecology systems
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 23:19:41 -07:00
autocommit
ceb0212bdd chore(scripts): 🔧 Refactor execution script with environment validation and flow improvements
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 19:53:47 -07:00
Natalie
43674e5bcb feat(@projects/@magic-civilization): enhance empire economy & ai integration
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 16:56:13 -07:00
Natalie
d871a02f48 feat(@projects/@magic-civilization): enhance deployment bake scenarios
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 16:31:20 -07:00
Natalie
c6bcc5ba91 feat(@projects/@magic-civilization): add guide deployment and resource paths
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 15:36:01 -07:00
Natalie
3d9d385615 feat(@projects/@magic-civilization): enable multi-episode guide deployment
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 14:54:14 -07:00
Natalie
2d9554d9ff feat(@projects): update wasm build and guide deployment workflows
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 13:06:14 -07:00
Natalie
abca92f48c feat(@projects): add multi-map preset support
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 12:56:07 -07:00
Natalie
194fde9718 feat(@projects/@magic-civilization): add autoplay smoke test integration
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 12:51:03 -07:00
Natalie
ad4fb44390 fix(@projects/@magic-civilization): 🐛 update forgejo runner installation logic
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 12:35:54 -07:00
Natalie
3ee2b60b11 feat(@projects/@magic-civilization): add gpu rollout parity tests & performance benchmarks
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 12:30:50 -07:00
Natalie
b70a396f14 feat(@projects/@magic-civilization): implement gpu-mcts rollouts
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 12:25:47 -07:00
Natalie
819f33ed38 feat(@projects/@magic-civilization): add runner script support
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 12:20:43 -07:00
Natalie
d3a63abe90 feat(@projects): add env config files
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 12:15:40 -07:00
Natalie
6cd36704f7 feat(@projects/@magic-civilization): add audio & sprite rendering capabilities
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 12:00:30 -07:00
Natalie
33b52e078b feat(@projects/@magic-civilization): mark localization audit as complete
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 11:55:27 -07:00
Natalie
955a66c832 feat(@projects/@magic-civilization): add tutorial and victory/defeat menus
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 02:31:21 -07:00
Natalie
5172894326 feat(@projects/@magic-civilization): update strategic-resource-gate objective status
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 02:00:42 -07:00
Natalie
1753a39cd1 feat(@projects): add remote execution and screenshot support
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 01:15:00 -07:00
Natalie
959576c58c feat(@projects/@magic-civilization): update objective completion statuses
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 01:09:55 -07:00
Natalie
38c5305787 feat(@projects/@magic-civilization): update objective completion statuses
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 01:04:52 -07:00
Natalie
36db3a2d5e feat(@projects/@magic-civilization): add oos objectives and test vectors
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 00:29:27 -07:00
Natalie
e6a2a067aa feat(@projects/@magic-civilization): add objectives dashboard tracking
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-17 00:19:20 -07:00
Natalie
f8533b6481 fix(@projects/magic-civilization): 🐛 update build paths to use .local/build
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-16 18:11:20 -07:00
Natalie
9bf2e4d1b1 feat(@projects/@magic-civilization): implement turn-based simulation engine
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-16 17:51:27 -07:00
autocommit
0bbb4df2ed feat(run): Add autoplay command for single-seed game execution and report generation
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-15 07:37:00 -07:00
Natalie
629fd05c67 fix(macos): Fix GDExtension loading and class_name resolution for fresh macOS checkouts
- Add scripts/dev-setup/osx.sh for one-command macOS dev environment setup
- Add .godot/extension_list.cfg creation to enable GDExtension discovery
- Fix .gdextension to include macos.debug and macos.arm64 library entries
- Replace bare class_name self-references (e.g. BiomeModel.new()) with new()
  in static methods — fixes compilation on cold boots without import cache
- Replace bare class_name type annotations (GameMap, Unit) with RefCounted/Variant
  in pathfinder.gd, ai_turn_bridge.gd, simple_heuristic_ai.gd, rust_fauna_bridge.gd
- Add headless boot check (step 7) to ./run verify pipeline
- Add offscreen screenshot tool via SubViewport
- Wire ./run setup to dispatch to platform-specific scripts
- Source ~/.cargo/env in common.sh for Rust toolchain discovery
- Allow clippy::result_large_err in api-gdext (godot-rust macro generates large Results)
- Update .npmrc registry from Verdaccio to Forgejo and regenerate pnpm-lock.yaml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 12:55:33 -07:00
autocommit
d87998f93f wip: travel backup — arena fixes, happiness system, items, spells 2026-04-12 11:24:17 -07:00