Skip to Content

check rules

The check tool validates a project in four layers — syntax, code gate, contract rules, typecheck; this page covers when it runs, when it blocks a deploy, and the main rules by area.

Each rule matches a kind of mistake that once crashed an app or failed a deploy. Errors block a deploy; warnings don’t.

Layers

check runs the cheapest layers first.

1. Syntax parses every .ts / .tsx file → syntax errors with line numbers 2. Code gate patterns that crash the app or leave the stack → code.* rules (errors) + quality warnings 3. Contract route tree, UI ↔ API match, .ts/.tsx boundary, handler schemas 4. Typecheck full TypeScript — only with check({ typecheck: true }), ~5–15 s

Each result line shows the layer, the rule id (when there is one), the file, the line and the fix:

✗ 2 error(s) Errors: - [gate:code.antd-v6-no-visible-prop] app/orders/page.tsx:42 <Modal visible={…}> — antd v6 Modal ignores `visible`, so it never opens. Use `open={…}` … - [contract] app/orders/page.tsx FE calls GET /orders/stats but no matching BE route found Warnings: - [gate:perf.order-unindexed] app/orders/repository.ts:18 orders.createdAt is used in orderBy but …

When check runs

  • On every write_files — the first three layers run inside the same call and the result comes back with it. Your agent fixes the findings in its next call.
  • When you call check — the first three layers; add typecheck: true to run the typecheck too. Run the typecheck once at the end of each phase, not after every file.
  • On deploy — all four layers run, the typecheck included, and the deploy is refused while errors remain. Type errors are the only ones you can override, with deploy({ force: true, reason }) when you are sure the app still works; errors from the first three layers cannot be overridden. The exception: a file tree that was already deployed successfully can always be deployed again, so you can roll back.

UI and stack

RuleMeaning
code.no-mui, code.no-shadcnImports MUI or shadcn/ui — use antd and pro-components.
code.no-tailwind-importImports a Tailwind package or a Tailwind-based UI kit — write utility classes directly in className.
code.no-css-importImports a .css file — apps have no CSS files; use antd tokens.
code.undefined-componentUses <Name /> that is neither imported nor declared — the page crashes with ”… is not defined”.
code.antd-v6-no-visible-propantd v6 Modal, Drawer, Dropdown, Tooltip, Popover and Popconfirm ignore visible — the overlay never opens; use open. Your own components and ModalForm / DrawerForm are not flagged.
code.no-pagecontainer-onbackonBack on PageContainer/PageHeader crashes the page — render your own back button.

Calling the API from the UI

RuleMeaning
code.invalid-api-methodCalls api.<resource>.<method>() that the generated client doesn’t have; the message lists the valid methods. The deploy build checks again against the client it generates and refuses the deploy if a call is still wrong.
(contract)The UI calls a path that no handler serves.

File tree

