Skip to content

test(map): assert iteration Name in 9-13 so item namer is actually verified - #55

Merged
wangyb-A merged 1 commit into
mainfrom
strengthen-9-13-name-assertions
Jul 31, 2026
Merged

test(map): assert iteration Name in 9-13 so item namer is actually verified#55
wangyb-A merged 1 commit into
mainfrom
strengthen-9-13-name-assertions

Conversation

@wangyb-A

@wangyb-A wangyb-A commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Problem

Requirement 9-13 (map with a custom item namer) identified its two MapIteration
events by placeholder id (${ITER0}, ${ITER1}) and never asserted Name. The
runner only checks keys present in the expected event and ignores extra actual keys,
so an SDK that accepted an item namer and then silently ignored it still passed
9-13. The requirement only proved that setting the option did not break results or
history shape.

Change

Name is an assertable top-level field on ContextStarted / ContextSucceeded.
9-13 now asserts it literally on all six context events:

  • Map context: named-items
  • iteration 0: item-1
  • iteration 1: item-2

Iteration ids stay as placeholders — the name is what the feature controls, the id
is not.

Validation

Ran the full map suite against us-west-2 for all three SDKs with a runner built
from this branch:

SDK map suite 9-13
JS 20 PASSED PASSED
Python 20 PASSED PASSED
Java 15 PASSED / 5 NOT_IMPLEMENTED / 0 FAILED PASSED

The recorded histories confirm the assertion is genuinely exercised rather than
skipped — all three SDKs emit identical names:

ContextStarted   Map           Name='named-items'
ContextStarted   MapIteration  Name='item-1'
ContextSucceeded MapIteration  Name='item-1'
ContextStarted   MapIteration  Name='item-2'
ContextSucceeded MapIteration  Name='item-2'
ContextSucceeded Map           Name='named-items'

Source-level confirmation that each SDK forwards the namer's return value verbatim
rather than decorating it:

  • JS — map-handler.ts sets name: config.itemNamer(item, index); concurrent-execution-handler.ts resolves item.name || item.id
  • Python — operation/map.py sets name=config.item_namer(item, i); concurrency/executor.py returns the bound name when present, else {prefix}{index}
  • Java — MapOperation passes itemNamer.apply(item, i) straight to enqueueItem

111 runner unit tests pass.

Also

Dropped the stale note claiming the Java MapConfig has no item-namer field and
that 9-13 is therefore expected to be permanently uncovered for Java. Java now
covers it via aws/aws-durable-execution-sdk-java#576.

…rified

9-13 asserted the two MapIteration events by placeholder id only and never
checked Name, so an SDK that accepts an item namer and silently ignores it
still passed. Name is an assertable top-level field on ContextStarted and
ContextSucceeded events (confirmed against a recorded map execution history,
where MapIteration events carry Name on both start and succeed).

Assert Name literally on all six context events: named-items for the Map
context, item-1 / item-2 for the two iterations. Both the JS and Python
handlers already emit exactly these names, so this is a tightening of the
assertion rather than a behavior change.

Also drop the stale note claiming the Java MapConfig has no item-namer field;
Java is adding MapConfig.itemNamer, so the requirement is no longer
permanently Java-uncovered.
@wangyb-A
wangyb-A marked this pull request as ready for review July 31, 2026 20:57
@wangyb-A
wangyb-A temporarily deployed to ai-pr-review-runtime July 31, 2026 20:57 — with GitHub Actions Inactive
@wangyb-A
wangyb-A temporarily deployed to ai-pr-review-runtime July 31, 2026 20:57 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

Claude AI review

Review — PR #55: assert iteration Name in map/9-13

No actionable findings. The change is a single data-only edit to test-requirements/map/9-13.yaml and is correct, schema-compatible, and internally consistent.

Verification performed:

  • Matcher premise confirmed (src/aws_durable_execution_conformance_tests/history.py:194-200): matching recurses over expected keys only and errors only when an expected key is missing from the actual event. So before this PR, Name was never in the expected dict and an SDK that accepted the item namer but ignored it still matched. Adding Name as a literal makes it enforced.
  • Name is an established assertable top-level field on lifecycle events — used literally in wait/2-2.yaml, wait/2-3.yaml, wait_for_condition/6-3.yaml and as placeholders in invoke/5-2.yaml. Asserting it on ContextStarted/ContextSucceeded fits the schema; the PR's recorded histories confirm the field is present on actual context events.
  • Internal consistency: the six added values (named-items, item-1×2, item-2×2, named-items) match the invocations prose and the map(name="named-items", …) call. Handler text was correctly tightened from "from the item and its index" to "from the item": with items [1,2], names item-1/item-2 are item-value-derived (index-derived would be item-0/item-1), so the edit removes a real ambiguity.
  • Iteration ids correctly remain placeholders (${ITER0}/${ITER1}); only Name is asserted literally, matching the stated intent.

Residual test risk (informational):

  • Positive assertion only — no dedicated negative fixture; the "an ignoring SDK must fail" guarantee rests on matcher behavior, not its own regression test.
  • Removing the "Java permanently uncovered" note makes 9-13 a hard Java requirement coupled to cross-repo aws/aws-durable-execution-sdk-java#576. Where that SDK change is absent, Java 9-13 will now FAIL rather than be treated as unimplemented. Intended per the PR, but not verifiable from this repository.

Reviewed commit 6399cda335a19718d7a7e7f52e2e4146f7178359. Workflow run

@github-actions

Copy link
Copy Markdown
Contributor

Codex AI review

No actionable findings.

Residual risk: cross-SDK integration coverage is required to confirm successful context events consistently emit the asserted Name fields; repository code was not executed during this review.

Reviewed commit 6399cda335a19718d7a7e7f52e2e4146f7178359. Workflow run

@wangyb-A
wangyb-A merged commit cf9e1b1 into main Jul 31, 2026
18 of 21 checks passed
@wangyb-A
wangyb-A deleted the strengthen-9-13-name-assertions branch July 31, 2026 21:17
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.

2 participants