magicciv/scripts
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
..
autoplay fix(@projects): 🐛 update deployment and guide workflows 2026-06-10 03:38:03 -07:00
dev-setup fix(@projects): 🐛 update deployment and guide workflows 2026-06-10 03:38:03 -07:00
lan fix(@projects): 🐛 update deployment and guide workflows 2026-06-10 03:38:03 -07:00
run feat(sim): land sim_scenario declarative harness + scenarios for headless Game 1 proof gate 2026-06-28 14:24:38 -04:00
apricot-async-smoke.sh feat(@projects/@magic-civilization): add async smoke test script 2026-05-05 14:12:23 -04:00
apricot-run.sh fix(@projects): 🐛 update deployment and guide workflows 2026-06-10 03:38:03 -07:00
claude-demo-25turn.sh feat(@projects/@magic-civilization): add rl-self-play harness and Claude player integration 2026-05-17 03:51:07 -07:00
claude-smoke-5endturn.sh feat(@projects/@magic-civilization): add rl-self-play harness and Claude player integration 2026-05-17 03:51:07 -07:00
cloud-bringup.sh fix(infra): make the DO fleet actually work on real hardware + render host 2026-06-27 12:45:29 -04:00
godot-docker.sh feat(@projects): add docker container wrapper for godot 2026-05-25 14:06:52 -07:00
mc-ai-docker.sh scripts(ai-docker): 🔨 Update Docker configuration for AI simulator with GPU support, environment variables, and runtime optimizations 2026-05-26 13:02:45 -07:00
p1-56-civics-proof.sh feat(@projects/@magic-civilization): add weston-based civics proof script 2026-05-14 19:44:00 -07:00
p2-60-lens-proof.sh feat(@projects/@magic-civilization): add lens proof rendering script 2026-05-14 18:12:38 -07:00
p2-72-option-b-render.sh feat(@projects/@magic-civilization): add rl-self-play harness and Claude player integration 2026-05-17 03:51:07 -07:00
player-api-example.py feat(@projects/@magic-civilization): rename claude-player to player-api refactor 2026-05-17 03:43:32 -07:00
player-api-server.sh feat(@projects/@magic-civilization): add terraforming cascade design and fauna updates 2026-06-09 19:51:48 -07:00
README.md feat(@projects/@magic-civilization): add staging export pipeline 2026-04-17 23:24:54 -07:00
regression_tests_status.sh feat(@projects/@magic-civilization): finalize economy integration 2026-04-17 02:16:11 -07:00
render-driver-server.sh feat(@projects/@magic-civilization): claude-player-mcp rendered tools — magic_civ_screenshot / open_screen (p2-86 phase 2) 2026-06-18 21:09:10 -05:00
rl-train.sh chore(rl-train): 🔧 Update RL training script with new environment variables and execution flow for dynamic environment selection and training modes 2026-05-26 02:21:14 -07:00
team_members.sh feat(@projects/@magic-civilization): finalize economy integration 2026-04-17 02:16:11 -07:00
ui-proof-capture.sh scripts(scripts): 🔨 Add UI proof capture script for screenshot generation and visual regression testing 2026-06-04 18:19:11 -07:00

scripts/ — repo automation

Everything in this directory is either sourced by ./run or invoked directly over SSH on a remote host (apricot, plum). Every *.sh is idempotent and safe to re-run.

Layout

scripts/
  run/              — ./run <cmd> dispatch modules; one file per concern
    common.sh       — colors, dotenv loader, $GAME_DIR/$SIMULATOR_DIR/$GUIDE_DIR
    build.sh        — cmd_build, cmd_build_wasm, cmd_build_gdext, cmd_build_info
    build-info.sh   — git-state → src/game/build_info.json generator
    dev.sh          — lint/format/test/verify/autoplay subcommands
    export.sh       — Godot export one-target dispatch
    remote.sh       — install:/start:/stop:/smoke: over SSH
    tools.sh        — setup + spritegen + misc one-offs
  dev-setup/        — one-shot env bootstrap scripts, per-OS
    osx.sh          — macOS (Homebrew + Godot + Rust + --with-runner)
    linux.sh        — generic Linux (dnf/apt + Rust + --with-runner)
    bluefin.sh      — rpm-ostree Bluefin layer (weston, vulkan-tools)
    lib/            — helpers shared across the per-OS scripts
      runner.sh     — forgejo-runner install/register/verify
  autoplay/         — runs ON a linux host (apricot) for headless batches
    run_ap3.sh      — weston-headless flatpak Godot invocation
    run_seeded.sh   — single-seed AUTO_PLAY wrapper
    test_save_resume.sh — save-at-T50 → resume → compare test harness

Conventions

  • Functions prefixed with _ are private helpers scoped to one file. Functions without the prefix are callable from other modules.
  • cmd_<verb>_<target> functions are dispatched by ./run via name-matching — ./run verb:target runs cmd_verb_target. No need to edit the top-level run case block to add a new subcommand.
  • Direct execution works too — every scripts/run/*.sh and scripts/dev-setup/*.sh has a working shebang and if [[ "${BASH_SOURCE[0]}" == "$0" ]] guard where relevant.
  • Remote scripts under autoplay/ are meant to be SSH-invoked from the EDIT host (typically plum) running on the RUN host (typically apricot). Never invoke them on the EDIT host directly.
  • Env files.env (tracked base) → .env.local (user secrets, gitignored) → .env.<mode>.env.<mode>.local. Loaded automatically by common.sh at source time. See .env.example for documented keys.

Export staging (p2-06)

tools/export-single.sh rsyncs the project to .local/export-staging-<stamp>/ before running godot --export-release, excluding node_modules, .local, target, .git, and dist. Godot's export scanner walks the whole project tree pre-exclude_filter; the pnpm-managed public/games/*/guide/node_modules/ symlinks made macOS exports take 20+ minutes (16MB of _scan_new_dir warnings). Staging drops that to under 10s of scan time.

  • Default: on for macos, off elsewhere.
  • Force on: EXPORT_STAGED=1 ./run export:linux.
  • Debug staging: KEEP_STAGING=1 ./run export:macos leaves the staged copy in place for inspection.