Space Docs
Guides
  • Pre-commit hook: Biome on staged files + full-monorepo pnpm typecheck (turbo-cached, cold ~30s). It blocks—fix first.
  • ^build in turbo: tests + typecheck build deps first; if type errors appear after changing a package, run pnpm build.
  • Workspace header: frontend sends x-workspace-id on every tRPC request; missing→user's default workspace.
  • Master workspace bypass: scopedFilter skips checks for the master UUID—never use it for user-facing ops.
  • Next.js: both apps output: "standalone" (.next/standalone deploys) + ignoreBuildErrors: true—rely on pnpm typecheck.
  • Async event dispatch: polling-based (1s)—events aren't processed immediately after a mutation.
  • CI: .github/workflows/ci.yml runs typecheck + lint + test on PR/push to main against pgvector/pgvector:pg16. No Temporal (activities run as plain TS); no Playwright; deploys manual via deploy.sh. PRs run only the tests the diff reaches; main runs all (docs/ci/test-selection.md).
  • Temporal activities import directly: they run in regular Node (not sandboxed)—lazy await import() heavy deps like @react-pdf/renderer.
  • Shared enum: assetTypeEnum lives in assets.ts, imported by products.ts—update in one place.
  • Report ORDER BY: report queries cast numeric columns to text at the num() boundary, and a bare ORDER BY alias binds to the output column—so ordering by the alias sorts money and counts lexicographically ("8000" outranks "160000", and a capped report keeps the wrong rows). Order by the underlying expression instead; inside a UNION, where an expression is not allowed, give the column a numeric type rather than casting it.
  • Open-redirect: quote/invoice tracking URLs embed the redirect target inside the signed JWT—never take it from query params.
  • Stripe webhook: POST /api/webhooks/stripe handles quote (payment_intent.*) + invoice (checkout.session.*), routed by session.metadata.invoiceId.
  • Automation allowlist: ActionExecutor.UPDATABLE_FIELDS gates automatable fields—extend it when adding one. RUN_WORKFLOW_ALLOWLIST gates run_workflow and is empty on purpose: workflow args are trusted, so a listed workflow must scope to the injected workspaceId.
  • Ask model: ASK_MODEL_ID (default DEFAULT_MODEL_BY_PROVIDER.anthropic, …/ask/model.ts) must exist in MODEL_PRICING (boot-checked); test embedders need createTestHybridRetriever.