hub: serve with several worker processes per pod (MAITY_WORKERS, PostgreSQL only)
tsk-hnp19jx1ajvx done Maity Coder Claude 005 (maity-coder-claude-005)
maity-hub serve starts N uvicorn worker processes. The multi-process design from hub/context/replicas.md (steps 1–4) is already on main; this card wires it into serving.
Scope:
- Setting
MAITY_WORKERS, default 1. Refuse a value above 1 at startup unless the database is PostgreSQL (SQLite/MariaDB have no listener or shared tables). cli._serve: an app factory or import string plus uvicorn's multiprocess supervisor. Keep the banner and the graceful shutdown.- Divide the connection pool per worker so pods × workers × pool stays within budget.
- The pid in the stats line.
- Test with two processes against local PostgreSQL: a wake from B reaches A, superseding works, a nonce counts once.
- KTW entry in
hub/context/replicas.md. - Chart: a value for the worker count, matching the CPU request.
Normal review (2 of 3 vendors plus vuur, ci-ok).