Refine active-rule deferral path matching; expand interpreter docs with concrete examples#745
Draft
Copilot wants to merge 5 commits into
Draft
Refine active-rule deferral path matching; expand interpreter docs with concrete examples#745Copilot wants to merge 5 commits into
Copilot wants to merge 5 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix behaviour differing from OPA on cyclic references
Handle cross-package cyclic references without over-eager recursion in interpreter/RVM
Jun 9, 2026
Copilot
AI
changed the title
Handle cross-package cyclic references without over-eager recursion in interpreter/RVM
Resolve cross-package Jun 9, 2026
data import recursion misclassification in interpreter and RVM
anakrish
reviewed
Jun 9, 2026
| // No rule found; fall back to module-level imports. | ||
| let import_key = format!("{}.{}", &self.current_package, root); | ||
| if let Some(import_expr) = self.policy.inner.imports.get(&import_key) { | ||
| if let Ok(mut import_chain) = parse_reference_chain(import_expr) { |
Collaborator
There was a problem hiding this comment.
Document this nicely. Not clear what is going on.
|
|
||
| /// Ensures all rule/default-rule paths matching a dynamic data lookup are evaluated. | ||
| /// Matches both exact path (`data.a.b`) and descendants (`data.a.b.*`). | ||
| fn ensure_matching_rules_for_dynamic_data_index(&mut self, path: &str) -> Result<()> { |
Collaborator
There was a problem hiding this comment.
Is this called in the hot path?
Copilot
AI
changed the title
Resolve cross-package
Refine active-rule deferral path matching; expand interpreter docs with concrete examples
Jun 9, 2026
data import recursion misclassification in interpreter and RVM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the data lookup deferral path in the interpreter to be clearer and more efficient. It adds thorough inline documentation and examples while tightening path matching to avoid unnecessary allocation in hot evaluation flow.
Deferral matching logic
module_path + "." + rule_path) with segment-aware prefix checks.request_matches_active_rule_path(requested_path, module_path, rule_path)to express matching semantics directly.Performance/idiomatic Rust
format!allocation inside active-rule evaluation checks.strip_prefix+ boundary-aware helper logic for allocation-light path comparisons.Comments and examples
data.a.banddata.a.b.descendants) and recursion wording for cross-package/sibling re-entry.