Skip to content

feat: More expressive conditions#17

Merged
jdehaan merged 13 commits into
mainfrom
chore/cleanup
May 17, 2026
Merged

feat: More expressive conditions#17
jdehaan merged 13 commits into
mainfrom
chore/cleanup

Conversation

@jdehaan
Copy link
Copy Markdown
Member

@jdehaan jdehaan commented May 17, 2026

The conditions are really complicated to read. Clear expressions shall be supported so the conditions can be checked at a glance.

jdehaan added 13 commits May 17, 2026 19:53
- 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
@jdehaan jdehaan merged commit 37bbc53 into main May 17, 2026
1 check passed
@jdehaan jdehaan deleted the chore/cleanup branch May 17, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant