fix(cedar): align cedarpy and cedar-wasm to Cedar Rust 4.8.2 (#168)#271
Conversation
…ples#168) Bump cedarpy 4.8.0->4.8.3 and downgrade @cedar-policy/cedar-wasm 4.10.0->4.8.2 so both bindings wrap the same Rust core, giving true engine parity instead of the prior tested-compatible skew. Update the CEDAR_WASM_VERSION drift-guard constant in cedar-wasm-layer.ts to match. Add Dependabot ignore rules for both packages so future bumps must be coordinated. Verified: contracts/cedar-parity fixtures pass on both engines (12/12), full CDK suite passes (1808/1808), full agent suite passes (819/819). Closes aws-samples#168
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #271 +/- ##
=======================================
Coverage ? 86.09%
=======================================
Files ? 167
Lines ? 39535
Branches ? 3923
=======================================
Hits ? 34036
Misses ? 5499
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No blocker:
|
Same Cedar Rust core (4.8.2), so engine parity is preserved. 4.8.4 picks up Python-side patches: - 4.8.1: pytest/wheel/time/keccak CVE patches in dev/transitive deps - 4.8.4: release-mode benchmark gating (build-only, no runtime impact) Verified our diagnostics.reasons usage (agent/src/policy.py:1133-1134) still surfaces parser-generated policy IDs — the 4.8.2 silent change was reverted in 4.8.3 and that revert is preserved in 4.8.4. Re-ran the full test plan: parity 6/6 + 6/6, CDK 1808/1808, agent 819/819.
|
Bumped to One thing worth calling out: 4.8.0 → 4.8.4 is not a flat patch sequence — 4.8.2 silently changed Re-ran the same test plan: parity 6/6 + 6/6, |
|
Approve after one fix: |
The banner is read by future contributors when bumping either binding; keeping it pointed at the old skew (cedarpy==4.8.0 / cedar-wasm@4.10.0) would mislead them after this PR lands. - agent: cedarpy==4.8.0 -> 4.8.4 - cdk: cedar-wasm@4.10.0 -> 4.8.2
|
lgtm |
Summary
Align both Cedar policy engine bindings to the same underlying Rust core (4.8.2) so the agent-side (
cedarpy) and Lambda-side (@cedar-policy/cedar-wasm) engines have true parity instead of the prior tested-compatible skew.cedarpy4.8.0 → 4.8.4 (still wraps Rust 4.8.2)@cedar-policy/cedar-wasm4.10.0 → 4.8.2CEDAR_WASM_VERSIONdrift-guard constant incdk/src/constructs/cedar-wasm-layer.tsmise.tomlto match new pinsignorerules for both packages so future bumps must be coordinated through a dedicated PRCloses #168.
Why 4.8.2 (not 4.10.0)
No
cedarpyrelease wraps Cedar Rust 4.9+. The latestcedarpy(4.8.4) still pinscedar-policy = "4.8.2". Until k9securityio publishes acedarpywrapping a newer core, 4.8.2 is the only version both bindings can share.API surface check
cdk/src/handlers/shared/cedar-policy.tsonly usespolicySetTextToParts,policyToJson, andisAuthorized— all stable in 4.8.2. No 4.9/4.10-specific calls.agent/src/policy.pyreadsresult.diagnostics.reasons(lines 1133–1134). Note 4.8.0 → 4.8.4 is not a flat patch sequence: 4.8.2 silently changedreasonsto surface@id("…")annotation values instead of parser-generatedpolicy0-style IDs, which would have broken our usage. 4.8.3 reverted that and 4.8.4 keeps the revert, so effective behavior matches 4.8.0.Test plan
agent/tests/test_cedar_parity.py— 6/6 passed (cedarpy 4.8.4 vs golden fixtures)cdk/test/handlers/shared/cedar-parity.test.ts— 6/6 passed (cedar-wasm 4.8.2 vs golden fixtures)mise //cdk:test— 1808/1808 passed, 101/101 suitesmise //agent:quality— 819/819 passed, lint + type-check clean, coverage 72.48% ≥ 72%agent/uv.lock,yarn.lock)Follow-ups
Notes
Documentation under
docs/design/CEDAR_HITL_GATES.mdstill references the priorcedarpy==4.8.0↔cedar-wasm==4.10.0skew narrative. That's intentionally left for a follow-up doc PR — this PR keeps the change set narrow to manifests, lockfiles, the version constant, the parity banner, and Dependabot config so the diff is reviewable as a focused parity-alignment change.