feat(#1466 P3c): insurance-prompt autopilot (advisor-first fallback client-send)#1474
Conversation
…lient-send) Hourly recurring.insurance_prompt_autopilot: booked (active) trips still carrying pending insurance past the booking grace window nudge the advisor first, then — on a later sweep once the nudge grace elapses — auto-send the client insurance proposal via InsuranceAutomationService.queueProposalEmails VERBATIM. This is the ONLY net-new client send in the Automation Gate epic. Safety (client-send blast radius): - Zero new send code — queueProposalEmails + handleInsuranceProposalEmail invoked verbatim; inherits the #1048 cutover + audience:'client' guard. - MIGRATION_SILENT_MODE hard-stops the whole sweep up front (no nudge, no token mint, no send). - Idempotent: pending-only selection, excludes any traveler whose insurance:${tripId}:${travelerId} job already exists in automation_job_history; deterministic jobId + UNIQUE(queue,job_id) is the second fence. - Advisor nudge strictly precedes any send (separate cycle); the nudge notification (stable per-(advisor,trip) dedupe key) is the durable "nudged at T" marker read by stage 2. - Trigger = grace-since-booking only (status='active', lastStatusChangeAt); purchase_window_hours never read. - No migration (grace = env/code const). P3b evidence auto-populates on the resulting client_esign waiver. InsuranceAutomationService resolved lazily via ModuleRef (breaks the TripsModule <-> AutomationModule DI cycle), mirroring the ShoreEx pattern. Tests (foreground): pure selection/grouping/staging spec (11) + processor handler spec (7) covering advisor-first, stage-2 send, within-grace defer, idempotent no-op, MIGRATION_SILENT_MODE suppression, and audience:'client' tag on the inherited send path. refs #1466 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
#1466 P3c — Insurance-prompt autopilot (FINAL slice of the Automation Gate epic)
Hourly
recurring.insurance_prompt_autopilot: booked (status='active') trips still carrying pendingtrip_traveler_insurancepast the booking grace window nudge the advisor first, then — on a later sweep once the nudge grace elapses — auto-send the client insurance proposal viaInsuranceAutomationService.queueProposalEmailsverbatim.Safety (client-send blast radius) — all verified by Codex xhigh
queueProposalEmails+handleInsuranceProposalEmailinvoked verbatim; the actual email still goes throughemailService.sendEmail({ audience: 'client', automated: true, templateSlug: 'insurance-proposal' }).schedule()'s no-op.insurance:${tripId}:${travelerId}job inautomation_job_history; deterministic jobId +UNIQUE(queue,job_id)second fence. Leftover-pending-minor can't double-send (queueProposalEmailsonly builds recipients from adults-with-email).insurance-autopilot:${advisorId}:${tripId}dedupe key) is the durable "nudged at T" marker read by stage 2; a missing/failed marker only delays, never skips to send.status='active'solastStatusChangeAt== booking anchor; soft-deleted excluded);purchase_window_hoursnever read (display-only per Al).client_esignwaiver.InsuranceAutomationServiceis resolved lazily viaModuleRef(breaks the TripsModule ↔ AutomationModule DI cycle — the ShoreEx pattern). Nudge reuses theautomation_gatecategory with a distinct dedupe namespace (no collision with the P2 gate nudge).Tests (foreground)
insurance-autopilot.spec.ts(11) — pure selection/grouping/staging, grace parsing, dedupe key.client-care.processor.insurance-autopilot.spec.ts(7) — advisor-first, stage-2 send, within-grace defer, idempotent no-op, MIGRATION_SILENT_MODE suppression,audience:'client'tag on the inherited send path.src/automationfolder: 112/112 green.Review
Codex gpt-5.5 xhigh: APPROVE on
e8fe7f6f.refs #1466
🤖 Generated with Claude Code