Skip to content

test(property): add filter chain semantic law tests - #1077

Merged
Sinity merged 1 commit into
masterfrom
worktree-agent-ac3fc6b8
May 16, 2026
Merged

Sinity merged 1 commit into
masterfrom
worktree-agent-ac3fc6b8

Conversation

@Sinity

@Sinity Sinity commented May 16, 2026

Copy link
Copy Markdown
Owner

Summary

Adds Hypothesis property tests for the four algebraic laws of the filter chain at the async repository/facade layer.

Problem

The filter chain has rich combinatorial behavior tested only with concrete seeded data. Subtle composition bugs are invisible to point tests.

Solution

New tests/property/test_filter_chain_laws.py — four @given tests: subset law, monotonicity, commutativity, idempotency. Strategy filter_params_strategy() draws provider, has_tool_use, has_thinking, min/max_messages, min_words, date range. max_examples=40, runtime <15s.

Verification

pytest tests/property/test_filter_chain_laws.py -v --hypothesis-seed=0
devtools verify --quick  # exit 0

Ref #997

Adds Hypothesis property tests for the four algebraic laws that
ConversationFilter must satisfy against a real SQLite archive:

1. Subset law: filter(X) result IDs ⊆ unfiltered result IDs
2. Monotonicity: adding more constraints never increases result count
3. Commutativity: filter(A).filter(B) ≡ filter(B).filter(A)
4. Idempotency: applying the same filter twice ≡ applying it once

Each test draws from filter_params_strategy() covering provider,
has_tool_use, has_thinking, min/max_messages, min_words, and date
ranges. The archive is seeded with 20 conversations spanning all four
providers with varied message counts, tool use, thinking blocks, and
2024 timestamps.

max_examples=40 keeps the suite under ~15s via parallel execution.

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 59 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: bbaaced7-ea4e-42e4-a316-1deab3b16347

📥 Commits

Reviewing files that changed from the base of the PR and between 0631b1a and 20ff9ab.

📒 Files selected for processing (1)
  • tests/property/test_filter_chain_laws.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-agent-ac3fc6b8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit 2f59d9d into master May 16, 2026
4 checks passed
@Sinity
Sinity deleted the worktree-agent-ac3fc6b8 branch May 16, 2026 09:34
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