{"site":"https://pitcheye.dev","name":"pitcheye.dev","description":"Deterministic cross-stack guardrails for Next.js + Drizzle + Supabase + Clerk + UploadThing + Inngest, shipping as a CLI, a GitHub Check, and an MCP server.","license":"MIT","query":null,"counts":{"rules":30,"error":23,"warn":7,"packs":6,"matched":30},"install":{"cli":"npx @pitcheye/check .","cliChangedOnly":"npx @pitcheye/check . --changed-only","cliSarif":"npx @pitcheye/check . --sarif > pitcheye.sarif","githubAction":"uses: pitcheye/nextgen@v1","mcp":{"Claude Code":"claude mcp add pitcheye -- npx -y @pitcheye/mcp","Hermes":"npx -y @pitcheye/mcp","Codex":"codex mcp add pitcheye -- npx -y @pitcheye/mcp","Cursor":"{\"mcpServers\":{\"pitcheye\":{\"command\":\"npx\",\"args\":[\"-y\",\"@pitcheye/mcp\"]}}}"}},"mcp":{"package":"@pitcheye/mcp","transport":"stdio","command":"npx","args":["-y","@pitcheye/mcp"],"tools":[{"name":"check_repo","description":"Full audit of a repo or subtree."},{"name":"check_diff","description":"Only files that differ from a base ref."},{"name":"explain_rule","description":"Failure mode, bad/good code pair, docs link."},{"name":"verify_fix","description":"Returns { passed } for the rules that were failing."}]},"packs":[{"id":"clerk","label":"Clerk Auth","count":5,"filter":"npx @pitcheye/check . --pack clerk"},{"id":"supabase-auth","label":"Supabase Auth","count":5,"filter":"npx @pitcheye/check . --pack supabase-auth"},{"id":"db","label":"DB / Drizzle","count":7,"filter":"npx @pitcheye/check . --pack db"},{"id":"vercel","label":"Vercel / Next","count":5,"filter":"npx @pitcheye/check . --pack vercel"},{"id":"webhooks","label":"UploadThing & Webhooks","count":4,"filter":"npx @pitcheye/check . --pack webhooks"},{"id":"inngest","label":"Inngest Jobs","count":4,"filter":"npx @pitcheye/check . --pack inngest"}],"rules":[{"ruleId":"clerk/unprotected-mutation","slug":"clerk-unprotected-mutation","pack":"clerk","severity":"error","title":"Mutating endpoint has no authentication","signal":"exported POST/PUT/PATCH/DELETE, or a publicProcedure .mutation(), with no auth() call in the module","whyItBreaks":"The handler writes to the database for any anonymous request. There is no session, so ownership checks downstream silently compare against undefined and either throw a 500 or, worse, write a row with a null owner.","suggestedFix":"Call `const { userId } = await auth()` from `@clerk/nextjs/server` as the first statement of the handler and return 401 when it is missing (or convert the tRPC entry point to `protectedProcedure`).","docsUrl":"https://pitcheye.dev/rules/clerk-unprotected-mutation","markdownUrl":"https://pitcheye.dev/rules/clerk-unprotected-mutation","explain":{"tool":"explain_rule","arguments":{"ruleId":"clerk/unprotected-mutation"}}},{"ruleId":"clerk/ui-only-role-gate","slug":"clerk-ui-only-role-gate","pack":"clerk","severity":"warn","title":"Role is enforced in the UI, not on the server","signal":"an API route that checks a session but never a role/permission, then writes to the database","whyItBreaks":"Any signed-in user can call the endpoint directly. Hiding the button in React removes the affordance, not the capability — `curl` with the same session cookie performs the privileged write.","suggestedFix":"Read the role from the session on the server (`const { sessionClaims } = await auth()`) and return 403 unless it matches, before the write. Set the role via Clerk public metadata, never from the request body.","docsUrl":"https://pitcheye.dev/rules/clerk-ui-only-role-gate","markdownUrl":"https://pitcheye.dev/rules/clerk-ui-only-role-gate","explain":{"tool":"explain_rule","arguments":{"ruleId":"clerk/ui-only-role-gate"}}},{"ruleId":"clerk/userprofile-page-missing-props","slug":"clerk-userprofile-page-missing-props","pack":"clerk","severity":"error","title":"<UserProfile.Page> is missing a required prop","signal":"`<UserProfile.Page>` without `label`, `url` and `labelIcon`","whyItBreaks":"Clerk drops the section entirely when any of `label`, `url` or `labelIcon` is missing. It throws nothing and renders nothing, so the page the developer just wrote simply never appears in the user menu and there is no error to search for.","suggestedFix":"Pass all three props: `<UserProfile.Page label=\"Billing\" url=\"billing\" labelIcon={<span>$</span>}>`.","docsUrl":"https://pitcheye.dev/rules/clerk-userprofile-page-missing-props","markdownUrl":"https://pitcheye.dev/rules/clerk-userprofile-page-missing-props","explain":{"tool":"explain_rule","arguments":{"ruleId":"clerk/userprofile-page-missing-props"}}},{"ruleId":"clerk/middleware-blocks-webhooks","slug":"clerk-middleware-blocks-webhooks","pack":"clerk","severity":"error","title":"Middleware protects webhook routes","signal":"clerkMiddleware with auth.protect() and a route matcher that does not carve out /api/webhooks, /api/uploadthing, /api/inngest","whyItBreaks":"Webhook senders have no session cookie. Protecting their endpoints returns a Clerk redirect, so every Stripe/UploadThing/Inngest delivery is rejected — the provider retries, then disables the endpoint, and bookings silently stop updating.","suggestedFix":"Add the machine-to-machine prefixes to the public matcher: `createRouteMatcher([\"/api/webhooks(.*)\", \"/api/uploadthing(.*)\", \"/api/inngest(.*)\", \"/.well-known(.*)\"])` and let each route verify its own signature.","docsUrl":"https://pitcheye.dev/rules/clerk-middleware-blocks-webhooks","markdownUrl":"https://pitcheye.dev/rules/clerk-middleware-blocks-webhooks","explain":{"tool":"explain_rule","arguments":{"ruleId":"clerk/middleware-blocks-webhooks"}}},{"ruleId":"clerk/middleware-missing-auth-await","slug":"clerk-middleware-missing-auth-await","pack":"clerk","severity":"error","title":"`auth()` is not awaited in middleware","signal":"`auth()` / `auth().protect()` called without `await` inside clerkMiddleware","whyItBreaks":"In Clerk v5+ the middleware is async and `auth()` returns a Promise. Reading `.userId` off the Promise — or calling `.protect()` on it — always yields undefined/falsy, so the guard never rejects and the route stays public.","suggestedFix":"Await the helper: `const { userId } = await auth()` and `await auth.protect()`.","docsUrl":"https://pitcheye.dev/rules/clerk-middleware-missing-auth-await","markdownUrl":"https://pitcheye.dev/rules/clerk-middleware-missing-auth-await","explain":{"tool":"explain_rule","arguments":{"ruleId":"clerk/middleware-missing-auth-await"}}},{"ruleId":"supabase-auth/server-get-session","slug":"supabase-auth-server-get-session","pack":"supabase-auth","severity":"error","title":"`supabase.auth.getSession()` used on the server","signal":"`.auth.getSession()` in a file that runs on the server","whyItBreaks":"On the server `getSession()` reads the session out of the request cookie without verifying its signature. Any caller can forge the cookie and be treated as that user. Supabase documents it as untrusted on the server and it is the single most-exploited mistake in this migration.","suggestedFix":"Use `const { data: { user } } = await supabase.auth.getUser()`, which round-trips to the Auth server and validates the JWT before you trust it.","docsUrl":"https://pitcheye.dev/rules/supabase-auth-server-get-session","markdownUrl":"https://pitcheye.dev/rules/supabase-auth-server-get-session","explain":{"tool":"explain_rule","arguments":{"ruleId":"supabase-auth/server-get-session"}}},{"ruleId":"supabase-auth/deprecated-auth-helpers","slug":"supabase-auth-deprecated-auth-helpers","pack":"supabase-auth","severity":"error","title":"Import from the deprecated `@supabase/auth-helpers-nextjs`","signal":"an import from '@supabase/auth-helpers-nextjs'","whyItBreaks":"auth-helpers is deprecated and never received Next 15 support: its cookie API is synchronous, its peer range caps Next at 14, and it silently stops refreshing sessions on Next 15. It is also the source of most broken RSC auth setups.","suggestedFix":"Import `createServerClient` / `createBrowserClient` from `@supabase/ssr` and pass an explicit `cookies: { getAll, setAll }` adapter.","docsUrl":"https://pitcheye.dev/rules/supabase-auth-deprecated-auth-helpers","markdownUrl":"https://pitcheye.dev/rules/supabase-auth-deprecated-auth-helpers","explain":{"tool":"explain_rule","arguments":{"ruleId":"supabase-auth/deprecated-auth-helpers"}}},{"ruleId":"supabase-auth/service-role-in-client","slug":"supabase-auth-service-role-in-client","pack":"supabase-auth","severity":"error","title":"Service-role key referenced in a client module","signal":"a `'use client'` module referencing SUPABASE_SERVICE_ROLE_KEY (or a bare non-NEXT_PUBLIC Supabase secret)","whyItBreaks":"A client module is bundled and shipped to the browser. Next only inlines `NEXT_PUBLIC_*`, so this reference either compiles to `undefined` (every RLS policy silently bypassed at runtime) or — if someone \"fixes\" it by renaming — publishes a full-privilege key. Both outcomes are account-wide compromise.","suggestedFix":"Move the admin client into a server-only module (`import \"server-only\"`), expose a route handler or server action, and keep the service-role key out of every client bundle.","docsUrl":"https://pitcheye.dev/rules/supabase-auth-service-role-in-client","markdownUrl":"https://pitcheye.dev/rules/supabase-auth-service-role-in-client","explain":{"tool":"explain_rule","arguments":{"ruleId":"supabase-auth/service-role-in-client"}}},{"ruleId":"supabase-auth/missing-session-refresh-middleware","slug":"supabase-auth-missing-session-refresh-middleware","pack":"supabase-auth","severity":"warn","title":"Middleware never refreshes the Supabase session","signal":"a middleware module with no `supabase.auth.getUser()` while the repo uses @supabase/ssr","whyItBreaks":"With @supabase/ssr the access token lives ~1h and is refreshed by the middleware. Without the refresh the session expires mid-visit and every server component starts rendering as signed-out — the classic \"randomly logged out\" report that is impossible to reproduce locally.","suggestedFix":"In middleware, build the client with the request/response cookie adapter and `await supabase.auth.getUser()` on every request, before returning the response.","docsUrl":"https://pitcheye.dev/rules/supabase-auth-missing-session-refresh-middleware","markdownUrl":"https://pitcheye.dev/rules/supabase-auth-missing-session-refresh-middleware","explain":{"tool":"explain_rule","arguments":{"ruleId":"supabase-auth/missing-session-refresh-middleware"}}},{"ruleId":"supabase-auth/sync-cookies-next15","slug":"supabase-auth-sync-cookies-next15","pack":"supabase-auth","severity":"error","title":"`cookies()` used synchronously on Next 15","signal":"`const cookieStore = cookies()` with no `await`, in a module importing `next/headers`","whyItBreaks":"`cookies()`, `headers()` and `draftMode()` became async in Next 15. The sync form returns a Promise, so `cookieStore.getAll()` is undefined, the Supabase client builds with zero cookies, and every request is anonymous — including the ones that just signed in.","suggestedFix":"Make the function async and await it: `const cookieStore = await cookies()`.","docsUrl":"https://pitcheye.dev/rules/supabase-auth-sync-cookies-next15","markdownUrl":"https://pitcheye.dev/rules/supabase-auth-sync-cookies-next15","explain":{"tool":"explain_rule","arguments":{"ruleId":"supabase-auth/sync-cookies-next15"}}},{"ruleId":"db/per-request-client","slug":"db-per-request-client","pack":"db","severity":"error","title":"Database client constructed per request","signal":"postgres()/createDb()/new Pool()/neon() constructed inside a request-path function","whyItBreaks":"Every request opens a new TCP connection that is never explicitly closed. Against a pooler (PgBouncer/Supabase/Neon) the slot stays checked out until it times out, so the app serves a few hundred requests and then hangs forever on connection acquisition — the classic \"works locally, dies on deploy at ~200 rps\" failure.","suggestedFix":"Hoist one module-level client and hand it out through a single accessor (`getDb()`), guarded with `if (!db) db = createDb()` so the module is evaluated once per process.","docsUrl":"https://pitcheye.dev/rules/db-per-request-client","markdownUrl":"https://pitcheye.dev/rules/db-per-request-client","explain":{"tool":"explain_rule","arguments":{"ruleId":"db/per-request-client"}}},{"ruleId":"db/shared-client-max-one","slug":"db-shared-client-max-one","pack":"db","severity":"error","title":"Shared client configured with `max: 1`","signal":"a module-level postgres()/Pool with `max: 1` outside migrations and scripts","whyItBreaks":"postgres.js DESTROYS a connection when a query rejects, so with a ceiling of one the next query waits for a connection that will never come back — the process hangs with no error. Even without a rejection it serialises every query in the app behind a single socket.","suggestedFix":"Set `max` to a real concurrency budget (typically 5–10 per instance) and keep a single module-level client.","docsUrl":"https://pitcheye.dev/rules/db-shared-client-max-one","markdownUrl":"https://pitcheye.dev/rules/db-shared-client-max-one","explain":{"tool":"explain_rule","arguments":{"ruleId":"db/shared-client-max-one"}}},{"ruleId":"db/supabase-rls-missing","slug":"db-supabase-rls-missing","pack":"db","severity":"error","title":"Table created in `public` with no RLS","signal":"CREATE TABLE public.<name> with no ENABLE ROW LEVEL SECURITY and no policy for that table in the file","whyItBreaks":"Supabase exposes every `public` table through PostgREST. Without RLS the anon key — which is shipped to the browser by design — can SELECT, INSERT, UPDATE and DELETE every row of it. This is a full data breach with a public credential.","suggestedFix":"Add `ALTER TABLE public.<name> ENABLE ROW LEVEL SECURITY;` immediately after the CREATE TABLE, plus the policies that should allow access.","docsUrl":"https://pitcheye.dev/rules/db-supabase-rls-missing","markdownUrl":"https://pitcheye.dev/rules/db-supabase-rls-missing","explain":{"tool":"explain_rule","arguments":{"ruleId":"db/supabase-rls-missing"}}},{"ruleId":"db/rls-permissive-using-true","slug":"db-rls-permissive-using-true","pack":"db","severity":"warn","title":"RLS policy is `USING (true)`","signal":"CREATE POLICY with FOR INSERT/UPDATE/DELETE/ALL and USING (true) or WITH CHECK (true)","whyItBreaks":"`USING (true)` is RLS switched on in name only: any authenticated (or anonymous, for SELECT grants) caller matches every row. It is usually added to silence a \"new row violates row-level security policy\" error, which means the write path is now open to the whole tenant population.","suggestedFix":"Scope the predicate to the owner, e.g. `USING (auth.uid()::text = user_id)` and the same expression for `WITH CHECK`.","docsUrl":"https://pitcheye.dev/rules/db-rls-permissive-using-true","markdownUrl":"https://pitcheye.dev/rules/db-rls-permissive-using-true","explain":{"tool":"explain_rule","arguments":{"ruleId":"db/rls-permissive-using-true"}}},{"ruleId":"db/neon-pooler-in-migrations","slug":"db-neon-pooler-in-migrations","pack":"db","severity":"error","title":"Pooler URL used for migrations","signal":"a pooled connection string in drizzle.config / migrations / seed scripts","whyItBreaks":"Migrations need session-level features (advisory locks, DDL in an explicit transaction, prepared statements) that a transaction pooler does not preserve. Against PgBouncer/Neon pooler you get intermittent DDL failures, half-applied migrations, and lock timeouts that are impossible to reproduce against a direct connection.","suggestedFix":"Use the DIRECT (unpooled) connection string for drizzle-kit and scripts — on Neon `DATABASE_URL_UNPOOLED`, on Supabase the `db.<ref>.supabase.co:5432` host.","docsUrl":"https://pitcheye.dev/rules/db-neon-pooler-in-migrations","markdownUrl":"https://pitcheye.dev/rules/db-neon-pooler-in-migrations","explain":{"tool":"explain_rule","arguments":{"ruleId":"db/neon-pooler-in-migrations"}}},{"ruleId":"db/postgres-js-prepare-true-with-pooler","slug":"db-postgres-js-prepare-true-with-pooler","pack":"db","severity":"error","title":"postgres.js against a pooler without `prepare: false`","signal":"postgres(<pooler url>, opts) where opts does not set prepare: false","whyItBreaks":"postgres.js prepares statements by default. A transaction pooler multiplexes backends, so a prepared statement created on one connection is missing on the next — you get `prepared statement \"s1\" already exists` or `does not exist` under load, and only under load.","suggestedFix":"Pass `{ prepare: false }` in the postgres.js options whenever the connection string is pooled.","docsUrl":"https://pitcheye.dev/rules/db-postgres-js-prepare-true-with-pooler","markdownUrl":"https://pitcheye.dev/rules/db-postgres-js-prepare-true-with-pooler","explain":{"tool":"explain_rule","arguments":{"ruleId":"db/postgres-js-prepare-true-with-pooler"}}},{"ruleId":"db/neon-http-multi-statement-tx","slug":"db-neon-http-multi-statement-tx","pack":"db","severity":"error","title":"`db.transaction()` on the Neon HTTP driver","signal":"drizzle-orm/neon-http imported and `.transaction()` called","whyItBreaks":"The Neon HTTP driver sends one statement per request and cannot hold a session, so `transaction()` cannot actually begin/commit across statements. Statements run outside the transaction and a failure mid-way leaves half-written data — atomically broken money paths.","suggestedFix":"Use `drizzle-orm/neon-serverless` with a `Pool` (the WebSocket driver) wherever you need transactions, or send the whole unit as one SQL statement.","docsUrl":"https://pitcheye.dev/rules/db-neon-http-multi-statement-tx","markdownUrl":"https://pitcheye.dev/rules/db-neon-http-multi-statement-tx","explain":{"tool":"explain_rule","arguments":{"ruleId":"db/neon-http-multi-statement-tx"}}},{"ruleId":"vercel/hobby-cron-violation","slug":"vercel-hobby-cron-violation","pack":"vercel","severity":"error","title":"Cron schedule is not allowed on the Hobby plan","signal":"a `crons[].schedule` in vercel.json that runs more than once per day","whyItBreaks":"Vercel Hobby allows one cron execution per day and validates the schedule at BUILD time. A sub-daily cadence does not degrade — it fails the deployment, so the fix ships as a failed preview with no runtime signal to debug.","suggestedFix":"Either move the job to a daily schedule (`0 6 * * *`) or upgrade to Pro. For sub-daily work, drive it from an Inngest job or an external scheduler hitting a route with its own auth.","docsUrl":"https://pitcheye.dev/rules/vercel-hobby-cron-violation","markdownUrl":"https://pitcheye.dev/rules/vercel-hobby-cron-violation","explain":{"tool":"explain_rule","arguments":{"ruleId":"vercel/hobby-cron-violation"}}},{"ruleId":"vercel/env-parity-drift","slug":"vercel-env-parity-drift","pack":"vercel","severity":"warn","title":"Missing secret env var is swallowed instead of failing fast","signal":"a `process.env.<SECRET>` read whose absent branch only `console.warn`s and skips work","whyItBreaks":"Environment variables are per-scope on Vercel: a key set in Production is absent in Preview unless someone added it. Code that warns-and-skips turns that drift into a silent behaviour difference — receipts \"sent\" in production, silently dropped in preview — and nobody sees it until a customer does.","suggestedFix":"Fail loudly at the boundary: `if (!key) throw new Error(\"RESEND_API_KEY is not set in this environment\")`. Validate required env in one module loaded at boot so a missing key breaks the deploy, not one feature.","docsUrl":"https://pitcheye.dev/rules/vercel-env-parity-drift","markdownUrl":"https://pitcheye.dev/rules/vercel-env-parity-drift","explain":{"tool":"explain_rule","arguments":{"ruleId":"vercel/env-parity-drift"}}},{"ruleId":"vercel/serverless-budget-guard","slug":"vercel-serverless-budget-guard","pack":"vercel","severity":"warn","title":"Long-running AI call with no `maxDuration`","signal":"a route handler calling an LLM SDK with no `export const maxDuration`","whyItBreaks":"Serverless functions get the plan default duration (10s on Hobby). An LLM completion routinely exceeds it, so the request is killed mid-flight: the user sees a 504, the provider still bills the tokens, and the retry bills them again.","suggestedFix":"Export `export const maxDuration = 60` (plan-dependent) from the route, and stream the response for anything user-facing so the connection outlives the first token.","docsUrl":"https://pitcheye.dev/rules/vercel-serverless-budget-guard","markdownUrl":"https://pitcheye.dev/rules/vercel-serverless-budget-guard","explain":{"tool":"explain_rule","arguments":{"ruleId":"vercel/serverless-budget-guard"}}},{"ruleId":"nextjs/server-action-unvalidated-input","slug":"nextjs-server-action-unvalidated-input","pack":"vercel","severity":"error","title":"Server action trusts an `any` parameter","signal":"a `'use server'` export whose `any` parameter is used directly in a DB write","whyItBreaks":"A server action is a public HTTP endpoint with a machine-generated id: the TS signature is not enforced at runtime, so `any` is whatever the caller posts. Passing it straight into `.set(...)`/`.values(...)` lets an anonymous caller write arbitrary columns — including privileged ones — on any row the guard does not name.","suggestedFix":"Type the parameter `unknown`, parse it with a zod schema (`const input = Schema.parse(raw)`) and write only the parsed fields.","docsUrl":"https://pitcheye.dev/rules/nextjs-server-action-unvalidated-input","markdownUrl":"https://pitcheye.dev/rules/nextjs-server-action-unvalidated-input","explain":{"tool":"explain_rule","arguments":{"ruleId":"nextjs/server-action-unvalidated-input"}}},{"ruleId":"nextjs/client-secret-leak","slug":"nextjs-client-secret-leak","pack":"vercel","severity":"error","title":"Secret exposed through a `NEXT_PUBLIC_` variable","signal":"a `NEXT_PUBLIC_*` env var whose name marks it as a secret","whyItBreaks":"Next inlines every `NEXT_PUBLIC_*` value into the client bundle at build time. A prefix mistake publishes a full-privilege key to anyone who opens devtools, and because it \"works\", it survives review.","suggestedFix":"Drop the `NEXT_PUBLIC_` prefix, keep the secret server-only, and expose the capability through a route handler or server action. Only publishable/anon keys belong in the client.","docsUrl":"https://pitcheye.dev/rules/nextjs-client-secret-leak","markdownUrl":"https://pitcheye.dev/rules/nextjs-client-secret-leak","explain":{"tool":"explain_rule","arguments":{"ruleId":"nextjs/client-secret-leak"}}},{"ruleId":"uploadthing/unauthenticated-file-router","slug":"uploadthing-unauthenticated-file-router","pack":"webhooks","severity":"error","title":"UploadThing route has no auth in `.middleware()`","signal":"a file-route `.middleware(async () => …)` with no `auth()` call, or a bare `z.string().url()` for a document/image field","whyItBreaks":"UploadThing endpoints are public: `.middleware()` is the only place a caller is identified, and an empty one lets anyone on the internet mint upload URLs against your app key and storage quota. The same hole appears on the read side when a mutation accepts any URL — an operator can attach a phishing link or third-party host as a licence document.","suggestedFix":"Resolve the caller in `.middleware()` (`const { userId } = await auth()`, throw `UploadThingError` when absent) and return `{ userId }` so `onUploadComplete` can scope the row. For URL fields, replace `z.string().url()` with a schema that checks the hostname against `utfs.io` / `*.ufs.sh`.","docsUrl":"https://pitcheye.dev/rules/uploadthing-unauthenticated-file-router","markdownUrl":"https://pitcheye.dev/rules/uploadthing-unauthenticated-file-router","explain":{"tool":"explain_rule","arguments":{"ruleId":"uploadthing/unauthenticated-file-router"}}},{"ruleId":"uploadthing/missing-size-or-mime-limit","slug":"uploadthing-missing-size-or-mime-limit","pack":"webhooks","severity":"error","title":"File route declares no size limit","signal":"an UploadThing `f({ … })` whose mime entry object has no `maxFileSize`","whyItBreaks":"Without `maxFileSize` UploadThing applies its own ceiling (orders of magnitude above anything you intend), and `blob: {}` accepts ANY file type. One authenticated caller can fill the storage quota with a single request — the bill arrives before the alert does.","suggestedFix":"Declare the policy: `f({ pdf: { maxFileSize: \"8MB\", maxFileCount: 1 } })`, and never use the `blob` mime — it accepts any content type.","docsUrl":"https://pitcheye.dev/rules/uploadthing-missing-size-or-mime-limit","markdownUrl":"https://pitcheye.dev/rules/uploadthing-missing-size-or-mime-limit","explain":{"tool":"explain_rule","arguments":{"ruleId":"uploadthing/missing-size-or-mime-limit"}}},{"ruleId":"webhooks/unverified-signature","slug":"webhooks-unverified-signature","pack":"webhooks","severity":"error","title":"Webhook parses the body without verifying its signature","signal":"a webhook handler calling `await req.json()` with no `constructEvent`/`verify` in the file","whyItBreaks":"A webhook URL is public and unguessable at best. Without a signature check, anyone who learns it can POST a forged `checkout.session.completed` and the handler will mark orders paid, credit balances, or flip a subscription — a full business-logic compromise with no credentials at all.","suggestedFix":"Read the RAW body (`await req.text()`), then verify it: `stripe.webhooks.constructEvent(rawBody, sig, secret)` (or `Webhook.verify` for Svix/Clerk/Resend). JSON-parsing first also breaks the signature — the exact bytes matter.","docsUrl":"https://pitcheye.dev/rules/webhooks-unverified-signature","markdownUrl":"https://pitcheye.dev/rules/webhooks-unverified-signature","explain":{"tool":"explain_rule","arguments":{"ruleId":"webhooks/unverified-signature"}}},{"ruleId":"webhooks/payment-update-missing-idempotency","slug":"webhooks-payment-update-missing-idempotency","pack":"webhooks","severity":"warn","title":"Payment webhook update has no lifecycle predicate","signal":"a webhook `.update(...)` whose `where` clause has no status/state condition","whyItBreaks":"Providers deliver at-least-once: the same event arrives twice on a retry, a duplicate subscription, or a replay. An update keyed only on the row id re-applies the transition — marking a refunded order paid again, re-crediting a balance, re-firing the emails. The database never objects, so nothing surfaces it.","suggestedFix":"Put the current state in the predicate: `.where(and(eq(orders.id, id), eq(orders.status, \"pending\")))` and treat 0 updated rows as \"already applied\".","docsUrl":"https://pitcheye.dev/rules/webhooks-payment-update-missing-idempotency","markdownUrl":"https://pitcheye.dev/rules/webhooks-payment-update-missing-idempotency","explain":{"tool":"explain_rule","arguments":{"ruleId":"webhooks/payment-update-missing-idempotency"}}},{"ruleId":"inngest/non-deterministic-outside-step","slug":"inngest-non-deterministic-outside-step","pack":"inngest","severity":"error","title":"Side effect runs outside `step.run()`","signal":"a DB/HTTP/SDK call in a function body with no `step.run()` ancestor","whyItBreaks":"Inngest replays the handler from the first line on every step transition and on every retry. A database write or an API call outside `step.run()` is repeated each time: duplicate notifications, double charges, one email per replay. It is invisible in the first run because the first run looks correct.","suggestedFix":"Wrap every side effect in `await step.run(\"name\", async () => { … })` and return the value you need. Keep only pure computation in the function body.","docsUrl":"https://pitcheye.dev/rules/inngest-non-deterministic-outside-step","markdownUrl":"https://pitcheye.dev/rules/inngest-non-deterministic-outside-step","explain":{"tool":"explain_rule","arguments":{"ruleId":"inngest/non-deterministic-outside-step"}}},{"ruleId":"inngest/nested-step-run","slug":"inngest-nested-step-run","pack":"inngest","severity":"error","title":"`step.run()` nested inside another `step.run()`","signal":"a `step.run(` call with another `step.run(` in its ancestors","whyItBreaks":"Steps are journaled by id at the top level of the function. A nested step is never independently memoised, so it re-executes with its parent on every replay while its own id is skipped — the work runs a different number of times than the journal says, which is how \"exactly once\" quietly becomes \"sometimes zero\".","suggestedFix":"Flatten it: await the inner step into a variable at the function level and pass the value into the outer one.","docsUrl":"https://pitcheye.dev/rules/inngest-nested-step-run","markdownUrl":"https://pitcheye.dev/rules/inngest-nested-step-run","explain":{"tool":"explain_rule","arguments":{"ruleId":"inngest/nested-step-run"}}},{"ruleId":"inngest/missing-put-handler","slug":"inngest-missing-put-handler","pack":"inngest","severity":"error","title":"Inngest serve() does not export `PUT`","signal":"`export const { GET, POST } = serve({...})` with no `PUT`","whyItBreaks":"Inngest syncs the app with your deployment over an out-of-band `PUT` request. Without the `PUT` export the sync fails, so functions are registered from an older build or not at all — the code you just deployed simply does not run, and the dashboard still shows the previous version as healthy.","suggestedFix":"Export all three: `export const { GET, POST, PUT } = serve({ client, functions })`.","docsUrl":"https://pitcheye.dev/rules/inngest-missing-put-handler","markdownUrl":"https://pitcheye.dev/rules/inngest-missing-put-handler","explain":{"tool":"explain_rule","arguments":{"ruleId":"inngest/missing-put-handler"}}},{"ruleId":"inngest/missing-retry-or-idempotency","slug":"inngest-missing-retry-or-idempotency","pack":"inngest","severity":"warn","title":"Function has neither `retries` nor `idempotency`","signal":"`createFunction({ id } , …)` with no `retries` and no `idempotency`","whyItBreaks":"Inngest retries by default until it decides not to, and the same event can be delivered more than once. With no `retries` ceiling a permanently failing job hammers your database for hours, and with no `idempotency` key a re-delivered event charges the card twice.","suggestedFix":"Set both: `{ id: \"charge-invoice\", retries: 3, idempotency: \"event.data.invoiceId\" }`. The idempotency expression must resolve to a stable business key, not a timestamp.","docsUrl":"https://pitcheye.dev/rules/inngest-missing-retry-or-idempotency","markdownUrl":"https://pitcheye.dev/rules/inngest-missing-retry-or-idempotency","explain":{"tool":"explain_rule","arguments":{"ruleId":"inngest/missing-retry-or-idempotency"}}}],"endpoints":{"landing":"https://pitcheye.dev/","rules":"https://pitcheye.dev/rules","sitemap":"https://pitcheye.dev/sitemap.xml","robots":"https://pitcheye.dev/robots.txt","search":"https://pitcheye.dev/.well-known/search"},"generatedAt":"2026-12-02T06:10:14.790Z"}