feat: Scout — batch territory qualification pipeline#6
Conversation
Three-tier funnel: header scan (no LLM), quick Gemini qualification, and full Lighthouse analysis for top prospects. Includes HTML sanitisation for LLM safety, SSE streaming API, and Scout UI. 57 unit tests covering sanitise, tier1, tier2, and pipeline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The preview model was deprecated. Also adds /api/scout/discover endpoint that uses Gemini to find prospect URLs from a vertical + geography query (e.g. "UK e-commerce companies"). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Search bar lets users type a query like "UK e-commerce companies" instead of manually pasting URLs. Hits the discover endpoint and populates the URL textarea with results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (21)
📝 WalkthroughWalkthroughIntroduces a complete three-tier territory qualification pipeline ("Scout") comprising Tier 1 framework detection, Tier 2 Gemini-based deal scoring, and optional Tier 3 deep analysis. Adds API endpoints for discovery and scanning, React UI components for input/progress/results display, HTML sanitization utilities for LLM processing, and extensive test coverage. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API as POST /api/scout
participant Tier1 as Tier 1 Scan
participant Cortex as Cortex DB
participant Tier2 as Tier 2 Qualify
participant Gemini as Gemini LLM
participant PageSpeed as PageSpeed API
participant Tier3 as Tier 3 Fetch/Analyze
Client->>API: POST { urls, tier3_limit, ... }
API->>API: Normalize & deduplicate URLs
API->>Cortex: Query previously analyzed prospects
API->>Tier1: scanTier1Batch(urls)
Tier1->>Tier1: Fetch & detect frameworks
Tier1->>API: Emit tier1 events
API->>Tier2: qualifyTier2(tier1 results)
Tier2->>Tier2: Sanitize HTML
Tier2->>Gemini: generateObject(sanitized_html)
Gemini->>Tier2: {framework, deal_score, promote_to_tier3}
Tier2->>API: Emit tier2 events
API->>Cortex: Store qualified prospects (score≥50)
alt Tier 3 Enabled & Candidates
API->>Tier3: Fetch pages for promotion candidates
Tier3->>PageSpeed: Fetch performance metrics
Tier3->>Gemini: Tech stack & value analysis
Tier3->>Cortex: Store Tier 3 results
Tier3->>API: Emit tier3 events
end
API->>Cortex: Store scan summary
API->>Client: Emit complete event (SSE)
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary
Test plan
npm run test— 57 new tests should pass/scout, search "UK e-commerce companies", verify URLs populate🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Documentation