[High] [Bug] Spire climbing: ascent seed missing runId, recovery room 10× regen not implemented, missing activity logs #332

Closed
opened 2026-06-08 16:02:47 +02:00 by Anexim · 3 comments
Owner

Spec: docs/specs/spire-climbing-spec.md

Discrepancies found:

DISC-1 [HIGH] — Ascent seed missing + runId for new floors

  • Spec §4.2: seed = floor × 12345 + runId
  • Code (combat-descent-actions.ts:109): Ascending path uses newFloor * 12345 (missing + runId)
  • Impact: Room counts differ between ascent and descent for the same floor. Descent path correctly uses newFloor * 12345 + s.runId
  • Fix: Add + runId to ascent seed: getRoomsForFloor(newFloor, newFloor * 12345 + s.runId)

DISC-14 [HIGH] — Recovery room 10× mana regen/conversion not implemented

  • Spec §4.8: "While in the recovery room, the player receives a 10× multiplier to mana regeneration rate and mana conversion efficiency"
  • Code (non-combat-room-actions.ts:133-140): Recovery room tick only tracks progress — does not apply any 10× multiplier
  • Fix: Apply 10× multiplier to mana regen and conversion rates while in recovery room

DISC-19 [MEDIUM] — Library room discipline selection may include locked disciplines

  • Spec §4.10: "Target discipline is chosen randomly from all unlocked disciplines"
  • Code (non-combat-room-actions.ts:107-109): Picks from disciplineStore.disciplines without filtering by unlocked status
  • Fix: Filter discipline selection to only include unlocked disciplines

DISC-29 [MEDIUM] — libraryStayed/recoveryStayed on room object instead of top-level state

  • Spec §6: Lists these as top-level state fields
  • Code (combat-state.types.ts): These fields live on currentRoom object, not top-level state
  • Fix: Either update spec to match code architecture, or move fields to top-level state

DISC-34 [MEDIUM] — Missing "Exited the Spire" activity log

  • Spec §5: "Exited the Spire"
  • Code (combatStore.ts:155-173): exitSpireMode does not log any activity entry
  • Fix: Add activity log entry on spire exit

DISC-15/DISC-18/DISC-21 [MEDIUM] — Missing non-combat room completion logs

  • Recovery room: missing "Recovery complete — mana regen and conversion boosted"
  • Treasure room: missing "Treasure room looted — {count} items recovered"
  • Library room: missing "Library study complete"
  • Fix: Add missing activity log entries

DISC-22 [MEDIUM] — Puzzle room log format mismatches

  • Entry log: code uses "(Enchanter's Trial)" but spec says " — Enchanter's Trial"
  • Solved log: code says "Puzzle solved on Floor N!" but spec says just "Puzzle solved!"
  • Fix: Update log messages to match spec format

DISC-23 [MEDIUM] — Puzzle room hardcoded MAX_LEVEL

  • Code (non-combat-room-actions.ts:79): const MAX_LEVEL = 10 (hardcoded)
  • Spec §4.11: Should use getMaxAttunementLevel()
  • Fix: Replace hardcoded value with function call
