Refer to style.md more in design.md

This commit is contained in:
2025-08-23 13:37:01 -04:00
parent f576e96b5d
commit 69310c3cf3

View File

@@ -32,7 +32,7 @@ WeaselDB is a high-performance write-side database component designed for system
### Build System ### Build System
Use CMake with C++20 and **always use ninja** (preferred over make): Use CMake with C++20 and **always use ninja** (see [style.md](style.md) for build details):
```bash ```bash
mkdir -p build && cd build mkdir -p build && cd build
@@ -271,12 +271,7 @@ This write-side component is designed to integrate with:
### Code Style & Conventions ### Code Style & Conventions
- **C++ Style**: Modern C++20 with RAII and move semantics See [style.md](style.md) for comprehensive C++ coding standards and conventions.
- **Memory Management**: Prefer arena allocation over standard allocators
- **String Handling**: Use `std::string_view` for zero-copy operations
- **Error Handling**: Return error codes or use exceptions appropriately
- **Naming**: snake_case for variables/functions, PascalCase for classes
- **Performance**: Always consider allocation patterns and cache locality
### Critical Implementation Rules ### Critical Implementation Rules
@@ -327,18 +322,8 @@ This write-side component is designed to integrate with:
- **Configuration**: All configuration is TOML-based using `config.toml` (see `config.md`) - **Configuration**: All configuration is TOML-based using `config.toml` (see `config.md`)
- **Testing Strategy**: Run unit tests, benchmarks, and debug tools before submitting changes - **Testing Strategy**: Run unit tests, benchmarks, and debug tools before submitting changes
- **Test Design**: Prefer testing through public interfaces rather than implementation details (see `style.md` for detailed testing guidelines) - **Build System**: CMake generates gperf hash tables at build time
- **Build System**: CMake generates gperf hash tables at build time; always use ninja - **Testing Guidelines**: See [style.md](style.md) for comprehensive testing standards including synchronization rules
- **Test Synchronization**:
- **ABSOLUTELY NEVER use sleep(), std::this_thread::sleep_for(), or any timeout-based waiting in tests**
- **NEVER use condition_variable.wait_for() or other timeout variants**
- Use deterministic synchronization only:
- **Blocking I/O** (blocking read/write calls that naturally wait)
- **condition_variable.wait()** with no timeout (waits indefinitely until condition is met)
- **std::latch, std::barrier, futures/promises** for coordination
- **RAII guards and resource management** for cleanup
- Tests should either pass (correct) or hang forever (indicates real bug to investigate)
- No timeouts, no flaky behavior, no false positives/negatives
--- ---
@@ -546,7 +531,4 @@ ParseResult parse_commit_request(const char* json, CommitRequest& out);
### Build Notes ### Build Notes
- **Always use ninja** - faster and more reliable than make See [style.md](style.md) for comprehensive build configuration and CMake integration details.
- Build from project root: `mkdir -p build && cd build && cmake .. -G Ninja && ninja`
- For specific targets: `ninja <target_name>` (e.g., `ninja load_tester`)
- Always build with `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`