docs: record Java payload offloading architecture - #678
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| The SDK-owned envelope distinguishes inline data from an external reference and carries preview, producer ownership, | ||
| content digest, producer context, and load semantics. `PayloadOffloadContext` explicitly provides execution identity, | ||
| payload kind, operation metadata, attempt, and the original serialization value when available. |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| The SDK envelope uses a reserved marker and version. During decoding: | ||
|
|
||
| - data without the reserved marker is a legacy raw `SerDes` string and is passed directly to `SerDes`; | ||
| - a recognized supported envelope is validated and decoded; | ||
| - a recognized malformed or unsupported envelope fails closed; | ||
| - disabling offloading writes the legacy raw format rather than an envelope. |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| public interface PayloadOffloader { | ||
| StoredPayload store( | ||
| String serializedPayload, | ||
| PayloadOffloadContext context); | ||
|
|
||
| String load( | ||
| StoredPayload payload, | ||
| PayloadOffloadContext context); | ||
| } |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Good point. We will make lifecycle ownership explicit rather than add an SDK-managed release or expiry mechanism. The SDK does not know the application retention period for an execution, its history, or delayed result decoding, so PayloadOffloader will remain a store/load contract and the SDK will never delete stored payloads, including after operation completion or checkpoint failure. Applications and storage implementations must manage retention and garbage collection externally, retain immutable references while any execution, replay, history inspection, or result decoder may need them, and clean up checkpoint-failure orphans according to their own lifecycle policy. The SDK-provided execution and entity metadata can be used to organize that cleanup.
| public record StoredPayload( | ||
| String reference, | ||
| Map<String, Object> preview) {} |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| Ordinary Lambda payloads should remain the default. An offloaded request should use a versioned source frame and | ||
| two-sided opt-in so a standard function, an older SDK, or a target using a different payload contract does not receive | ||
| an opaque storage envelope accidentally. |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_a7axren6v3zm3tulbax62pwffy
[P1] Authenticate cross-execution reference frames. Two-sided opt-in prevents accidental incompatibility but does not prove the claimed producer context, reference, or tenant; a forged or leaked frame could load another execution's payload from shared storage. Require a signed/MACed capability or service-attested source plus tenant validation, with forged-reference and cross-tenant rejection tests.
|
|
||
| The SDK envelope uses a reserved marker and version. During decoding: | ||
|
|
||
| - data without the reserved marker is a legacy raw `SerDes` string and is passed directly to `SerDes`; |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_rheryyqbwobolm46tjwl6gxi6z
[P1] Make legacy detection collision-safe. SerDes historically permits arbitrary strings, so an existing checkpoint—or raw payload written while offloading was disabled—may already match the marker and be misread as an envelope. Use out-of-band format metadata or another migration scheme that cannot reinterpret legacy user data, and test a valid legacy payload matching the proposed marker.
| public interface PayloadOffloader { | ||
| StoredPayload store( | ||
| String serializedPayload, | ||
| PayloadOffloadContext context); | ||
|
|
||
| String load( | ||
| StoredPayload payload, | ||
| PayloadOffloadContext context); | ||
| } |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_zpmaifv6futdsizdh74idrh7ss
[P1] Define a lifecycle for stored references. A store/load-only contract cannot reclaim a successful publication whose checkpoint fails, while backend cleanup without a specified retention horizon can break late replay, history inspection, or root decoding. Define cleanup ownership and minimum safe retention, or add commit/expiry/release support, with checkpoint-failure and late-replay tests.
| public record StoredPayload( | ||
| String reference, | ||
| Map<String, Object> preview) {} |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_mrow7c5lmd7sgoiwhmoypzf7pw
[P2] Make preview data immutable and wire-safe. This record exposes a mutable Map<String, Object> directly; mutation after sizing can change the final envelope, and arbitrary object graphs may fail SDK-owned serialization. Constrain previews to a defined wire type and defensively deep-copy them in the public model.
Claude AI reviewThis PR is documentation-only: it adds Review notes:
No code, public API, checkpoint/replay, concurrency, or test files are touched by this PR, so the SDK-specific correctness/regression concerns (replay semantics, stable operation IDs, thread coordination, etc.) do not apply. No residual test risk: per AGENTS.md/CONTRIBUTING.md, documentation-only changes do not require unit/integration tests, and none were expected here. No actionable findings. Reviewed commit |
Codex AI reviewFour architecture contract gaps remain around cross-execution trust, replay compatibility, payload lifecycle, and immutable preview data. Reviewed commit |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue Link, if available
Related to #463 and #366.
Description
PayloadOffloaderas the Java SDK payload-storage architecture.SerDes, composable pipeline, and dedicated offloader options.SerDesconfigurations.disablePayloadOffloading()operation-builder API rather than a public disabled sentinel.SerDesAPIs when those are more idiomatic for their languages.Demo/Screenshots
Not applicable; documentation-only change.
Checklist
Testing
git diff --cached --check