[Medium] [Task] Golemancy redesign cleanup — remove orphaned legacy code and update docs #290
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The golemancy system redesign (component-based construction: Core + Frame + Mind Circuit + Enchantances) is functionally complete and all runtime code uses the new system. However, there are several orphaned legacy artifacts and documentation inconsistencies that should be cleaned up.
What's Done ✅
cores.ts(4),frames.ts(7),mindCircuits.ts(4),golemEnchantments.ts(8)GolemDesign,ComputedGolemStats,GolemManaCost,GolemUnlockRequirementtypes intypes.tsare completegolem-combat-actions.tsimplements the full component-based combat pipeline (summoning, maintenance, mana regen, attacks, room duration)golemancy-actions.tshandles design CRUD and loadout managementGolemancyTab.tsx,GolemDesignBuilder.tsx,GolemLoadoutPanel.tsx,ActiveGolemsPanel.tsxall use the new component systemSpireCombatControls.tsxalready updated to useactiveGolems+golemDesignsfrom the new systemcombatStore.tsinitial state usesRuntimeActiveGolem[](new type)GolemancyStatetype intypes/game.tsusesactiveGolems: RuntimeActiveGolem[]andgolemDesigns: Record<string, SerializedGolemDesign>GOLEMS_DEF,summonedGolems,golemId, orGolemDefremain in source codegolemancy-data.test.ts,golemancy-combat.test.ts,GolemancyComponents.test.ts,golemancy-utils.test.ts) all test the new systemRemaining Work
1. Remove orphaned
ActiveGolemV2type andcreateActiveGolemutilitysrc/lib/game/data/golems/types.ts—ActiveGolemV2interface (lines ~140-150) is exported but never used at runtime. The runtime usesRuntimeActiveGolemfromtypes/game.ts.src/lib/game/data/golems/utils.ts—createActiveGolem()function returnsActiveGolemV2but is only called in test files, never in production code. ThesummonGolemsOnRoomEntry()function ingolem-combat-actions.tscreatesRuntimeActiveGolemobjects directly.src/lib/game/data/golems/index.ts— exportsActiveGolemV2which is orphaned.ActiveGolemV2fromtypes.tsand its export fromindex.ts. Either removecreateActiveGolem()or update it to returnRuntimeActiveGolemif tests need it.2. Remove orphaned legacy compatibility functions from
utils.tssrc/lib/game/data/golems/utils.ts— Four@deprecatedfunctions exist only for legacy compatibility:getGolemFloorDuration()— returns hardcoded3getGolemDamage()— returns0getGolemAttackSpeed()— returns0getGolemMaintenanceMultiplier()— returns13. Update
fabricator-spec.mdfiles reference tabledocs/specs/attunements/fabricator/fabricator-spec.md(line ~253)src/lib/game/data/golems/ | Golem definitions (10 golems)src/lib/game/data/golems/ | Golem component definitions (4 cores, 7 frames, 4 mind circuits, 8 enchantments)4. Update
spire-combat-spec.md§9 Golemancy Systemdocs/specs/spire-combat-spec.md(lines 413-548)GolemDefinitioninterface with fields likesummonCostType,maintenanceCostType,golemDef,golem.baseDamage,golem.attackSpeed,golem.element,golem.maintenanceCostGolemDefinitioninterface with the newSerializedGolemDesign+RuntimeActiveGolemtypesgolemDesignsand component-based cost calculation5. Update
GAME_BRIEFING.mdGolemancy sectiondocs/GAME_BRIEFING.md(lines ~758-810)6. Update
golemancy-spec.md§19 Files Referencedocs/specs/attunements/fabricator/systems/golemancy-spec.md(last section)docs/specs/spire-combat-spec.md §9says "Authoritative runtime spec (needs update)"Verification Steps
After cleanup:
bun run buildto confirm no compilation errorsbun run testto confirm all tests passgrep -r "GOLEMS_DEF\|summonedGolems\|golemId\|GolemDef\|ActiveGolemV2" src/to confirm no legacy references remainStarting work on the golemancy redesign cleanup. Will work through all 6 items: remove orphaned types/utils, update docs (fabricator-spec, spire-combat-spec, golemancy-spec, GAME_BRIEFING), then verify with build+test+grep.
✅ All 6 cleanup items complete:
ActiveGolemV2type fromtypes.tsand its export fromindex.tscreateActiveGoleminutils.tsto returnRuntimeActiveGolem(the actual runtime type)utils.ts:getGolemFloorDuration,getGolemDamage,getGolemAttackSpeed,getGolemMaintenanceMultiplier— zero callers foundgolemancy-data.test.tsto useRuntimeActiveGolemtype assertionfabricator-spec.mdreference table,spire-combat-spec.md §9(full rewrite to component-based system + Known Gaps table),golemancy-spec.md §19(removed "needs update" note),GAME_BRIEFING.md(replaced old golem types with component-based summary)Verification:
bun run build— compiled successfullybun run test— 52 test files, 1009 tests passedgrep -r "GOLEMS_DEF|summonedGolems|golemId|GolemDef|ActiveGolemV2" src/— only a comment remainsgrep -r "getGolemFloorDuration|getGolemDamage|getGolemAttackSpeed|getGolemMaintenanceMultiplier" src/— zero matches