Skip to content

Upgrade cel-rust 0.12 → 0.13 (then revisit 0.14 once released) #31

@hardbyte

Description

@hardbyte

Goal

Upgrade our cel dependency from 0.12.0 to 0.14.0 in two steps, with 0.13 as a stable midpoint.

Why two steps

  • 0.13.0 (2026-03-12) introduced the "dyn Val" rewrite — Value becomes an outer convenience layer over Box<dyn Val>, Context stores dyn Val directly (no longer Send), and trait-driven dispatch (Adder, Comparer, Indexer, Sizer, etc.) replaces the previous ad-hoc impls. Also: no type coercion on map index access; NoSuchOverload when indexing into strings; Err-resilient AND/OR.
  • 0.14.0 (release PR clarkmcc/cel-rust#279, open since 2026-03-12) adds struct support (StructDef, CelStruct), Optional proper overloads, removes lifetimes from Type/Env, and removes contains from containers (string-only).

Going through 0.13 first lets us absorb the dyn-Val refactor against a released, semver-stable target before chasing the moving 0.14 surface.

Our cel surface area (everything that will need to change)

  • src/lib.rs / src/context.rs — exhaustive Value::* pattern matching for Python conversions (Null, Bool, Int, UInt, Float, Timestamp, Duration, String, List, Bytes, Map, Opaque).
  • cel::Context construction and variable insertion.
  • cel::Program::compile and execution.
  • cel::ExecutionError — we match exhaustively to map to typed Python exceptions (UndeclaredReference, UnsupportedBinaryOperator, FunctionError, …).
  • cel::objects::{Key, OptionalValue, TryIntoValue}.
  • cel::extractors::Arguments for user-registered functions.
  • Value::Opaque(Arc<…>) for our Optional wrapper.

Plan

Phase 1 — Upgrade to 0.13.0

  • Bump cel = "0.13" in Cargo.toml.
  • Migrate Value/Context interop to the dyn-Val model (Context stores dyn Val; we lose Send).
  • Update ExecutionError mapping for any renamed/removed variants.
  • Verify map indexing — no more type coercion; ensure our tests still pass or update behaviour intentionally.
  • Verify string indexing now errors (was previously allowed) — surface as a Python exception.
  • Re-run benchmarks (bench.py) and note any regression.
  • Full test suite green.

Phase 2 — Upgrade to 0.14.0 (wait for release)

  • Track clarkmcc/cel-rust#279; upgrade once published to crates.io.
  • Drop lifetimes from Type/Env usage.
  • Adjust: contains no longer works on containers (string-only).
  • Decide whether to expose CEL struct support to Python.

Phase 3 — Repo move

  • Upstream is moving from clarkmcc/cel-rust to the cel-rust org (#237). Update any links/docs once the move completes.

Related upstream activity worth watching

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions