Files
zarinpal-analytics-deployment/docs/GROWTH-COACH-SCHEDULER-CONTRACT.md

10 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Growth Coach Scheduler Contract
- `cmd/scheduler` یک سرویس خصوصی و مستقل از API/worker است و endpoint عمومی ندارد.
- هر ساعت بیدار می‌شود؛ قبل از ساعت ۰۷:۰۰ تهران job روزانه نمی‌سازد.
- گزارش روزانه برای هر پروفایل جاری، برنامه هفتگی در شنبه و برنامه ماهانه در روز اول ماه جلالی enqueue می‌شود.
- fingerprint یکتای PostgreSQL از merchant، terminal، cadence، شروع دوره و profile version ساخته می‌شود؛ اجرای هم‌زمان scheduler job تکراری ایجاد نمی‌کند.
- scheduler فقط enqueue می‌کند. generation در worker انجام می‌شود و هر render صرفاً state ذخیره‌شده را می‌خواند.
- rollback با خاموش‌کردن `AI_COACH_ENABLED` انجام می‌شود؛ داده‌های profile، plan و «قدم‌های زرین» حفظ می‌شوند.
- signals عملیاتی: queue age، generation latency، provider/validation failure، token/cost، stale plan و evaluation lag. prompt و متن profile نباید log شوند.