| 02-backend-services |
04 |
infra |
| firebase-functions |
| cloud-scheduler |
| health-probes |
| retention-cleanup |
| onSchedule |
|
| phase |
provides |
| 02-backend-services |
healthProbeService.runAllProbes(), alertService.evaluateAndAlert(), HealthCheckModel.deleteOlderThan(), AlertEventModel.deleteOlderThan(), deleteProcessingEventsOlderThan() |
|
|
| runHealthProbes Cloud Function export (every 5 minutes, separate from processDocumentJobs) |
| runRetentionCleanup Cloud Function export (weekly Monday 02:00, 30-day rolling deletion) |
|
| 03-api-layer |
| 04-frontend |
| phase-03 |
| phase-04 |
|
| added |
patterns |
|
|
| onSchedule Cloud Functions use dynamic import() to avoid cold-start overhead and module-level secret access |
| Health probes as separate named Cloud Function — never piggybacked on processDocumentJobs (PITFALL-2) |
| retryCount: 0 for health probes — 5-minute schedule makes retries unnecessary |
| Promise.all() for parallel multi-table retention cleanup |
|
|
|
| runHealthProbes is completely separate from processDocumentJobs — distinct Cloud Function, distinct schedule (PITFALL-2 compliance) |
| retryCount: 0 on runHealthProbes — probes recur every 5 minutes, retry would create confusing duplicate results |
| runRetentionCleanup uses Promise.all() for parallel deletes — three tables are independent, no ordering constraint |
| runRetentionCleanup only deletes monitoring tables (service_health_checks, alert_events, document_processing_events) — agentic RAG tables out of scope per research Open Question 4 |
| RETENTION_DAYS = 30 is a constant, not configurable — matches INFR-03 spec exactly |
|
| Scheduled Cloud Functions: dynamic import() + explicit secrets array per function |
| Retention cleanup: Promise.all([model.deleteOlderThan(), ...]) pattern for parallel table cleanup |
|
|
1min |
2026-02-24 |