feat(#305): EventBridge v2.4 terminals and service-token job polling - #307
Merged
mottych merged 2 commits intoApr 10, 2026
Merged
Conversation
- Publish email-insight completion/failure to domain bus with flat v2.4 detail (requestId, kickoffEventId, executionMode)
- Persist requestId/topic context and kickoff_transport; domain terminals only for Api EventBridge kickoff
- GET /ai/jobs/{id}: accept service_enrichment + role=service bearer tokens
- Pulumi: ai.job.requested rule on purposepath-domain-events-{stack}; PutEvents IAM for domain bus
Made-with: Cursor
…llowlist, auth naming) - pip-audit: ignore GHSA-926x-3r5x-gfhw (langchain-core) pending coordinated bump - auth: use jwt_signing_key for get_tenant_for_async_job_access decode - secrets baseline: allowlist auth.py keyword hits + restore analyze_slow_llm_calls; resync paths from local detect-secrets Made-with: Cursor
mottych
marked this pull request as ready for review
April 10, 2026 02:06
mottych
deleted the
feature/issue-305-eventbridge-terminals-service-auth
branch
April 15, 2026 17:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Implements #305: pure EventBridge terminal completion for email insight jobs (spec v2.4) plus service-token alignment for API fallback polling.
publish_email_insight_terminal_v24publishesai.job.completed/ai.job.failedtopurposepath-domain-events-{STAGE}with flat v2.4 detail (requestId,kickoffEventId,executionMode, etc.). Legacyai.job.*events on the default bus remain for non–email-insight / non–EventBridge-kickoff jobs.request_id,topic_category,event_signal,kickoff_transport(eventbridgevsapi) so terminals only fire for Api EventBridge kickoff +email_insight.GET /ai/jobs/{jobId}accepts bearer tokens wheretokenType/token_type=service_enrichment,role=service, andtenant_idis present; v2POST /execute-asyncrequiresrequestIdand can useAuthorizationbearer if body token omitted.ai.job.requestedrule + target on shared domain bus; LambdaPutEventsIAM for default + domain bus.Checklist
ENGINEERING_GUIDE.mddocs/frontend-integration-guide.md(or I updated it)ApiResponse[...]with snake_case keyspytest -q)docs/frontend-alignment-plan.mdif scope affects alignmentTesting
Unit tests updated for kickoff detail, async models, execute-async route, and EventBridge client. Ran:
Result: all unit tests pass except pre-existing failures in
tests/unit/services/test_website_analysis_service.py(unchanged by this PR).Mypy on touched files:
uv run mypy ../coaching/src/api/auth.py ../coaching/src/services/async_execution_service.py ../coaching/src/api/routes/ai_execute_async.py ../shared/services/eventbridge_client.py --explicit-package-bases— clean.Deploy note: Event bus
purposepath-domain-events-{env}must exist in AWS before applying Pulumi changes.Screenshots/Logs (optional)
N/A