Skip to content

fix(rvm): isolate nested query assertion mode - #929

Merged
Anand Krishnamoorthi (anakrish) merged 1 commit into
microsoft:mainfrom
anakrish:rvm-priority-one-query-scope
Nov 9, 2026
Merged

Anand Krishnamoorthi (anakrish) merged 1 commit into
microsoft:mainfrom
anakrish:rvm-priority-one-query-scope

Conversation

@anakrish

Copy link
Copy Markdown
Collaborator

Prevent outer negation from disabling positive filters inside nested comprehensions and every queries. Restore the caller assertion mode after compilation and preserve inner negation.

Adds interpreter/native/suspendable regression coverage. Debug CI, formatting, clippy, feature checks, and no_std checks pass.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The tests use only outer == comparisons, leaving assertion-mode restoration regressions undetected in negated =, undefined-operand, and destructuring-filter paths.

1 open issue
What changed in this PR

This PR fixes RVM compilation so outer negation does not disable positive filters inside nested comprehensions and every queries, keeping policy results aligned with the interpreter.

Changes:

  • Isolates nested-query assertion mode and restores the caller’s mode after compilation.
  • Adds regression coverage for the interpreter and both RVM execution modes, including inner negation.
  • Documents nested-query assertion behavior.
File Description
tests/​rvm/​rego/​comprehension_failure_differential.rs Adds cross-engine regression cases and suspendable completion checks.
src/​languages/​rego/​compiler/​queries.rs Scopes assertion mode to query compilation and restores caller state.
docs/​rvm/​architecture.md Explains nested assertion mode and negation behavior.

Review effort: Max

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The := destructuring tests can mask a soft-mode regression that skips literal/reference checks, leaving both equality paths without matching and mismatching = regression coverage.

1 open issue
1 resolved since last review

Review effort: Max

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The destructuring regression cases pass even without the nested-filter fix, leaving the soft-mode-sensitive branches that previously dropped filters untested.

2 open issues

Review effort: Max

Enforce nested query filters without leaking assertion mode or skipped root loads into the caller. Cover nested negation, destructuring equality, and skipped query paths across both execution modes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 84271ec2-b466-4cfe-bf58-848f4dceb842
@anakrish
Anand Krishnamoorthi (anakrish) marked this pull request as ready for review November 9, 2026 17:02
@anakrish
Anand Krishnamoorthi (anakrish) merged commit 2bc7574 into microsoft:main Nov 9, 2026
59 checks passed
@anakrish
Anand Krishnamoorthi (anakrish) deleted the rvm-priority-one-query-scope branch November 9, 2026 18:57
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