Skip to content

test(conformance): plugin hook-info field-shape handlers (10-19..10-23) - #602

Draft
wangyb-A wants to merge 4 commits into
plugin-hook-parity-fixfrom
plugin-hook-field-shape
Draft

test(conformance): plugin hook-info field-shape handlers (10-19..10-23)#602
wangyb-A wants to merge 4 commits into
plugin-hook-parity-fixfrom
plugin-hook-field-shape

Conversation

@wangyb-A

@wangyb-A wangyb-A commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds 5 conformance handlers (conformance-tests/src/main/java/plugin/Plugin{InvocationInfo,OperationInfo,AttemptInfo,OperationChange,ContextInfo}Shape.java) plus template_plugin.yaml entries implementing plugin hook-info FIELD-SHAPE requirements 10-19..10-23 from aws/aws-durable-execution-conformance-tests#72 (land that PR first).

Each handler logs ONE single-line JSON record per hook event: a canonical camelCase dump of that hook's own info record, with null/unexposed fields OMITTED so a missing key fails its assertion. Real SDK APIs only, spotless-clean.

Stacked PR

Top of a 2-PR stack — base is the parity-fix branch, not main.

  1. fix(plugin): surface missing state fields on hook info records #618 — SDK parity fix (plugin-hook-parity-fix), exposes the missing hook-info fields.
  2. This PR — the handlers that assert them.

The dependency is real, not cosmetic: the final commit here dumps operations/updatedOperations, isReplay, attempt, executionInput, executionResult and the operation result, which only exist after the parity fix. Review the base PR first; merge it first.

Testing

Live plugin conformance suite (us-west-2), run against the full stack: 23 cases, 0 failures, 2 skipped — 21/21 covered, up from 18/21.

Requirement Before parity fix With stack
10-19 invocation-info shape FAILED PASSED
10-21 attempt-info shape FAILED PASSED
10-22 operation-change shape FAILED PASSED
10-20, 10-23 PASSED PASSED
10-1..10-13, 10-15..10-17 PASSED PASSED

