Skip to content

feat: configurable arbitrary precision#433

Merged
stefan-gorules merged 10 commits intomasterfrom
feat/configurable-arbitrary-precision
Mar 3, 2026
Merged

feat: configurable arbitrary precision#433
stefan-gorules merged 10 commits intomasterfrom
feat/configurable-arbitrary-precision

Conversation

@stefan-gorules
Copy link
Copy Markdown
Contributor

@stefan-gorules stefan-gorules commented Feb 19, 2026

Make arbitrary_precision an optional feature flag

This PR refactors serde_json's arbitrary_precision from being always-on to an opt-in Cargo feature flag across the core crates (zen-types, zen-expression, zen-engine). All bindings (Node.js, Python, C, UniFFI) explicitly enable the flag, preserving current behavior.

What changed:

The arbitrary_precision feature on serde_json was previously hardcoded in zen-types, zen-expression, and zen-engine. Now each crate declares its own arbitrary_precision feature that propagates through the dependency chain (zen-enginezen-expressionzen-typesserde_json). Core crates default to arbitrary_precision off, while all binding crates opt in explicitly.

When the feature is enabled (current default for all bindings), number handling is unchanged — numbers round-trip through serde_json as strings and are parsed via Decimal::from_str_exact / from_scientific.

When disabled, serialization and deserialization fall back to native i64/u64/f64 conversions, and the NUMBER_TOKEN-based struct hack used by arbitrary_precision is compiled out via #[cfg] guards in the Variable and RcValue ser/de impls.

Additional changes:

  • CI: replaced addnab/docker-run-action@v3 with stefan-gorules/docker-run-action@v1

@stefan-gorules stefan-gorules merged commit 46688a4 into master Mar 3, 2026
54 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.

2 participants