Deepen formula semantic invariant properties (#112) - #145
Conversation
Add depth-enforced formula generators for the semantic invariants introduced in PR #104. Ensure the invalid `Or` and invalid `And` properties always exercise trees with at least four levels, and keep the valid-tree strategy positive while retaining the same depth guarantee. Assert the generated tree depth inside each property so future strategy changes cannot silently shrink this coverage back to shallow trees.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideDeepens the semantic-invariant property tests by introducing depth-enforced formula generators and asserting a minimum tree depth across three key properties, ensuring they exercise sufficiently nested formula structures. File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. crates/sempai/src/tests/property_tests.rs Comment on lines +197 to +199 vec(atomless_tree_without_not_in_or(), 0..=2),
deep_atomless(MIN_PROPERTY_DEPTH - 1),
vec(atomless_tree_without_not_in_or(), 0..=2),❌ New issue: Code Duplication |
This comment was marked as resolved.
This comment was marked as resolved.
- Add module-private helper for shared required-branch composition in property test generators. - Refactor and to use helper, preserving existing strategy semantics and depth constraints.
Summary
This branch deepens the property coverage for issue #112 by making the
sempaisemantic invariant generators produce formula trees with at least four levels of
nesting. It keeps
proptestas the existingcrates/sempaidev-dependency,adds depth-enforced generators for positive, constraint-only and atomless
formula shapes, and asserts the depth guarantee inside each property.
Closes #112.
Review walkthrough
tree_depthassertion helper.InvalidNotInOr,MissingPositiveTermInAnd, and valid positive trees now exercise nested formula structures.Validation
cargo test -p sempai: passed.make check-fmt: passed.make lint: passed.make test: passed; nextest ran 1,389 tests and workspace doctests passed.git diff --check: passed.Notes
coderabbit review --agentwas attempted three times after the implementationmilestone, including after the reported wait windows. Each attempt stopped before
review with a recoverable CodeRabbit rate-limit error, so there were no review
concerns to clear locally.
Summary by Sourcery
Strengthen semantic invariant property tests by generating and asserting on deeper, more complex formula trees.
Enhancements:
Tests: