feat(policy-engine): add fuzz harness for tree config + evaluation (#… - #332
Merged
Idaonoli merged 2 commits intoSep 3, 2026
Merged
Conversation
…tellar-compliance-kit#234) - Add MaxDepthExceeded error variant (value 5) and MAX_CHECKS=16 constant to keep per-evaluate resource cost bounded - Enforce depth limit in add_check; returns Err(MaxDepthExceeded) when the check list is already at capacity - Convert CheckKind enum to tuple variants (DenylistCheck / JurisdictionCheck wrapper structs) to comply with contracttype constraint on named struct-like enum variants - Add contracts/policy-engine/src/fuzz.rs: seeded xorshift32 PRNG loop exercising random AddDenylist / AddJurisdiction / RemoveCheck sequences with an All/Any oracle; verifies no panic and result consistency across all seeds - Add contracts/policy-engine/src/test_utils.rs: self-contained MockDenylist and MockJurisdiction inline contracts used by both fuzz and unit tests (avoids dependency on broken dev-dep crates) - Update test.rs to use inline mocks; add test_max_depth_exceeded - Add contracts/policy-engine to workspace members in Cargo.toml - Fix stray closing paren in jurisdiction-flag is_permitted_jurisdiction - Document harness in fuzz/README.md under policy-engine (stellar-compliance-kit#234) section Tested: FUZZ_ITERATIONS=10000 FUZZ_OPS=32 → 10k iterations, 0 failures, 905s wall time. All 6 policy-engine unit tests pass.
|
@Peace-001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@Peace-001 is attempting to deploy a commit to the idaonoli-2655's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…234)
Tested: FUZZ_ITERATIONS=10000 FUZZ_OPS=32 → 10k iterations, 0 failures, 905s wall time. All 6 policy-engine unit tests pass.
Closes
Closes #
What changed and why
Checklist
cargo test --workspacepasses locallycargo clippy --workspace --all-targets -- -D warningspasses locallyCloses Add a fuzz harness for policy-engine tree configuration + evaluation #234