Skip to content

feat(stepfunctions): close conformance gap with 23 missing ops#703

Merged
vieiralucas merged 11 commits intomainfrom
worktree-worktree-stepfunctions-23ops
Apr 23, 2026
Merged

feat(stepfunctions): close conformance gap with 23 missing ops#703
vieiralucas merged 11 commits intomainfrom
worktree-worktree-stepfunctions-23ops

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 23, 2026

Summary

  • 23 new Step Functions handlers covering activities + task tokens, state machine versions/aliases, map runs, RedriveExecution, StartSyncExecution, TestState, and ValidateStateMachineDefinition.
  • New per-account state for activities, versions, aliases, map runs, and pending task tokens.
  • States conformance: 14/37 -> 37/37 (100%).

Test plan

  • cargo test -p fakecloud-conformance --test stepfunctions -> 23 pass
  • cargo run -p fakecloud-conformance -- run --services states -> 37/37 OK
  • cargo run -p fakecloud-conformance -- audit / check -> PASS
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo fmt

Summary by cubic

Implements 23 missing AWS Step Functions operations and closes the states emulator conformance gap. Conformance is now 37/37 (100%) with per-account state for activities, versions/aliases, map runs, and task tokens.

  • New Features

    • Activities: create/describe/list/delete + GetActivityTask; persists task tokens per account.
    • Versions & Aliases: publish/list/delete versions; CRUD aliases with weighted routing.
    • Map Runs: describe/list/update; per-account storage; 404 on unknown ARNs.
    • Execution: RedriveExecution; StartSyncExecution (EXPRESS); TestState; ValidateStateMachineDefinition.
  • Bug Fixes

    • ListStateMachineAliases anchors on ':' to prevent prefix bleed.
    • routingConfiguration validated (1–2 routes; weights 0–100 sum to 100; version ARN required).
    • StartSyncExecution validates JSON input and returns InvalidExecutionInput on bad payloads.

Written for commit 3eb1e56. Summary will update on new commits.

Adds the remaining Step Functions operations across activities,
versions, aliases, map runs, and execution lifecycle extras:
- Activities: Create/Delete/Describe/List + GetActivityTask issuing
  a synthetic task token; SendTask Success/Failure/Heartbeat update
  the persisted token state.
- State machine versions: Publish (auto-incrementing), List, Delete.
- State machine aliases: Create/Delete/Describe/List/Update with
  weighted routing configuration persisted per alias.
- Map runs: Describe/List/Update on a per-account map_runs map (404
  on unknown ARNs).
- Execution extras: RedriveExecution flips a stopped execution back
  to RUNNING; StartSyncExecution synthesizes a SUCCEEDED sync result
  for EXPRESS state machines; TestState echoes input as output;
  ValidateStateMachineDefinition runs the existing validator and
  returns OK/FAIL diagnostics.

States conformance closes to 37/37 (100%); workspace baseline -69
(net new ops add 18 passing variants while two previously SKIPped
ops in adjacent services drop out of audited tests).
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 4.24779% with 541 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/fakecloud-stepfunctions/src/service.rs 2.52% 541 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

4 issues found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/fakecloud-stepfunctions/src/service.rs">

<violation number="1" location="crates/fakecloud-stepfunctions/src/service.rs:1037">
P2: `CreateStateMachineAlias` accepts invalid `routingConfiguration` values instead of validating required route count/weights.</violation>

<violation number="2" location="crates/fakecloud-stepfunctions/src/service.rs:1116">
P2: `ListStateMachineAliases` uses an over-broad prefix match and can return aliases for the wrong state machine.</violation>

<violation number="3" location="crates/fakecloud-stepfunctions/src/service.rs:1142">
P2: `UpdateStateMachineAlias` does not validate `routingConfiguration` and can store invalid routing weights.</violation>

<violation number="4" location="crates/fakecloud-stepfunctions/src/service.rs:1255">
P2: `StartSyncExecution` should validate `input` as JSON and return `InvalidExecutionInput` for malformed payloads.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread crates/fakecloud-stepfunctions/src/service.rs Outdated
Comment thread crates/fakecloud-stepfunctions/src/service.rs
Comment thread crates/fakecloud-stepfunctions/src/service.rs Outdated
Comment thread crates/fakecloud-stepfunctions/src/service.rs
…pfunctions-23ops

# Conflicts:
#	conformance-baseline.json
- ListStateMachineAliases: anchor prefix on ':' separator so
  state machine 'foo' doesn't match aliases for 'foobar'
- CreateStateMachineAlias / UpdateStateMachineAlias: validate
  routingConfiguration via shared parser - 1-2 routes, weights
  0-100 summing to exactly 100, stateMachineVersionArn required
- StartSyncExecution: validate input as JSON and return
  InvalidExecutionInput for malformed payloads
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/fakecloud-stepfunctions/src/service.rs">

<violation number="1" location="crates/fakecloud-stepfunctions/src/service.rs:1469">
P2: `routingConfiguration` validation is incomplete: it accepts routes from different state machines. Reject mixed parent ARNs so alias routing stays valid and AWS-compatible.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

format!("routingConfiguration weights must sum to 100, got {total}."),
));
}
Ok(parsed)
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 23, 2026

Choose a reason for hiding this comment

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

P2: routingConfiguration validation is incomplete: it accepts routes from different state machines. Reject mixed parent ARNs so alias routing stays valid and AWS-compatible.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/fakecloud-stepfunctions/src/service.rs, line 1469:

<comment>`routingConfiguration` validation is incomplete: it accepts routes from different state machines. Reject mixed parent ARNs so alias routing stays valid and AWS-compatible.</comment>

<file context>
@@ -1425,6 +1414,61 @@ fn resource_not_found(arn: &str) -> AwsServiceError {
+            format!("routingConfiguration weights must sum to 100, got {total}."),
+        ));
+    }
+    Ok(parsed)
+}
+
</file context>
Suggested change
Ok(parsed)
let parent = parsed[0]
.state_machine_version_arn
.rsplit_once(':')
.map(|(p, _)| p)
.ok_or_else(|| {
AwsServiceError::aws_error(
StatusCode::BAD_REQUEST,
"ValidationException",
"stateMachineVersionArn must be a version ARN.",
)
})?;
if parsed.iter().any(|r| {
r.state_machine_version_arn
.rsplit_once(':')
.map(|(p, _)| p)
!= Some(parent)
}) {
return Err(AwsServiceError::aws_error(
StatusCode::BAD_REQUEST,
"ValidationException",
"All routingConfiguration stateMachineVersionArn values must belong to the same state machine.",
));
}
Ok(parsed)
Fix with Cubic

…orktree-stepfunctions-23ops

# Conflicts:
#	conformance-baseline.json
…orktree-stepfunctions-23ops

# Conflicts:
#	conformance-baseline.json
…orktree-stepfunctions-23ops

# Conflicts:
#	conformance-baseline.json
…orktree-stepfunctions-23ops

# Conflicts:
#	conformance-baseline.json
…orktree-stepfunctions-23ops

# Conflicts:
#	conformance-baseline.json
…orktree-stepfunctions-23ops

# Conflicts:
#	conformance-baseline.json
@vieiralucas vieiralucas merged commit 777d756 into main Apr 23, 2026
48 checks passed
@vieiralucas vieiralucas deleted the worktree-worktree-stepfunctions-23ops branch April 23, 2026 10:35
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.

1 participant