<!-- LOVABLE:BEGIN -->
> [!IMPORTANT]
> This project is connected to [Lovable](https://lovable.dev). Avoid rewriting
> published git history — force pushing, or rebasing/amending/squashing commits
> that are already pushed — as it rewrites history on Lovable's side and the
> user will likely lose their project history.
>
> Commits you push to the connected branch sync back to Lovable and show up in
> the editor, so keep the branch in a working state.

## What Lovable manages

Rules outside this block are the project's own. Change the pieces below in
Lovable, not by hand. With the [Lovable MCP](https://mcp.lovable.dev)
connected, `send_message` asks Lovable to do it; otherwise ask the user to
use the editor.

- **Database.** Do not add or edit `supabase/migrations/` or `drizzle/`.
  Ask Lovable to change the schema.
- **Generated files.** Do not edit a file whose header says it is automatically
  generated.
- **AI gateway.** Keep model calls on Lovable's gateway, and keep
  `LOVABLE_API_KEY` out of browser code.
- **Connectors.** Lovable provides native connectors. `list_connectors` shows
  which are enabled; `add_connector` only returns the dashboard link. When a
  connector is enabled, calls go through the connector gateway and need
  `LOVABLE_API_KEY`. When Lovable does not provide one, users can bring their
  own key and store it in Secrets.
- **Secrets.** Lovable manages them. Do not put secret values in the repo.
<!-- LOVABLE:END -->

## Project rules
- All wallet/balance changes go through SECURITY DEFINER SQL functions (submit_task, request_withdrawal, admin_*); users have no direct write access to profiles/transactions — prevents tampering and duplicate payouts.
- Login uses a synthetic email `<10-digit-mobile>@roztask.app` (auto-confirm on) because auth requires an email.
- Admin is a role in `user_roles`; grant it by SQL, never from the client.
- Store uploaded task logos as task-logos/ paths in icon_url and render through TaskLogo signed URLs; private storage permits signed-in reads and admin-only uploads while preserving legacy image URLs.
- Persist reusable UPI IDs on profiles through the authenticated save_upi_id RPC; keep withdrawal UPI snapshots unchanged so edits never alter past payment destinations.
