Skip to content
voxix edited this page Nov 16, 2026 · 18 revisions

CI

GitHub Actions, .github/workflows/ci.yml. Pre-commit hooks run ruff and uv lock --check locally; run the rest with the commands in AGENTS.md.

Check Tool Catches
Format, lint ruff Messy code
Types pyright Made-up fields, wrong signatures
Module boundaries import-linter api and agent importing each other
Dependencies deptry, uv sync --locked Unused, missing or unlocked packages
Tests pytest against Postgres 18 Regressions
Coverage of changed lines diff-cover, 70% Untested additions
API contract api.export_openapi must leave contracts/ unchanged Forgotten contract updates
Protobuf grpcio-tools regen must leave ate_pb2.py(i) unchanged; buf lint and format Stale stubs, messy ate.proto
Substrate API subset test_ate_proto.py against upstream ateapi.proto at tag v1.0.0 Wrong field number, type or oneof
Web oxlint, tsc, vite build, generated client matches contract Frontend breakage, client drift
End to end Playwright (Chromium) against the compose api and agent services and Postgres Web and API out of step
Secrets gitleaks Keys in code or history

Changes reach main through PRs with green checks. One PR is one small feature or fix, based on main; no stacked PRs. A PR that depends on another waits until that one is merged. Rules: AGENTS.md.

Images

Once the checks pass on main, the images job publishes ghcr.io/voxix-dev/justpass-ai/api and ghcr.io/voxix-dev/justpass-ai/agent, each tagged with the commit SHA. An ActorTemplate needs the agent image pinned by digest: use the digest of the SHA tag (crane digest <image>:<sha>). Substrate pulls anonymously, so the agent package must be public. GHCR makes a new package private, and a workflow can't change that: an org owner sets it once in the package settings. Production runs the ghcr API image too, so the api package must be public as well, see Deploy.

Deploy

.github/workflows/deploy.yml runs after ci succeeds on a push to main, and only when the repository variable GCP_PROJECT_ID is set. It skips if main has moved on, so a late older run cannot roll back a newer deploy. It authenticates with Workload Identity Federation, restricted to this repository and owner IDs, the main branch and the deploy workflow, so nothing deploys before a merge. Its jobs:

  1. infra applies deploy/terraform/prod (state in a GCS bucket, prefix prod) as the github-terraform service account, which trusts only this job's production environment token: Cloud Run, Cloud SQL, the secrets, an Artifact Registry remote repository that proxies ghcr.io anonymously (Cloud Run cannot pull from GHCR) and the github-deployer service account. The apply is also the API deploy: the job resolves the linux/amd64 digest of the API image the images job pushed for that commit and passes it as api_image_digest, so the new image and the environment it expects go out in one revision. Terraform waits for that revision to be ready and fails the job otherwise.
  2. cluster runs after infra. It bootstraps the substrate database through the Cloud SQL Auth Proxy, runs deploy/gke/sync.sh (Substrate v1.0.0 and the agents, pinned by digest) and uploads the ate-api CA and the agent template to Secret Manager. The API needs no stored token: it fetches Google ID tokens itself, so nothing has to be renewed between deploys.
  3. web-build builds the web app without an OIDC token, so dependency install scripts cannot reach GCP, and web deploys the built files to Firebase Hosting as the deployer (apps/web/firebase.json, /api/** rewritten to the Cloud Run service; /assets/** cached for a year, everything else revalidated). It needs infra: the web build gets the Firebase web config (VITE_FIREBASE_*, none of it secret) from the Terraform outputs. The auth domain is the Hosting domain.

prod/auth.tf makes the Firebase web app and the Identity Platform config: anonymous and email-link sign-in (the email provider is on; the app offers only the link, but password sign-up stays possible through the REST API), authorized domains <project>.web.app and <project>.firebaseapp.com. It imports the existing Identity Platform config, so a fresh project needs one manual step first: Firebase console, Authentication, Get started.

What the workflow needs before it can run, and what Google cannot delete again, is deploy/terraform/bootstrap, applied by hand once by a project owner: the Firebase project and its default Hosting site, the Workload Identity pool and provider, and the github-terraform service account. Its outputs and the state bucket are the repository variables.

Two more CI jobs cover the infrastructure: terraform (fmt, validate, terraform test of the module) and gcp-e2e (the module and the deploy script against floci-gcp, see Local development).

Evals

Real homework samples with what a good answer must contain (evals/). They cost model credits, so they run nightly or on PRs labelled run-evals, never on every PR. Synthetic samples aren't useful; the set needs real, anonymized homework photos.

Clone this wiki locally