- Removed auto-unlock lines in gameStore.ts element regen loop and recovery room boost loop
- Added unlocked guard to skip locked elements during conversion processing
- Added regression test (bug-377) verifying only transference stays unlocked
Fixes#377
- Modified generateGuardianName() in guardian-encounters.ts to add a cycleOffset (floor/50) that shifts prefix selection for the same elements at different 100-floor ranges
- For multi-element names, also shift the title by cycleOffset to further reduce collision chance
- Added regression test guardian-names-unique.test.ts with 7 test cases covering:
* Previously colliding floors (170/370 crystal, 200/230 exotic convergence, 210/240 astral convergence)
* All static guardian floors (10-240) uniqueness
* All procedural guardian floors (250-490) uniqueness
* Full range (10-490) uniqueness
* Determinism check
* Title format validation
Fixes#376
- Wrap GameOverScreen in ErrorBoundary in page.tsx to prevent blank page on render errors
- Add defensive Number.isFinite checks in GameOverScreen for all numeric props
- Add regression test for day 30 → game-over flow (day30-blank-page.test.ts)
Fixes#375
- playwright.config.ts: change baseURL from dev site to localhost:3000
- combat-happy-path.spec.ts: fix climb button location (LeftPanel, not spire tab), fix descent via store, handle game-over from day overflow, reduce tick counts to avoid day 30 limit
- fabricator-happy-path.spec.ts: set currentAction to meditate before crafting (required by startFabricatorCrafting)
- playtest.spec.ts: rewrite from scratch — use localhost, window.__TEST__ bridge (not window.__debug), current tab names (no grimoire/element tabs), split into 3 files under 400-line limit
- playtest-basic-ui.spec.ts: sections 1-3 (basic UI, stats, spire)
- playtest-tabs.spec.ts: sections 4-11 (all tab navigation tests)
- playtest-debug.spec.ts: sections 12-14 (debug tab, bridge, stress test)
- #371: Replace Math.random() with seeded PRNG in getSpireEnemyArmor/Barrier
- #370: Add mana refund when cancelling pact ritual in cancelPactRitual
- #367: Add ENCHANT_MASTERY check for design slot 2 in crafting store
- #364: Fix useGameDerived to read crafting data from useCraftingStore
- #363: Clamp recovery room regen delta to prevent negative mana loss
- #365: Add shield/barrier/healthRegen fields to all procedural guardians
- #362: Refactor enchanting tick pipeline to return writes instead of direct store calls
Extracted procedural guardian generators into guardian-procedural.ts to stay under 400-line limit.
All 1158 tests pass.
- #354: unlockAttunement now uses _get() instead of undefined 'state' variable
- #353: startPreparing now deducts raw mana from the mana store after validation
- #352: processGolemAttacks/processBasicAttack accept current mana as params instead of initializing to 0/{}
- Updated golem-combat-actions.test.ts to pass new currentRawMana/currentElements params
- Added regression tests for all 3 bugs (16 new tests, all passing)
Issue #346: Added floorHP > 0 guard to primary and equipment spell casting
while loops in combat-actions.ts. Previously spells continued casting and
draining mana after all enemies were dead.
Issue #345 Bug A: Populated equipmentSpellStates from equipped gear in
gameStore.ts combat tick setup using getActiveEquipmentSpells(). Previously
equipment spell enchantments (e.g., spell_manaBolt on casters) never fired
during combat because equipmentSpellStates was always empty.
Issue #345 Bug B: Added deductWeaponEnchantCosts() helper in combat-damage.ts
and wired it into the melee loop in combat-actions.ts. Weapon enchant spells
(fireBlade, frostBlade, lightningBlade, voidBlade) now properly deduct mana
per melee hit instead of providing free elemental bonus damage.
All 1141 tests pass (65 test files), no regressions. Added 5 new regression tests.
Files changed:
- combat-actions.ts: +floorHP>0 guards, weapon enchant cost deduction
- combat-damage.ts: +deductWeaponEnchantCosts() helper
- gameStore.ts: +equipment spell state population from equipped gear
- spell-cast-floorhp-guard.test.ts: new regression test file
Two root causes fixed:
1. gameStore.ts: computeRegen now receives actual attunements instead of empty {}, so rawGrossRegen includes attunement contributions (was ~2/hr, now correct 3000+/hr)
2. gameStore.ts buildConversionParams: use rawManaRegen with level scaling (1.5^(level-1)) instead of conversionRate for per-element grossRegen
3. LeftPanel.tsx: same grossRegen fix + include attunement regen in rawGrossRegen display
4. ElementStatsSection.tsx: same grossRegen fix
5. useGameDerived.ts: pass actual attunements to computeRegen for baseRegen calculation
Added regression test: conversion-pause-bug-regression.test.ts (7 tests)
- Add getTwoHandedBlocker() helper to EquipmentSlotGrid that detects when
mainHand has a two-handed weapon and returns the weapon name
- Render offHand slot with Lock icon + 'Blocked: <weapon name>' label +
reduced opacity when blocked, distinct from normal 'Empty' dashed-border slot
- Add regression test verifying all 4 two-handed types are correctly flagged
and non-two-handed types remain unblocked (11 tests)
- Fix conversion rate level scaling from linear (1+level*0.5) to exponential (1.5^(level-1)) in conversion-rates.ts
- Fix getAttunementLevelMultiplier formula to match spec §4.3
- Add level-up logging in attunementStore.ts via combat store addActivityLog
- Clarify getAttunementConversionRate returns flat base rate (level scaling applied separately)
- Update spec §8 to describe time-based puzzle room system matching code implementation
- Add 17 regression tests verifying exponential scaling, base rate behavior, and spec table values
- Remove Spells tab trigger from TabTriggers in page.tsx
- Remove TabsContent value='spells' block in page.tsx
- Remove lazy import of SpellsTab in page.tsx
- Change default activeTab from 'spells' to 'disciplines'
- Remove SpellsTab re-export from tabs/index.ts
- Remove SpellsTab re-export from game/index.ts
- Delete src/components/game/tabs/SpellsTab.tsx
Spell data (SPELLS_DEF, spells store state) preserved - spells still exist as enchantments.
Bug #293: elementDrain was computed but never subtracted from element pools.
The tick pipeline now applies net regen (produced - drained) instead of
gross production to element pools, matching the spec §8 regen deduction model.
- Fix summonGolemsForRoom to use golemLoadout instead of removed enabledGolems
- Fix discBonus hardcoded to 0 in golem-combat.ts pipeline (now computed from discipline effects)
- Remove deprecated types: SummonedGolem, ActiveGolem, GolemDef
- Remove legacy GolemancyState fields: enabledGolems, summonedGolems, legacyActiveGolems
- Remove orphaned store actions: toggleGolem, setEnabledGolems
- Delete orphaned legacy data files: base-golems.ts, elemental-golems.ts, hybrid-golems.ts
- Update GolemDebugSection to use new golemLoadout system
- Update golemancy-spec.md §17 to reflect all features as complete
- Update all test files to match new type shapes
- All 958 tests passing
The curse debuff was stored on enemies via dot-runtime.ts but the
amplification was never applied to incoming damage. Added curse
magnitude check in applyEnemyDefenses (combat-tick.ts) that multiplies
incoming damage by (1 + magnitude) for each active curse effect.
- Curse amplification applied BEFORE dodge/barrier/armse defenses
- Multiple curse effects stack multiplicatively
- Non-curse effects (burn, freeze, etc.) are ignored for amplification
Also updated spire-combat-spec.md Known Gaps table to reflect:
- Melee defense bypass fixed (issue #285)
- Curse amplification now implemented (issue #286)
Added 9 regression tests in curse-amplification.test.ts.
All 957 tests pass (50 test files).
Bug: Melee sword attacks passed null as the enemy to applyEnemyDefenses,
causing all enemy defenses (armor, barrier, dodge) to be bypassed.
Spell damage and DoT effects correctly went through defenses.
Fix: In combat-actions.ts melee loop, get the current target enemy
from currentRoom.enemies (lowest HP, matching focus-fire targeting)
and pass it to applyEnemyDefenses instead of null.
Added 7 regression tests in melee-defense-bypass.test.ts to verify:
- Melee damage is reduced by armor
- Melee damage is reduced by barrier
- Unarmored enemies take more damage than armored ones
- Full damage dealt when no defenses
- Focus-fire targeting (lowest HP enemy)
- Graceful handling of empty enemy list
- Comparison proving defense application
All 948 tests pass (49 test files).
- Add new golem component types (Core, Frame, MindCircuit, Enchantment)
- Create 4 Core tiers, 7 Frames, 4 Mind Circuits, 8 Enchantments
- Rewrite golem utils for component-based stat computation
- Update GolemancyState with new fields (golemDesigns, golemLoadout, activeGolems)
- Update combat store, actions, and pipelines for new golem system
- Rewrite GolemancyTab with component selection UI
- Update fabricator discipline perks for new system
- Add comprehensive tests for component registries and utilities
- All files under 400 lines, all 743 tests passing
- New files: element-distance.ts, conversion-costs.ts, conversion-rates.ts
- All conversion types (discipline, attunement, pact) use unified formula
- Conversion costs scale exponentially by element tier (10^(d+1) raw, 10*(d+1) per component)
- Costs deducted from regen, not from mana pool
- Auto-pause on insufficient regen with UI warning
- Meditation boosts conversion rates (reduced by distance)
- Attunement levels provide +50% multiplicative bonus per level
- Guardian pacts provide +0.15/hr base rate + invoker level bonus
- Removed convertMana, processConvertAction, craftComposite from manaStore
- Stats tab shows per-element conversion breakdown with formulas
- ManaDisplay shows per-element net regen rates
- All 916 tests pass, all files under 400 lines
- Add applyDamageToRoom() function targeting individual enemies
- Add lowestHPEnemy() helper for focus-fire targeting
- AoE spells distribute damage across all enemies
- Single-target attacks hit lowest HP enemy first
- Refactor processCombatTick spell/equipment/melee/DoT damage to use per-enemy system
- Update golemApplyDamageToRoom in golem-combat pipeline for per-enemy targeting
- Add currentRoom to CombatTickResult and sync through gameStore
- Update combat-actions tests with proper enemy setup for per-enemy tests
- Extract combat-damage.ts module to stay under 400-line limit
- Add calcMeleeDamage() with elemental matchup for enchanted swords
- Add meleeSwordProgress per-instance accumulator to combat state
- Add melee branch in processCombatTick (no mana cost, no Executioner/Berserker)
- Add baseDamage/attackSpeed stats to all 5 sword types
- Wire equippedSwords through gameStore to combat tick pipeline
- 16 new regression tests, all 937 tests pass
- Add ActiveEffect, EffectType types to game.ts; activeEffects + effectiveArmor on EnemyState
- Add SpellOnHitEffect + onHitEffect field to SpellDefinition
- Wire onHitEffect to fire (burn), death (curse), lightning (armor_corrode), frost (freeze), soul (bypassArmor burn)
- Add applyOnHitEffect() — applies on-hit effect on successful spell hit (spec §6.2)
- Add processDoTPhase() — ticks all active effects after weapon/golem attacks (spec §6.3)
- Add bypassArmor/bypassBarrier support in applyEnemyDefenses() (AC-13)
- Export standalone applyEnemyDefenses from combat-tick.ts for DoT pipeline
- Split DoT runtime into separate dot-runtime.ts (135 lines) to keep combat-actions.ts under 400 lines
- Update all enemy generation sites with activeEffects/effectiveArmor defaults
- Fix test helpers for new required fields
All 921 tests pass (45 test files)
- Add ActiveGolem interface and activeGolems to GolemancyState
- Add maxRoomDuration to all 12 golem definitions
- Create golem-combat-actions.ts with pure golem combat logic (summoning, maintenance, attacks, room-duration)
- Create golem-combat.ts pipeline for golem combat setup
- Wire golem maintenance and attacks into processCombatTick
- Wire golem summoning into advanceRoomOrFloor on room entry
- Wire golem room-duration countdown into onFloorCleared callback
- Update combat-actions tests for new processCombatTick signature
- All 921 tests pass, all files under 400-line limit
Closes#259
- Rewrite e2e/fabricator-happy-path.spec.ts from scratch:
craft 8 gear pieces (1 per slot) via Fabricator UI,
equip all via store bridge, verify equipment effects
- Add debugBridge.ts: exposes Zustand stores on window.__TEST__
so Playwright can call store actions via page.evaluate()
- Import debugBridge in page.tsx as side-effect
- Uses Debug tab UI for attunement/element unlocking
- Uses store bridge for discipline XP, mana capacity, materials,
recipe unlocking, and equipment slot assignment
- Test passes in ~3.5 minutes (155s craft time + setup)
- #238: Fix spire tab inconsistent state (Max Floor 1 but Floors Cleared 0) by not inflating maxFloorReached on enterSpireMode and preserving it on exitSpireMode
- #240: Fix guardian armor display stray text by extracting stat formatters in SpireSummaryTab
- #244: Improve discipline auto-pause UX with log messages and visual feedback on DisciplineCard
- #246: Fix raw mana exceeding max cap by recomputing maxMana after discipline XP gains
- #248: Update AGENTS.md (remove gitea_get_project_boards, add gitea_start_session, 22 mana types, 8 stores, updated guardian tiers)
- #248: Update README.md (remove Prisma/SQLite refs, update mana types/guardian tiers/discipline counts)
- #248: Update GAME_BRIEFING.md (8 stores, 22 mana types, 64 disciplines, 8-tier guardians, correct code architecture)
- #236: Fix Climb the Spire React #185 infinite loop - removed redundant set() in processCombatTick that caused double Zustand writes per tick
- #235: Add enchanting design/prepare/apply tick handlers - extracted to pipelines/enchanting-tick.ts
- #235: Fix startApplying not setting currentAction to 'enchant'
- #243: Guard discipline store against undefined activeIds/processedPerks from corrupted persisted state
- #245: Change Plasma symbol from ⚡ (conflicts with Lightning) to 🔴
- #241: Fix combat store maxFloorReached desync - initialize to 0, reset on exitSpireMode
- #239: Fix EffectSelector not rendering when unlockedEffects is empty (fresh game)
- Created pipelines/enchanting-tick.ts to keep gameStore.ts under 400 lines