**Spec:** `docs/specs/spire-climbing-spec.md` **Discrepancies found:** ### DISC-1 [HIGH] — Ascent seed missing `+ runId` for new floors - **Spec §4.2:** `seed = floor × 12345 + runId` - **Code (`combat-descent-actions.ts:109`):** Ascending path uses `newFloor * 12345` (missing `+ runId`) - **Impact:** Room counts differ between ascent and descent for the same floor. Descent path correctly uses `newFloor * 12345 + s.runId` - **Fix:** Add `+ runId` to ascent seed: `getRoomsForFloor(newFloor, newFloor * 12345 + s.runId)` ### DISC-14 [HIGH] — Recovery room 10× mana regen/conversion not implemented - **Spec §4.8:** "While in the recovery room, the player receives a 10× multiplier to mana regeneration rate and mana conversion efficiency" - **Code (`non-combat-room-actions.ts:133-140`):** Recovery room tick only tracks progress — does **not** apply any 10× multiplier - **Fix:** Apply 10× multiplier to mana regen and conversion rates while in recovery room ### DISC-19 [MEDIUM] — Library room discipline selection may include locked disciplines - **Spec §4.10:** "Target discipline is chosen randomly from all unlocked disciplines" - **Code (`non-combat-room-actions.ts:107-109`):** Picks from `disciplineStore.disciplines` without filtering by unlocked status - **Fix:** Filter discipline selection to only include unlocked disciplines ### DISC-29 [MEDIUM] — `libraryStayed`/`recoveryStayed` on room object instead of top-level state - **Spec §6:** Lists these as top-level state fields - **Code (`combat-state.types.ts`):** These fields live on `currentRoom` object, not top-level state - **Fix:** Either update spec to match code architecture, or move fields to top-level state ### DISC-34 [MEDIUM] — Missing "Exited the Spire" activity log - **Spec §5:** `"Exited the Spire"` - **Code (`combatStore.ts:155-173`):** `exitSpireMode` does **not** log any activity entry - **Fix:** Add activity log entry on spire exit ### DISC-15/DISC-18/DISC-21 [MEDIUM] — Missing non-combat room completion logs - Recovery room: missing "Recovery complete — mana regen and conversion boosted" - Treasure room: missing "Treasure room looted — {count} items recovered" - Library room: missing "Library study complete" - **Fix:** Add missing activity log entries ### DISC-22 [MEDIUM] — Puzzle room log format mismatches - Entry log: code uses `"(Enchanter's Trial)"` but spec says `" — Enchanter's Trial"` - Solved log: code says "Puzzle solved on Floor N!" but spec says just "Puzzle solved!" - **Fix:** Update log messages to match spec format ### DISC-23 [MEDIUM] — Puzzle room hardcoded MAX_LEVEL - **Code (`non-combat-room-actions.ts:79`):** `const MAX_LEVEL = 10` (hardcoded) - **Spec §4.11:** Should use `getMaxAttunementLevel()` - **Fix:** Replace hardcoded value with function call
Anexim added the ai:todo label 2026-06-08 16:02:47 +02:00
n8n-gitea was assigned by Anexim 2026-06-08 16:02:47 +02:00
Anexim added ai:in-progress and removed ai:todo labels 2026-06-08 20:27:32 +02:00
Author
Owner

Starting work on spire climbing spec discrepancies. Will fix in order: DISC-1 (ascent seed), DISC-14 (recovery room 10× regen), DISC-19 (library locked disciplines), DISC-29 (state placement), DISC-34 (exit spire log), DISC-15/18/21 (missing room logs), DISC-22 (puzzle log format), DISC-23 (hardcoded MAX_LEVEL).

Starting work on spire climbing spec discrepancies. Will fix in order: DISC-1 (ascent seed), DISC-14 (recovery room 10× regen), DISC-19 (library locked disciplines), DISC-29 (state placement), DISC-34 (exit spire log), DISC-15/18/21 (missing room logs), DISC-22 (puzzle log format), DISC-23 (hardcoded MAX_LEVEL).
Author
Owner

