You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Permanent Guardrails for Rust Excellence
Version: 1.0.0 | Established: 2025-12-11
EXECUTIVE SUMMARY
This document establishes permanent, embedded quality gates for ReasonKit-core development.
All work MUST pass these gates before merge. No exceptions.
# MUST PASS before any PR review
cargo build --release 2>&1| tee build.log
# Exit code MUST be 0# Warnings count MUST be < 10 (decreasing trend required)
Metric
Threshold
Enforcement
Build success
100%
HARD BLOCK
Warnings
< 10
SOFT (track trend)
Build time
< 60s (incremental)
MONITORING
Gate 2: Linting (BLOCKING)
# MUST PASS before merge
cargo clippy -- -D warnings -W clippy::all -W clippy::pedantic
Lint Category
Action
Rationale
clippy::all
DENY
Standard safety
clippy::pedantic
WARN
Quality improvement
clippy::unwrap_used
WARN
Production safety
clippy::expect_used
ALLOW
Explicit is OK
Gate 3: Formatting (BLOCKING)
# MUST PASS - auto-fixable
cargo fmt --check
cargo fmt # Fix if needed
Gate 4: Testing (BLOCKING)
# MUST PASS with coverage threshold
cargo test --all-features
cargo test --release # Also test optimized builds# Coverage tracking (target: 80%)
cargo tarpaulin --out Html --output-dir target/coverage
Metric
Threshold
Enforcement
Unit test pass
100%
HARD BLOCK
Integration test pass
100%
HARD BLOCK
Coverage
> 80%
SOFT (track trend)
Doc tests
100%
HARD BLOCK
Gate 5: Benchmarks (MONITORING)
# Run on performance-critical changes
cargo bench --bench retrieval_bench
# Regression threshold: 5%# If > 5% regression: INVESTIGATE before merge
Benchmark
Baseline
Max Regression
BM25 query
TBD
5%
Vector search
TBD
5%
Hybrid fusion
TBD
5%
2. CODE REVIEW CHECKLIST
Every PR MUST answer these questions:
Architecture
Does this change align with the 5-layer architecture?
Is the change in the correct layer?
Are cross-layer dependencies minimized?
Safety
No unsafe blocks without explicit justification
No .unwrap() in library code (use ? or .expect())
Error types are informative and actionable
No hardcoded secrets or credentials
Performance
Hot paths are allocation-free where possible
Large data uses iterators, not collecting to Vec
Async operations don't block the runtime
Benchmarks added for new performance-critical code
Documentation
Public APIs have doc comments
Complex logic has inline comments
README updated if user-facing changes
CHANGELOG entry added
3. PERIODIC QUALITY REVIEWS
Weekly: Automated Metrics
# Run every Monday via CI
./scripts/quality_metrics.sh
# Outputs:# - Test coverage trend# - Warning count trend# - Benchmark regression report# - Dependency audit
This Quality Assurance Plan is a BINDING COMMITMENT.
All development work on reasonkit-core MUST:
1. Pass all 5 quality gates before merge
2. Follow embedded best practices
3. Maintain or improve quality metrics
4. Undergo periodic expert review
Violations require:
- Root cause analysis
- Corrective action plan
- Prevention measures
Signed: Claude Code (AI Engineering Agent)
Date: 2025-12-11
"Quality is not an act, it is a habit." - Aristotle"Designed, Not Dreamed." - ReasonKit