一键导入
rust-bulletproof
enforces advanced correctness standards for Lilith's Rust core using fuzzing, property testing, and Miri.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
enforces advanced correctness standards for Lilith's Rust core using fuzzing, property testing, and Miri.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | rust_bulletproof |
| description | enforces advanced correctness standards for Lilith's Rust core using fuzzing, property testing, and Miri. |
| version | 1.0.0 |
This skill goes beyond standard unit testing to ensure the mathematical correctness and memory safety of Lilith's critical Rust path (lilith-zero/src). It employs fuzzing, property-based testing, and interpreter-based verification.
policy_validator.rs, pattern_matcher.rs, or security.rs.unsafe blocks.Tokio, Mutex, or RwLock.Use proptest to mathematically assert that functions never panic and properties hold for all inputs, not just example cases.
Command:
# Run property tests specifically (usually marked with #[test])
cd lilith-zero; cargo test --package sentinel --test properties
Note: If tests\properties.rs does not exist, ask the user to create a property test for the new feature.
If the code uses unsafe or does complex pointer arithmetic, you MUST run Miri. Miri interprets the code to find memory leaks, data races, and misalignment.
Command:
# Install Miri if missing
rustup component add miri
# Run tests under Miri
cd lilith-zero; cargo miri test
For parsers and security boundaries, run a short fuzzing campaign to find edge case crashes.
Command:
# Ensure cargo-fuzz is installed
cargo install cargo-fuzz
# Initialize if needed: cargo fuzz init
# Run the relevant target (e.g., policy_parser)
cd lilith-zero; cargo fuzz run policy_parser -- -max_total_time=300 # 5 minutes
Verify that your tests are actually checking the code by introducing random bugs (mutants) and ensuring tests fail.
Command:
# Install cargo-mutants
cargo install cargo-mutants
# Run mutation tests
cd lilith-zero; cargo mutants
User: "I optimized the PolicyMatcher using raw pointers for speed."
Agent Response:
"Since you modified PolicyMatcher with unsafe code:
cd lilith-zero; cargo miri test - Must pass without UB.cd lilith-zero; cargo test test_policy_matcher_properties - Verify invariants hold.cd lilith-zero; cargo fuzz run matcher_fuzz - Run for 5 minutes.Would you like me to construct a property test scaffold for this optimization?"