This commit adds comprehensive property-based tests and fuzzing coverage for critical router and parser invariants as specified in plan §8. **Property Tests (proptest) - router.rs:** - `prop_write_targets_count`: Verifies |write_targets| == RG × RF - `prop_write_targets_rf_per_group`: Verifies each group contributes exactly RF nodes - `prop_covering_set_covers_all_shards`: Verifies covering set includes all shards - `prop_reshuffle_bound_on_add`: Verifies reshuffle bounded by 4 × RF × ceil(S / Ng_new) - `prop_determinism`: Verifies same inputs produce same outputs - `prop_shard_for_key_uniformity`: Verifies uniform key distribution across shards **Fuzz Targets (cargo-fuzz):** - `config_parser.rs`: Feeds random UTF-8 to Config::from_yaml - `filter_parser.rs`: Feeds random strings to query planner filter grammar - `canonical_json.rs`: Roundtrips random JSON through canonicalizer **Bug Fixes:** - Fixed missing `mode_b_type` import in mode_b_coordinator.rs - Fixed missing `Arc` import in scatter.rs All property tests pass at 1024 cases per property. Fuzz targets are ready for integration with weekly CI fuzz runs via Argo Workflow. Closes: miroir-89x.6
29 lines
533 B
TOML
29 lines
533 B
TOML
[package]
|
|
name = "miroir-fuzz"
|
|
version = "0.0.0"
|
|
authors = ["Automatically generated"]
|
|
publish = false
|
|
edition = "2021"
|
|
|
|
[package.metadata]
|
|
cargo-fuzz = true
|
|
|
|
[dependencies]
|
|
libfuzzer-sys = "0.4"
|
|
miroir-core = { path = "../crates/miroir-core" }
|
|
serde_json = "1"
|
|
|
|
# Prevent workspace dependency inheritance
|
|
[workspace]
|
|
|
|
[[bin]]
|
|
name = "config_parser"
|
|
path = "fuzz_targets/config_parser.rs"
|
|
|
|
[[bin]]
|
|
name = "filter_parser"
|
|
path = "fuzz_targets/filter_parser.rs"
|
|
|
|
[[bin]]
|
|
name = "canonical_json"
|
|
path = "fuzz_targets/canonical_json.rs"
|