feat(plugin): Add result accessor to OperationEndInfo - #596
Conversation
Pull request was converted to draft
70c49fd to
85d282c
Compare
85d282c to
f22bf2e
Compare
f22bf2e to
fdbfe49
Compare
Pull request was converted to draft
Resolves the OperationEndInfo conflict against the preview-marking change in #620, which replaced the record-level '@deprecated This is a preview API' javadoc with @experimental on the individual record components. The new result component now carries @experimental, matching error on the same record and executionInput/executionResult on the invocation records added in #622.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…he old arity
Review feedback on the result accessor:
- Only a SUCCEEDED operation reports a result. A wait-for-condition is
checkpointed as STEP and reuses stepDetails().result() to carry its
intermediate check-loop state between attempts, so a failed one could
surface that state as its result, contradicting the documented
null-on-failure contract. Verified: without the guard the new test
reports {"polls":2} for a FAILED operation.
- Override toString() to omit result. Records render every component, so
plugins that log the info object whole would have begun emitting
customer payloads (possibly secrets or personal data). Output is
otherwise unchanged; matches the invocation records from #622.
- Add a constructor at the previous 11-argument arity delegating with a
null result, so existing callers keep compiling and linking.
- Cover the CHAINED_INVOKE, CALLBACK, and CONTEXT extraction branches,
which had no direct test.
This comment has been minimized.
This comment has been minimized.
2b91878 to
36eae1a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| : null; | ||
| case CONTEXT -> | ||
| operation.contextDetails() != null ? operation.contextDetails().result() : null; | ||
| default -> null; |
There was a problem hiding this comment.
Nonblocking. This default branch makes it harder to catch when we are adding new primitives.
| if (operation == null || operation.type() == null || operation.status() != OperationStatus.SUCCEEDED) { | ||
| return null; |
There was a problem hiding this comment.
Codex AI review
[P2] Preserve results for virtual operations. Successful virtual child contexts, including flat map/parallel branches, call fireOnOperationEnd(null, ...) after already serializing their result; non-checkpointed empty maps also pass null. This guard therefore reports result() == null despite a successful result. Thread the serialized value through the operation-end conversion when no backend Operation exists, and add flat-branch and empty-map integration coverage.
Codex AI reviewOne correctness gap remains in result propagation for successful virtual operations. Reviewed commit |
Claude AI reviewNo blocking findings. This PR cleanly adds a Verified as correct:
Minor, non-blocking nit (not filed inline): the new javadoc at Residual test risk: low. The added tests cover the extraction matrix and the redaction/compat behavior end-to-end. 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
#579
Description
OperationEndInfo exposed error() for failed operations but had no way for plugins to access the serialized result of successful operations.
Demo/Screenshots
N/A
Checklist
Testing
Unit Tests
Have unit tests been written for these changes? Added
Integration Tests
Have integration tests been written for these changes? Added
Examples
Has a new example been added for the change? (if applicable) N/A