Skip to content

Update TPE DRT for API changes#973

Merged
john-h-kastner-aws merged 8 commits into
mainfrom
fix-tpe-drt
Jun 25, 2026
Merged

Update TPE DRT for API changes#973
john-h-kastner-aws merged 8 commits into
mainfrom
fix-tpe-drt

Conversation

@john-h-kastner-aws

@john-h-kastner-aws john-h-kastner-aws commented Jun 22, 2026

Copy link
Copy Markdown
Contributor
  • Use public API to access true/false/error/residual permits/forbids
  • Use true_permits/true_forbids instead of satisfied_
  • Replace residual_policies call with policies

Fixes break caused by change in cedar-policy/cedar#2401. Also depends on cedar-policy/cedar#2418

unrelated change: made the error case comparison slightly stricter, failing on some ffi error that were previously ignored.

Copilot AI 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.

Pull request overview

Updates the Cedar DRT TPE fuzz comparison helper to match recent cedar-policy TPE response API changes and tightens how Rust/Lean error cases are handled during equivalence checking.

Changes:

  • Switches from satisfied_* iterators to the public true_*, false_*, error_*, and residual_* policy-ID iterators for Rust TPE response comparison.
  • Replaces residual extraction via residual_policies() with iterating policies() and building a PolicyId -> PST Expr map.
  • Makes the “both sides errored” case stricter by only accepting FfiError::LeanBackendError(_) as an expected Lean-side error.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cedar-drt/fuzz/src/tpe.rs Outdated
Comment thread cedar-drt/fuzz/src/tpe.rs
Comment thread cedar-drt/fuzz/src/tpe.rs
Comment thread cedar-drt/fuzz/src/tpe.rs
john-h-kastner-aws and others added 5 commits June 25, 2026 19:23
Signed-off-by: John Kastner <jkastner@amazon.com>
Signed-off-by: John Kastner <jkastner@amazon.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: John Kastner <jkastner@amazon.com>
Signed-off-by: jkastner <jkastner@amazon.com>
Signed-off-by: jkastner <jkastner@amazon.com>
Signed-off-by: jkastner <jkastner@amazon.com>
Signed-off-by: jkastner <jkastner@amazon.com>
let [pst::Clause::When(pst_expr)] = pst_policy.body().clauses().as_slice() else {
panic!("expected exactly one `when` clause in residual")
};
(id, pst_expr.as_ref().clone())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That looks much nicer than before.

@john-h-kastner-aws john-h-kastner-aws merged commit 795ddcc into main Jun 25, 2026
14 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.

4 participants