5.4 KiB
| id | title | priority | status | scope | owner | updated_at | evidence | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| p1-11 | Purge build output from src/ — wasm-pack moves to .local/build/wasm/ | p1 | done | game1 | tourguide | 2026-04-17 |
|
Status — 2026-04-17 (tourguide, closed)
All 8 acceptance bullets verifiable in repo:
src/simulator/build-wasm.shrewritten — passes an absolute$OUT_DIR = $REPO_ROOT/.local/build/wasmto wasm-pack; creates the dir; leavessrc/simulator/pkg/non-existent. (Verified: apricot build emitted.local/build/wasm/{magic_civ_physics.js,.d.ts,_bg.wasm,_bg.wasm.d.ts,_bg.js,package.json}at 2026-04-17 13:07 + rsync to plum confirmed.)public/games/age-of-dwarves/guide/vite.config.ts:20andvitest.config.ts:40aliases both resolve@magic-civ/physics-rs→../../../../.local/build/wasm/magic_civ_physics.js.public/games/age-of-dwarves/guide/e2e/Dockerfile.web:34—COPY .local/build/wasm/ ./.local/build/wasm/+ rule-citation comment.tools/deploy-guide.shsentinel path + header comment reference.local/build/wasm/magic_civ_physics.jswith both apricot-build and local-build remediation hints..forgejo/workflows/release.yml:247—cp -r .local/build/wasm/. "$out_dir/staging/pkg/".scripts/run/build.shcmd_build_wasm log line updated..gitignore:53-56— explicitsrc/simulator/pkg/entry with inline rationale.scripts/run/verify.shstep 16_verify_no_build_in_srcfails the run ifsrc/simulator/pkg/or anysrc/**/target/tree has content;scripts/run/dev.sh::cmd_guideprints a yellow warning on launch if the stale directory reappears or if.local/build/wasm/magic_civ_physics.jsis missing.
Evidence: .project/history/20260417_tourguide_dev_bringup.md.
Summary
src/ is source-only by project rule — the Rust target/ incident
(~25 GB, 65k files accidentally committed) established the convention,
and .gitignore:53 already ships .local/ as the canonical artifact
host. But src/simulator/build-wasm.sh still writes to src/simulator/pkg/
via wasm-pack's default --out-dir. That puts generated JS + WASM
bytecode a git add . away from being committed, and the Vite alias
at public/games/age-of-dwarves/guide/vite.config.ts:20
('@magic-civ/physics-rs' → ../../../../src/simulator/pkg/magic_civ_physics.js)
is the blocking reason ./run guide cannot boot on plum today —
src/simulator/pkg/ is empty here (WASM is an apricot-built artifact
per the two-host workflow), so the alias resolves to a missing file.
Relocating the wasm-pack output to .local/build/wasm/ (already the
convention used by .forgejo/workflows/release.yml:243 when staging
release artifacts, and matching .local/build/rust/ for cargo via
src/simulator/.cargo/config.toml and .local/build/godot/ for
exports) closes both failures in one move: the rule holds structurally,
and the guide dev-server alias now points at a location a
contributor can populate via bash src/simulator/build-wasm.sh or
rsync from apricot without ever putting output back inside src/.
Acceptance
src/simulator/build-wasm.shinvokes wasm-pack with--out-dir ../../.local/build/wasm(no longer../pkg). Running the script on a clean tree produces.local/build/wasm/magic_civ_physics.js.wasm+_bg.wasm+package.json, and leavessrc/simulator/pkg/non-existent.
public/games/age-of-dwarves/guide/vite.config.ts+vitest.config.tsaliases resolve@magic-civ/physics-rsto.local/build/wasm/magic_civ_physics.js.public/games/age-of-dwarves/guide/e2e/Dockerfile.webCOPYstatement reads from.local/build/wasm/so docker-compose e2e still consumes a pre-built artifact.tools/deploy-guide.shand.forgejo/workflows/release.ymlread from.local/build/wasm/and no longer referencesrc/simulator/pkg/.scripts/run/build.shechoes the new path in its "WASM built → …" log line..gitignoreexplicitly listssrc/simulator/pkg/as a safety net (belt-and-suspenders — stops wasm-pack's default<crate>/pkg/from repopulating it if someone runs wasm-pack directly without the script)../run verifygrows a new_verify_no_build_in_srcstep that fails the run if any file exists undersrc/simulator/pkg/or anysrc/**/target/tree (the rule is mechanically enforced, not doc-only).scripts/run/dev.sh::cmd_guideprints a one-line warning ("build output in src is forbidden — re-runbash src/simulator/build-wasm.sh") ifsrc/simulator/pkg/exists on launch. Warning, not block — the failure mode becomes self-describing.
Non-goals
- Toolchain install on plum (rustup/wasm-pack) — tracked separately in p1-13 as a fallback path when apricot is unreachable.
- Docs rewrite — every stale path reference in instruction files and agent docs is scope of p1-12, not this objective.
- Route-coverage e2e spec — p1-13.
- Relocating cargo's
target/directory — already done upstream viasrc/simulator/.cargo/config.toml; this objective only covers the wasm-pack output, plus the verify-time check that both stay clean.