Skip to content

Extend TPE to support attribute level partial information - #2547

Open
john-h-kastner-aws wants to merge 5 commits into
tpe-reduce-has-hastag-falsefrom
tpe-final
Open

john-h-kastner-aws wants to merge 5 commits into
tpe-reduce-has-hastag-falsefrom
tpe-final

Conversation

@john-h-kastner-aws

@john-h-kastner-aws john-h-kastner-aws commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description of changes

This is the core implementation of "TPE infinity" extension. It adds the internal implementation details required to support partial evaluation with attribute level partial information.

It doesn't include the public API, which will come in a PR on top of this for separate review.

The internal representation of partial values now supports the following states for attributes.

  1. A known value
  2. An attribute known to exist, but with an unknown value
  3. An entirely unknown attribute which may or may not exist
  4. An attribute which does not exist

Issue #, if available

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

  • A breaking change requiring a major version bump to cedar-policy (e.g., changes to the signature of an existing API).
  • A backwards-compatible change requiring a minor version bump to cedar-policy (e.g., addition of a new API).
  • A bug fix or other functionality change requiring a patch to cedar-policy.
  • A change "invisible" to users (e.g., documentation, changes to "internal" crates like cedar-policy-core, cedar-validator, etc.)
  • A change (breaking or otherwise) that only impacts unreleased or experimental code.

I confirm that this PR (choose one, and delete the other options):

  • Updates the "Unreleased" section of the CHANGELOG with a description of my change (required for major/minor version bumps).
  • Does not update the CHANGELOG because my change does not significantly impact released code.

I confirm that cedar-spec (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar formal model or DRT infrastructure.
  • Requires updates, and I have made / will make these updates myself. (Please include in your description a timeline or link to the relevant PR in cedar-spec, and how you have tested that your updates are correct.)
  • Requires updates, but I do not plan to make them in the near future. (Make sure that your changes are hidden behind a feature flag to mark them as experimental.)
  • I'm not sure how my change impacts cedar-spec. (Post your PR anyways, and we'll discuss in the comments.)

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar language specification.
  • Requires updates, and I have made / will make these updates myself. (Please include in your description a timeline or link to the relevant PR in cedar-docs. PRs should be targeted at a staging-X.Y branch, not main.)
  • I'm not sure how my change impacts the documentation. (Post your PR anyways, and we'll discuss in the comments.)

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Coverage Report

Head Commit: 3c21bbeda5975c5b1da9b574492bdfb95e5e0841

Base Commit: 811ec0765704c43724e66e9e1f9e60ae73e8009e

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 91.31%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy-core/src/batched_evaluator.rs 🟢 8/9 88.89% 141
cedar-policy-core/src/tpe/entities.rs 🟢 311/346 89.88% 136-140, 220, 275, 308-313, 364-374, 376-379, 627-633
cedar-policy-core/src/tpe/evaluator.rs 🟢 69/72 95.83% 511, 529, 546
cedar-policy-core/src/tpe/request.rs 🟢 31/35 88.57% 275-278
cedar-policy-core/src/tpe/value.rs 🟢 126/131 96.18% 102, 119, 142, 204, 264
cedar-policy-core/src/validator/coreschema.rs 🔴 0/6 0.00% 630-635
cedar-policy/src/api/tpe.rs 🟢 54/57 94.74% 114, 305-306

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 88.42%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4722/5102 92.55% --
cedar-policy 🟢 4861/5965 81.49% --
cedar-policy-cli 🟡 1294/1669 77.53% --
cedar-policy-core 🟢 25059/28260 88.67% --
cedar-policy-formatter 🟢 914/1088 84.01% --
cedar-policy-symcc 🟢 6931/7405 93.60% --
cedar-wasm 🔴 0/28 0.00% --

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>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Coverage Report

Head Commit: 4594d0451fcbd274a91dea146faf9c3f73bfbad3

Base Commit: d3d9a458bc384ab36030d5e76cdcc47d2bce1c7b

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 91.04%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy-core/src/batched_evaluator.rs 🟢 8/9 88.89% 141
cedar-policy-core/src/tpe/entities.rs 🟢 291/326 89.26% 137-141, 221, 276, 309-314, 365-375, 377-380, 634-640
cedar-policy-core/src/tpe/evaluator.rs 🟢 69/72 95.83% 511, 529, 546
cedar-policy-core/src/tpe/request.rs 🟢 31/35 88.57% 275-278
cedar-policy-core/src/tpe/value.rs 🟢 126/131 96.18% 102, 119, 142, 204, 264
cedar-policy-core/src/validator/coreschema.rs 🔴 0/6 0.00% 630-635
cedar-policy/src/api/tpe.rs 🟢 54/57 94.74% 114, 305-306

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 88.42%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4722/5102 92.55% --
cedar-policy 🟢 4861/5965 81.49% --
cedar-policy-cli 🟡 1294/1669 77.53% --
cedar-policy-core 🟢 25066/28267 88.68% --
cedar-policy-formatter 🟢 914/1088 84.01% --
cedar-policy-symcc 🟢 6931/7405 93.60% --
cedar-wasm 🔴 0/28 0.00% --

Signed-off-by: jkastner <jkastner@amazon.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Coverage Report

Head Commit: b877242d2ab072acc3da92382a354bf39a46dbd9

Base Commit: d3d9a458bc384ab36030d5e76cdcc47d2bce1c7b

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 92.21%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy-core/src/batched_evaluator.rs 🟢 8/9 88.89% 141
cedar-policy-core/src/tpe/entities.rs 🟢 243/266 91.35% 133-137, 272, 305-310, 361-364, 604-610
cedar-policy-core/src/tpe/evaluator.rs 🟢 68/71 95.77% 511, 529, 546
cedar-policy-core/src/tpe/request.rs 🟢 31/35 88.57% 275-278
cedar-policy-core/src/tpe/value.rs 🟢 129/134 96.27% 92, 109, 132, 194, 257
cedar-policy-core/src/validator/coreschema.rs 🔴 0/6 0.00% 630-635
cedar-policy/src/api/tpe.rs 🟢 54/57 94.74% 114, 305-306

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 88.43%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4722/5102 92.55% --
cedar-policy 🟢 4861/5965 81.49% --
cedar-policy-cli 🟡 1294/1669 77.53% --
cedar-policy-core 🟢 25054/28244 88.71% --
cedar-policy-formatter 🟢 914/1088 84.01% --
cedar-policy-symcc 🟢 6931/7405 93.60% --
cedar-wasm 🔴 0/28 0.00% --

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.

1 participant