id: 7ae0f5b6885d4152adec60187d1e3497
parent_id: 
item_type: 1
item_id: 837e81dd86d04905aa6de44f33cf21f4
item_updated_time: 1785752447020
title_diff: "[{\"diffs\":[[1,\"Skara Brae — Quality Check Procedure\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":36}]"
body_diff: "[{\"diffs\":[[1,\"# Skara Brae — Quality Check Procedure\\\n\\\n## Purpose\\\n\\\nSystematic verification that the implementation matches design notes, passes all code checks, and follows Clean Code / Clean Architecture principles.\\\n\\\n## Procedure\\\n\\\n### Step 1: Code Checks\\\n\\\n```bash\\\n# Rust build + clippy\\\ncd ~/Development/skara-brae/skara-brae-server && cargo clippy -- -W clippy::all 2>&1\\\n\\\n# Rust tests\\\ncd ~/Development/skara-brae/skara-brae-server && cargo test 2>&1\\\n\\\n# Vue typecheck\\\ncd ~/Development/skara-brae/skara-brae-client && npx vue-tsc --noEmit 2>&1\\\n```\\\n\\\n### Step 2: Implementation vs Design Notes\\\n\\\nFor each design note, verify the implementation matches:\\\n\\\n| Note | ID | What to Check |\\\n|---|---|---|\\\n| Game Concept Overview | `fcd381c235694f29abf73665317a40f5` | Character system (races, classes, stats), economy model, adventure structure |\\\n| Combat System & Stat Scaling | `5ff1fed180fa4b39b4cdb925f34c1008` | BIGINT stats, open-ended d100, crit tables, crit caps by level diff |\\\n| Mechanics Source Mapping | `81ac5941f07d4cdcb41a4797c7ec1c99` | BT1/RM/IF/Torn mapping consistency |\\\n| Project Plan | `088737f31c514f1da21cc42c0ab6acc1` | Resolved inconsistencies, next priorities |\\\n| Tech Stack & Architecture | `980c3eb587294e4383474b94988f2f88` | Crate structure, dependency direction, deployment |\\\n| Skill & Magic System | `8bee50c2a9194ec491612ace0bd40fe4` | Spell system design vs implementation |\\\n| Medals & Honours | `e368348dd9c341f59fe55594a0fbca96` | Medal system (not yet implemented) |\\\n| Idle Fantasy Inspirations | `fea2d81f0414484fa4edf126f8ca17ed` | Features adopted from IF |\\\n\\\nCheck items:\\\n- [x] Stats are i64 (BIGINT) — not i32\\\n- [x] 5 races match design (Human, Elf, Dwarf, Hobbit, HalfElf)\\\n- [x] 10 classes match design (Warrior through Sorcerer, no Cleric)\\\n- [x] Crit damage cap by level difference implemented\\\n- [x] Open-ended d100 combat rolls\\\n- [x] BT1 items (127), enemies (125), spells (79), songs (6) all present\\\n- [x] Zones match BT1 dungeon structure (8 zones)\\\n- [x] Shop economy uses BT1 gold values\\\n- [x] Bard songs with combat integration\\\n- [x] Spell system with SP costs, learning, combat casting\\\n- [x] Training costs gold (not just energy)\\\n- [x] Review Board level-up: XP threshold polynomial (18×100×(level-1)²), gold cost, max level 100\\\n\\\n### Step 3: Clean Architecture Audit\\\n\\\nCheck dependency direction:\\\n- [x] `sb-shared` → no dependencies on other game crates (domain types only)\\\n- [x] `sb-core` → depends only on `sb-shared` + `sb-common` (domain services, no HTTP)\\\n- [x] `sb-api` → depends on `sb-core`, `sb-shared`, `sb-auth`, `sb-db` (HTTP adapters)\\\n\\\nCheck layer violations:\\\n- [x] No `serde_json` in domain logic (only in LazyLock data loaders)\\\n- [x] No `include_str!` called during business logic (only module-level const)\\\n- [ ] No `rand::rng()` in domain functions (2 violations: create_character, resolve_combat_full)\\\n- [ ] Route handlers delegate to domain services (14 handlers still have inline logic)\\\n\\\nCheck code quality:\\\n- [ ] No magic numbers (25+ remaining in combat/character code)\\\n- [x] No abbreviations in variable names\\\n- [x] Functions do one thing, are short\\\n- [x] No duplicated logic across modules\\\n- [x] No comments that restate code\\\n- [x] Fail fast, return early — happy path flat\\\n- [x] No mixed concerns (HTTP + business logic in same function)\\\n\\\n### Step 4: Bug Scan\\\n\\\n- [x] All gold/energy/nerve/SP costs are both displayed AND enforced\\\n- [x] All state mutations happen inside write locks\\\n- [x] No unwrap() on fallible operations in route handlers (11 low-risk remain)\\\n- [x] All enum match arms exhaustive\\\n- [x] No integer overflow paths (xp_for_level uses saturating arithmetic)\\\n\\\n## Audit History\\\n\\\n| Date | Clippy | Tests | vue-tsc | Criticals Found | Criticals Fixed |\\\n|---|---|---|---|---|---|\\\n| 2026-08-03 #1 | 18 warnings | 0 tests | clean | 3 | 3 |\\\n| 2026-08-03 #2 | 0 | 42 pass | clean | 4 | 4 |\\\n| 2026-08-03 #3 | 0 | 44 pass | clean | 1 | 1 |\\\n\\\n## Quality Gate\\\n\\\nA check passes when:\\\n- Zero clippy warnings (excluding allowed lints)\\\n- Zero typecheck errors\\\n- All tests pass\\\n- Zero critical architecture violations\\\n- All tracked inconsistencies have a ticket or accepted rationale\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":4124}]"
metadata_diff: {"new":{"id":"837e81dd86d04905aa6de44f33cf21f4","parent_id":"d1892c7c531848f5a5a3ac5e1749f7cf","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1785733516986,"markup_language":1,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2026-08-03T10:29:25.019Z
created_time: 2026-08-03T10:29:25.019Z
is_locked: 0
type_: 13