Use this list before opening a pull request and when reviewing one. Skip the sections the change does not touch. Each item names what checks it: [type], [lint], [test], [build], [deploy] or [convention]. A [convention] item is checked only by a reviewer, so read it carefully.
Always
-
pnpm check-types,pnpm lint,FORMAT_BASE_REF=origin/main pnpm format:checkandpnpm testpass.[type][lint][test] - Database behavior is tested against the disposable cluster:
node scripts/test-local-postgres.mjs exec pnpm test:integration.TEST_DATABASE_URLnever points at a shared or hosted database.[test] - A user-visible change has a changelog entry, and a changed flow updates its guide in the same change.
[convention] - Commits are logical Conventional Commits, and file moves are not mixed with behavior changes.
[convention]
Backend feature shape
- The feature lives in
packages/api/src/features/<feature>/with role names (contract,procedures,service,errors,jobs,http) as described in ADR-0011.[test]boundary test - The contract file starts with the
LEAF MODULEheader and imports only leaves.[test]scripts/leaf-modules.test.mjs - Nothing new imports another feature's internals, a
*.proceduresfile or a*.jobsfile, andplatform/imports no feature.[lint].oxlintrc.json·[test]scripts/feature-boundaries.test.mjs - No import cycle was introduced.
[test]scripts/import-cycles.test.mjs - A migrated feature's
*.service.ts,*.rules.ts,*.policy.tsand*.procedures.tsare listed in the D2 and D8 overrides of.oxlintrc.json.[lint]
Tenant isolation
- Procedures use
context.db, which runs asapp_tenant. TheorganizationIdfilter is still present.[test]rls.isolation.test.ts - A new table uses
pgTable.withRLSwithtenantPolicy(...), gets its GRANT inpackages/db/scripts/rls-baseline.mjsand ships with a generated, reviewed migration.drizzle-kit pushis never used.[test]rls-catalog.test.ts - A new cross-tenant path uses
asSystem(db, reason, fn)with a newSystemReason, andnode scripts/check-system-call-sites.mjs --writeran in the same change.[lint] -
withTenantholds no network I/O.[convention] - An operation limited to some Org roles chains
requireOrgRole(...)afterorgProcedure; no service compares role strings.[test]require-org-role.test.ts·[convention] - A tenancy change ran
pnpm --filter @template-cloudflare/db test:rls-matrix, andnode scripts/rls-preview-proof.mjs <previewUrl>passed against the preview before a production deploy.[test][deploy]
Client/server boundary
- A client imports only leaves, contracts or
import type. No barrel was added to a server-capable module (ADR-0002).[lint] - A new cross-package import added a deliberate
exportsentry, and the package page names it. The web app imports norouters/*.schemaalias.[test]packages/api/src/exports.test.ts, docs package-exports test -
pnpm --filter web buildpasses, includingassert-client-bundle-clean.mjs.[build] -
apps/mobilechanged only if the change is meant for the native app.[convention]
Errors and Effect
- A domain failure is a
Schema.TaggedErrorin<feature>.errors.ts, and the feature mapper handles it. A service imports no@orpc/*.[type][lint] - A new client-visible code is in
APP_ERRORS,ERROR_MESSAGE_KEYSand every locale (en, de, fr).[type][test]locale tests - A procedure body calls
runProcedureonce. NoLayer,ManagedRuntimeor I/O runtime exists at module scope (ADR-0010, ADR-0005).[convention] - Only idempotent reads are retried. A webhook POST or an email send is never retried in-round.
[convention]
Configuration and logging
- A new environment variable is declared in
packages/envand documented in the environments guide. It is read through the schema, notprocess.env.[lint]node/no-process-env - Expected failures (4xx) are not logged as errors. Unexpected failures carry the request ID. Logs contain no credentials, prompts or private payloads.
[convention]
Runtime, bundle and decisions
- A runtime, deadline or heavy-dependency change has a dated report in
docs/measurements/with exact commands and limits.[convention] - A change to an established boundary reads the relevant ADR first. A new boundary decision gets an ADR with a status line, and the ADR index is updated.
[convention] - Dependency changes follow the two-day release quarantine and exact pins.
[test]tooling tests
Read Enforcement for the full list of rules and how each is checked.