Durable notes for Cloud Agents. Standard commands live in README.md and package.json; only non-obvious caveats are captured here.
- Context7 peer-library docs habit (and the Next 16 local-docs carve-out) lives in
docs/agents-guide.md. Project MCP is local@upstash/context7-mcp@3.2.5withCONTEXT7_API_KEYfrom env/Secrets. If the host-injected Context7 MCP returns quota exceeded, usenpx ctx7 library|docs …with the same secret — do not invent peer APIs from training data. - Runtime: the app hard-requires Node >=24.15.0 <25 / npm 11.x (
engine-strict; the preinstall and runtime gates enforce the minor floor, whilescripts/dev-free-port.mjsrejects other majors). A compatible Node 24 is installed via nvm and symlinked into/usr/local/cargo/bin(first entry inPATH) sonode/npmresolve to it in every shell. If a shell ever resolves/exec-daemon/node(v22) instead, prepend the installed nvm Node 24 bin toPATH(for example"$HOME/.nvm/versions/node/v24.18.1/bin"; runls "$HOME/.nvm/versions/node"to confirm the exact patch version). - Live vs demo mode: the app auto-detects. When the Supabase + OpenAI env vars below are present (set them as Cloud Agent Secrets so they inject into
.env.local/process.env),isDemoMode()(src/lib/env.ts) is false and the app runs against the liveClinical KB Databaseproject (~2000 indexed docs) with OpenAI answer generation. When they are absent, dev auto-falls back to demo mode using the synthetic corpus insrc/lib/demo-data.ts/public/demo-documents/. Required for live mode:NEXT_PUBLIC_SUPABASE_URL,SUPABASE_PROJECT_REF,SUPABASE_PROJECT_NAME,NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY(sb_publishable_…),SUPABASE_SERVICE_ROLE_KEY(accepts thesb_secret_…secret key),OPENAI_API_KEY. KeepRAG_PROVIDER_MODE=autoso OpenAI is used with graceful source-only fallback.E2E_USER_EMAIL/E2E_USER_PASSWORDpower CI env-check and Playwright. - Live-mode caveat:
RAG_PROVIDER_MODE=autoattempts OpenAI (fast → strong route); if generation fails the built-in quality gates it silently degrades to a deterministic "Source-only" answer that still cites real documents — this is expected, not a failure. The header sign-in UI exposes magic-link + OAuth only (no password field), but the/api/answer+ retrieval flow works server-side without a browser session. - What still won't run in this VM even with secrets:
npm run workeralso needs the Python OCR stack (worker/python/requirements.txt) and heavy parsing deps; Supabase edge functions need Deno v2.x + deployment.verify:releaseadditionally runs governance/eval gates. Treat missing-secret failures ofcheck:supabase-project/verify:releasein demo mode as expected, not regressions. - Dev server:
npm run devselects a stable per-project localhost port (e.g.4461), binds0.0.0.0, and prints the exact URL. Never assume port 3000/3001/3002.npm run ensurestarts/verifies it in the background. - Verification without secrets:
npm run lint,npm run typecheck, andnpm run test(vitest) all pass offline.npm run verify:cheapalso runs runtime, GitHub Actions pin, CI-scope, and sitemap checks.npm run verify:pr-localadds format, conditional build/client-bundle scanning, and RAG fixture/manifest validation without repeating unit tests; browser, Docker/Supabase, audit, and provider checks remain separate. Seedocs/testing.mdfor lock, live-test, Playwright, and flake-ledger rules. Ifcheck:installed-lock-parityorcheck:playwright-browser-revisionreports Playwright/image drift (#255), do not force a mismatched Chromium path — delegate browser proof to CI Production UI (seedocs/testing.md§ Testing speed playbook). - For GitHub-related work authorised in this session, prefer the connected GitHub connector/MCP tools first for PR, issue, comment, review-thread, and Actions tasks they support (including run/job/log/artifact inspection and review-thread replies/resolution). A missing
ghCLI is not a blocker for connector-supported work; never add a PAT as a workaround. The intended connection isBigSimmowith repository write access. Reserve administrator access for separately approved operations. Verify the exact target and connector result before any write. Ordinary authorised shellgitbranch publication remains allowed; use shellghonly for a genuine connector gap and only when the task permits it.