id: 61812f5cc5d54be0af15567677e1c1c3
parent_id: 55b9d8f7f2764c069232aa6dd0be21dc
item_type: 1
item_id: 088737f31c514f1da21cc42c0ab6acc1
item_updated_time: 1785750162267
title_diff: "[]"
body_diff: "[{\"diffs\":[[0,\"echanics\"],[1,\" + Quality\"],[0,\")\\\n\\\n## Su\"]],\"start1\":76,\"start2\":76,\"length1\":16,\"length2\":26},{\"diffs\":[[0,\"em. \"],[-1,\"Currently running as a f\"],[1,\"F\"],[0,\"unct\"]],\"start1\":242,\"start2\":242,\"length1\":32,\"length2\":9},{\"diffs\":[[0,\"y state.\"],[1,\" Quality-checked with 0 clippy warnings.\"],[0,\"\\\n\\\n---\\\n\\\n#\"]],\"start1\":280,\"start2\":280,\"length1\":16,\"length2\":56},{\"diffs\":[[0,\"026-08-0\"],[-1,\"2\"],[1,\"3\"],[0,\")\\\n\\\n### B\"]],\"start1\":353,\"start2\":353,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\"tats\"],[-1,\" uses i64 for all stats, matching design spec\"],[1,\", EnemyStats, CombatStats all use i64\"],[0,\"\\\n- *\"]],\"start1\":961,\"start2\":961,\"length1\":53,\"length2\":45},{\"diffs\":[[0,\"= 5%\"],[-1,\" (per design doc)\"],[0,\"\\\n- *\"]],\"start1\":1207,\"start2\":1207,\"length1\":25,\"length2\":8},{\"diffs\":[[0,\"m**:\"],[-1,\" `known_spells` on Character,\"],[0,\" aut\"]],\"start1\":1227,\"start2\":1227,\"length1\":37,\"length2\":8},{\"diffs\":[[0,\"level 1 \"],[-1,\"spells \"],[0,\"at creat\"]],\"start1\":1243,\"start2\":1243,\"length1\":23,\"length2\":16},{\"diffs\":[[0,\" higher \"],[-1,\"levels \"],[0,\"at Revie\"]],\"start1\":1269,\"start2\":1269,\"length1\":23,\"length2\":16},{\"diffs\":[[0,\"rd (\"],[-1,\"costs gold\"],[1,\"gold cost\"],[0,\"), a\"]],\"start1\":1290,\"start2\":1290,\"length1\":18,\"length2\":17},{\"diffs\":[[0,\"), activate one \"],[-1,\"spell \"],[0,\"for combat, SP d\"]],\"start1\":1303,\"start2\":1303,\"length1\":38,\"length2\":32},{\"diffs\":[[0,\"ight\"],[-1,\"\\\n- **Spell combat integration**: `resolve_combat_fu\"],[1,\". **Mage↔Magician mapping** resolved via `class_for_spe\"],[0,\"ll\"],[1,\"s\"],[0,\"()`\"],[-1,\" applies\"],[1,\"\\\n- **Spell combat integration**:\"],[0,\" dam\"]],\"start1\":1348,\"start2\":1348,\"length1\":72,\"length2\":101},{\"diffs\":[[0,\"al spell\"],[-1,\" effects\"],[1,\"s applied\"],[0,\" during \"]],\"start1\":1455,\"start2\":1455,\"length1\":24,\"length2\":25},{\"diffs\":[[0,\"venture \"],[-1,\"combat\"],[1,\"rounds\"],[0,\"\\\n- **Son\"]],\"start1\":1482,\"start2\":1482,\"length1\":22,\"length2\":22},{\"diffs\":[[0,\"n**:\"],[-1,\" `resolve_combat_with_song()` applies\"],[0,\" bar\"]],\"start1\":1523,\"start2\":1523,\"length1\":45,\"length2\":8},{\"diffs\":[[0,\"/debuffs\"],[1,\" applied in combat\"],[0,\"\\\n- **Sho\"]],\"start1\":1543,\"start2\":1543,\"length1\":16,\"length2\":34},{\"diffs\":[[0,\"**: \"],[-1,\"`always_in_shop` flag (15 basic items), `shop_stock` HashMap, sell adds to\"],[1,\"15 basic items always in stock, sell adds to stock, buy checks gold before\"],[0,\" sto\"]],\"start1\":1586,\"start2\":1586,\"length1\":82,\"length2\":82},{\"diffs\":[[0,\"HP —\"],[-1,\" all\"],[0,\" regen\"],[-1,\"erate over time\"],[1,\" via polling (15s client interval)\"],[0,\"\\\n- *\"]],\"start1\":1728,\"start2\":1728,\"length1\":33,\"length2\":48},{\"diffs\":[[0,\"unds\"],[-1,\" per stat\"],[1,\", costs 1 energy + gold per train\"],[0,\"\\\n- *\"]],\"start1\":1806,\"start2\":1806,\"length1\":17,\"length2\":41},{\"diffs\":[[0,\"**: \"],[-1,\"Full h\"],[1,\"H\"],[0,\"eal \"]],\"start1\":1854,\"start2\":1854,\"length1\":14,\"length2\":9},{\"diffs\":[[0,\"sion\"],[-1,\": Streets → Cellar → Sewers Upper/Deep → Catacombs → Harkyn's Castle → Kylearan's Tower → Mangar's Tower\"],[0,\"\\\n- *\"]],\"start1\":1935,\"start2\":1935,\"length1\":112,\"length2\":8},{\"diffs\":[[0,\"els \"],[-1,\"saved \"],[0,\"as J\"]],\"start1\":2008,\"start2\":2008,\"length1\":14,\"length2\":8},{\"diffs\":[[0,\"- **\"],[-1,\"In-memory state**: No database yet\\\n- **Seeded users**: admin (id=1) + player (id=2)\\\n- **No auth**: No JWT/session system yet\"],[1,\"Domain services**: `services.rs` — `pick_enemy()`, `equipped_attack_type/damage()`, `total_defense()`, `equip/unequip_item()`, `train_stat()` with injectable RNG\\\n- **Seeded users**: admin (id=1) + player (id=2)\\\n- **0 clippy warnings** — all collapsible_if, useless_vec, comparison_to_empty, manual_range_contains fixed\"],[0,\"\\\n\\\n##\"]],\"start1\":2020,\"start2\":2020,\"length1\":132,\"length2\":326},{\"diffs\":[[0,\"y), \"],[-1,\"**\"],[0,\"Spells\"],[-1,\"**\"],[0,\" (ca\"]],\"start1\":2574,\"start2\":2574,\"length1\":18,\"length2\":14},{\"diffs\":[[0,\"vate\"],[-1,\" one spell for combat\"],[0,\"\\\n- *\"]],\"start1\":2737,\"start2\":2737,\"length1\":29,\"length2\":8},{\"diffs\":[[0,\"ored\"],[-1,\" spell points bar on home dashboard\"],[0,\", vi\"]],\"start1\":2820,\"start2\":2820,\"length1\":43,\"length2\":8},{\"diffs\":[[0,\"- **\"],[-1,\"Custom favicon**: SVG shield with sword\\\n- **Dynamic browser title**: `Skara Brae - {page label}`\"],[1,\"Regen polling**: 15s interval refreshes selected character, triggers server-side `apply_regen()`\\\n- **Custom favicon**: SVG shield with sword\\\n- **Dynamic browser title**: `Skara Brae - {page label}`\\\n\\\n### Quality (2026-08-03)\\\n- **3 critical bugs fixed**:\\\n  1. Mage class couldn't cast spells (magician/mage mismatch) — `class_for_spells()` + `is_caster_class()` in spells.rs, client casterClasses updated\\\n  2. Race condition in `run_adventure()` — all post-combat mutations now inside write lock\\\n  3. `buy_item()` decremented stock before gold check — reordered to check gold first\\\n- **18 clippy warnings resolved** (collapsible_if, useless_vec, unused_mut, filter_next, comparison_to_empty, manual_range_contains)\\\n- **Remaining known warnings** (deferred — architecture-level, not bugs):\\\n  - 14 route handlers contain inline business logic (should be extracted to domain)\\\n  - 16 handlers return untyped `Json<serde_json::Value>` instead of typed structs\\\n  - 25+ magic numbers in combat/character code\\\n  - 4 non-injective RNG calls (create_character, resolve_combat_full, 2 in run_adventure)\\\n  - 11 unwrap() calls in route handlers\\\n- **0 tests** — no test infrastructure yet\"],[0,\"\\\n\\\n--\"]],\"start1\":2907,\"start2\":2907,\"length1\":104,\"length2\":1180},{\"diffs\":[[0,\"encies (\"],[1,\"all \"],[0,\"resolved\"]],\"start1\":4113,\"start2\":4113,\"length1\":16,\"length2\":20},{\"diffs\":[[0,\"4) |\"],[-1,\" Now\"],[0,\" i64\"]],\"start1\":4223,\"start2\":4223,\"length1\":12,\"length2\":8},{\"diffs\":[[0,\"for \"],[-1,\"CharacterStats, EnemyStats, CombatStats stats | Fixed\"],[1,\"all stat fields | Done\"],[0,\" |\\\n|\"]],\"start1\":4232,\"start2\":4232,\"length1\":61,\"length2\":30},{\"diffs\":[[0,\"ble \"],[-1,\"— Luck merges Wis+Cha \"],[0,\"|\\\n| \"]],\"start1\":4340,\"start2\":4340,\"length1\":30,\"length2\":8},{\"diffs\":[[0,\"eric, 4 \"],[-1,\"spell\"],[0,\"casters)\"]],\"start1\":4441,\"start2\":4441,\"length1\":21,\"length2\":16},{\"diffs\":[[0,\") | \"],[-1,\"Intentional — m\"],[1,\"M\"],[0,\"atch\"]],\"start1\":4456,\"start2\":4456,\"length1\":23,\"length2\":9},{\"diffs\":[[0,\"d | \"],[-1,\"Fixed\"],[1,\"Done\"],[0,\" |\\\n|\"]],\"start1\":4522,\"start2\":4522,\"length1\":13,\"length2\":12},{\"diffs\":[[0,\"bat \"],[-1,\"integration \"],[0,\"| Do\"]],\"start1\":4575,\"start2\":4575,\"length1\":20,\"length2\":8},{\"diffs\":[[0,\"8 zones \"],[-1,\"matching \"],[0,\"BT1 dung\"]],\"start1\":4609,\"start2\":4609,\"length1\":25,\"length2\":16},{\"diffs\":[[0,\"s | \"],[-1,\"Reorganized\"],[1,\"Done\"],[0,\" |\\\n\\\n\"]],\"start1\":4628,\"start2\":4628,\"length1\":19,\"length2\":12},{\"diffs\":[[0,\"p_fc\"],[-1,\"3f363bf001uzEC631JsnxCIA` on `:8080\"],[1,\"60e7d420013nBqe0Uu5Bnkt5` on `:8080`\\\n- Client: `bgp_fc61a2927001eAzZARzgLYl4TK` on `:5173\"],[0,\"`\\\n\\\n-\"]],\"start1\":4664,\"start2\":4664,\"length1\":43,\"length2\":97},{\"diffs\":[[0,\" zones)\\\n\"],[1,\"\\\n---\\\n\\\n## Next Steps (priority order)\\\n\\\n1. **Leveling system** — XP accumulates but level never increases\\\n2. **Test infrastructure** — at least unit tests for combat, stat_bonus, services\\\n3. **Persistent storage** — swap in-memory state for a database (sb-db crate exists)\\\n4. **PvP combat** — energy-costed, Torn-style screen\\\n5. **Idle auto-combat** — offline progress\\\n6. **Dungeon exploration mode** — using map data\\\n7. **Medals & Honours** — achievement system\\\n8. **Auth** — JWT or session-based\\\n9. **Architecture cleanup** — typed response structs, extract remaining business logic from routes, named constants for magic numbers\"]],\"start1\":4957,\"start2\":4957,\"length1\":8,\"length2\":637}]"
metadata_diff: {"new":{},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2026-08-03T09:49:24.796Z
created_time: 2026-08-03T09:49:24.796Z
is_locked: 0
type_: 13