Skip to content

fix: consistent status check and correct negation operators#1

Merged
mfrachet merged 1 commit intomainfrom
fix/bug-scan-evaluate-consistency-and-negation-operators
Feb 24, 2026
Merged

fix: consistent status check and correct negation operators#1
mfrachet merged 1 commit intomainfrom
fix/bug-scan-evaluate-consistency-and-negation-operators

Conversation

@mfrachet
Copy link
Copy Markdown
Owner

Summary

  • BUG 1 (HIGH): evaluate() now uses !== "enabled" instead of === "disabled", making it fail-closed and consistent with evaluateAll(). Previously, an invalid status like "enbaled" would be treated as enabled by evaluate() but disabled by evaluateAll().
  • BUG 2 (MEDIUM): not_contains now returns true when the user field is missing or non-string — a missing field does not contain the substring. Previously it incorrectly returned false.
  • BUG 3 (MEDIUM): not_in guard separated for clarity — invalid rule.value returns false independently from the membership check.
  • Added 8 new tests covering status consistency, missing field behavior, and segment depth protection. Renamed 3 duplicate test names.

Test plan

  • All 187 tests pass (179 existing + 8 new)
  • Status consistency: evaluate() and evaluateAll() both return false for invalid status values
  • not_contains returns true for missing/non-string fields
  • not_in returns true for missing fields
  • Segment depth at exactly 10 works; exceeding 10 returns false
  • Duplicate test names in repartition.test.ts renamed

🤖 Generated with Claude Code

…ng fields

- evaluate() now uses `!== "enabled"` (fail-closed) matching evaluateAll() behavior
- not_contains returns true when user field is missing/non-string (missing field doesn't contain substring)
- not_in guard separated for clarity
- Add tests for status consistency, missing field behavior, and segment depth protection
- Rename duplicate test names in repartition.test.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mfrachet mfrachet force-pushed the fix/bug-scan-evaluate-consistency-and-negation-operators branch from c9dd17b to c216fa2 Compare February 24, 2026 13:24
@mfrachet mfrachet merged commit b32b11e into main Feb 24, 2026
1 check passed
@mfrachet mfrachet deleted the fix/bug-scan-evaluate-consistency-and-negation-operators branch February 24, 2026 13:26
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