1.9 KiB
1.9 KiB
Agent Operating Rules — Poona Hospital AMS
- Build exactly what the plan and proposal describe. Out of scope: QR codes, barcode scanning, SMS/WhatsApp, any AI/LLM features, payment/rent/depreciation modules, multi-hospital tenancy, mobile native apps.
- Work phase by phase. Do not start the next phase until told. Commit at the end of each phase with message
phase-N: <summary>. - Never invent requirements. Where the proposal says "to be confirmed", implement it as an editable setting with the default given in section 4 and log it in
docs/ASSUMPTIONS.md. - Store all timestamps in UTC; display in Asia/Kolkata with format
DD-MMM-YYYY HH:mm(dates only:DD-MMM-YYYY). One shared formatting helper on the frontend (src/lib/format.ts); one on the backend (app/core/time_utils.py). - Business calculations live in pure functions in
backend/app/services/with unit tests. Routers stay thin. - Permissions are enforced on the server (including field-level). The UI hides or disables controls as a convenience only.
- No secrets in code. Demo passwords exist only in the seed script and the README.
- Keep dependencies minimal and pinned.
- After each phase update README.md.
- If something is ambiguous and blocking, make the most reasonable choice, record it in
docs/ASSUMPTIONS.md, and continue.
Implementation Notes
- N1: When renewing a contract, add
is_superseded: bool = Falseto the contracts model and set True on the old contract when renewing, so history filtering works cleanly. - N2:
calibration_records.statusandpm_records.statusvaluesupcoming/due/overdueare NEVER stored in the DB; onlycompletedis persisted. The Pydantic response schema computes them from due_date and effective_today(). - N3: SQLite engine must use
check_same_thread=False, WAL mode, and busy_timeout=5000ms. APScheduler jobs must useget_scheduler_db()context manager — never a request session.