Skip to content

Add the aws-step-functions-python-sdk reference implementation - #1

Merged
RoboDonut merged 16 commits into
mainfrom
add-step-functions-reference
Sep 18, 2026
Merged

RoboDonut merged 16 commits into
mainfrom
add-step-functions-reference

Conversation

@RoboDonut

Copy link
Copy Markdown
Contributor

First reference implementation in the labs collection: an AWS Step Functions pipeline that submits a Wherobots job run via the wherobots-python-sdk using the callback pattern, with a reusable poller state machine as the fallback for failures the job cannot report itself.

What's inside

  • Callback pattern (waitForTaskToken): the job posts its own success/failure through an API Gateway relay Lambda; no polling on the happy path. The single-use task token is the auth capability.
  • Three-layer failure contract, all verified live: soft failures post the traceback as the execution cause; hard deaths (OOM/kill) surface via 60s heartbeats + HeartbeatSeconds: 180; the fallback recovers the run_id from the deterministic job name and polls Wherobots for the true status (confirmed FAILED verdict in 4m05s on a simulated OOM).
  • Guided local dashboard: upload → deploy → run → teardown, streamed CLI calls, a live 10-second block timeline, read-only code viewers per step, and a test-mode dropdown (normal / soft failure / hard-death OOM simulation).
  • Hygiene: secrets only in a gitignored .env (documented .env.example), every AWS resource tagged (ManagedBy/Project/CreatedAt/TeardownBy), symmetric teardown, blog-ready flow diagrams in assets/.

Root README gains the index table for implementations to come.

🤖 Generated with Claude Code

Step Functions pipeline that submits a Wherobots job run via
wherobots-python-sdk using the callback pattern: the job posts its own
success/failure (with traceback) through an API Gateway relay and
heartbeats every 60s; HeartbeatSeconds catches hard deaths (OOM/kill)
the job cannot report, routing to a FindRun Lambda and a reusable poller
state machine for the true terminal status. Ships with a guided local
dashboard (upload -> deploy -> run -> teardown, live 10s block timeline,
three test modes including an os._exit OOM simulation), blog-ready flow
diagrams, and symmetric tagged teardown. All behavior verified against
live AWS + Wherobots Cloud runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@salty-hambot salty-hambot Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed by Salty Hambot 🤖🧂 — rubric mode

Verdict: ✅ pass

Dimension Verdict Notes
correctness ✅ pass Success-post moved out of the try, dynamic ErrorPath/CausePath wired, parse_opts trailing-flag fix — all confirmed in code with tests.
security ✅ pass Dedicated relay role, secret echo closed on both create/update paths, JSON-encoded env maps; public relay rests on the single-use token as documented.
privacy ✅ pass Internal 'aws-asset-catalog' reference removed and CI now greps for it; secrets stay in gitignored .env, masked in preflight.
reliability ✅ pass Exec-lock drain-before-wait, fail-loud teardown and deploy retry tracking, add-permission narrowed to ResourceConflictException — all landed.
scalability ✅ pass Single-user local control plane at reference scale; no scaling concerns in the changed paths.
observability ✅ pass Live graph/timeline surfacing is thorough; terminal JobFailed carries the caught error via ErrorPath/CausePath.
clarity/maintainability ✅ pass Code is clean, well-commented, and the fix comments explain the constraints (heartbeat window, drain-before-wait, least privilege).
test quality ✅ pass Unit coverage now includes parse_opts, ASL invariants, drain-before-wait deadlock regression, and the three callback-delivery contract paths.

Seventeen threads chased down, and this round the launchpad's clean — both reviewers came up empty, the code confirms every fix landed (240s heartbeat, dedicated relay role, dynamic JobFailed error paths, drain-before-wait, fail-loud teardown/deploy, success-post out of the try). Ship it.

Prior findings: ✅ 16 resolved · ⚠️ 1 still open

0 finding(s) posted.
💰 Review cost: $2.4430 · 686.9k in / 16.4k out tokens · ⏱️ 3m6.5s
💬 To request a re-review, comment @salty-hambot review

Comment thread aws-step-functions-python-sdk/scripts/02_deploy.sh Outdated
Comment thread aws-step-functions-python-sdk/scripts/02_deploy.sh Outdated
Comment thread aws-step-functions-python-sdk/dashboard/server.py
Comment thread aws-step-functions-python-sdk/scripts/02_deploy.sh
Comment thread aws-step-functions-python-sdk/scripts/02_deploy.sh Outdated
Comment thread aws-step-functions-python-sdk/dashboard/server.py Outdated
Comment thread aws-step-functions-python-sdk/job/hello_wherobots_job.py
RoboDonut and others added 2 commits September 18, 2026 10:15
…env JSON, relay role split, exec lock, dead code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread aws-step-functions-python-sdk/scripts/99_teardown.sh Outdated
RoboDonut and others added 2 commits September 18, 2026 11:22
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…heel motif

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread aws-step-functions-python-sdk/scripts/02_deploy.sh
RoboDonut and others added 2 commits September 18, 2026 11:29
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… live (4m46s)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread aws-step-functions-python-sdk/scripts/02_deploy.sh Outdated
RoboDonut and others added 2 commits September 18, 2026 11:58
… evidence note

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread aws-step-functions-python-sdk/02_deploy.sh Outdated
RoboDonut and others added 3 commits September 18, 2026 12:10
… root

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ADME disclaimers, CI

Per the Wherobots Labs charter: Apache 2.0 LICENSE, CONTRIBUTING.md with
the release-gate and no-core-access rules, the verbatim Labs disclaimer in
both READMEs with a GitHub Issues pointer, and a CI workflow running
syntax checks, ASL validation, a secrets scan, and a required-files check.
Comment thread aws-step-functions-python-sdk/dashboard/server.py
Comment thread aws-step-functions-python-sdk/scripts/02_deploy.sh Outdated
@RoboDonut

Copy link
Copy Markdown
Contributor Author

@salty-hambot review

Comment thread aws-step-functions-python-sdk/scripts/02_deploy.sh Outdated
Comment thread aws-step-functions-python-sdk/job/hello_wherobots_job.py Outdated
…ernal tool reference from deploy comment; tests for both callback paths
@RoboDonut

Copy link
Copy Markdown
Contributor Author

@salty-hambot review

@RoboDonut
RoboDonut merged commit 27cbaf6 into main Sep 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant