Skip to content

Commit eda89c9

Browse files
authored
Release v0.5.0 (#81)
* chore(release): prepare v0.5.0 release - Bump version from 0.4.7 to 0.5.0 across workspace - Add comprehensive v0.5.0 CHANGELOG entry - Security hardening (Phase 1 & 2) - Zero-cost GAT migration (1.82x performance improvement) - Generic type system refactoring - 2,593 tests passing with 87.35% coverage - Update unreleased section for v0.6.0 planning * docs: remove frequently-changing metrics from README Remove version-specific and frequently-changing information: - Test count references (2,593 tests, 44 tests, etc.) - Coverage percentage (87.35%) - Keep only stable, general descriptions README should contain general functionality overview with parameters that rarely change.
1 parent 787a93b commit eda89c9

File tree

4 files changed

+147
-16
lines changed

4 files changed

+147
-16
lines changed

CHANGELOG.md

Lines changed: 132 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,143 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12-
### Planned for v0.5.0
12+
### Planned for v0.6.0
1313

1414
- **Enhanced Framework Integrations**: Additional Rust web framework support (Actix, Warp)
1515
- **Custom priority strategies**: User-configurable prioritization algorithms
1616
- **GPU acceleration**: CUDA-based JSON processing for ultra-high throughput
1717

18+
## [0.5.0] - 2026-01-26
19+
20+
### Security
21+
22+
- **Phase 1 & 2 Security Hardening**: Comprehensive DoS protection and input validation (#80)
23+
- **Bounded Iteration Protection**: MAX_SCAN_LIMIT (10,000) prevents unbounded iteration attacks
24+
- DOS-001: filter_limited() with scan_limit enforcement
25+
- DOS-002: Result limit protection (MAX_RESULTS_LIMIT: 10,000)
26+
- DOS-003: MAX_PREALLOC_SIZE (1,024) prevents excessive memory allocation
27+
- **Input Validation**: Multi-layer validation for all query operations
28+
- Pagination::validate() - checks limit (1-1,000), offset (<1M), sort_by whitelist
29+
- SessionQueryCriteria::validate() - validates ranges, rejects empty filters
30+
- StreamFilter::validate() - priority range validation
31+
- **Memory Protection**: Bounded HashMap allocation in health checks
32+
- MEM-001: HashMap::with_capacity(MAX_HEALTH_METRICS) for session health
33+
- MEM-002: Session-level stats caching with 5s TTL (CachedSessionStats)
34+
- **Error Handling**: Proper NotFound errors instead of empty results (ERR-001)
35+
- **Type Safety**: saturating_f64_to_u64() handles NaN/infinity/negative values
36+
- **Documentation**: Comprehensive DashMap weakly consistent iteration guarantees
37+
- **Testing**: 367-test security_bounded_iteration_integration.rs suite
38+
- **Verification**: 100% coverage for security-critical code, <1% performance overhead
39+
40+
### Performance
41+
42+
- **Zero-Cost GAT Migration**: Complete removal of async_trait overhead (#78)
43+
- **1.82x faster**: Static dispatch replaces dynamic dispatch (Box<dyn Future>)
44+
- **11 async_trait traits removed**: Migrated to Generic Associated Types
45+
- **8 new GAT traits**: Using gat_port! macro and manual GAT implementations
46+
- StreamRepositoryGat: +4 methods (find_sessions_by_criteria, get_session_health, etc.)
47+
- StreamStoreGat: +3 methods (find_streams_by_session, update_stream_status, etc.)
48+
- SessionTransactionGat, FrameRepositoryGat, EventStoreGat, CacheGat, etc.
49+
- **Zero heap allocations**: Compile-time monomorphization replaces runtime polymorphism
50+
- **API stability**: All method signatures remain semantically identical
51+
- **Code reduction**: Net -31 lines through elimination of boilerplate
52+
53+
### Infrastructure
54+
55+
- **Generic Type System Refactoring**: Foundation for type-safe architecture
56+
- **Phase 1 (#74)**: Generic Id<T> and IdDto<T> wrappers
57+
- Type-safe identifiers with phantom types
58+
- Zero-cost abstractions for domain entities
59+
- **Phase 2 (#75)**: Generic InMemoryStore<K, V>
60+
- Unified storage layer for all entity types
61+
- Lock-free concurrent access with DashMap
62+
- Type aliases: SessionStore, StreamStore
63+
- **gat_port! macro (#76)**: Declarative GAT trait definitions
64+
- Reduces boilerplate for standard CRUD operations
65+
- Consistent interface patterns across ports
66+
67+
- **Repository Enhancements**:
68+
- **Atomic Operations**: update_with() for read-modify-write consistency
69+
- **Caching Layer**: CachedSessionStats with AtomicU64 for thread-safe stats
70+
- **Query Methods**: 12 new GAT methods for advanced filtering and statistics
71+
- **WebSocket Transport**: Migrated to zero-cost GAT pattern
72+
73+
### Code Quality
74+
75+
- **Clean Architecture Compliance**: Zero violations, strict layer separation
76+
- Domain layer: Pure business logic with GAT ports
77+
- Application layer: CQRS command/query handlers
78+
- Infrastructure layer: Zero-cost GAT implementations
79+
- **Clippy Clean**: Zero warnings with `-D warnings` strict mode
80+
- Fixed collapsible_if with let-chains
81+
- Replaced format! allocations with as_str() in hot paths
82+
- Applied saturating conversions for type safety
83+
- **Test Coverage**: 2,593 tests passing (87.35% coverage)
84+
- 367 security integration tests
85+
- GAT query performance benchmarks
86+
- Cross-platform validation (Linux, macOS, Windows)
87+
88+
### Documentation
89+
90+
- **Security Documentation**: Comprehensive security limits and rationale
91+
- Production tuning guide for MAX_SCAN_LIMIT and pagination limits
92+
- DashMap weakly consistent iteration guarantees
93+
- Defense-in-depth security layer documentation
94+
- **CI/CD Improvements**: GitHub Actions updates
95+
- actions/labeler: 5 → 6 (#77)
96+
- Contributor documentation enhancements
97+
- Optimized release workflow
98+
- **API Documentation**: Enhanced port trait documentation
99+
- StreamFilter priority field limitations documented
100+
- Future implementation strategies outlined
101+
- Migration guide for GAT transition
102+
103+
### Bug Fixes
104+
105+
- **State Transitions**: Return InvalidStateTransition for invalid status changes
106+
- Fix Created status transition validation
107+
- Proper error handling for Paused status
108+
- **Client Info Filtering**: Implement client_info_pattern matching in queries
109+
- **Code Formatting**: Applied nightly rustfmt for CI compliance
110+
- **Race Conditions**: Fixed cache update with entry().and_modify() atomic API
111+
- **Off-by-One Errors**: Use enumerate() for exact scan limit enforcement
112+
113+
### Breaking Changes
114+
115+
- **async_trait Removal**: All domain ports migrated to GAT
116+
- Replace `CacheRepository` with `CacheGat`
117+
- Replace `StreamSessionRepository` with `StreamRepositoryGat`
118+
- Supporting types unchanged, method signatures semantically identical
119+
- **Error Types**: NotFound errors replace empty results
120+
- SessionNotFound, StreamNotFound instead of Ok(None)
121+
122+
### Migration Guide
123+
124+
For users upgrading from v0.4.7:
125+
126+
1. **Port Trait Updates**: Replace async_trait imports with GAT equivalents
127+
```rust
128+
// Before
129+
use crate::domain::ports::StreamSessionRepository;
130+
131+
// After
132+
use crate::domain::ports::StreamRepositoryGat;
133+
```
134+
135+
2. **Error Handling**: Update code expecting empty results to handle NotFound errors
136+
```rust
137+
// Before
138+
if let Some(session) = repo.find(&id).await? { ... }
139+
140+
// After (unchanged - still works, but errors are more explicit)
141+
if let Some(session) = repo.find(&id).await? { ... }
142+
```
143+
144+
3. **Security Limits**: Review pagination parameters against new limits
145+
- MAX_PAGINATION_LIMIT: 1,000 (was implicit)
146+
- MAX_PAGINATION_OFFSET: 1,000,000 (was implicit)
147+
- Adjust client code if using larger values
148+
18149
## [0.4.7] - 2026-01-25
19150

20151
### Performance

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resolver = "3"
77
[workspace.package]
88
homepage = "https://github.com/bug-ops/pjs"
99
documentation = "https://docs.rs/pjson-rs"
10-
version = "0.4.7"
10+
version = "0.5.0"
1111
authors = ["Andrei G. <k05h31@gmail.com>"]
1212
readme = "README.md"
1313
edition = "2024"
@@ -44,8 +44,8 @@ mimalloc = "0.1"
4444
once_cell = "1.21"
4545
parking_lot = "0.12"
4646
paste = "1.0"
47-
pjson-rs-domain = { version = "0.4.7",path = "crates/pjs-domain" }
48-
pjson-rs = { version = "0.4.7", path = "crates/pjs-core" }
47+
pjson-rs-domain = { version = "0.5.0",path = "crates/pjs-domain" }
48+
pjson-rs = { version = "0.5.0", path = "crates/pjs-core" }
4949
priority-queue = "2.7"
5050
prometheus = "0.14"
5151
proptest = "1.9"

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
High-performance Rust library for priority-based JSON streaming with SIMD acceleration. Stream large JSON responses progressively, delivering critical data first while background data loads asynchronously.
1313

1414
> [!IMPORTANT]
15-
> **v0.4.7**: GAT migration (1.82x faster), HTTP adapter with CQRS, decompression algorithms with security hardening. 2,158 tests passing. Requires **nightly Rust** for zero-cost async abstractions.
15+
> GAT migration (1.82x faster), HTTP adapter with CQRS, comprehensive security hardening with bounded iteration and input validation. Requires **nightly Rust** for zero-cost async abstractions.
1616
1717
## Features
1818

@@ -22,7 +22,7 @@ High-performance Rust library for priority-based JSON streaming with SIMD accele
2222
- **WebAssembly** - Browser and Node.js support with compact bundle (~70KB gzipped)
2323
- **Secure** - Defense-in-depth decompression protection, DoS prevention, input validation
2424
- **Schema Aware** - Automatic compression and semantic analysis
25-
- **Production Ready** - Clean Architecture, 87.35% test coverage, Prometheus metrics
25+
- **Production Ready** - Clean Architecture, comprehensive test suite, Prometheus metrics
2626

2727
## Performance
2828

@@ -257,7 +257,7 @@ const stream = PriorityStream.withSecurityConfig(security);
257257
- Max object keys: 10,000
258258

259259
> [!IMPORTANT]
260-
> **v0.4.7 Security**: Delta and RLE decompression now include 4-layer defense-in-depth protection against decompression bombs (CVSS 7.5 vulnerabilities fixed).
260+
> **Security**: Comprehensive multi-layer protection including bounded iteration (DoS prevention), input validation, and 4-layer defense-in-depth decompression protection against compression bombs (CVSS 7.5 vulnerabilities fixed).
261261
262262
**Decompression Security:**
263263

@@ -271,18 +271,18 @@ const stream = PriorityStream.withSecurityConfig(security);
271271
PJS follows Clean Architecture with Domain-Driven Design:
272272

273273
- **pjs-domain** - Pure business logic, WASM-compatible
274-
- **pjs-wasm** - WebAssembly bindings with PriorityStream API, security limits (44 tests)
275-
- **pjs-core** - Rust implementation with HTTP/WebSocket integration (2,100+ tests)
274+
- **pjs-wasm** - WebAssembly bindings with PriorityStream API, security limits
275+
- **pjs-core** - Rust implementation with HTTP/WebSocket integration
276276
- **pjs-demo** - Interactive demo servers with real-time streaming
277277
- **pjs-js-client** - TypeScript/JavaScript client with WasmBackend transport
278278
- **pjs-bench** - Comprehensive performance benchmarks
279279

280-
**v0.4.7 Improvements:**
280+
**Key Features:**
281281

282-
- **GAT Migration**: Zero-cost async abstractions (1.82x faster)
282+
- **GAT Migration**: Zero-cost async abstractions (1.82x faster than async_trait)
283283
- **HTTP Adapter**: 8 REST endpoints with CQRS pattern
284-
- **Security Hardening**: Decompression bomb protection, input validation
285-
- **Test Coverage**: 87.35% (2,158 tests passing)
284+
- **Security Hardening**: Bounded iteration, input validation, decompression bomb protection
285+
- **Generic Type System**: Type-safe Id<T> wrappers, generic InMemoryStore<K, V>
286286
- **Platform Support**: Windows, Linux, macOS validated
287287

288288
## Contributing

0 commit comments

Comments
 (0)