Contributing¶
How to contribute to HyperbyteDB: the PR process, code review checklist, and engineering policies.
PR Process¶
- Branch from
main. - Implement your change following the Coding Standards.
- Test locally:
- Document new config keys in
docs/user-guide/configuration.mdandconfig.toml.example. - Open a PR against
main. - CI must pass — format, clippy, tests, and release build.
Code Review Rubric¶
Every PR is reviewed against the following layers. Each gate requires cited evidence (command output, test name, or code trace).
Tool Gates (CI alignment)¶
| Gate | Command | Evidence |
|---|---|---|
| Format | cargo fmt --all --check | CI fmt job green |
| Lint | cargo clippy --all-targets -- -D warnings | CI clippy job green |
| Unit tests | cargo test --lib | CI test job |
| Integration tests | cargo test --test '*' | CI test job |
| Release build | cargo build --release | CI build job |
Layer A — Correctness¶
A.1 Rust fundamentals - No new unwrap/expect on fallible paths in non-test code. - Errors propagate with ? or explicit mapping. - No Mutex/RwLock held across .await. - Public API changes are intentional.
A.2 Data path integrity - WAL ordering and sequence semantics preserved. - Flush does not drop acknowledged writes. - Replication apply path is idempotent. - Storage layout and file naming match StorageLayout.
A.3 Distributed semantics - Network failures have timeouts, retries, and backoff. - Raft log/store/network/state machine changes preserve safety.
A.4 HTTP/InfluxDB v1 compatibility - Status codes and bodies match docs/user-guide/reference.md. - Auth paths remain consistent.
A.5 Query translation safety - Identifiers and literals are quoted/escaped against injection.
A.6 Security - Secrets not logged. - Password hashing uses Argon2.
A.7 Observability - No high-cardinality labels on Prometheus metrics.
Layer B — Maintainability¶
- Port traits remain the primary abstraction between application and adapters.
- Config keys documented when added or renamed.
- Domain types free of I/O dependencies.
Layer D — Tests¶
Suite ownership (avoid duplication):
| Suite | Owns |
|---|---|
cargo test --lib | Pure Rust units, parsers, domain invariants |
tests/compat/ | InfluxDB v1 HTTP/DDL/query compatibility |
tests/integration.rs | Server integration without cluster |
tests/raft_integration.rs | Raft-specific integration |
tests/e2e/ (Go) | Multi-node cluster, failover, rolling restart |
Before deleting a test, show that another suite covers the same behavior.
Layer E — De-bloating¶
Allowed removals (each needs proof):
- Unused dependencies —
cargo macheteclean +cargo check --all-targets. - Unreachable code — Not part of stable
pubAPI; grep consumers; tests pass. - Duplicate documentation — Consolidate with one canonical page.
- Obsolete scripts — No references in CI, README, or
deploy/. - Local-only artifacts — Never delete user data trees.
Breaking removals (HTTP shape, config keys, features) require explicit label and changelog note.
Engineering Policies¶
Rust coding standards¶
The project follows the rust-skills rule set (MIT), summarized in the root .cursorrules file. Key areas: ownership, error handling, memory safety, API design, async patterns, performance, and anti-patterns.
Commit conventions¶
- Use clear, descriptive commit messages.
- Reference issues when applicable.
- Keep commits focused — one logical change per commit.
Dependencies¶
- Prefer
Arc<dyn Trait>for dependency injection. - Keep domain types free of I/O dependencies.
- Pin major versions of GitHub Actions.
- Commit
Cargo.lock.
Getting Help¶
- Check Architecture for system design questions.
- Check Core Modules for "where is this code?" questions.
- Check Extension Points for "how do I add...?" questions.
Engineering review artifacts and editor policy¶
- Review rubric (layers, suite gates, de-bloating rules): engineering/code-review-rubric.md.
- Section review notes (architecture areas, findings log): engineering/section-review-notes.md.
Rust coding standards (editors and AI): the in-repo summary lives in the root .cursorrules file (condensed from rust-skills). If you change or extend project-wide Rust guidance, update .cursorrules and the engineering rubric if review gates change. A full per-rule copy may exist under .cursor/skills/ locally; that path is sometimes gitignored and does not change policy.
Further Reading¶
| Document | Topic |
|---|---|
| Architecture | System design |
| Coding Standards | Code conventions |
| Testing | Test strategy |
| Building & CI | Build and CI details |
| Key Design Decisions | Technical deep dives |