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
[Requirement]: Map/Parallel custom-serdes cases should use a lossy transform to pin fresh-success round-trip semantics #114
map (a companion case is also needed for parallel — see below)
Behavior to cover
The Map (test-requirements/map/9-14.yaml) and Parallel (test-requirements/parallel/8-15.yaml) custom per-item / per-branch serdes requirements currently specify a round-tripping (symmetric) serializer:
9-14 wraps v → wrapped:v → v
8-15 wraps v → {"wrapped": v} → v
Because serialize→deserialize is value-preserving, their ExpectedResult is round-trip-equal to the pre-serde values. So these cases assert only that the serde is invoked (via the checkpointed wrapped:… payload) — they never pin whether a serde's transform is reflected in the aggregate result on a fresh (non-replay) success.
Proposal: add (or amend to) Map and Parallel custom-serdes cases that use a lossy transform — mirroring the uppercasing serde already used in step/1-6 and child/3-14 — where the operation body returns the input unchanged and the serde uppercases on serialize / reads it back verbatim on deserialize. Assert that the fresh single-shot execution's aggregate result equals the transformed values, e.g. items ["x", "y"] → Result: ["X", "Y"], matching what replay reconstructs from the checkpointed payloads.
Why it matters
step/1-6 and child/3-14 already mandate fresh-success round-trip at the language-neutral level (a fresh execution must return the uppercased value). Map/Parallel leave it unspecified, so an SDK can return the raw body value on the fresh run but the serde-transformed value on replay — a fresh-vs-replay divergence that silently corrupts downstream logic — while the suite stays green.
This is precisely the spot implementations differ: the JS SDK reconstructs Map/Parallel results by re-driving child contexts on replay, whereas other SDKs (e.g. .NET) use a parent-summary representation and must explicitly re-deserialize the just-written checkpoint on a fresh success. A lossy serde is the only thing that catches the divergence; the current symmetric serde cannot.
Expected cross-SDK behavior
On a fresh success, a compliant SDK's Map/Parallel aggregate result should reflect each item's/branch's serde transform — identical to what replay produces from the checkpointed payloads.
Known divergence to ratify: whether all SDKs already guarantee this for Map/Parallel (as they do for step/child), or whether some apply the transform only on replay. If maintainers prefer to settle the semantics question first, this can start as a discussion / behavior dispute and convert to the requirement once ratified.
Take a Map over ["x", "y"] where each iteration body returns its item unchanged and a custom ItemSerializer is attached. The serde transform happens at checkpoint time: the SDK writes the serializer's output to history, and on replay reads the result back by deserializing that stored payload.
Case A — today's symmetric/lossless serde (map/9-14): wraps on serialize, unwraps on deserialize.
serialize: x → "wrapped:x" (checkpoint payload)
deserialize: "wrapped:x" → x
Round-trip is lossless (deserialize(serialize(x)) == x), so the two possible SDK behaviors are indistinguishable:
SDK re-deserializes checkpoint on fresh?
fresh run returns
replay returns
yes
x
x
no (returns raw body value)
x
x
Both rows are identical — the test passes whether or not the SDK implements fresh-success round-trip. 9-14 proves the serde was invoked (payload is wrapped:x) but cannot prove the fresh result matches replay.
Case B — proposed lossy serde (mirrors step/1-6): uppercases on serialize, reads back verbatim; body still returns the item unchanged.
serialize: x → "X" (checkpoint payload)
deserialize: "X" → "X"
Round-trip is now lossy (deserialize(serialize("x")) == "X"), so the behaviors diverge:
SDK re-deserializes checkpoint on fresh?
fresh run returns
replay returns
yes (correct)
["X","Y"]
["X","Y"]
no (bug)
["x","y"] ❌
["X","Y"]
A buggy SDK returns ["x","y"] on the first execution but ["X","Y"] after any replay — same Map, two different results, silently corrupting downstream consumers of the fresh value. Setting ExpectedResult: ["X","Y"] fails the fresh run for the buggy SDK. The lossy serde is the only thing that separates the rows.
This is why step/1-6 and child/3-14 (which already use the lossy uppercasing serde) pin the behavior, while the lossless map/9-14 and parallel/8-15 leave it unspecified — exactly the gap this requirement closes.
Activity
GarrettBeatty commentedon Sep 3, 2026
Concrete example: why a lossy serde is required
Take a Map over
["x", "y"]where each iteration body returns its item unchanged and a customItemSerializeris attached. The serde transform happens at checkpoint time: the SDK writes the serializer's output to history, and on replay reads the result back by deserializing that stored payload.Case A — today's symmetric/lossless serde (
map/9-14): wraps on serialize, unwraps on deserialize.x→"wrapped:x"(checkpoint payload)"wrapped:x"→xRound-trip is lossless (
deserialize(serialize(x)) == x), so the two possible SDK behaviors are indistinguishable:xxxxBoth rows are identical — the test passes whether or not the SDK implements fresh-success round-trip.
9-14proves the serde was invoked (payload iswrapped:x) but cannot prove the fresh result matches replay.Case B — proposed lossy serde (mirrors
step/1-6): uppercases on serialize, reads back verbatim; body still returns the item unchanged.x→"X"(checkpoint payload)"X"→"X"Round-trip is now lossy (
deserialize(serialize("x")) == "X"), so the behaviors diverge:["X","Y"]["X","Y"]["x","y"]❌["X","Y"]A buggy SDK returns
["x","y"]on the first execution but["X","Y"]after any replay — same Map, two different results, silently corrupting downstream consumers of the fresh value. SettingExpectedResult: ["X","Y"]fails the fresh run for the buggy SDK. The lossy serde is the only thing that separates the rows.This is why
step/1-6andchild/3-14(which already use the lossy uppercasing serde) pin the behavior, while the losslessmap/9-14andparallel/8-15leave it unspecified — exactly the gap this requirement closes.