@@ -50,6 +50,32 @@ each live model call (default 60). Each run prints one JSON object to stdout; re
5050` low_confidence ` ) exit 0, operational failures exit non-zero (auth, model, docs, lockdown, parse,
5151transport, timeout). Query and refusal logs land in ` .logs/qa/ ` (gitignored).
5252
53+ ### Deploying strata-qa as a Lambda
54+
55+ ` strata-qa ` can run as a container-image AWS Lambda behind an IAM-authed Function URL.
56+ The image bakes the docs + CLI in at build time; the build context is the repo root.
57+
58+ ``` bash
59+ AWS_REGION=< region> CURSOR_API_KEY=< personal-or-service-account-key> ./strata-qa/deploy.sh
60+ ```
61+
62+ ` deploy.sh ` creates the ECR repo, stores the key in Secrets Manager, creates the
63+ execution role, deploys the function from the image, caps reserved concurrency, and
64+ prints the Function URL. Invoke it with a SigV4-signed ` POST ` whose JSON body is
65+ ` {"question": "..."} ` (optional ` model ` , ` requestId ` , ` replyTo ` ); the response body is
66+ the ` QaResult ` JSON the CLI emits plus ` requestId ` , and ` error ` on failures. Refusals
67+ return HTTP 200.
68+
69+ Config via Lambda env vars: ` AGENT_TIMEOUT_MS ` (default 90000, must stay under the
70+ Lambda ` TIMEOUT_S ` of 120), ` QA_MODEL ` (default ` gpt-5.6-luna ` ), ` QA_ALLOWED_MODELS `
71+ (comma-separated allowlist for caller-supplied ` model ` ), ` DOCS_ROOT ` (default
72+ ` /var/task ` ), ` QA_LOG_DIR ` (default ` /tmp/qa ` — the only writable path).
73+
74+ Two behaviours worth knowing: ` docsVersion ` is a ` sha256: ` hash rather than a git SHA
75+ (the image has no ` .git ` ; ` STRATA_QA_GIT_SHA ` carries the commit), and a question that
76+ hits the 90s timeout returns 504 and recycles the container, so the next invocation
77+ pays a cold start.
78+
5379## Developing
5480
5581``` bash
0 commit comments