The three prior failures were the deliberate parity signals these handlers exist to produce; the base PR resolves all three.

  • ✅ 10-20 and 10-23 pass (incl. OperationInfo.status, subType tokens, and correct isReplayingChildren semantics), plus the entire mapped 10-1..10-17 regression.
  • 10-14 and 10-18 report UNCOVERED because their handlers live on separate branches — expected, not a regression. The operation-result payload gap stays tracked by behavioral test 10-14 (Add plugin conformance case 10-14 (known SDK gap) #581), out of GA shape-suite scope.

One caveat on evidence: the runner asserts the ExpectedLogs field-presence probes against CloudWatch during the run and then deletes the stack, which takes the log groups with it. The passing assertions are the record; the raw emitted hook records were not retained as an artifact.

Closes #604

@wangyb-A
wangyb-A had a problem deploying to ai-pr-review-runtime August 6, 2026 23:55 — with GitHub Actions Failure
@wangyb-A
wangyb-A had a problem deploying to ai-pr-review-runtime August 6, 2026 23:55 — with GitHub Actions Failure
@wangyb-A wangyb-A changed the title Add hook-info field-shape conformance handlers Plugin hook-info field shape: conformance handlers + SDK parity fixes Aug 10, 2026
@wangyb-A
wangyb-A force-pushed the plugin-hook-field-shape branch from fd7c2c6 to 0bd1029 Compare August 10, 2026 23:44
@wangyb-A wangyb-A changed the title Plugin hook-info field shape: conformance handlers + SDK parity fixes test(conformance): plugin hook-info field-shape handlers (10-19..10-23) Aug 10, 2026
@wangyb-A
wangyb-A changed the base branch from main to plugin-hook-parity-fix August 10, 2026 23:44
Alex Wang added 4 commits August 11, 2026 01:11
The parity fix beneath this commit exposes fields the shape handlers
could not previously read. Dump them so 10-19, 10-21 and 10-22 assert the
real surface rather than recording its absence:

- 10-19: operationsCount and updatedOperationsCount on invocation-start,
  operationsCount and executionStartTimestamp on invocation-end.
- 10-21: isReplay on attempt-start and attempt-end, alongside the
  distinct isReplayingChildren (dumped unasserted).
- 10-22: attempt and isReplay on each change delta item.

The handler javadocs previously documented these as missing Java
surfaces; that prose is updated to describe what is now exposed and to
note that payload fields remain deliberately absent.
@wangyb-A
wangyb-A force-pushed the plugin-hook-field-shape branch from 0bd1029 to 2b28744 Compare August 11, 2026 04:34
@wangyb-A
wangyb-A deployed to ai-pr-review August 14, 2026 21:52 — with GitHub Actions Active
@wangyb-A
wangyb-A temporarily deployed to ai-pr-review-runtime August 14, 2026 21:52 — with GitHub Actions Inactive
@wangyb-A
wangyb-A temporarily deployed to ai-pr-review-runtime August 14, 2026 21:52 — with GitHub Actions Inactive
.str("parentId", info.parentId())
.num("attempt", info.attempt())
.time("startTimestamp", info.startTimestamp())
.bool("isReplayingChildren", info.isReplayingChildren())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex AI review

[P2] Include the operation-level replay flag. UserFunctionStartInfo exposes isReplay() separately from isReplayingChildren(), and this scenario produces both replayed and live context starts. Omitting it prevents 10-23 from detecting an incorrect context-operation replay flag. Emit both fields.

Suggested change
.bool("isReplayingChildren", info.isReplayingChildren())
.bool("isReplay", info.isReplay())
.bool("isReplayingChildren", info.isReplayingChildren())

@github-actions

Copy link
Copy Markdown

Codex AI review

Found one gap in the context hook field-shape coverage. Review was read-only; tests were not run.

Reviewed commit 2b28744f3e7697db95bbc534c4dd625706c9307b. Workflow run

Comment on lines +116 to +117
raw("hook", "\"" + hook + "\"");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude AI review

Maintainability (low): The Rec single-line JSON builder — the constructor plus str/num/bool/time/raw/emit and the static upper/msg/quote methods (~90 lines) — is duplicated verbatim in all five new handlers (PluginAttemptInfoShape, PluginContextInfoShape, PluginInvocationInfoShape, PluginOperationChangeShape, PluginOperationInfoShape), roughly 360 duplicated lines out of the PR's 982 additions.

PluginSupport already exists as the documented home for shared plugin-conformance helpers (it hosts arnField, isStep, isContext, etc.). Because every handler emits the same escaped JSON shape, any future fix to the JSON escaping or field formatting must be applied in five places, and the copies can silently diverge.

Fix: Hoist Rec (and upper/msg/quote) into PluginSupport (or a new package-private PluginJsonRecord class) and have each handler construct the shared type, deleting the per-file copies.

@github-actions

Copy link
Copy Markdown

Claude AI review

Verified all five new conformance handlers plus the PluginSupport.isContext helper and template_plugin.yaml entries against the checked-out base (the plugin-hook-parity-fix branch, which already exposes every field these handlers dump). No correctness, regression, replay-semantics, generic-typing, serialization, or plugin-lifecycle defects survived verification:

  • Every plugin-info accessor used (InvocationInfo/InvocationEndInfo/OperationInfo/OperationEndInfo/OperationChangeInfo/OperationChangeItemInfo/UserFunctionStartInfo/UserFunctionEndInfo) matches the record shapes and nullability.
  • Type tokens are correct: case-sensitive isStep("STEP")/isContext("CONTEXT") against OperationType.toString() (confirmed by PluginInfoConverterTest), and case-insensitive isStepChange for the raw typeAsString() source.
  • SDK APIs (withPlugins, retryStrategy, exponentialBackoff, JitterStrategy.NONE, parallel(...).branch(...), wait(null, ...)) resolve and mirror existing handlers.
  • The Rec JSON builder produces valid single-line JSON (comma bookkeeping, null-skipping, control-char escaping, single durableExecutionArn stamp).

One low-severity maintainability finding: the Rec helper is duplicated verbatim across all five new files — see conformance-tests/src/main/java/plugin/PluginAttemptInfoShape.java:117.

Residual test risk: these handlers have no local/unit coverage — per AGENTS.md, conformance tests are validated only by the live cloud suite in a separate repo, and the PR notes the emitted records were not retained as an artifact (the stack, and its CloudWatch log groups, are deleted after the run). Correctness of the field-shape assertions therefore rests entirely on that live run rather than anything reproducible in this repo.

Reviewed commit 2b28744f3e7697db95bbc534c4dd625706c9307b. Workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin hook info records missing state/metadata fields at invocation, attempt, and change hooks

1 participant