Context
Passport #121 adds expiry notifications via webhook. This issue specifically covers the advance warning — emitting a passport.expiring_soon event 7 days before the expiry date so the agent has time to renew.
What to implement
Cron job: daily expiry scan
A scheduled job (same pattern as the existing health check cron) that runs daily and:
- Scans all active passports
- For each passport where
expiresAt is within the next 7 days
- Emits a
passport.expiring_soon webhook event (if not already emitted for this passport in the current 7-day window — dedupe by passport ID + week)
Webhook payload
{
"event": "passport.expiring_soon",
"passportId": "psp_abc",
"agentId": "bot-1",
"expiresAt": "2026-07-03T00:00:00Z",
"daysRemaining": 6
}
Route: GET /api/cron/expiry-warnings (cron-compatible)
Returns { checked, warned, skipped } for monitoring.
Acceptance criteria
🎁 Evidencia visual = reward extra
- Si tu PR incluye video demo o capturas de pantalla mostrando la funcionalidad pedida funcionando end-to-end, va a ser considerado para rewards de GrantFox en esta issue. No es obligatorio, pero suma mucho para la evaluación.
Context
Passport #121 adds expiry notifications via webhook. This issue specifically covers the advance warning — emitting a
passport.expiring_soonevent 7 days before the expiry date so the agent has time to renew.What to implement
Cron job: daily expiry scan
A scheduled job (same pattern as the existing health check cron) that runs daily and:
expiresAtis within the next 7 dayspassport.expiring_soonwebhook event (if not already emitted for this passport in the current 7-day window — dedupe by passport ID + week)Webhook payload
{ "event": "passport.expiring_soon", "passportId": "psp_abc", "agentId": "bot-1", "expiresAt": "2026-07-03T00:00:00Z", "daysRemaining": 6 }Route: GET /api/cron/expiry-warnings (cron-compatible)
Returns
{ checked, warned, skipped }for monitoring.Acceptance criteria
passport.expiring_sooneventpassport.expiredinstead)🎁 Evidencia visual = reward extra