Operator setup for Cursor Cloud VMs. Not loaded into ADR 0019 trusted review context (see AGENTS.md).
| Service | How to run | Notes |
|---|---|---|
| Postgres 16 | docker run -d --name pr-agent-postgres -e POSTGRES_DB=pr_agent -e POSTGRES_USER=pr_agent -e POSTGRES_PASSWORD=pr_agent -p 5432:5432 postgres:16-alpine |
Required for both web and worker roles |
| Web (webhook intake) | ROLE=web nub src/index.ts |
Listens on PORT (default 3000; 7224 in .env.example and Compose); GET /health returns ok; GET /ready pings Postgres |
| Worker (agent work) | ROLE=worker nub src/index.ts |
Processes reviews, descriptions, asks, triage, verification, CI refresh, and retention |
- Install Nub once —
npm install -g --ignore-scripts=false @nubjs/nub, thennub installin the repo. Node 22.22.0 is pinned in.node-version; Nub provisions it on demand. Prefernub installover repo-rootnpm install. PATHbefore global npm — if/exec-daemon(or another Node) precedes the nvm Node onPATH,npm install -gmay target/usr/lib/node_modulesand fail withEACCES. Put the pinned Node first (export PATH="$HOME/.nvm/versions/node/$(cat .node-version)/bin:$PATH"afternvm install/nvm use), then install Nub.- npm peer deps / Effect —
.npmrcsetslegacy-peer-deps=trueso scripts that still callnpm installcan resolve Effect’s strict peer graph (Nub already handles this). After an accidental npm tree, deletenode_modulesand runnub install. GITHUB_APP_PRIVATE_KEYmust be a valid PEM key —loadConfig()callscrypto.createPrivateKey()and throws on placeholders. For local-only dev, generate a throwaway key:openssl genrsa 2048 > key.pemand set the.envvalue to the escaped content.- Docker in cloud VMs — needs
fuse-overlayfsstorage driver andiptables-legacy. The update script handles Docker installation; startdockerdmanually if needed:sudo dockerd &>/tmp/dockerd.log &. - Unit tests (
nub run test) do not need Postgres. Integration tests require a reachable DB:docker compose up -d postgresthenDATABASE_URL=postgres://pr_agent:pr_agent@localhost:5432/pr_agent nub run test:integration(exits nonzero without Postgres). Inventory-only:nub run test:integration:inventory. Usenub run --node testif Vitest shows augmentation-related flakiness. WorkspacesearchWorkspacetests invoke the realgitonPATH. Git 2.39.x or newer is enough; shared search does not pass--max-count. - Lint/fmt commands:
nub run lint(oxlint, type-aware),nub run typecheck(tsc),nub run fmt:check(oxfmt). Combined:nub run check:code. - Ignored build scripts warning from Nub is expected for some transitive deps (
esbuild,protobufjs). The worker image does not need a nativesqlite3build for the agent runtime (see ADR 0023). - Vercel site deploys install pinned Nub via
site/vercel.json(npm install -g @nubjs/nub@…+nub ci --filter pr-agent-landing...), thennub --node run buildso Vite runs on plain Node. The repo is Nub identity (packageManager: nub@…,nub.lock, install knobs innub.jsonc).