Add the Stage 5 Cloud Run Simulation Entry service#651
Draft
anth-volk wants to merge 11 commits into
Draft
Conversation
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.
Summary
policyengine-simulation-entryFastAPI service on Cloud Run;dict/dict[str, Any]boundaries with named Pydantic, root-model, andTypedDictschemas;Why
Stage 5 establishes the permanent simulation control-plane boundary before later stages migrate routing, durable state, and worker responsibilities. The existing Modal gateway remains the authenticated backend and rollback target during this stage.
The explicit shared schemas make the entrypoint, existing gateway, executor, OpenAPI artifact, and generated SDK agree on the same wire contract instead of accepting or advertising arbitrary objects.
Impact
The new service can be deployed and qualified independently without changing production traffic. Existing clients retain the same request/response shapes and job identifiers. The old Modal deployment remains intact.
One-time cloud projects, identities, IAM, workload identity, and secret resources are configured manually by authorized operators using private runbooks. The public deployment guide describes only the architecture and lifecycle. Credential values remain in the cloud secret store; the workflow receives only environment-owned resource references.
Root causes addressed
The initial implementation also needed tighter WIF trust, a valid-length GCP project ID, robust outbound 401/403 credential refresh, stronger recursion validation, correct generated-client checkout provenance, an explicit Modal runtime extra, corrected FastAPI handler typing, explicit schemas at every newly introduced mapping boundary, and removal of inappropriate committed one-time infrastructure automation.
Validation
Live authenticated tests require deployed candidate URLs and environment secrets and run in the new CI/CD jobs.
Fixes #650