Outbound Communication Engine
ShippedAutomated multi-step customer outreach triggered by storm events (or any system event). Provider-agnostic (Twilio SMS, Resend email, Go High Level). Multi-step sequences (e.g., SMS day 0, email day 3, SMS day 7). TCPA compliance with SMS opt-in/opt-out (STOP keyword). Reply detection auto-stops sequences. Cron processes queue every 5 min. 5 new DB tables, 8 API routes, GHL OAuth integration, outreach dashboard UI.
Show details
Automated multi-step customer outreach triggered by storm events (or any system event). Provider-agnostic (Twilio SMS, Resend email, Go High Level). Multi-step sequences (e.g., SMS day 0, email day 3, SMS day 7). TCPA compliance with SMS opt-in/opt-out (STOP keyword). Reply detection auto-stops sequences. Cron processes queue every 5 min. 5 new DB tables, 8 API routes, GHL OAuth integration, outreach dashboard UI.
**Meta:** Roadmap `E36` · Owner Guillermo · Timeline Now · Priority P0
## Features (14/17)
- [X] Outreach engine — enrollment + queue processor (cron every 5min)
- [X] Provider abstraction (Twilio, Resend, Go High Level)
- [X] Go High Level integration (OAuth, Conversations API, webhooks)
- [X] Multi-step outreach sequences (SMS + email, configurable delays)
- [X] Storm ingest → outreach enrollment hook (critical/high risk)
- [X] TCPA compliance module (opt-in/opt-out, rate limiting, contact gaps)
- [X] SMS opt-out webhook (Twilio STOP keyword → auto-cancel enrollments)
- [X] AI message generation (Gemini storm_alert templates with fallbacks)
- [X] Reply detection (stop sequence if customer replies)
- [X] Outreach dashboard UI (stats, sequences, enrollments, send history)
- [X] API routes — sequences CRUD, enrollments, sends, provider config, stats
- [X] Communication logs + omnichannel inbox bridge for all sends
- [ ] Seed default storm outreach sequence for teams
- [ ] Sequence editor UI (create/edit steps from dashboard)
- [X] GHL connect/disconnect settings page
- [X] Outreach analytics page (sequence performance, bulk-send history, winrate KPIs)
- [ ] Generalized event triggers (lead_created, proposal_sent, appointment_missed)
## Open questions
* What GHL location ID and OAuth credentials to use for production?
* Beyond storms, what events should trigger automated outreach first?
> **Note:** 12/16 features done. Core engine fully functional. Outreach sequences triggered automatically from storm ingest cron. Remaining: seed data, sequence editor UI, GHL settings page, event trigger expansion.
---
> **2026-07-10 full code audit:** shipped scope verified in the codebase and marked Done. Remaining gaps (template editor UI, sequence-builder UI, non-storm triggers) moved to SUN-120 Follow-ups & Polish. Note: bulk send IS shipped (storm/outreach/bulk-send).
---
> **2026-07-10 full code audit:** shipped scope verified in the codebase and marked Done. Remaining gaps (template editor UI, sequence-builder UI, non-storm triggers) moved to SUN-120 Follow-ups & Polish. Note: bulk send IS shipped (storm/outreach/bulk-send).
Invoicing & Billing
ShippedInvoice CRUD with line items, Stripe webhook for payment processing, invoice list/detail/create pages. Migration applied with invoices + payments + invoicelineitems tables. Stripe integration active. Remaining: AI tools for auto-generation, AR aging, and payment reminders.
Show details
Invoice CRUD with line items, Stripe webhook for payment processing, invoice list/detail/create pages. Migration applied with invoices + payments + invoice_line_items tables. Stripe integration active. Remaining: AI tools for auto-generation, AR aging, and payment reminders.
**Meta:** Roadmap `E14` · Owner Guillermo · Timeline Now · Priority P0
## Features (9/13)
- [X] invoices table (line items, tax, status, due date)
- [X] invoice_line_items table
- [X] payments table (Stripe integration)
- [X] Invoice CRUD API (GET/POST list, GET/PATCH/DELETE detail)
- [X] Stripe webhook (payment_intent.succeeded, checkout.session.completed)
- [X] Invoice list page with filtering and stats
- [X] Invoice detail page (view/edit)
- [X] New invoice creation page
- [X] Zod validation schemas for invoices
- [X] createInvoice AI tool (pre-existed; audit corrected)
- [X] sendPaymentLink AI tool (Stripe Checkout) — PR #247
- [X] getARSummary AI tool (aging buckets) — PR #247
- [X] sendPaymentReminder AI tool (external-comms double-lock + TCPA) — PR #247
## Open questions
* Do we need milestone-based billing (e.g., 50% at install, 50% at PTO)?
* Tax calculation — manual or integrate with a tax API?
> **Note:** 9/13 features done. Core invoicing infrastructure shipped — tables, API, Stripe webhook, and full UI. Remaining items are AI automation tools.
---
## 2026-07-10 full code audit — corrections
* **createInvoice AI tool EXISTS** (lib/ai/tools/finance-writes.ts, router+safety wired) — the checklist above is stale. updateInvoice / getInvoices / getCommissions AI tools also live, plus the invoice-prompter (Doug) agent.
* **Stripe is receive-only scaffolding:** getStripe() is only used for webhook signature verification; zero outbound Stripe calls — nothing creates PaymentIntents/Checkout sessions; stripe_invoice_id / stripe_hosted_invoice_url never populated. "Collect a payment" is not yet possible.
* Webhook handles payment_intent.succeeded + invoice.payment_succeeded/failed but **NOT checkout.session.completed**; no DELETE endpoint on invoices.
* 2 bugs filed under SUN-120: Record Payment 405 route mismatch; webhook payment status 'completed' vs trigger 'succeeded'.
**Real remaining scope:** outbound Stripe (payment links / checkout), sendPaymentLink + getARSummary + sendPaymentReminder AI tools, the 2 bug fixes, DELETE endpoint.
> **2026-07-11 SHIPPED — epic complete (PRs #246 + #247):** Record-Payment route + webhook single-count fix (#246); Stripe Checkout payment links, checkout.session.completed handling, draft-only DELETE, and the 3 AI tools (#247). NOTE: outbound Stripe requires STRIPE_SECRET_KEY / NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY / STRIPE_WEBHOOK_SECRET set in Vercel prod — endpoints fail honestly (503 STRIPE_NOT_CONFIGURED) until then. Open questions (milestone-based billing, tax API) remain product decisions.
AI Dispatch
ShippedCrew dispatch shipped as a field-dispatch system: drag-and-drop dispatch board, auto-dispatch recommendations, the dispatch_recommender Buddy agent, and AI chat tools. (Original spec called for conversation-only dispatch; the shipped architecture pairs AI recommendations with a board.) Remaining: mobile accept/decline, route optimization, crew GPS.
Show details
Crew dispatch shipped as a field-dispatch system: drag-and-drop dispatch board, auto-dispatch recommendations, the dispatch_recommender Buddy agent, and AI chat tools. (Original spec called for conversation-only dispatch; the shipped architecture pairs AI recommendations with a board.) Remaining: mobile accept/decline, route optimization, crew GPS.
**Meta:** Roadmap `E13` · Owner Guillermo · Timeline Now · Priority P0
## Features (8/11)
- [X] field_dispatches / field_dispatch_buckets / field_dispatch_events / dispatch_phase_rules tables
- [X] Drag-and-drop dispatch board at /dashboard/[teamId]/schedule (reorder, complete/cancel)
- [X] "Ready to Schedule" recommendations panel
- [X] Greedy auto-dispatch engine (haversine + crew service radius)
- [X] dispatch_recommender Buddy agent
- [X] scheduleDispatch + getTodaysDispatches AI tools + dispatch API
- [X] Slack daily dispatch digest
- [X] Field-app read-only today's-dispatches tab with turn-by-turn Directions
- [ ] Mobile accept/decline workflow + push-to-crew
- [ ] Multi-stop route optimization (Google Routes API)
- [ ] Real-time crew GPS on map
## Open questions
* How far in advance should AI dispatch — day-of or week ahead?
* What is the override flow when a crew calls in sick?
> **Note:** SUN-DSP — feature list re-baselined 2026-06 to the shipped field-dispatch architecture (the original crew_availability / dispatch_log spec was superseded). Remaining: mobile accept/decline workflow, multi-stop route optimization, real-time crew GPS.
---
> **2026-07-10 full code audit:** shipped scope verified in the codebase and marked Done. Drive-time estimates item is DONE (PR #207: Google Distance Matrix in lib/scheduling/travel-time.ts, consumed by greedy dispatcher + ops map). Multi-stop sequencing exists (nearest-neighbor route-order.ts + apply-route-order). Remaining gaps (mobile accept/decline + push, VRP/Routes API optimization, live GPS streaming — last-known-24h already on ops map) moved to SUN-120. Unlisted shipped extras: material-readiness scan + badge, dispatch_phase_rules API, atomic reorder RPC, event audit log, public shareable schedule, unscheduled queue, v1 mobile API.
AI Workflow Engine
ShippedAI-enforced workflow rules — no visual rule builder. Workflow rules table defines phase sequences, blockers, and auto-created follow-on tasks. AI blocks out-of-sequence changes and explains why in natural language. Replaces Coperniq's drag-and-drop workflow builder with zero UI.
Show details
AI-enforced workflow rules — no visual rule builder. Workflow rules table defines phase sequences, blockers, and auto-created follow-on tasks. AI blocks out-of-sequence changes and explains why in natural language. Replaces Coperniq's drag-and-drop workflow builder with zero UI.
**Meta:** Roadmap `E12` · Owner Guillermo · Timeline Now · Priority P0
## Features (5/8)
- [X] workflow_rules table (phase conditions & actions)
- [X] task_dependencies table (finish-to-start, etc.)
- [X] checkWorkflowBlockers AI tool
- [X] getBlockedItems AI tool (all blocked tasks with reasons)
- [X] Workflow rules API (GET list / POST create rule)
- [ ] resolveBlocker AI tool
- [ ] Blocked indicator on task cards
- [ ] Project template rule definitions (JSON)
## Open questions
* What are the most critical workflow sequences to enforce first?
* Should rules be editable by team admins or developer-only?
> **Note:** SUN-WFE — now In Progress. Live: workflow_rules + task_dependencies tables, workflow rules API (GET/POST), and the checkWorkflowBlockers + getBlockedItems AI tools (router-wired). Remaining: resolveBlocker tool, workflow-driven blocked indicator on task cards, and project-template rule seeding. Note: 0 rules in prod yet, so nothing is enforced until rules are authored.
---
## 2026-07-10 full code audit — reframe
The engine is **advisory-only** today: workflow_rules + CRUD API + checkWorkflowBlockers/getBlockedItems chat tools all verified, BUT **no write path enforces anything** — task/project status writes (AI tools and REST PATCH routes) never consult the rules, canProceed is never acted on, blocked_reason is never auto-populated, and task_dependencies is a dead table (zero readers/writers outside generated types). The epic's core promise ("AI blocks out-of-sequence changes") is unimplemented.
**Real remaining scope (supersedes checklist):**
- [X] Enforcement hook: consult workflow_rules in task/project status write paths (AI write tools + REST PATCH), block or warn per action_type — SHIPPED PR #243 (lib/workflow/enforcement.ts; 409 WORKFLOW_BLOCKED; fail-open)
- [X] Wire task_dependencies (finish-to-start) into the same check — SHIPPED PR #243 (table is now live)
- [X] Auto-populate blocked_reason / blocked_by_rule_id / blocked_at on block, cleared on next allowed change — SHIPPED PR #243. Task-card badge still open (below)
- [ ] Blocked badge on task cards (reads blocked_reason)
- [ ] resolveBlocker AI tool
- [ ] Template-seeded rule definitions (nothing populates rules today — they only exist if manually POSTed)
---
> **2026-07-10 SHIPPED — epic complete (PRs #243 + #244):** enforcement live in task/project write paths (409 WORKFLOW_BLOCKED, blocked_* persisted/cleared), task_dependencies finish-to-start live, blocked badge on task cards, resolveBlocker AI write tool, template-seeded warn-tier rules for standard_install/standard_dnr on both instantiation paths. Remaining nice-to-have: block-tier seeded rules once evaluator gains to-status scoping (warn chosen to avoid deadlocking new projects).
Customer Import
ShippedImport ~1,500 existing customers from the ops spreadsheet. Validate, deduplicate, geocode addresses for map view. Includes platform auto-detection (Salesforce, HubSpot, GoHighLevel, JobNimbus).
Show details
Import ~1,500 existing customers from the ops spreadsheet. Validate, deduplicate, geocode addresses for map view. Includes platform auto-detection (Salesforce, HubSpot, GoHighLevel, JobNimbus).
**Meta:** Roadmap `E3` · Owner Guillermo · Timeline Completed · Priority P0
## Features (7/7)
- [X] CSV/spreadsheet import tool with drag-drop
- [X] Data validation & 3-tier duplicate detection
- [X] Batch import with progress (4-step wizard, 100-row batches)
- [X] Address geocoding (Google Places API, batch 50)
- [X] Column auto-mapping with fuzzy header matching
- [X] Platform-specific field mappings
- [X] Import history with pagination
Team Knowledge Library & AI Context Engine
ShippedCentralized per-team document library: teams upload arbitrary documents (PDF, Word, Excel, images, …) into one knowledge area; content is extracted, chunked, and embedded per tenant; the AI assistant retrieves from it when answering — a per-tenant context engine.
Show details
Centralized per-team document library: teams upload arbitrary documents (PDF, Word, Excel, images, …) into one knowledge area; content is extracted, chunked, and embedded per tenant; the AI assistant retrieves from it when answering — a per-tenant context engine.
**Meta:** Roadmap · Owner Guillermo · Timeline Next · Priority P1
## Already built (2026-07-10 audit — ~70–80% of the plumbing)
* Team-scoped document_chunks table (team_id, embedding vector(768), extracted_facts) with per-tenant isolation in the retrieval RPC
* Extraction→chunking→embedding cron (ai-doc-extract-and-embed: Gemini vision extract, contextual chunking, 768-dim embeddings)
* searchKnowledgeBase chat tool (lib/knowledge/search.ts → search_document_chunks RPC, unions team chunks + global AHJ/utility sources), wired across lookup/deep-context/general/analysis/communication router modes + Slack assistant
* Per-project Knowledge tab with Reference Documents + chunk counts
## Features (the missing 20–30%)
- [X] Team-wide document library data model — decouple chunks from project_documents/permit_documents (CHECK constraint today forces every chunk onto a project/permit); standalone team uploads
- [X] Library UI — upload, browse, search, manage documents at team level (not per-project)
- [X] Office format extraction (.docx/.xlsx via mammoth/exceljs; .pptx/.doc still skipped) — .docx/.xlsx/.pptx currently skipped as binary_format; only PDF/image/plain-text ingested
- [X] Hybrid retrieval on documents (RRF ordering, cosine score contract preserved) — search_document_chunks is vector-cosine only; extend the tsvector+RRF hybrid (search_all_v2) that CRM entities already have
- [X] Context injection policy — SHIPPED PR #243: auto-inject top-3 chunks ≥0.45 score per chat turn into the system prompt (lib/ai/auto-context.ts; ≤4k chars, 1500ms budget, fail-open, AI_AUTO_CONTEXT=false opt-out); searchKnowledgeBase stays as the deep-pull path
- [ ] Ingest sources beyond uploads — inbox attachments, project docs (already flow), field photos' extracted text
## Open questions
* Storage quota / doc-count limits per team?
* Retention + re-embed strategy when a doc is replaced?
> **2026-07-11 SHIPPED (PR #245):** team_documents DDL applied to prod AlloyDB (Cloud Run psql; verified via PostgREST), library CRUD API + Library tab on /ai/knowledge, extraction cron ingests team docs + .docx/.xlsx, search_document_chunks v4 hybrid (explicit 9-arg DROP to avoid overload ambiguity). Remaining tail: .pptx/.doc extraction, ingest-beyond-uploads, quotas/retention policy, library re-process action.
Relational Workspace
ShippedAirtable/Metabase-style relational workspace over SunrAI data: pick a record type, pull in related records and roll-ups with one click, save and share views. Governed semantic registry + query engine. Experience overhaul shipped live (default joined view, always-on relationships rail, views management, starter recommendations).
Show details
Airtable/Metabase-style relational workspace over SunrAI data: pick a record type, pull in related records and roll-ups with one click, save and share views. Governed semantic registry + query engine. Experience overhaul shipped live (default joined view, always-on relationships rail, views management, starter recommendations).
**Meta:** Roadmap `E40` · Owner Guillermo · Timeline Completed · Priority P1
## Features (11/11)
- [X] Semantic registry + relational query engine (3-hop joins, measures, cursor paging)
- [X] Default Projects+Customers joined view that auto-runs (no blank canvas)
- [X] Always-on relationships rail (plain language, one-click add)
- [X] Saved + team-shared views + management page
- [X] Starter-view recommendations
- [X] Grouped + board lenses, inline edits, drilldown
- [X] Excel replacement: self-serve custom fields + spreadsheet feel (resize, enum dropdowns, CSV, auto-run)
- [X] Workbooks (Excel-style tabs) of saved views + view forks + save-dedup
- [X] Conversational view drafting (natural-language → view + diff chips) + chat bridge
- [X] Per-user private fields (data-isolated) + formula columns (margin / days-between)
- [X] XLSX workbook export
> **Note:** SHIPPED LIVE. Base overhaul PR #97 (relationships rail, default joined view, saved-views page), 2026-06-08. Excel-replacement build (PRs #144–#153, 2026-06): self-serve custom fields, spreadsheet feel (resize / enum dropdowns / CSV / auto-run), workbooks (tabs) + view forks + dedup, conversational view drafting + diff chips, per-user private fields, formula columns, XLSX export. Remaining: row-insert from the grid (deferred pending a SoCap creation-boundary decision — docs/plans/workspace-row-insert-future.md); re-enabling workspace e2e in CI (E41).
Roofing Quote & BOM Tool
ShippedQuick roofing quote generator (most solar contractors also roof — high value; currently a manual spreadsheet). Squares × base rate with adders, plus an auto-generated bill of materials from roof measurements. Modeled on the team's "Roofing BOM Quoting tool" spreadsheet (Roof Quote tab). Attaches to a pre-sales opportunity (depends on E38).
Show details
Quick roofing quote generator (most solar contractors also roof — high value; currently a manual spreadsheet). Squares × base rate with adders, plus an auto-generated bill of materials from roof measurements. Modeled on the team's "Roofing BOM Quoting tool" spreadsheet (Roof Quote tab). Attaches to a pre-sales opportunity (depends on E38).
**Meta:** Roadmap `E39` · Owner Guillermo · Timeline Completed · Priority P1
## Features (11/11)
- [X] Refusal logic — only accept projects over $5k
- [X] Base = squares × $550/sq
- [X] Roof type multiplier on the running total — Hip ×1.20 OR Gable ×1.15 (one or the other)
- [X] Adders: 2-story +$50/sq · steep (7–9/12) +$50/sq · very steep (10/12+) +$100/sq
- [X] Layers: 2 layers +$100/sq · 3 layers +$200/sq
- [X] Flashing +$15/linear foot (roof intersections)
- [X] Dump/haul flat $650; travel $2/mile over 50mi from Davenport, IA
- [X] Decking replacement $80/sheet — noted, excluded from quote
- [X] Auto BOM (shingles, ridge cap/vent, starter, ice & water, felt, drip edge, apron, boots, vents) from measurements
- [X] Quote builder UI + save + recent quotes (/roofing)
- [X] Branded estimate PDF export (PR #116)
> **Note:** v1 SHIPPED (PR #104, PDF export PR #116): /dashboard/[teamId]/roofing — live quote (base $550/sq, verified to the cent against the spreadsheet’s $12,362.50 example), optional measurements → bill of materials, save + recent quotes, roofing_quotes table, branded PDF export. Standalone; attach-to-customer/lead moved to E41 follow-ups; solar quick-quote sibling in FUTURE_ITEMS.
SunrAI Native Sales Support (leads / opportunities)
ShippedAdd pre-sales support natively in SunrAI: first-class opportunity/lead entities distinct from customer/project, so quoting (incl. roofing) has somewhere to live. DECISION: add sales support in SunrAI but AVOID proposals for now (invoices, yes). SoCap is NOT sunset — proposals/contracts/financing stay there; SunrAI handles leads → invoicing.
Show details
Add pre-sales support natively in SunrAI: first-class opportunity/lead entities distinct from customer/project, so quoting (incl. roofing) has somewhere to live. DECISION: add sales support in SunrAI but AVOID proposals for now (invoices, yes). SoCap is NOT sunset — proposals/contracts/financing stay there; SunrAI handles leads → invoicing.
**Meta:** Roadmap `E38` · Owner Guillermo · Timeline Now · Priority P1
## Features (8/12)
- [X] opportunity / lead entities, distinct from customer / project (8-table b2_leads schema live)
- [X] Leads DataGrid + CRUD + transition state machine + Excel import (dedup) + SoCap intake
- [X] TCPA/DNC/consent tables + team_kpi_targets
- [X] Kanban pipeline board — leads grouped by stage, drag to advance (status-machine enforced)
- [X] Rep assignment — Claim / My Leads / Only-my-leads (assignment had no UI before)
- [X] Lead → customer → project conversion (Convert action + endpoint; links roofing quotes)
- [X] Leads in primary nav + Add-Lead / Excel-import dialogs
- [ ] Click-to-call dialer (lead_call_attempts) + rep KPI / throughput dashboard
- [X] sales_manager / sales_agent roles live on the portal
- [ ] Invoicing in SunrAI (see E14) *(in progress)*
- [ ] Guardrails against opportunity ↔ customer/project data confusion
- [ ] Proposals — deliberately NOT in SunrAI (stays in SoCap)
## Open questions
* Do leads/opportunities need their own page, or fold into the workspace (E40)?
* Which invoice flows matter first (deposit, milestone, final)?
> **Note:** In Progress — the pre-sales foundation was fully built but had ZERO adoption (0 leads in any team). Activation pass (2026-06-14): a Kanban pipeline board (drag to advance, enforced by the shared lib/leads/status machine), real rep assignment (Claim / My Leads — assignment previously had no UI, so every lead was permanently "unclaimed"), a fixed silent inline-edit bug (optimistic writes hit ['leads',teamId] while the grid cached ['leads',teamId,undefined]), and a seeded demo pipeline on the QA Sandbox. Already-live before this: 8-table b2_leads schema, leads DataGrid (inline edit, saved views), CRUD + transition state machine, Excel import with address-hash dedup, SoCap inbound intake, lead→customer→project Convert (links roofing quotes), Leads in primary nav. Gaps before done: click-to-call dialer over lead_call_attempts, rep KPI dashboard, data-confusion guardrails, invoicing (E14). Proposals stay in SoCap; SoCap not sunset.
---
> **2026-07-10 full code audit:** shipped scope verified in the codebase and marked Done. Remaining gaps moved: click-to-call dialer → SUN-122 (Twilio Voice; lead_call_attempts table already provisioned), rep KPI dashboard + SoCap intake wiring → SUN-120. TCPA/DNC/consent + team_kpi_targets tables exist but are dormant (no consuming code).
Labor Time Tracking
ShippedTrack crew labor hours per project/task for job costing and payroll. Log time dialog, labor time API, and dashboard page built. Feeds into E15 (AI Job Costing) for profitability analysis.
Show details
Track crew labor hours per project/task for job costing and payroll. Log time dialog, labor time API, and dashboard page built. Feeds into E15 (AI Job Costing) for profitability analysis.
**Meta:** Roadmap `E34` · Owner Guillermo · Timeline Now · Priority P1
## Features (5/7)
- [X] Labor time API (GET/POST with team_id scoping)
- [X] Labor time dashboard page (list, filters, stats)
- [X] Log time dialog (project/task selector, hours, notes)
- [X] TanStack Query hook (use-labor-time.ts)
- [X] Clock-in / clock-out with GPS location
- [ ] Weekly timesheet view
- [ ] Payroll export (CSV/QuickBooks)
> **Note:** 5/7 features done. Core time logging shipped. Remaining: GPS clock-in, timesheets, payroll export. Foundational for E15 (Job Costing).
---
> **2026-07-10 full code audit:** shipped scope verified in the codebase and marked Done. Remaining gaps (weekly timesheet, payroll export) moved to SUN-120. Shipped scope is richer than listed: mileage/odometer/gas capture with auto gas-expense, background GPS on mobile, crew_location mirroring, v1 mobile API with idempotency.
---
> **2026-07-10 full code audit:** shipped scope verified in the codebase and marked Done. Remaining gaps (weekly timesheet, payroll export) moved to SUN-120. Shipped scope is richer than listed: mileage/odometer/gas capture with auto gas-expense, background GPS on mobile, crew_location mirroring, v1 mobile API with idempotency.
AI Knowledge Graph & Semantic Search
ShippedVector embeddings (pgvector + Gemini Embedding 2), universal semantic search, and context graph functions powering the AI chat agent. Single-query deep context retrieval for projects, customers, pipeline analytics, crew scheduling, and phase bottleneck detection.
Show details
Vector embeddings (pgvector + Gemini Embedding 2), universal semantic search, and context graph functions powering the AI chat agent. Single-query deep context retrieval for projects, customers, pipeline analytics, crew scheduling, and phase bottleneck detection.
**Meta:** Roadmap `E27` · Owner Guillermo · Timeline Completed · Priority P1
## Features (12/12)
- [X] pgvector embeddings — Gemini Embedding 2 (768-dim), HNSW cosine indexes
- [X] Universal semantic search across projects, customers, tasks, phases
- [X] Automated embedding sync cron (hourly, 500/batch, all teams)
- [X] Embedding auto-nulling triggers on content change
- [X] Multimodal embeddings (photo + voice transcript)
- [X] get_project_graph() — deep context: phases, tasks, customer, permits, crews, proposals
- [X] get_customer_graph() — projects, proposals, communications, storm exposure, referrals
- [X] get_pipeline_graph() — sales stages, weighted values, deals at risk, win/loss
- [X] get_crew_schedule_graph() — crew tasks, assignments, hours aggregation
- [X] get_phase_bottleneck_graph() — phases ranked by avg duration, stuck projects
- [X] AI chat tool integration (Vercel AI SDK tool calling)
- [X] Backfill script (3 parallel workers, 500-record batches)
> **Note:** All 12 features complete. This emerged organically from AI platform work and represents a major infrastructure investment for AI-first product intelligence.
Multi-Channel Inbox
ShippedUnified inbox showing all customer communications (email, SMS, Slack, WhatsApp, voice notes, AI chat) in one chronological thread per customer. GoHighLevel's killer feature. Full inbox UI built with channel sidebar, threading, compose, AI draft, realtime broadcast, auto-resolve cron, and WhatsApp webhook.
Show details
Unified inbox showing all customer communications (email, SMS, Slack, WhatsApp, voice notes, AI chat) in one chronological thread per customer. GoHighLevel's killer feature. Full inbox UI built with channel sidebar, threading, compose, AI draft, realtime broadcast, auto-resolve cron, and WhatsApp webhook.
**Meta:** Roadmap `E30` · Owner Guillermo · Timeline Completed · Priority P1
## Features (16/16)
- [X] Unified communication timeline per customer (all channels)
- [X] Reply from inbox (email, SMS) without switching tools
- [X] Unread/unreplied indicator + unread count API
- [X] Team inbox view (all customers, filterable by assignee)
- [X] AI-suggested reply drafts (Gemini)
- [X] Channel sidebar (email, SMS, Slack, WhatsApp filtering)
- [X] Email threading (In-Reply-To, References, subject grouping)
- [X] Compose dialog (multi-channel send)
- [X] Realtime broadcast (Supabase realtime for live updates)
- [X] Auto-resolve cron (stale conversations)
- [X] WhatsApp webhook integration
- [X] Inbox Zod validation schemas
- [X] Intel sidebar + AI project-summary panel (per-conversation context)
- [X] Click-to-call (outbound voice via GoHighLevel)
- [X] Internal team DM / team-tab compose
- [X] Gmail thread dedup + GHL inbound webhook → inbox bridge
> **Note:** All 16 features done (@mentions moved to E41 follow-ups). Full inbox UI shipped with realtime support, WhatsApp integration, click-to-call, and the GHL inbound bridge.
AI Pipeline Intelligence
ShippedSales pipeline intelligence native in SunrAI (reversed from an earlier SoCap deferral — "sales in SunrAI, not SoCap"). Pipeline + sales-funnel analytics pages, getpipelinegraph(), daily snapshots, stale-deal detection, and AI chat tools all live.
Show details
Sales pipeline intelligence native in SunrAI (reversed from an earlier SoCap deferral — "sales in SunrAI, not SoCap"). Pipeline + sales-funnel analytics pages, get_pipeline_graph(), daily snapshots, stale-deal detection, and AI chat tools all live.
**Meta:** Roadmap `E16` · Owner Guillermo · Timeline Completed · Priority P1
## Features (6/6)
- [X] sales_stages table (probability, color, order)
- [X] pipeline_snapshots table (daily trending)
- [X] get_pipeline_graph() — shared infrastructure, stays in SunrAI
- [X] Pipeline + sales-funnel analytics pages (aging, expected installs, at-risk, conversion)
- [X] Stale/aging deal detection + conversion metrics (mv_sales_metrics_daily)
- [X] advancePipelineStage + getPipelineSummary AI chat tools
## Open questions
* What are the current sales stages and at what point is a deal "stale"?
> **Note:** All 6 features done. Live: get_pipeline_graph(), sales_stages, pipeline_snapshots; advancePipelineStage + getPipelineSummary AI chat tools; pipeline analytics page (aging / expected installs / at-risk); sales-funnel analytics backed by mv_sales_metrics_daily. Appointment→project conversion wiring moved to E41 follow-ups.
CompanyCam Data Pipeline
ShippedPull inspection photos and checklists from CompanyCam to seed the AI training dataset. API client, sync pipeline, GCS integration, webhook endpoint all built. 1,051 photos from 37 projects synced. (GCS photo migration tracked in E1.)
Show details
Pull inspection photos and checklists from CompanyCam to seed the AI training dataset. API client, sync pipeline, GCS integration, webhook endpoint all built. 1,051 photos from 37 projects synced. (GCS photo migration tracked in E1.)
**Meta:** Roadmap `E11` · Owner Guillermo · Timeline Completed · Priority P1
## Features (10/10)
- [X] CompanyCam API client (auth, pagination, projects, photos, tags)
- [X] Photo export pipeline (download to GCS sunrai-photos bucket)
- [X] Sync pipeline (tags → templates, projects → match, photos → GCS)
- [X] Integration settings API (GET/POST/DELETE)
- [X] Webhook endpoint (real-time photo/project sync)
- [X] 1,051 photos synced from 37 CompanyCam projects
- [X] Sync execution & GCS verification
- [X] Background sync worker (incremental sync via API route)
- [X] Sync progress UI (live tracking, job polling, phase indicators)
- [X] Photo preview & browse UI (settings projects list + native field app)
## Open questions
* How many total photos in CompanyCam? What storage/bandwidth for bulk export?
* Are photos organized by project or by date in CompanyCam?
> **Note:** All 10 features done (Jimmy photo-walkthrough meeting moved to E41 follow-ups).
SoCap Integration
ShippedIntegration between SoCap and SunrAI. Shared auth, customer sync, Slack notifications, milestone broadcasting. All 7 features done.
Show details
Integration between SoCap and SunrAI. Shared auth, customer sync, Slack notifications, milestone broadcasting. All 7 features done.
**Meta:** Roadmap `E7` · Owner Guillermo · Timeline Completed · Priority P1
## Features (7/7)
- [X] Shared auth SSO (Stack Auth project dcf44038)
- [X] Customer data sync (bidirectional upsert)
- [X] Slack integration (notifications, commands, daily summaries)
- [X] Address import API
- [X] Team provisioning from SoCap org
- [X] Member sync with role mapping
- [X] Milestone broadcasting to SoCap
> **Note:** Loan calculator range display in proposals (SoCap-side) moved to E41 follow-ups.
Loan Calculator
Shipped4.99% origination, APR 5–12%, terms 10/15/20/30yr. Show payment ranges in SoCap proposals.
Show details
4.99% origination, APR 5–12%, terms 10/15/20/30yr. Show payment ranges in SoCap proposals.
**Meta:** Roadmap `E5` · Owner Noah · Timeline Completed · Priority P1
## Features (3/3)
- [X] Google Sheets calculator
- [X] SoCap integration (payment ranges)
- [X] Customer-facing quote tool
Project Map View
ShippedInteractive map of all projects with status-colored markers, search, filtering, and detail popups. Built on Google Maps + [deck.gl](<http://deck.gl>) ScatterplotLayer. Includes batch geocoding for un-geocoded projects. View switcher on projects page (List / Map / Analytics / Timeline).
Show details
Interactive map of all projects with status-colored markers, search, filtering, and detail popups. Built on Google Maps + [deck.gl](<http://deck.gl>) ScatterplotLayer. Includes batch geocoding for un-geocoded projects. View switcher on projects page (List / Map / Analytics / Timeline).
**Meta:** Roadmap `E4` · Owner Guillermo · Timeline Completed · Priority P1
## Features (10/10)
- [X] Interactive map with [deck.gl](<http://deck.gl>) ScatterplotLayer
- [X] Status color coding (5 categories: active, pending, completed, on-hold, cancelled)
- [X] Search by project name, customer, or address
- [X] Status filter dropdown + color legend
- [X] Hover popup with project details
- [X] Selected project detail card with navigation
- [X] Auto-zoom to fit all projects
- [X] "Geocode X more" button for un-geocoded projects
- [X] View switcher (List / Map / Analytics / Timeline)
- [X] Batch geocoding API with Google Places + caching
> **Note:** All 10 features done (route optimization moved to E41 follow-ups). Completed Mar 18. Full interactive map with geocoding, filtering, and search.
Storm Intelligence & AI Hail Pipeline
ShippedSevere weather tracking with AI-powered hail detection using free MRMS MESH radar data. Phases 0-4 complete. Damage probability, AI narratives, agent workflows, predictive SPC outlooks, web push, predictive storm cron, automated outreach, and (April 2026) per-team subscription-aware Slack digest with self-serve config all shipped. CSV export includes full customer + storm data. 5mi matching radius.
Show details
Severe weather tracking with AI-powered hail detection using free MRMS MESH radar data. Phases 0-4 complete. Damage probability, AI narratives, agent workflows, predictive SPC outlooks, web push, predictive storm cron, automated outreach, and (April 2026) per-team subscription-aware Slack digest with self-serve config all shipped. CSV export includes full customer + storm data. 5mi matching radius.
**Meta:** Roadmap `E2` · Owner Guillermo · Timeline Completed · Priority P1
## Features (25/25)
- [X] NWS/SPC/IEM/FEMA real-time ingest + cron (8 sources)
- [X] Map overlay with [deck.gl](<http://deck.gl>) heatmap
- [X] Customer impact correlation (Haversine 5mi radius)
- [X] Follow-up queue & workflow
- [X] Service area management
- [X] Extract maxHailSize from NWS alerts (Phase 1)
- [X] Wire SWDI nx3hail into ingest pipeline (Phase 1)
- [X] NCEI historical hail lookup by address (Phase 1)
- [X] MRMS MESH hail detection via IEM (Phase 2)
- [X] MRMS VTEC storm-based warnings (Phase 2)
- [X] AI storm narrative generation (Phase 3)
- [X] Damage probability model — TORRO scale (Phase 3)
- [X] Autonomous agent triggers — auto tasks + notifications (Phase 3)
- [X] Slack notification bridge for storm alerts
- [X] Predictive alerting — SPC Day 1-3 outlooks (Phase 3)
- [X] Web push notifications for affected projects
- [X] CSV export with customer info + storm event details
- [X] 17 Midwest/Central US states coverage
- [X] Automated storm outreach engine (Phase 4 — see E35)
- [X] Daily Slack storm digest cron + per-team channel routing
- [X] Subscription-aware filter (team_storm_subscriptions ∩ service_areas)
- [X] Per-team severity threshold config (extreme / severe / moderate / minor)
- [X] On-demand "Send test digest now" button + endpoint
- [X] Self-serve "Request expanded coverage" flow (DMs platform admins)
- [X] Slack settings card with subscription badge + service-area mismatch warning
## Open questions
* How do we validate MRMS MESH accuracy vs ground truth?
> **Note:** All 24 features done (AWS GRIB2 processing — deferred — moved to E41 follow-ups). Canopy Weather DOA: pull-only API, $999-1999/yr. Our pipeline: $5-45/mo free MRMS MESH data. CSV export: 32K+ rows for IL+IA with customer name, phone, email, address, distance, risk level. April 2026: Slack digest hardened with subscription entitlement filter — paying-state-only enforcement.
Installation Partners
ShippedManage subcontractor and installation partner relationships. Partner list and detail pages built. Track certifications, service areas, and assignment history.
Show details
Manage subcontractor and installation partner relationships. Partner list and detail pages built. Track certifications, service areas, and assignment history.
**Meta:** Roadmap `E35` · Owner Guillermo · Timeline Now · Priority P2
## Features (3/6)
- [X] Partners list page (filterable, searchable)
- [X] Partner detail page (contact info, certifications, notes)
- [X] partners table (already exists in DB)
- [ ] Partner assignment to projects
- [ ] Partner performance tracking (on-time, quality)
- [ ] Partner portal (limited access view)
> **Note:** 3/6 features done. UI shipped, needs project assignment integration and performance tracking.
---
> **2026-07-10 full code audit:** shipped scope verified in the codebase and marked Done. Remaining gaps (assignment UI, auto performance metrics, portal) + duplicate partners/installation_partners consolidation moved to SUN-120. projects.partner_id already exists and is AI-writable + consumed by $/W analytics.
Crew Scheduling & Routing
ShippedField worker scheduling, job dispatch, route optimization. Crew management and calendar views functional. AI scheduling handles task assignment. Missing: mobile dispatch, route optimization, GPS tracking.
Show details
Field worker scheduling, job dispatch, route optimization. Crew management and calendar views functional. AI scheduling handles task assignment. Missing: mobile dispatch, route optimization, GPS tracking.
**Meta:** Roadmap `E10` · Owner Guillermo · Timeline Next · Priority P2
## Features (5/9)
- [X] Crew CRUD (create, add/remove members, duplicate, role assignment)
- [X] CalendarView (Month/Week/Day) with external calendar sync
- [X] get_crew_schedule_graph() — crew tasks, assignments, hours aggregation
- [X] AI-powered task scheduling (via E9.6 — auto/SLA/phase modes)
- [X] Operations dashboard with team workload view
- [ ] Mobile dispatch with push + acceptance workflow
- [ ] Route optimization (multi-stop days, Google Routes API)
- [ ] Real-time crew location on map (GPS)
- [ ] Drive time estimates between jobs
## Open questions
* How many crews operate daily and in what geography?
* Do crews use company vehicles or personal (affects GPS tracking)?
> **Note:** Major progress: a full dispatch scheduling board shipped at /dashboard/[teamId]/schedule (drag-drop crew/date assignment, reorder, complete/cancel, recommendations panel) backed by a greedy auto-dispatch engine (haversine + crew service-radius), the dispatch_recommender Buddy agent, and a Slack daily digest. The field app has a read-only today's-dispatches tab with turn-by-turn Directions, plus push-token registration infra. Remaining (the original mobile/routing scope): crew accept/decline workflow + push-to-crew, multi-stop route optimization (Google Routes API), real-time crew GPS on a map, and job-to-job drive-time estimates.
---
> **2026-07-10 full code audit:** shipped scope verified in the codebase and marked Done. Superseded/absorbed by the shipped dispatch system (SUN-92): board with Day/Week/Month views, crew CRUD, Google Calendar sync, get_crew_schedule_graph(), workload view all verified. Drive-time item DONE via PR #207. Remaining mobile/GPS/route-optimization gaps tracked once in SUN-120 (shared with SUN-92).
AI Platform
ShippedAI-powered features across the platform. All 9 core features shipped including smart scheduling with Gemini 2.5 Flash.
Show details
AI-powered features across the platform. All 9 core features shipped including smart scheduling with Gemini 2.5 Flash.
**Meta:** Roadmap `E9` · Owner Guillermo · Timeline Completed · Priority P2
## Features (13/13)
- [X] AI chat with multi-turn memory (20-msg context)
- [X] AI security prompt (injection prevention, 52-test suite)
- [X] Customer communication AI (email/SMS generation)
- [X] AI-powered project risk scoring (deterministic + Gemini)
- [X] Voice note transcription (Gemini)
- [X] SMS inbound AI (Twilio webhook)
- [X] Generative UI components (email drafts, project cards, task lists)
- [X] Proposal AI generation improvements
- [X] Smart scheduling — Gemini 2.5 Flash, 3 modes (auto/SLA/phase), confidence scores
- [X] Citations in AI responses (source attribution)
- [X] Gemini re-ranking for search result quality
- [X] Web push notifications (service worker + subscription API)
- [X] AI metrics dashboard (accuracy, usage, model performance)
> **Note:** All 13 features complete. Extended beyond original 9 with citations, re-ranking, push notifications, and AI metrics dashboard.
Project Management
ShippedFull project management module with status workflows, task assignment (individual + crew + role-based), templates, timeline views, document management, Kanban board, and operations dashboard. 52 project components built.
Show details
Full project management module with status workflows, task assignment (individual + crew + role-based), templates, timeline views, document management, Kanban board, and operations dashboard. 52 project components built.
**Meta:** Roadmap `E8` · Owner Guillermo · Timeline Completed · Priority P2
## Features (11/11)
- [X] Project status workflow (8 statuses: planning → completed + on_hold, cancelled)
- [X] Task assignment — individual (assignee_id), crew (assignee_crew_id), role-based (role_key)
- [X] Kanban board by phase/status with bulk actions
- [X] Task filters (assignee, status, priority, role_key)
- [X] Project templates (save-as-template, apply-template, template library)
- [X] Timeline views (ProjectTimeline, UnifiedTimeline, CalendarView Month/Week/Day)
- [X] Document management (upload, preview, GCS project-documents bucket)
- [X] Operations dashboard (KPIs, task stats, upcoming installs, team workload)
- [X] Staffing analysis API (missing role assignments)
- [X] Task dependencies tracking
- [X] Phase sequencing with order_index
> **Note:** All 11 features done (drag-drop Gantt moved to E41 follow-ups). Operations dashboard with real-time KPIs is a standout feature.
Recently Shipped
ShippedContinuous improvements — the smaller fixes, polish, and reliability work we ship between major roadmap milestones. Updated automatically as we release.
Show details
Continuous improvements — the smaller fixes, polish, and reliability work we ship between major roadmap milestones. Updated automatically as we release.
**Meta:** Roadmap · Continuous · Auto-updated from merged PRs
## Recently Shipped
- [X] Milestone filter on list + board; fix map dropping 2 stages (#275)
- [X] Boundary-aware chunking for the KB corpus (chunking miss class) (#267)
- [X] OR-semantics lexical leg (v7) + reranker sees the full 50-row pool (#265)
- [X] Prod log audit — resolver outage fallback, dead-air persistence, judge grounding (#255)
- [X] Knowledge retrieval wave (staging #250–#254) → production (#258)
- [X] AI testing hardening wave 3: action intent forced under Gemini's grammar budget, visualization intent, full agent-fleet coverage (#263)
- [X] AI testing hardening wave 2: blast-radius crons covered, four real defects fixed (#262)
- [X] AI testing hardening wave 1: generated-UI contracts, eval-gate integrity, dead chat tools restored (#260)
- [X] Systemic mobile responsiveness pass — chat escape, dvh sizing, touch targets, zero overflow (#249)
- [X] Wave 4 — Stripe payment collection, click-to-call, comms tail, partners consolidation, library quota (#247)
- [X] Team Knowledge Library — team-wide docs, Office extraction, hybrid retrieval (#245)
- [X] Polish batch — invoicing fixes, timesheet/payroll, partners, outreach editors, rep KPIs, SoCap intake (#246)
- [X] Twilio-first outreach SMS, real WhatsApp outbound, workflow engine completion (#244)
- [X] Unified GHL comms, workflow rule enforcement, AI auto-context injection (#243)
- [X] Member offboarding — deactivate / reactivate / remove (#228)
- [X] Global search now finds full words and matches by name, email, phone & address (#226, #227, #231)
- [X] Fixed project document downloads for external + stored files (#238)
- [X] AI chat reliability + rendering fixes; nightly answer-quality checks (#215, #217, #218, #237)
- [X] Storm → Affected Customers: last 24h / 48h windows + card/table view toggle (#230)
- [X] Ambient "Ask SunrAI" corner chat — expandable, with history (#214)
- [X] Reorganized the left nav into workflow sections; hover labels on top-bar icons (#209, #212)
- [X] Projects list: instant inline edit, full addresses, saved column widths (#219)
- [X] Import a WhatsApp conversation into a project timeline (#196, #203)
- [X] Ops map: real Google drive-times, route drawing, push suggested job order to the schedule (#200, #204, #207)
- [X] Web clock-in/out, per-person time report, and a gas-expense approval flow (#186, #191, #192, #193)
- [X] Roofing quotes: list + detail pages and add-on line items (#206, #208, #211)
- [X] Field (mobile) app: offline-first reliability, security cleanup, refreshed UI (#181, #185)
- [X] In-app feedback button with screenshot attachments routed to the team tracker (#190, #205)