[High] [Task] Bug Audit Summary — 14 issues found across all systems #372

Closed
opened 2026-06-10 20:11:08 +02:00 by Anexim · 3 comments
Owner

Bug Audit Complete

A comprehensive parallel scan of the entire codebase was performed, analyzing:

  • Combat & damage calculation
  • Crafting & enchanting system
  • Mana, discipline & prestige stores
  • Game store, tick pipeline & UI
  • Guardian, pact & golemancy systems

Issues Created

Critical (3)

  • #352 Golem combat wipes all mana when no enemies alive
  • #353 Preparation mana never deducted — infinite mana exploit
  • #354 unlockAttunement crashes with ReferenceError

High (8)

  • #355 Fabricator attunement permanently ununlockable
  • #356 Victory condition unreachable — game-over fires first
  • #357 quickStart prestige upgrade does nothing
  • #358 spendRawMana/spendElementMana accept negative amounts
  • #359 Crystal conversion sand cost halved (duplicate key)
  • #360 4+ pacts produce negative damage/insight multiplier
  • #361 PactCost/signingCost mismatch for procedural guardians

Medium (6)

  • #362 Enchanting tick pipeline race condition
  • #363 Recovery room regen delta can be negative
  • #364 UI reads crafting data from wrong store
  • #365 Procedural guardians missing shield/barrier/healthRegen
  • #367 Design slot 2 bypasses ENCHANT_MASTERY requirement
  • #370 Cancelling pact ritual doesn't refund mana
  • #371 Spire enemy armor/barrier non-deterministic

Key Patterns Found

  1. Resource management: Multiple places where resources are validated but not deducted (preparation), or where negative values create exploits (spendMana)
  2. State consistency: Tick pipeline sometimes uses live store instead of snapshot; UI reads from wrong store
  3. Missing data: Procedural guardians missing defensive stats; prestige upgrade using wrong key name
  4. Edge cases: Victory condition unreachable; circular dependencies; deep recursion in descent
## Bug Audit Complete A comprehensive parallel scan of the entire codebase was performed, analyzing: - Combat & damage calculation - Crafting & enchanting system - Mana, discipline & prestige stores - Game store, tick pipeline & UI - Guardian, pact & golemancy systems ## Issues Created ### Critical (3) - [#352](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/352) Golem combat wipes all mana when no enemies alive - [#353](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/353) Preparation mana never deducted — infinite mana exploit - [#354](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/354) unlockAttunement crashes with ReferenceError ### High (8) - [#355](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/355) Fabricator attunement permanently ununlockable - [#356](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/356) Victory condition unreachable — game-over fires first - [#357](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/357) quickStart prestige upgrade does nothing - [#358](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/358) spendRawMana/spendElementMana accept negative amounts - [#359](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/359) Crystal conversion sand cost halved (duplicate key) - [#360](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/360) 4+ pacts produce negative damage/insight multiplier - [#361](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/361) PactCost/signingCost mismatch for procedural guardians ### Medium (6) - [#362](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/362) Enchanting tick pipeline race condition - [#363](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/363) Recovery room regen delta can be negative - [#364](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/364) UI reads crafting data from wrong store - [#365](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/365) Procedural guardians missing shield/barrier/healthRegen - [#367](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/367) Design slot 2 bypasses ENCHANT_MASTERY requirement - [#370](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/370) Cancelling pact ritual doesn't refund mana - [#371](https://gitea.tailf367e3.ts.net/Anexim/Mana-Loop/issues/371) Spire enemy armor/barrier non-deterministic ## Key Patterns Found 1. **Resource management**: Multiple places where resources are validated but not deducted (preparation), or where negative values create exploits (spendMana) 2. **State consistency**: Tick pipeline sometimes uses live store instead of snapshot; UI reads from wrong store 3. **Missing data**: Procedural guardians missing defensive stats; prestige upgrade using wrong key name 4. **Edge cases**: Victory condition unreachable; circular dependencies; deep recursion in descent
Anexim added the ai:todo label 2026-06-10 20:11:08 +02:00
n8n-gitea was assigned by Anexim 2026-06-10 20:11:08 +02:00
Author
Owner

Progress update: 7 of 14 issues completed. Fixed: #358 (negative mana exploit), #357 (quickStart), #359 (crystal conversion), #356 (victory condition), #355 (fabricator unlock), #360 (negative pact multiplier), #361 (pact cost mismatch). Remaining: #351 (discipline auto-pause), #371 (Math.random), #370 (pact refund), #367 (design slot 2), #366 (design state lost), #365 (procedural guardian fields), #364 (UI wrong store), #363 (recovery regen), #362 (enchanting tick race), #369 (duplicate log), #368 (long names).

Progress update: 7 of 14 issues completed. Fixed: #358 (negative mana exploit), #357 (quickStart), #359 (crystal conversion), #356 (victory condition), #355 (fabricator unlock), #360 (negative pact multiplier), #361 (pact cost mismatch). Remaining: #351 (discipline auto-pause), #371 (Math.random), #370 (pact refund), #367 (design slot 2), #366 (design state lost), #365 (procedural guardian fields), #364 (UI wrong store), #363 (recovery regen), #362 (enchanting tick race), #369 (duplicate log), #368 (long names).
Anexim added ai:in-progress and removed ai:todo labels 2026-06-11 09:43:13 +02:00
Author
Owner

Starting work on remaining 7 medium-priority bugs from the audit. Will fix in parallel batches.

Starting work on remaining 7 medium-priority bugs from the audit. Will fix in parallel batches.
Anexim added ai:done and removed ai:in-progress labels 2026-06-11 11:38:04 +02:00
Author
Owner

All 7 medium-priority bugs from the audit have been fixed and pushed to master. All 1158 tests pass.

Fixed:

  • #371: Spire enemy armor/barrier now use seeded PRNG instead of Math.random()
  • #370: cancelPactRitual now refunds the guardian pactCost mana
  • #367: Design slot 2 in crafting store now checks ENCHANT_MASTERY special
  • #364: useGameDerived now reads equipmentInstances/equippedInstances from useCraftingStore
  • #363: Recovery room regen delta clamped to 0 (no more negative mana)
  • #365: All procedural guardian tiers (4-8) now include shield, barrier, healthRegen fields
  • #362: Enchanting tick pipeline refactored to return writes instead of calling store directly

Also extracted procedural guardian generators into guardian-procedural.ts to stay under 400-line file limit.

All 7 medium-priority bugs from the audit have been fixed and pushed to master. All 1158 tests pass. Fixed: - #371: Spire enemy armor/barrier now use seeded PRNG instead of Math.random() - #370: cancelPactRitual now refunds the guardian pactCost mana - #367: Design slot 2 in crafting store now checks ENCHANT_MASTERY special - #364: useGameDerived now reads equipmentInstances/equippedInstances from useCraftingStore - #363: Recovery room regen delta clamped to 0 (no more negative mana) - #365: All procedural guardian tiers (4-8) now include shield, barrier, healthRegen fields - #362: Enchanting tick pipeline refactored to return writes instead of calling store directly Also extracted procedural guardian generators into guardian-procedural.ts to stay under 400-line file limit.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#372