Skip to content

Debugging and validation ​

Verify the backend API before debugging the page. Use dedicated development databases, Redis, and test accounts. Test commands do not automatically isolate every external resource; prepare the environment described by the target repository.

Command reference ​

Run commands in the specified component directory. Start with relevant tests, then complete the repository's required checks before delivery.

DirectoryCommandPurpose
Backenduv run ruff check .Python lint checks
Backenduv run ruff format --check .Check formatting without modifying files
Backenduv run pytestBackend tests; verify test resources and fixtures first
Backenduv run alembic current, uv run alembic headsCompare database and source migration versions
Webpnpm lintLint with some automatic fixes; review the diff afterwards
Webpnpm typecheckVue and TypeScript checks
Webpnpm testVitest tests
Webpnpm buildProduction-mode build
Desktoppnpm typecheck, pnpm test, pnpm buildTypes, main-process service tests, and build

Keep temporary logs, screenshots, and test output in local .local/ directories outside product commits. Use pytest --basetemp for a dedicated temporary directory; pytest clears that directory, so use an empty location reserved for the test run.

Diagnose requests in order ​

  1. Inspect the path, method, HTTP status, and response in browser Network tools.
  2. Check the user, permissions, and target tenant. Reproduce the same request in /docs; do not include tokens in logs or issue reports.
  3. Check backend logs for route execution, service errors, and missing migrations.
  4. Once the API is correct, inspect frontend types, response unwrapping, state updates, and translations.
SymptomCheck first
Web loads, but requests fail to connect or return 502Backend process, port, .env.test.local / .env.test, and Vite proxy
404Router registration in app/main.py, prefix, and request path
401Sign-in state, refresh, and target service; do not bypass authentication in the page
403Permission code, enabled roles, tenant ownership, and record scope
422Fields, types, lengths, and extra input; read validation details
Missing menuMenu synchronization, role grants, and refreshed login permissions
Menu exists but page failsGenerated routes, file path, and menu component mapping
API succeeds but page data is emptyrequest already unwraps data; do not access data.data again
Missing table or columnAlembic version, model imports, and database connection
Translation keys appear as textResource nesting and App.I18n.Schema

Minimum module validation ​

AreaVerify
Normal useCreation, refresh, pagination, and empty states
InputEmpty values, length limits, invalid IDs, and extra tenantId fields
PermissionsDirect API calls are rejected for ordinary roles without access
Tenant and record scopeLists, counts, details, and writes share the same boundary
TransactionsRolling back after a service call leaves no persisted record; failures never show success
MigrationsUpgrade and downgrade in a dedicated database; retain existing migration regressions
PagesDuplicate submission, rapid paging, retry, mobile, and light/dark themes
LocalizationBoth languages for buttons, menus, validation, errors, and empty states

For AI tools, also verify revoked permissions, expired confirmations, duplicate execution, and historical result access. See business tool integration.

Tutorial test coverage ​

The documentation repository's tests/test_notes*.py exercises example service behavior using in-memory SQLite. Follow the notes tutorial to run it. These tests do not replace PostgreSQL migration, HTTP authentication, browser, or production-build validation in the target project.

Deliver source, migrations, menus, translations, and related tests together. See upgrade, backup, and recovery for release procedures.