Skip to content

fix(stepfunctions): fix execution overwrite, IsPresent null, catcher short-circuit#274

Merged
vieiralucas merged 4 commits intomainfrom
worktree-fix+cubic-batch2-stepfunctions
Apr 12, 2026
Merged

fix(stepfunctions): fix execution overwrite, IsPresent null, catcher short-circuit#274
vieiralucas merged 4 commits intomainfrom
worktree-fix+cubic-batch2-stepfunctions

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 12, 2026

Summary

  • Guard succeed_execution/fail_execution against overwriting terminal states (e.g., ABORTED by StopExecution) — background interpreter no longer clobbers stopped executions
  • Fix IsPresent to correctly return true for fields explicitly set to null — checks parent object instead of relying on resolve_path which returns Value::Null for both missing and null
  • Fix find_catcher to skip malformed catchers (missing Next) instead of aborting the entire search via ? operator
  • Add warning log when Wait state has no valid Seconds/SecondsPath/Timestamp/TimestampPath

Addresses unresolved Cubic findings from PRs #241, #244, #242.

Test plan

  • cargo clippy -p fakecloud-stepfunctions -- -D warnings passes
  • All 41 unit tests pass (2 new: test_is_present_with_null_value, test_find_catcher_skips_malformed_and_finds_next)

Summary by cubic

Fixes in fakecloud-stepfunctions: stop overwriting terminal executions by guarding before add_event, treat explicit nulls as present for IsPresent (including array indices; reject malformed segments like foo[0]extra), skip catchers without Next, and warn when Wait lacks valid Seconds/SecondsPath/Timestamp/TimestampPath. Prevents clobbered ABORTED runs and addresses Cubic findings from #241, #242, and #244.

Written for commit 5aad2bf. Summary will update on new commits.

…short-circuit, wait warnings

- Guard succeed_execution/fail_execution against overwriting terminal states (ABORTED)
- Fix IsPresent to treat present-but-null fields as present (check parent object)
- Fix find_catcher to skip malformed catchers instead of aborting via ? operator
- Add warning log when Wait state has no valid wait parameters
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.

2 issues found across 3 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/choice.rs">

<violation number="1" location="crates/fakecloud-stepfunctions/src/choice.rs:240">
P2: The new `IsPresent` existence check regresses JsonPath support by not handling array-index segments (e.g. `$.items[0]`), so existing fields can be treated as missing.</violation>
</file>

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

<violation number="1" location="crates/fakecloud-stepfunctions/src/interpreter.rs:1539">
P1: The terminal-status guard runs after writing the terminal history event, so aborted/stopped executions can still record `ExecutionSucceeded`/`ExecutionFailed` events. Move the guard before `add_event` to avoid inconsistent history.</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/interpreter.rs Outdated
Comment thread crates/fakecloud-stepfunctions/src/choice.rs
…ndle array indices in IsPresent

- Move terminal-status guard before add_event to prevent recording spurious history events
- Handle array-index segments (e.g. $.items[0]) in field_exists_in_input for IsPresent
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 2 files (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/choice.rs">

<violation number="1" location="crates/fakecloud-stepfunctions/src/choice.rs:255">
P1: Array index parsing assumes a trailing `]` and can panic or mis-parse malformed JsonPath segments.</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/choice.rs Outdated
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/choice.rs">

<violation number="1" location="crates/fakecloud-stepfunctions/src/choice.rs:260">
P2: Array-index path parsing now accepts malformed segments with trailing characters after `]`, which can make invalid JsonPath expressions evaluate as existing fields.</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/choice.rs
@vieiralucas vieiralucas merged commit 93758cf into main Apr 12, 2026
22 checks passed
@vieiralucas vieiralucas deleted the worktree-fix+cubic-batch2-stepfunctions branch April 12, 2026 13:43
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