magicciv/.project/objectives/p1-25-export-script-error-cleanup.md
Natalie 8e3107b92a feat(@projects/@magic-civilization): update tech-tree and mcts service implementation
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-25 22:48:40 -07:00

2.6 KiB

id title priority status scope owner updated_at evidence
p1-25 Eliminate parse-error spam in export logs (Unit dup decl + SaveManager stray) p1 done game1 shipwright 2026-04-25
src/game/engine/scenes/tests/crafting_complete_proof.gd (UnitStub redeclaration removed; values now set in _init() so parent Unit class members aren't shadowed)
tools/export-single.sh (rsync staging now excludes .godot/ to prevent stale-cache races)
apricot:~/Code/@projects/@magic-civilization/src/game/engine/src/map/save_manager.gd (stray duplicate file deleted; identical-bytes copy of src/core/save_manager.gd, both declaring class_name SaveManager)

Summary

Every Linux/Windows export log was emitting two families of parse errors despite producing a working binary:

  1. Class "SaveManager" hides a global script class. — apricot had a stray duplicate src/game/engine/src/map/save_manager.gd (byte-identical to src/core/save_manager.gd, both declaring class_name SaveManager). The Mac source tree was clean; the apricot stray must have come from a prior agent's misplaced rsync. Deleted on apricot 2026-04-25; export logs now register SaveManager exactly once.

  2. The member "type_id" / "hp" / "max_hp" / "movement_remaining" / "position" / "equipped_items" already exists in parent class Unit.engine/scenes/tests/crafting_complete_proof.gd had a class UnitStub: extends Unit block that redeclared 6 fields the parent Unit class already owns. Comment in the file claimed "Unit.gd is a 2-line stub" but Unit.gd evolved past that point. Refactored UnitStub to set those values in _init() instead of redeclaring them.

Both error families surfaced in every export run since shipwright started exporting builds; not a regression introduced today, just never triaged because the export still produced a working binary.

Acceptance

  • bash tools/export-single.sh linux and bash tools/export-single.sh windows log zero SCRIPT ERROR lines for SaveManager or Unit member duplication. Verified p2-06-clean-final-20260425/linux/ + p2-06-final-clean-windows/windows/ (2026-04-25).
  • ✓ Wine smoke against the cleaned Windows export still hits AutoPlay: VICTORY! Player 1 wins via domination on turn 54 — no functional regression. (2026-04-25)
  • tools/export-single.sh staging-rsync now excludes .godot/ to prevent any future stale-cache class-registration races.

Non-goals

  • Fixing the harmless Could not create directory: '/tmp' warning that wine emits at startup (sandboxing artefact, not the game).
  • Fixing the 3 resources still in use at exit warning at the end of every Godot run (unrelated leak in Godot shutdown).