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
fix(generic): do not flatten a nested object that is null in any row (losslessness)
_analyze_flattenable skipped None during shape analysis, so a field that was a
dict in some rows and None at an intermediate nesting level in others was
flattened; on decode the None row's leaves resolved as absent and unflattened
to a missing key, dropping the value ({"meta":{"owner":None}} decoded to {}).
Now bails to the attachment path when a nested field (parent_path != "") is None;
a top-level None still flattens losslessly via the "-"/all-null rule.
Adds test_flatten_roundtrip: aligned nested-object arrays with null at depth —
the shape the scalar-only generator never produced, which is why this shipped
despite property-based round-trip fuzzing. Enforced cross-SDK by the shared
conformance fixtures flatten/017-019. (Prototype pollution does not affect
Python; dicts have no mutable prototype.)
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,15 @@
1
1
# Changelog
2
2
3
+
## v2.2.2 (2026-07-10)
4
+
5
+
### Fixes
6
+
7
+
-**Losslessness (nested null):** a nested object that is null at an intermediate level (e.g. `{"meta": {"owner": None}}`) is no longer flattened. Previously its leaves encoded as absent (`~`) and unflattened to a missing key, silently dropping the null. Such fields now fall back to the attachment mechanism; a top-level `None` still flattens losslessly (emits `-`, reconstructs via the all-null rule). Enforced by the shared conformance fixtures `flatten/017`–`019`. Prototype pollution does not affect Python (dicts have no mutable prototype).
8
+
9
+
### Tests
10
+
11
+
-`test_flatten_roundtrip`: aligned arrays whose shared fields are fixed-shape nested objects with a field or an intermediate nested level sometimes null/absent — the shape the prior scalar-only generator never produced, leaving the flatten/unflatten path unexercised. Verified to fail on the pre-fix encoder and pass on the fix.
Copy file name to clipboardExpand all lines: pyproject.toml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
5
5
[project]
6
6
name = "gcf-python"
7
-
version = "2.2.1"
7
+
version = "2.2.2"
8
8
description = "The AI-native wire format for structured data. 50-92% fewer tokens than JSON. 100% comprehension on every frontier model. Zero dependencies."
0 commit comments