Skip to content

test(rule_engine): expand evaluator coverage 8->44 (v26.06.18)#44

Merged
ancongui merged 1 commit into
mainfrom
chore/rule-engine-test-coverage
Jun 6, 2026
Merged

test(rule_engine): expand evaluator coverage 8->44 (v26.06.18)#44
ancongui merged 1 commit into
mainfrom
chore/rule-engine-test-coverage

Conversation

@ancongui
Copy link
Copy Markdown
Contributor

@ancongui ancongui commented Jun 6, 2026

Summary

Validating the implement-rule-engine skill 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:

  • every leaf operator eq/ne/gt/ge/lt/le/in/not_in/regex (+ None/missing-field returns False without crashing, + a type-mismatch comparison is surfaced in EvaluationResult.error, not silent);
  • composite and/or/not and the not-arity guard;
  • then vs otherwise branch selection;
  • set/increment/nested-dotted-write, and unsupported-action isolation (a failing action records its error while siblings still run);
  • the loud unknown-operator error;
  • the disabled-rule skip;
  • RuleSet priority 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.

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.
@ancongui ancongui merged commit 8e4e2fb into main Jun 6, 2026
5 checks passed
@ancongui ancongui deleted the chore/rule-engine-test-coverage branch June 6, 2026 07:32
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