The merge gate and review checklist for the frontend. A change is mergeable only when every applicable box is satisfied. See agents.md for the rule set and auth.md for the trust model.
pnpm test # vitest run
pnpm typecheck # tsc --noEmit
pnpm lint # next lint (ESLint)
pnpm build # next buildThe Husky pre-commit hook runs vitest related → typecheck → build on staged files; CI (deploy.yml) runs the lint / * gate + test:coverage, typecheck, lint, build and Single lockfile on Node 24, all installing pnpm install --frozen-lockfile. Never merge red. Merge to main auto-deploys to Vercel.
- Reads go through Server Actions →
newsDB, not the gateway Worker. - The only frontend→gateway calls are admin mutations via
src/lib/admin/gateway.ts(WorkOS token forwarded). - No new article sub-object siloing another domain's data; the feed only reads
engagement.*category/tag fields the pipeline writes.
-
/adminaccess is gated by the authoritative server-side check insrc/app/admin/layout.tsx(withAuth()+resolveTier), not by middleware/cookie presence. - RBAC grants are honored only inside the platform-team org (
WORKOS_PLATFORM_ORG_ID); no unscoped role/permission check. - No secret (
WORKOS_API_KEY,MONGODB_URI,FLY_TRIGGER_TOKEN) reaches a client component or is logged.
- Data-fetching pages have an error boundary and a skeleton/loading state.
- Lists use stable unique keys (not array indices).
- No layout shift introduced (dynamic offsets measured, not hardcoded); images use
next/imagewith sizing. - Client/server boundary correct (
'use client'only where needed; secrets stay server-side).
- JSON-LD via
safeJsonLdStringify(); image URLs viaisValidImageUrl(); CSSurl()viasafeCssUrl(). - Engagement Route Handlers rate-limited (
checkRateLimit+getRequestIp). - No inline styles; Radix + Tailwind; no raw URL interpolation into markup or styles.
- New/changed pages mock
@/lib/actions/feed(not@/lib/api) and match the documented return shapes. - Coverage stays above thresholds (60% statements/functions/lines, 50% branches).
- Dependency changes were made with pnpm and commit
pnpm-lock.yamlalongsidepackage.json(overrides inpnpm-workspace.yaml); nopackage-lock.jsonoryarn.lockis added. - Conventional-commit message; PR opened as draft.
- Verify each claimed finding against the actual code first.
- Confirm the fix doesn't move a read off the Server Action path, weaken the admin gate, or drop a security helper.
- Re-run
test+typecheck+lint+buildbefore merging.