Checks

September 16, 2026 ยท View on GitHub

Husky hooks, npm run validate, and the test commands that gate commits and pushes. See the setup index for the other setup pages.

  • git commit runs the Husky pre-commit hook, which formats staged JavaScript/TypeScript/JSON/Markdown/CSS files with oxfmt, applies oxlint --fix to staged JavaScript/TypeScript files, runs npm run typecheck for the repo, and runs npm run migrations:check before the commit is created.
  • git push runs the Husky pre-push hook, which executes npm run test:push (CI=1 test:node + test:workers) so pushes are blocked when those suites fail. Those are the same Nx targets the CI Node / Workers jobs run, so a remote-cache hit is possible after push. Playwright E2E stays in npm run validate and the CI E2E job. The push hook stops short of that suite because Playwright E2E is heavier than the unit gate, and a failed e2e leg skips the unit gate when the push is retried with --no-verify. Bundler artifacts live under src/node_modules/.kody-generated/. Local origin development uses Vite; wrangler-env.ts still wraps D1/types and sibling worker deploys. Playwright sets CLOUDFLARE_ENV=test so Vite skips platform/runtime auxiliary workers. Cursor Cloud Agent VMs keep Cursor's hook dispatcher as core.hooksPath and compose Husky through npm run hooks:ensure (prepare runs it after husky; Cloud Agent environment start should run it too) so pre-push still reaches .husky/_ โ€” see cloud-agents.md. Vitest's default testTimeout is 20s so the workers pool's first Durable Object RPC in a file (~10s) does not fail the default budget (see decision 0011); the push gate also sets CI=1 so worker count and Nx cache hashes match GitHub Actions.
  • Because the commit hook already enforces formatting, lint fixes, and typechecking, agents do not need to run those checks separately before every commit unless they want earlier feedback or are validating a larger change set before opening a PR.
  • Push-time hooks intentionally stop short of npm run validate; Playwright E2E, MCP E2E, and repo-wide format checks remain explicit checks because they are heavier than the push gate.
  • npm run validate is the single authoritative local gate. It is read-only and executes format:check, lint, typecheck, test:node, test:workers, Playwright E2E, MCP E2E, backup:build, status:build, nx-cache:build, jobs:build, runtime:build, platform:build, primitives:check, migrations:check, deploy-guardrails:check, docs:check-temporal, docs:check-decisions, and mermaid:check in parallel, reporting every failure (sibling checks are not aborted on the first failure, including when one of the docs or mermaid checks fails). The unit-test and Playwright legs set CI=1 so timeouts, worker limits, and Nx cache hashes match the contended parallel layout used in GitHub Actions. CI runs the same checks as parallel jobs (๐Ÿงน Static, ๐Ÿงช Node, โ˜๏ธ Workers, ๐Ÿ”Œ MCP, ๐ŸŽญ E2E, aggregated by โœ… Validate). If npm run validate passes locally, CI will pass. Trusted writers (Cloud Agent environments, and same-repo validate) set NX_SELF_HOSTED_REMOTE_CACHE_SERVER and the write token so Nx uploads task artifacts to https://nx-cache.kody.codes. Fork pull_request validate uses the read token and can only GET (see decision 0019, decision 0038, decision 0040, and packages/nx-cache/readme.md). Those cached scripts run through tools/run-nx.ts so a mid-run remote-cache transport flake cannot fail validate after the tasks already succeeded.
  • npm run deploy-guardrails:check protects reviewed Durable Object migration history and bindings in both Wrangler configs, requires exact allowlisting for class deletion, and rejects destructive Cloudflare CLI operations in automatically triggered GitHub Actions jobs.
  • npm run validate:fix runs format + lint:fix and is the explicit opt-in for mutating auto-fixes. It is never required to pass validate.
  • npm run format applies formatting updates on its own.
  • npm run test:push runs the same test:node and test:workers suites enforced by the Husky pre-push hook and by the CI Node / Workers jobs.
  • npm run test:e2e:run ensures Playwright Chromium is installed before the suite starts, so npm run validate self-heals on a fresh machine.
  • Use npm run test:e2e:install when you want to prefetch Playwright browsers ahead of time instead of waiting for the first E2E run. CI caches ~/.cache/ms-playwright and runs test:e2e:ensure, so a lockfile-matching cache hit skips the download and never runs apt-get (--with-deps is local-only; apt-get update can hang the E2E job past the 15-minute timeout).
  • npm run test:e2e:run runs the Playwright suite through Nx and depends on a cached worker:prepare-e2e-env target for .env bootstrap plus an uncached worker:prepare-playwright target that checks the local Chromium install.
  • npm run test:mcp runs MCP server E2E tests and also depends on the cached worker:prepare-e2e-env target, which writes packages/worker/.env from .env.example when needed and backfills COOKIE_SECRET before the test run.