All 8 spec discrepancies fixed:

  1. DISC-1 [HIGH] — Fixed ascent seed in combat-descent-actions.ts: added + s.runId so ascent uses newFloor * 12345 + s.runId (matching descent path)
  2. DISC-14 [HIGH] — Recovery room 10× regen/conversion multiplier already implemented in gameStore.ts tick pipeline (~line 300). The tick function applies 9× additional regen on top of the 1× base already applied.
  3. DISC-19 [MEDIUM] — Fixed library room discipline selection to filter out paused disciplines: Object.entries(allDisciplines).filter(([, ds]) => ds && !ds.paused)
  4. DISC-29 [MEDIUM] — Updated spec §6 to document that libraryStayed/recoveryStayed live on the currentRoom object rather than top-level state
  5. DISC-34 [MEDIUM] — Added "Exited the Spire" activity log in exitSpireMode() via get().addActivityLog('floor_transition', 'Exited the Spire') called after set() to avoid nested setState
  6. DISC-15/18/21 [MEDIUM] — Added missing completion logs:
    • Recovery: "Recovery complete — mana regen and conversion boosted"
    • Library: "Library study complete"
    • Treasure: "Treasure room looted — {count} items recovered"
  7. DISC-22 [MEDIUM] — Fixed puzzle room log format:
    • Entry: Changed from "(Enchanter's Trial)" to " — Enchanter's Trial"
    • Solved: Changed from "Puzzle solved on Floor ${s.currentFloor}!" to "Puzzle solved!"
  8. DISC-23 [MEDIUM] — Replaced hardcoded MAX_LEVEL = 10 with imported MAX_ATTUNEMENT_LEVEL from ../data/attunements in puzzle room attunement reduction calculation

Files modified:

  • src/lib/game/stores/combat-descent-actions.ts (DISC-1)
  • src/lib/game/stores/combatStore.ts (DISC-34)
  • src/lib/game/stores/non-combat-room-actions.ts (DISC-19, DISC-22, DISC-23, DISC-15/18/21)
  • docs/specs/spire-climbing-spec.md (DISC-29)

All 58 test files (1069 tests) pass.

All 8 spec discrepancies fixed: 1. **DISC-1 [HIGH]** ✅ — Fixed ascent seed in `combat-descent-actions.ts`: added `+ s.runId` so ascent uses `newFloor * 12345 + s.runId` (matching descent path) 2. **DISC-14 [HIGH]** ✅ — Recovery room 10× regen/conversion multiplier already implemented in `gameStore.ts` tick pipeline (~line 300). The tick function applies 9× additional regen on top of the 1× base already applied. 3. **DISC-19 [MEDIUM]** ✅ — Fixed library room discipline selection to filter out paused disciplines: `Object.entries(allDisciplines).filter(([, ds]) => ds && !ds.paused)` 4. **DISC-29 [MEDIUM]** ✅ — Updated spec §6 to document that `libraryStayed`/`recoveryStayed` live on the `currentRoom` object rather than top-level state 5. **DISC-34 [MEDIUM]** ✅ — Added `"Exited the Spire"` activity log in `exitSpireMode()` via `get().addActivityLog('floor_transition', 'Exited the Spire')` called after `set()` to avoid nested setState 6. **DISC-15/18/21 [MEDIUM]** ✅ — Added missing completion logs: - Recovery: `"Recovery complete — mana regen and conversion boosted"` - Library: `"Library study complete"` - Treasure: `"Treasure room looted — {count} items recovered"` 7. **DISC-22 [MEDIUM]** ✅ — Fixed puzzle room log format: - Entry: Changed from `"(Enchanter's Trial)"` to `" — Enchanter's Trial"` - Solved: Changed from `"Puzzle solved on Floor ${s.currentFloor}!"` to `"Puzzle solved!"` 8. **DISC-23 [MEDIUM]** ✅ — Replaced hardcoded `MAX_LEVEL = 10` with imported `MAX_ATTUNEMENT_LEVEL` from `../data/attunements` in puzzle room attunement reduction calculation Files modified: - `src/lib/game/stores/combat-descent-actions.ts` (DISC-1) - `src/lib/game/stores/combatStore.ts` (DISC-34) - `src/lib/game/stores/non-combat-room-actions.ts` (DISC-19, DISC-22, DISC-23, DISC-15/18/21) - `docs/specs/spire-climbing-spec.md` (DISC-29) All 58 test files (1069 tests) pass.
Anexim added ai:done and removed ai:in-progress labels 2026-06-08 20:36:16 +02:00
Author
Owner

All 8 discrepancies resolved. See previous comment for full details.

All 8 discrepancies resolved. See previous comment for full details.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#332