Skip to content

feat: prototype lead-scoring module (ICP gate + intent + routing)#7

Open
bdevierno1 wants to merge 1 commit into
mainfrom
add-lead-scoring-module
Open

feat: prototype lead-scoring module (ICP gate + intent + routing)#7
bdevierno1 wants to merge 1 commit into
mainfrom
add-lead-scoring-module

Conversation

@bdevierno1

Copy link
Copy Markdown
Owner

What

Adds backend/app/services/lead_scorer.py — a self-contained lead-scoring module encoding the Vecna ICP Scoring Rubric and Fit × Intent model.

Three public entry points:

Function Responsibility
score_fit(profile) ICP gate — applies all positive/negative signals, classifies A/B/C tier
score_intent(signals, now) Intent scoring — per-signal decay windows, dedup, active vs expired
evaluate_lead(profile, signals, now) Combined: ICP gate → intent → routing matrix → ScoringResult

ICP positive signals encoded (firmographic + technographic):

  • Employee count 200–5,000 (+25)
  • FinTech/SaaS/e-commerce/regulated-data industry (+20)
  • Revenue $20M–$1B (+15)
  • Cloud-native + platform/SRE team (+15)
  • US/EU region (+10)
  • No existing agent/automation platform (+15)

ICP negative signals encoded:

  • <50 employees or pre-seed (−30)
  • Free/student/personal domain (−40)
  • Unsupported regulated industry (−25)
  • Competitor employee or tire-kicker (−20)
  • No budget authority in buying group (−20)

Intent signals with per-signal decay windows (7–30 days):
pricing page visit, demo booked/attended, docs deep-read, competitor comparison, free-trial signup, repeat multi-contact, email open, unsubscribe (permanent).

Routing matrix (all 6 cells):

  • A + High → ae_same_day
  • A + Low → nurture_content
  • B + High → ae_qualify_hard
  • B + Low → nurture_rescore
  • C + High → self_serve
  • C + Low → suppress

Why

Operationalises the ICP Scoring Rubric and Lead-Scoring Model as testable, deterministic Python — executable by API callers, background jobs, or the Vecna agent runtime.

How to verify

cd backend
python -m pytest tests/test_lead_scorer.py -v   # 64 tests, all pass
python -m pytest tests/ --ignore=tests/test_api.py -q  # 177 total, all pass

tests/test_api.py fails to import fastapi in the local dev environment — this is a pre-existing issue unrelated to this PR (confirmed on main before this branch).

Out of scope

  • API endpoint wiring (route /api/leads/score) — deferred to follow-up
  • Persistence layer (no DB model yet)
  • Front-end UI

Rollback

Delete the two files; no migrations, no schema changes, no API surface changes.


🤖 Generated with Vecna

Co-Authored-By: Vecna noreply@vecna.ai

…trix)

Encodes ICP Scoring Rubric and Lead-Scoring Model (Fit x Intent):

- ICP gate: 6 positive attributes (+10 to +25) + 5 negative signals (-20 to -40)
- Intent signals: 8 behavioral events with point values and decay windows
- Routing matrix: all 6 Fit x Intent combinations with owner and SLA
- Feature flag: LEAD_SCORING_ENABLED=1 (default off) + LEAD_SCORING_KILL_SWITCH
- Endpoints: GET /status, GET /rubric, POST /score (503 when disabled)
- 19 tests covering score math, band boundaries, routing, flag behavior

Co-Authored-By: Vecna <noreply@vecna.ai>
@bdevierno1 bdevierno1 force-pushed the add-lead-scoring-module branch from 4c8802b to ddfb04f Compare June 19, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant