test(rule_engine): expand evaluator coverage 8->44 (v26.06.18)#44
Merged
Conversation
Validating implement-rule-engine found NO bug — the evaluator is correct — but the module had ~8 tests for 361 lines with many paths unexercised. Adds tests/rule_engine/test_evaluator_coverage.py covering: every leaf operator (eq/ne/gt/ge/lt/le/in/not_in/regex) + None/missing safety + type-mismatch surfacing, composite and/or/not (+ not-arity), then vs otherwise, set/increment/nested-write/ unsupported-action isolation, loud unknown-operator error, disabled-rule skip, and RuleSet priority ordering + cross-rule error isolation. No framework behavior changed. Gates: mypy --strict (607), ruff + format, full suite 3720 passed.
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.
Summary
Validating the
implement-rule-engineskill found it clean — the skill is faithful and the evaluator has no bug (all operators correct, loud unknown-operator errors, per-action + per-rule isolation, correct priority ordering). The one actionable audit finding was thin test coverage: ~8 tests for 361 lines, with many paths only verified manually.This adds
tests/rule_engine/test_evaluator_coverage.py(36 tests, suite 8 → 44) locking in the previously-unexercised paths:eq/ne/gt/ge/lt/le/in/not_in/regex(+ None/missing-field returnsFalsewithout crashing, + a type-mismatch comparison is surfaced inEvaluationResult.error, not silent);and/or/notand thenot-arity guard;thenvsotherwisebranch selection;set/increment/nested-dotted-write, and unsupported-action isolation (a failing action records its error while siblings still run);RuleSetpriority ordering over a shared context (adversarial: insertion order ≠ priority order) and cross-rule error isolation (one failing rule doesn't abort the set).No framework behavior changed — this is test-only hardening.
Gates
mypy --strict(607) ✓ ·ruff+ruff format✓ · rule_engine suite 44 passed · full suite 3720 passed, 1 skipped.Bumps
v26.06.17 → v26.06.18, CHANGELOG (Tests),uv.lock.