Skip to content

Commit ea8eb37

Browse files
baonguyenNavaclaude
andcommitted
Document strata-qa Lambda deployment and invocation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 71c37c8 commit ea8eb37

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ both are skill-runtime helpers, not part of the manual dev pipeline.
5353
cd strata-qa && npm install && npm test # setup + units (no live model)
5454
npm run qa -- "<question>" --docs-root .. # ask (needs CURSOR_API_KEY: personal or service-account key)
5555
npm run qa -- eval --docs-root .. # score golden fixtures (live)
56+
57+
# Deploy strata-qa as a container-image Lambda (needs AWS creds + docker + CURSOR_API_KEY)
58+
./strata-qa/deploy.sh # from the repo root: build, push, deploy, print URL
59+
docker build -f strata-qa/Dockerfile -t strata-qa-lambda . # build the image only (context = repo root)
5660
```
5761

5862
Default model is `gpt-5.6-luna`. `--timeout <seconds>` bounds each live model call (default 60).

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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,
5151
transport, 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

Comments
 (0)