Skip to content

Add Strict FilterStrategy#4

Merged
oojacoboo merged 1 commit into
masterfrom
feature/strict-filter-strategy
Apr 15, 2026
Merged

Add Strict FilterStrategy#4
oojacoboo merged 1 commit into
masterfrom
feature/strict-filter-strategy

Conversation

@oojacoboo

Copy link
Copy Markdown
Contributor

Summary

  • Adds Strict case to the FilterStrategy enum — a deny-by-default strategy
  • Processes filters like AnyMatch, but after the filter loop, if any active ContextProvider is not covered by any filter's context: array, appends 1 = 0 (denying all results)
  • ignore: true counts as "covered" — the context is acknowledged, just without extra conditions

Key behaviors

  • Context-free filters (empty context: []) still apply to all contexts
  • Only one 1 = 0 is ever appended (early return on first uncovered context)
  • If no ContextProvider is active at all, no denial occurs

Test plan

  • 5 new test cases in ConditionResolverTest: covered context, ignored-as-covered, uncovered denial, no-active-context, multiple-active-one-uncovered
  • Updated FilterStrategyTest for 3 enum cases
  • All 46 tests pass

Strict works like AnyMatch for processing filters, but after the filter
loop, any active ContextProvider whose identifier is not covered by a
filter's context array causes 1 = 0 to be appended (denying all results).
This eliminates the need to explicitly deny every uncovered context.
@oojacoboo
oojacoboo merged commit c310470 into master Apr 15, 2026
3 checks passed
@oojacoboo
oojacoboo deleted the feature/strict-filter-strategy branch April 15, 2026 22:52
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