Code Quality Guide Core Principle Production database. Correctness paramount. Crash corrupt. Correctness Rules 1. No workarounds or quick hacks. Handle all errors, check invariants 2. Assert often. Never silently fail or swallow edge cases 3. Crash on invalid state if it risks data integrity. Don't continue in undefined state 4. Consider edge cases. On long enough timeline, all possible bugs will happen Rust Patterns - Make illegal states unrepresentable - Exhaustive pattern matching - Prefer enums over strings/sentinels - Minimize heap allocations - Write CPU-friendly code (microsecond = lon…