Skip to content

feat: Handle more OPA semantics in RVM compiler - #515

Merged
Anand Krishnamoorthi (anakrish) merged 3 commits into
microsoft:mainfrom
anakrish:rvm-opa-1
Dec 3, 2025
Merged

feat: Handle more OPA semantics in RVM compiler#515
Anand Krishnamoorthi (anakrish) merged 3 commits into
microsoft:mainfrom
anakrish:rvm-opa-1

Conversation

@anakrish

Copy link
Copy Markdown
Collaborator
  1. out parameter syntax.
  2. not expression with out parameters

Also add span information to compiler errors.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
- Teach the hoister/destructuring planner to respect parent scope when building binding plans for extra arguments, so already-bound vars yield equality checks.
- Update the compiler’s function-call path to drop the trailing out-argument, run its binding plan after the call, and share call-target resolution logic.
- Add regression suites for builtin and user-defined out-parameter scenarios plus align the CLI example output when RVM returns undefined.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
Comment thread src/languages/rego/compiler/program.rs Fixed
- Add a scoped soft_assert_mode to the compiler so `not` statements compile their subexpressions without emitting hard AssertCondition/AssertNotUndefined instructions.
- Teach binding-plan application to return an optional result register; equality plans now yield a boolean in soft mode, allowing not abs(-5 , 3) to succeed instead of aborting.
- Update function-call, loop, and rule plumbing to consume the new binding-plan outcome, including copying the produced register when an out-parameter equality is used.
- Trim the OPA TODO list to the remaining troublesome folders.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
Comment thread src/languages/rego/compiler/function_calls.rs

@dpokluda David Pokluda (dpokluda) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

:shipit:

@anakrish
Anand Krishnamoorthi (anakrish) merged commit 1d627f3 into microsoft:main Dec 3, 2025
41 checks passed
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