Skip to content

fix: filter logic#920

Merged
ayushjain17 merged 1 commit intomainfrom
fix/filter
Mar 18, 2026
Merged

fix: filter logic#920
ayushjain17 merged 1 commit intomainfrom
fix/filter

Conversation

@ayushjain17
Copy link
Collaborator

@ayushjain17 ayushjain17 commented Mar 18, 2026

Summary by CodeRabbit

  • Refactor
    • Enhanced dimension filtering logic to account for dimension dependencies when evaluating context filters, enabling more accurate filtering based on dimension relationships and request parameters.

@ayushjain17 ayushjain17 requested a review from a team as a code owner March 18, 2026 12:24
@semanticdiff-com
Copy link

semanticdiff-com bot commented Mar 18, 2026

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6460d4e9-a59a-440d-8e19-bf7dc80b11f7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR extends the filter_by_dimension method signature across multiple modules to accept original request length and dimension metadata, enabling dependency-graph-based dimension resolution. The filtering logic now validates whether requested dimensions are satisfied either directly or through their dependency relationships in the dimension metadata.

Changes

Cohort / File(s) Summary
Handler Updates
crates/context_aware_config/src/api/context/handlers.rs, crates/experimentation_platform/src/api/experiments/handlers.rs
Capture original dimension parameter count before evaluation and pass it along with dimension metadata to filter_by_dimension calls.
Core Filtering Logic
crates/superposition_types/src/contextual.rs
Extended filter_by_dimension signature to accept request length and dimension metadata. Rewrote filtering to check if requested dimensions are satisfied directly or via dependency graph. Updated test cases to provide new parameters.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

bug

Suggested reviewers

  • knutties
  • Datron
  • mahatoankitkumar

Poem

🐰 Dimensions now dance with their graphs in tow,
Dependencies resolved as the filters flow,
Each request measured against what could be,
New parameters guide us to accuracy! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: filter logic' is vague and does not clearly describe the specific changes made. Provide a more specific title that describes which filter logic was fixed, e.g., 'fix: improve dimension filtering by including dependency graph resolution' or 'fix: enhance context filtering with dependency-aware dimension matching'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/filter
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/superposition_types/src/contextual.rs`:
- Around line 47-57: The current check in the dimension_keys iterator
incorrectly inspects dependency_graph.keys() instead of traversing edges from
the requested dimension; change the predicate (used where
dimension_keys.iter().all(...) is evaluated) to start from
dependency_graph.get(dimension) and perform a graph traversal following
dependency edges (including transitive hops) to see if any reachable dependency
node exists in variables, reusing the same traversal logic used elsewhere where
dependency_graph.get(dimension) is followed; ensure you handle missing entries
with unwrap_or_default() behavior so that a dimension is accepted if either
variables.contains_key(dimension) or any reachable dependency node is present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cb7fd7ee-fea9-4cbe-babf-7b6c677c05f8

📥 Commits

Reviewing files that changed from the base of the PR and between 6219f24 and 9c2a0c1.

📒 Files selected for processing (3)
  • crates/context_aware_config/src/api/context/handlers.rs
  • crates/experimentation_platform/src/api/experiments/handlers.rs
  • crates/superposition_types/src/contextual.rs

@ayushjain17 ayushjain17 merged commit e54cd89 into main Mar 18, 2026
21 checks passed
@ayushjain17 ayushjain17 deleted the fix/filter branch March 18, 2026 13:45
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.

3 participants