PoC: Return the same evaluation errors from TPE as from concrete evaluation#2162
Draft
luxas wants to merge 1 commit intocedar-policy:mainfrom
Draft
PoC: Return the same evaluation errors from TPE as from concrete evaluation#2162luxas wants to merge 1 commit intocedar-policy:mainfrom
luxas wants to merge 1 commit intocedar-policy:mainfrom
Conversation
…uation Signed-off-by: Lucas Käldström <lucas.kaldstrom@upbound.io>
This was referenced Feb 17, 2026
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.
Description of changes
Draft PR, I need to double-check some of the logic here still and add some more unit tests, but it should be good enough to discuss at least. What do you think about this rewrite? I think it could help make the code between TPE and the concrete evaluator more similar and hopefully comparable, especially when the older
partial-evalis deprecated and removed from the concrete evaluator.Discussed this with @john-h-kastner-aws. The idea is to return a concrete error whenever the concrete evaluator would, and just exactly the same error as the concrete evaluator would. However, cases like
<residual> && <error>do not fold to<error>, as<residual>could evaluate to another error.Also noted that the stack overflow check was not added to TPE. Also I'm trying to make the errors nice by preserving the Loc information, but it seems like I need to do some other thing still to produce nice reports in miette to show where the error came from.
Fixes: #1736
(at least part of, we could add the
Diagnosticsin a follow-up PR)Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
I confirm that this PR (choose one, and delete the other options):
Not sure, do you want a release note for this one? I can add one.
I confirm that
cedar-spec(choose one, and delete the other options):Would you be interested in updating cedar-spec with a theorem that the errors should be the same between concrete and TPE?
I confirm that
docs.cedarpolicy.com(choose one, and delete the other options):