Skip to content

Call symbolicEqual through the evaluation function gateway - #22

Merged
m-messer merged 3 commits into
mainfrom
use-execution-role-for-invoke
Nov 26, 2026
Merged

m-messer merged 3 commits into
mainfrom
use-execution-role-for-invoke

Conversation

@m-messer

@m-messer m-messer commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Replaces EvaluationFunctionClient (which requires INVOKER_ID / INVOKER_KEY / INVOKER_REGION) with a small EvaluationFunctionInvoker that calls symbolicEqual with an HTTPS POST, the same way any other client calls an evaluation function. No AWS credentials or IAM permissions are needed. It uses only the standard library (urllib).
  • The full URL to call is read from the SYMBOLIC_EQUAL_URL env var (e.g. https://<api-id>.execute-api.eu-west-2.amazonaws.com/default/symbolicEqual) and used as given. Pointing each environment at its own function also stops staging from calling prod symbolicEqual, which the old hard-coded function name did.
  • Response handling matches the old client (result returned, error re-raised as EvaluationException). HTTP and network failures raise, and the old client's unparseable-response path (which referenced an undefined variable) is fixed.
  • Importing evaluation.py no longer needs any AWS config, so tests drop the MissingCredentials workaround. Adds unit tests for the invoker and updates docs/dev.md.

Before deploying

Set SYMBOLIC_EQUAL_URL on the deployed function in each environment:

  • staging arraySymbolicEqual-staging: <staging gateway invoke URL>/symbolicEqual-staging
  • production arraySymbolicEqual: <production gateway invoke URL>/symbolicEqual

Without it, grading fails with SYMBOLIC_EQUAL_URL is not set. Redeploys keep the env var, because the backend only updates function code on existing functions.

Test plan

  • pytest passes locally (14 tests) with no AWS credentials or config
  • Set the env var on arraySymbolicEqual-staging, deploy, and grade a matrix response end to end
  • Confirm symbolicEqual-staging (not prod symbolicEqual) receives the staging calls

🤖 Generated with Claude Code

m-messer and others added 2 commits November 26, 2026 10:10
Replace EvaluationFunctionClient, which requires static INVOKER_* access
keys, with a small boto3-based invoker that uses the default credential
chain (the Lambda execution role). The boto3 client is created lazily so
importing the module needs no AWS configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Switch from invoking via the Lambda API to an HTTPS POST to the public
evaluation function gateway, so no AWS credentials or IAM permissions are
needed. The gateway base URL comes from EVALUATION_FUNCTION_GATEWAY_URL,
and the -staging/-dev suffix is taken from this function's own name so
calls stay within the same environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@m-messer m-messer changed the title Invoke symbolicEqual using the Lambda execution role Call symbolicEqual through the evaluation function gateway Nov 26, 2026
Drop the gateway base URL and environment suffix logic: the env var now
holds the full URL of the function to call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@m-messer
m-messer marked this pull request as ready for review November 26, 2026 13:08
@m-messer
m-messer merged commit 9dcf9ea into main Nov 26, 2026
26 of 28 checks passed
@m-messer
m-messer deleted the use-execution-role-for-invoke branch November 26, 2026 13:08
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