RuleMeaning
code.no-app-api-folderA file under app/api/ — the tree is flat: app/<resource>/<method>.ts.
code.no-framework-file-emitHand-written app/db.ts, app/api.ts or app/hooks.ts — manh.run generates these.
code.reserved-std-pathA file under manh/ — that folder is reserved for built-in services.
config.wrong-extensionapp/auth.tsx or app/upstream.tsx — config files must be .ts; manh.run never reads the .tsx.
shared.impure-importA file in app/shared imports something other than app/shared/*, manh/enum, manh/flow and manh/vn (such as app/db, react, manh/env) or uses window, document, localStorage.
shared.not-tsxA .tsx file or JSX in app/shared — that folder holds plain .ts only.
(contract)A .tsx file imports a server-only module, or a .ts file imports React. app/shared/* is the one folder both sides import.

Server and database

RuleMeaning
code.runtime-importImports a runtime module other than import { env } from "manh/env" — that is the only runtime import allowed.
code.backend-package-not-allowedThe package isn’t on manh.run’s server list; the message lists the allowed packages.
code.no-remote-importImports from a URL (https://…, esm.sh, the old esm.town/v/std/* URLs) — not supported; built-in services live at manh/*.
code.unknown-std-importImports an manh/<name> that doesn’t exist (such as manh/oauth) — sign-in is declared in app/auth.ts (email/password; add providers: ["google"] for Google).
code.no-dayjs-in-backendUses dayjs in a .ts file — it exists only in the UI; use Date on the server.
code.no-async-transactiondb.transaction(async …) — the async callback isn’t awaited and errors don’t roll back; use a synchronous callback.
(contract)A handler reads body or a field that its schema doesn’t declare.

A missing import of eq, and, desc and similar from app/db is not an error: the build adds it.

Security and sign-in

RuleMeaning
code.hardcoded-secretA string in code looks like a real API key — set the secret in the dashboard and read it as env.NAME.
code.no-reserved-envReads a reserved name (OPENAI_*, FT_* and others) — manh.run’s keys aren’t in the app; use manh/*.
auth.config-invalidapp/auth.ts has the wrong shape: no roles, a defaultRole outside roles, an unknown signup or providers value, or values that aren’t literals.
access.invalidexport const access isn’t "public", "user" or a literal array of role names.
access.unknown-roleaccess names a role that isn’t in roles of app/auth.ts.
auth.signed-in-redirect-loopWarning: a sign-in page goes home whenever a user exists (useEffect(() => { if (user) nav("/") }, [user])). If anything on the home page still sees nobody signed in, the two pages bounce forever. Navigate right after signIn(…) in the submit handler, or only when the session starts while the page is open.
code.jwt-verify-algverify(token, secret) without "HS256" — every request fails sign-in.
tenant.removedThe app has an app/tenant.ts. manh.run no longer has a multi-tenant mode: one app, one database. Delete the file; when each client needs separate data, clone the app per client, or scope rows by an org column (orgId).

Cron

RuleMeaning
code.cron-missing-scheduleA .cron.ts file has no export const schedule — the job never runs.
code.cron-invalid-scheduleThe schedule doesn’t have exactly 5 fields (minute hour day month weekday, in UTC).

Sample data

RuleMeaning
sample.template-unchangedThe project was made from a template and the app was changed for its new owner, but spec/sample-data.json is still the template’s (another business’s customers, products and places). Write a new file for the owner’s business in one write_files call: keep the tables and columns the message lists, 80 KB at most. The deploy loads it into the empty tables; if the app was deployed already, delete the old sample rows with db_exec first.

Common warnings

Warnings don’t block a deploy, but they point at what to fix.

RuleMeaning
code.missing-frontendNo .tsx files yet — expected while you build the data and API phases.
code.no-inline-drizzle-in-handlerA handler calls db.select/insert… directly — move the query into repository.ts.
perf.order-unindexedA list sorts by a column with no index — it slows down as the table grows. Not reported when an index (composite included) starts with the sorted column or with the column the query filters on with eq, when the query filters by an indexed foreign key with .limit(n) of 50 or less, and for the users table generated from app/auth.ts.
list.unboundedA hand-written pageSize schema has no .max(…) — one request could read the whole table. Use listSchema() from app/db (caps it at 100) or add .max(100).
code.hardcoded-colorA hard-coded color in style — take it from theme.useToken() (token.colorTextLightSolid for white text on a colored fill, token.colorBgMask for a dark scrim); use Typography.Text type for red/green text and Tag color for status labels. White, black or rgba overlays on a background image are not flagged.
seo.missing-metaA public page has no title / description in meta. When the app has sign-in, only pages in the layout’s PUBLIC_PAGES-style list are reported; the login, register and users pages never are; meta = { noindex: true } in app/layout.tsx covers every page below it.
code.no-raw-useapi-on-own-backendUses useApi() to call the app’s own API — it works, but prefer the typed useApiClient() from app/api.
code.no-direct-sqlite-core-importImports from drizzle-orm/sqlite-core — the build rewrites it to app/db, but import from app/db.
code.antd-v6-no-bodystyle-prop, code.antd-v6-no-headstyle-prop, code.antd-v6-no-dropdownclassname-prop, code.antd-v6-no-tabpane-jsx, code.antd-v6-no-menu-item-jsxOlder antd v6 spellings that still work — prefer styles={{ body, header }}, classNames={{ popup: { root } }}, items={[…]}.
code.antd-responsive-xs-onlyA table column with responsive: ["xs"] alone — antd shows it only on phones (under 576 px), never on a computer. Write responsive: ["xs", "sm"] to show it on every screen.
access.public-writeA write handler (POST, PUT, PATCH, DELETE) has access = "public" — anyone can call it.
sample.qualityspec/sample-data.json has rows that contradict each other or look made up: an id with no row in the file (classes[3].teacher_id = 9 but teachers has no id 9), a child row whose ids differ from its parent’s (attendance in a class other than its session’s), a child marked in a class it is not enrolled in, \n written as two characters (the page shows “\n”), phones like 0900000001, @example.com addresses, “Lorem ipsum”, one name repeated on many rows, or a table with a list screen and no rows (that screen is empty at handover). Names table, row and column; at most 8 lines. Fix the sample file so rows agree, with real, varied names and numbers.
sample.runtime-rewriteServer code that updates data and quotes 3 or more values of spec/sample-data.json (a “normalise sample data” button) — rewriting sample rows at runtime breaks half-way. Delete it and rewrite the sample file.

Good to know

  • While syntax errors remain, most code gate rules pause — fix syntax first, then run again.
  • deploy runs the typecheck too, so a type error blocks the deploy. Run check({ typecheck: true }) before you hand the app over to see type errors early, not at deploy time.
  • This page lists the main rules, not all of them. Every message includes the fix.

Built-in hints

hint.* warnings name a framework feature that already does what a file writes by hand. They never block. One per kind per project:

  • hint.useAction — repeated try / message.error(e.response.data.message) around API calls → useAction from app/hooks.
  • hint.std-vn — hand-written Vietnam time (+7h) or money formatting → manh/vn.
  • hint.mail-html — a hand-written HTML escape in mail code → html and mailFrame from manh/email.
  • hint.csv-export — a hand-made CSV download → block export-excel.
  • hint.numbering — document codes built with padStart → block numbering.
  • hint.flow-history — a from/to status history table → Flow.move returns the row to store; show it on the record page with <ActivityLog> from manh/shell.
  • hint.row-scope — the same role-based row filter in several queries → scopeBy from app/db.

Next steps

Last updated