You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(codec): reject unsafe Python integers before JSON encoding #331
Scope for 0.11: reject integers outside the JavaScript safe range before JSON output. Preserve safe numbers, finite float behavior, and Arrow int64 semantics. Keep Python int mapped to TypeScript number.
Acceptance criteria:
Both safe integer boundaries round-trip exactly.
Positive and negative values at and beyond 2**53 reject, including signed int64 bounds and factorial examples.
Errors include the result path and explicit conversion guidance.
Booleans and valid finite floats remain supported.
Arrow int64 rows remain exact.
Affected menagerie rows become LOUD_FAIL with discriminating expectations.
Generated-wrapper tests exercise the rejection through the real bridge.
Migration documentation explains this behavior change.
Tagged bigint transport is separate work in #337. Do not return bigint under an unchanged Promise.
Architectural approach:
Apply the integer policy from #343 consistently across producer, generated types, and validation. Use #344 to verify boundaries. Preserve this issue's rejection policy unless a separately reviewed design changes it. Coordinate through #345.
Unsafe Python integers now raise a conversion error before JSON can round them. Safe boundaries, both signs of unsafe bounds, factorial results, and nested paths have producer, generated-validator, menagerie, and isolated-consumer coverage. Migration guidance explains the safe-number range and explicit alternatives.
Evidence: runtime/tywrap_bridge_core.py, src/contracts/value-contract.ts, src/core/callable-compiler.ts, test/python/test_bridge_core.py, test/isolated_consumer.conformance.ts, and docs/guide/migrating-to-0-11.md.
Verified release evidence:
Implementation #362 and release #354 merged after independent review, green checks, and resolved CodeRabbit findings. Final candidate 0861ebe and merge f6f811d have identical trees.
Final full CI passed, including check:all, scientific 103/103, clean consumer 20/20, real Pyodide/browser 8/8, performance 25/25, and Node/Python/Bun/OS checks. Performance budgets remained unchanged.
Fresh published-consumer run passed 20/20 checks with exact registry versions, isolated imports, and generated calls. It used no local-package fallback.
Activity
bbopen commentedon Sep 20, 2026
Unsafe Python integers now raise a conversion error before JSON can round them. Safe boundaries, both signs of unsafe bounds, factorial results, and nested paths have producer, generated-validator, menagerie, and isolated-consumer coverage. Migration guidance explains the safe-number range and explicit alternatives.
Evidence:
runtime/tywrap_bridge_core.py,src/contracts/value-contract.ts,src/core/callable-compiler.ts,test/python/test_bridge_core.py,test/isolated_consumer.conformance.ts, anddocs/guide/migrating-to-0-11.md.Verified release evidence:
0861ebeand mergef6f811dhave identical trees.The architecture decision records the accepted scope and prototype limits.
Closing with the implemented and verified 0.11 release outcome.