Skip to content

feat(LeadCapture): 0–100 intent scoring, compliance risk and structured lead fields - #3000

Merged
RockChinQ merged 1 commit into
masterfrom
feat/leadcapture-scoring
Nov 12, 2026
Merged

RockChinQ merged 1 commit into
masterfrom
feat/leadcapture-scoring

Conversation

@RockChinQ

Copy link
Copy Markdown
Member

Requested on LANG-327, based on the customer's lead-scoring rubric (A/B/C keyword tiers with points, urgency/decision-maker bonuses, deductions, compliance-risk words, thresholds ≥60 / 30–59 / <30, and the lead fields to capture). Decision from Chin Rock: medium intent is asked once too.

Changes (LeadCapture 0.3.0)

  • Scoring: the judge returns {score 0–100, signals[], risk, risk_reason, reason}. Levels come from the new config items high_score (default 60) and ask_score (default 30). Medium and high intent get the contact request once; low does not. A 0.1/0.2-style strong_intent answer still maps to a score. An answer without a score is recorded as an error and never breaks the reply.
  • Compliance risk (risk_prompt, default lists scalping, fake orders, cracking, scraping WeChat/banks, VPNs…): the lead becomes risk, with no contact request and no sales email. It is kept for review on the page.
  • Lead fields (lead_fields, default: the 12 fields from the rubric): extracted once from the whole conversation when contact details arrive. They appear at the top of the email (missing ones show as 未提及) and on the page. The subject now reads 【购买意向·高意向 75分】….
  • Page: score/level column, risk total and filter, a lead-fields table in the detail view, and per-judgment score/signals/risk.
  • The intent_prompt default now describes a scoring rubric; READMEs (en/zh) are updated.

Verification

  • plugins/misc/LeadCapture: 31 passed, 8 of them new:

    • tiers high/medium/low decide the single ask;
    • configurable thresholds;
    • risk never asks or emails;
    • email shows score, signals and extracted fields (unknown keys dropped, missing ones shown as 未提及);
    • an unparseable judgment is recorded as an error;
    • score clamping.
  • ruff check, check_catalog.py, test_repository.py OK.

  • Real model check: brightdata's claude-haiku-5-5 via LangBot Models, with the exact prompts the plugin builds and the customer's rubric.

    Sample Score Result
    high 100 7 signals
    trial-only 20 low, matches the rubric's +10 per B signal
    low (free/homework) 0
    ticket scalping 45 risk=true
    Traditional Chinese 100

    Field extraction filled 10 of 12 fields correctly and left the 2 unmentioned ones empty.

🤖 Generated with Claude Code

…ed lead fields

Driven by a customer's lead-scoring rubric (A/B/C keyword tiers, bonuses,
deductions, compliance-risk words, lead fields):

- the judge returns score/signals/risk/risk_reason/reason; levels come
  from configurable high_score (60) and ask_score (30), so medium and
  high intent are asked once; 0.1/0.2-style strong_intent answers still
  map to a score
- compliance risk (configurable risk_prompt) marks the lead "risk": no
  contact request, no sales email, listed for review
- once contact details arrive, configurable lead_fields are extracted
  from the whole conversation and shown at the top of the email (subject
  now carries level and score) and on the page
- Page: score/level column, risk total and filter, lead fields and
  per-judgment signals in the detail view
- bump to 0.3.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@RockChinQ
RockChinQ merged commit ea4c792 into master Nov 12, 2026
22 checks passed
@RockChinQ
RockChinQ deleted the feat/leadcapture-scoring branch November 12, 2026 07:15
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant