feat: More expressive conditions#17
Merged
Merged
Conversation
- Delete docs/roadmap.md - Replace the per-check table in checks.md with a short page that points users to 'hah list-checks' for the full listing - Rename 'Built-in Checks' -> 'Shipped Checks' in README.md - Remove roadmap entry from docs/plan.md and docs/dev/README.md
- Compact conditions: `- info: "$x > 0"` with auto-type inference - Inferred conditions: omit `type:` field, auto-detect from fields present - New CLI command: `hah validate` checks rule file syntax without running checks - Add serde-value dependency for buffered deserialization - Update DSL docs with compact/inferred syntax examples - Add validate command to README
- Convert 11 fully convertible rules to compact syntax - Convert 6 partially convertible rules (nested conditions) - 6 rules unchanged (for_each, regex_match not supported)
- all:/any: keys accept an array of child conditions - Severity is auto-derived as max(child severities) - Convert all rule files to use the new compact form - Update DSL docs with nested compact syntax examples
- Compact form: `- warning: "$value =~ '^pattern'"` - Quotes around the pattern are automatically stripped - Convert legacy-network-interfaces.yaml to compact syntax - Update DSL docs with =~ operator example
- Remove ForEach variant from RuleCondition entirely - Add for_each (list + as) to RuleOutcome for per-item findings - Conditions now only answer 'should we report?' (non_empty check) - Outcome handles 'how to display?' (iterate and produce findings) - Convert all 5 for_each rules to new model - Update DSL docs with outcome for_each section
Remove TypedCondition, InferredCondition and the serde-value dependency. The Deserialize impl now directly deserializes CompactCondition. Add string equality support ($var == \"string\") to compact expressions. Convert all tests to compact syntax. Update docs/dsl.md accordingly.
- rule.rs → rule/{mod,model,condition,eval,check,tests}.rs
- Filter construction from expr.rs → filters/build.rs
- expr.rs now contains only Expression AST and eval logic
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.
The conditions are really complicated to read. Clear expressions shall be supported so the conditions can be checked at a glance.