Integration pending 4h estimated Tier 12 Scenario Follow-up Prompts: Edge Function Infrastructure

Integration Purpose

Verify integration with dependent epics: epic-scenario-based-follow-up-prompts-scheduler-and-ui

This integration checkpoint ensures proper coordination and compatibility between different epics. It verifies that all interfaces, data flows, and dependencies are correctly implemented before proceeding.

Execution Context

Execution Tier
Tier 12

Tier 12 - 5 tasks

Can start after Tier 11 completes

Integration Task

Handles integration between different epics or system components. Requires coordination across multiple development streams.

Task Status
Statuspending
TypeIntegration
Estimated4h
Tier12
Parent Epic
Scenario Follow-up Prompts: Edge Function Infrastructure
Scenario-based Follow-up Prompts
Epic Risks (2)
medium impact low prob technical

Supabase Edge Functions on Deno can have cold-start latency of 500ms–2s. If the evaluation window contains many activities (e.g., post-holiday catch-up), the function may approach the 60-second invocation timeout before completing all evaluations.

Mitigation & Contingency

Mitigation: Implement pagination in the activity fetch query with a configurable page size; process pages sequentially and commit history records per page so partial runs are recoverable on the next invocation.

Contingency: If timeout remains an issue at scale, split the evaluation into per-chapter invocations triggered by a fan-out pattern using Supabase Realtime or a lightweight queue.

medium impact low prob dependency

Supabase cron triggers (pg_cron or Edge Function schedules) may miss invocations during platform maintenance windows, causing evaluation gaps that delay time-sensitive prompts beyond their intended delivery window.

Mitigation & Contingency

Mitigation: Configure the look-back window to be 2× the cron interval (e.g., 2-hour look-back for hourly cron) so a single missed invocation does not result in missed prompts; log each run's look-back range for auditability.

Contingency: If missed invocations are detected via monitoring alerts, implement a manual re-trigger endpoint accessible to admins that runs the evaluation for a specified time range.