system-prompts-and-models-o.../dealix/auto_client_acquisition/service_excellence/launch_package.py
Dealix Builder e106a9a0d2 feat(targeting+service+excellence): Saudi Targeting OS + Service Tower + Service Excellence — 38 modules + 62 endpoints + 105 tests
Targeting & Acquisition OS (16 modules) — نظام الاستهداف الذكي
- account_finder: account-first targeting; 12 buying signals; deterministic 10-25 accounts per (sector, city)
- buyer_role_mapper: 14 buyer roles + sector-specific buying-committee maps + role-based Arabic angles
- contact_source_policy: 12 sources (crm_customer→opt_out) with risk_score, channels-allowed, retention guidance, lawful_basis
- contactability_matrix: 5 action modes (suggest_only/draft_only/approval_required/approved_execute/blocked); opt-out always blocked
- linkedin_strategy: Lead Forms + Ads + manual ONLY; linkedin_do_not_do() locks scrape/auto-DM/auto-connect/extensions
- email_strategy: drafts + unsubscribe footer + domain-pacing (fresh/warmed/trusted/damaged) + spam-trigger risk
- whatsapp_strategy: opt-in only; rejects cold + risky phrases; opt-in template requires explicit purpose+company+unsubscribe
- social_strategy: official APIs only; listening + drafts; no auto-publish
- outreach_scheduler: day-by-day plans + daily limits + opt-out enforcement
- reputation_guard: bounce/complaint/opt-out thresholds → healthy/watch/pause + recovery actions per channel
- daily_autopilot: Arabic brief + 7 today actions + EOD report
- acquisition_scorecard: pipeline + meetings + risks + productivity_score
- self_growth_mode: 5 ICP focuses for Dealix; daily brief + monthly targets
- free_diagnostic: Free Growth Diagnostic (3 ops + msg + risk + plan) → paid pilot recommendation
- contract_drafts: Pilot/DPA/Referral/Agency/SOW outlines (legal_review_required, PDPL-aware)
- service_offers: 7 targeting-tier offers + recommend by customer-type

Service Tower (8 modules) — برج الخدمات الذاتية (12 productized services)
- service_catalog: 12 services with target_customer/outcome/inputs/workflow/deliverables/pricing/risk/proof/upgrade
- service_wizard: deterministic recommend (agency→partner; list→list_intelligence; founder→self_growth; CEO→exec_brief; budget≥2999→growth_os; default→first_10)
- mission_templates: workflow steps with approval gates + linked growth missions
- pricing_engine: SAR quotes scaled by company_size×urgency×channels_count + setup_fee + monthly_offer
- deliverables: client report outline + proof pack template + operator checklist (no live actions)
- service_scorecard: 0..100 score from drafts/replies/meetings/pipeline/CSAT
- whatsapp_ceo_control: daily brief, approval cards (≤3 buttons), risk alerts, EOD reports
- upgrade_paths: deterministic next-service recommendation + Arabic upsell messages

Service Excellence OS (8 modules) — مصنع الخدمات الممتازة
- feature_matrix: 12 must-have features per service + advanced/premium/future tiers
- service_scoring: 10-dimension excellence score (clarity, speed_to_value, automation, compliance, proof, upsell, uniqueness, scalability, ops_daily, proof_data) → launch_ready/beta_only/needs_work
- quality_review: 4 gates (proof / approval / pricing / channels) + status verdict; review_service_before_launch and review/all
- competitor_gap: 7 competitor categories (CRM, WhatsApp tools, email assistants, LinkedIn tools, agencies, revenue intelligence, generic AI) + Dealix advantages + do-not-copy
- proof_metrics: required metrics + ROI estimate (pipeline_x + closed_won_x) + Arabic summary
- research_lab: monthly brief + feature hypotheses + top-3 experiments + monthly review
- service_improvement_backlog: feedback→backlog conversion + impact/effort prioritization + weekly improvements
- launch_package: landing outline + sales script + 12-min demo script + 5-day onboarding checklist

Routers (3 new) — 62 endpoints
- /api/v1/targeting/* — 20 endpoints (accounts, buying-committee, contacts, uploaded-list, outreach, daily-autopilot, self-growth, reputation, linkedin, drafts, free-diagnostic, services, contracts)
- /api/v1/services/* — 20 endpoints (catalog, recommend, intake, start, workflow, deliverables, proof-pack, quote, setup-fee, monthly-offer, scorecard, upgrade-path, ceo daily-brief/approval-card/risk-alert/EOD)
- /api/v1/service-excellence/* — 22 endpoints (feature-matrix, score, quality-review, review/all, proof-metrics, roi-estimate, gap-analysis, research-brief, hypotheses, experiments, monthly-review, backlog, weekly-improvements, launch-package, landing/sales/demo/onboarding)

Tests (3 new files, 105 tests)
- test_targeting_os: 47 tests (Arabic accounts, buying committees, opt-out blocked, cold WA blocked, LinkedIn no-scraping, email unsubscribe, WA risk, outreach plan, reputation guard, self-growth, contracts, scorecard)
- test_service_tower: 38 tests (12+ services, all have pricing/proof/deliverables/approval, wizard recommendations, workflow includes approval, quote scales, CEO cards ≤3 buttons, no live send)
- test_service_excellence: 33 tests (feature matrix, score returns status, ALL services pass quality gates, ROI x-multiples, 7 competitor categories, hypotheses+experiments, backlog conversion, launch package complete, demo=12min)

Docs (3 new + 1 updated)
- TARGETING_ACQUISITION_OS.md (Arabic)
- SERVICE_TOWER_STRATEGY.md (Arabic)
- SERVICE_EXCELLENCE_OS.md (Arabic)
- DEALIX_100_PERCENT_LAUNCH_PLAN.md — added §36 Targeting OS + §37 Service Tower + §38 Service Excellence + §39 Landing Pages

Landing pages (4 new, RTL Arabic)
- services.html — 3 doors + 12 productized services
- free-diagnostic.html — free growth diagnostic
- first-10-opportunities.html — kill feature
- agency-partner.html — agency partner program

Test results
- 105/105 new tests pass
- Full suite: 768 passed, 2 skipped
- 0 existing tests broken

Safety + integration with previous layers
- Targeting OS uses contactability_matrix → ALL contacts gated before any send
- Service Tower's workflow includes approval gate; ALL services live_send_allowed=False
- Service Excellence quality_review BLOCKS launch on missing proof/approval/pricing/unsafe channels
- linkedin_do_not_do() encodes 8 explicit prohibitions (scraping/auto-DM/auto-connect/extensions)
- whatsapp_do_not_do() blocks cold sends + group scraping
- Contracts always: legal_review_required=True, not_legal_advice=True, PDPL sections present
- Self-Growth Mode lets Dealix target its OWN ICP using the same approval-first pipeline

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 17:11:00 +03:00

126 lines
5.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Launch package — لكل خدمة: landing page outline + sales script + demo + onboarding."""
from __future__ import annotations
from typing import Any
from auto_client_acquisition.service_tower import get_service
def build_landing_page_outline(service_id: str) -> dict[str, Any]:
"""Outline of a landing page for the service (Arabic, RTL)."""
s = get_service(service_id)
if s is None:
return {"error": f"unknown service: {service_id}"}
return {
"service_id": service_id,
"title_ar": s.name_ar,
"sections_ar": [
"Hero: العرض في جملة + CTA",
"وعد المنتج: ماذا سيحصل العميل عليه؟",
"كيف تعمل الخدمة (3 خطوات)",
"Deliverables — قائمة بالمخرجات",
"Pricing — السعر بوضوح",
"Proof — ما الذي نقيسه",
"Safety — لا live send، Approval-first",
"Trust — للوكالات / B2B سعودي",
"FAQ",
"CTA النهائي",
],
"cta_ar": "ابدأ الآن" if s.pricing_max_sar > 0 else "احجز التشخيص المجاني",
"must_include_ar": [
"Approval-first.",
"لا cold WhatsApp.",
"PDPL-aware.",
"لا وعود بنتائج مضمونة.",
],
}
def build_sales_script(service_id: str) -> dict[str, Any]:
"""Sales script (Arabic) — discovery → pitch → close."""
s = get_service(service_id)
if s is None:
return {"error": f"unknown service: {service_id}"}
return {
"service_id": service_id,
"discovery_questions_ar": [
"وش أكبر تحدي نمو لديكم اليوم؟",
"كيف تستهدفون اليوم؟ ما الذي يعمل؟",
"ما الذي يأخذ وقتاً يومياً ولا يثبت قيمة؟",
"هل عندكم قائمة عملاء قدامى لم تتم متابعتهم؟",
"من يوافق على الرسائل قبل الإرسال؟",
],
"pitch_ar": (
f"بناءً على ما شاركته، {s.name_ar} مناسبة لكم. "
f"خلال {('7 أيام' if s.pricing_model == 'sprint' else 'الشهر الأول')}، "
f"سنطلع لكم: {', '.join(s.deliverables_ar)}."
),
"objection_handling_ar": {
"price": "نقدم Free Diagnostic أولاً — تشوفون النتائج قبل الدفع.",
"timing": "Pilot 7 أيام لا يحتاج التزام طويل — جرّبوه ثم قرروا.",
"trust": "Approval-first: لا نرسل أي شيء بدون موافقتكم.",
"complexity": "نتولى الإعداد كاملاً في 3 أيام عمل.",
},
"close_ar": (
"إذا الفكرة منطقية، أحدد لكم Pilot يبدأ يوم الأحد. "
"أرسل لي تأكيد + اسم منسّق Approvals."
),
}
def build_demo_script(service_id: str) -> dict[str, Any]:
"""12-minute Arabic demo script."""
s = get_service(service_id)
if s is None:
return {"error": f"unknown service: {service_id}"}
return {
"service_id": service_id,
"duration_minutes": 12,
"minute_by_minute_ar": [
"02: الفكرة الكبرى — Dealix ليس CRM ولا أداة واتساب.",
f"24: عرض {s.name_ar} — Daily Brief / Command Feed.",
"46: مثال حي — 10 فرص في 10 دقائق.",
"68: Trust Score + Simulator + Proof Pack.",
"810: الأمان والتكاملات (security + connectors).",
"1012: العرض والـ CTA.",
],
"do_not_do_ar": [
"لا تكشف API keys على الشاشة.",
"لا تشغّل live WhatsApp في الـdemo.",
"لا تعد بأرقام لم تُحقَّق.",
],
}
def build_onboarding_checklist(service_id: str) -> dict[str, Any]:
"""Onboarding checklist for the customer (first 5 days)."""
s = get_service(service_id)
if s is None:
return {"error": f"unknown service: {service_id}"}
return {
"service_id": service_id,
"service_name_ar": s.name_ar,
"first_5_days_ar": [
"يوم 1: kick-off + جمع الـ intake + توقيع DPA draft.",
"يوم 2: ربط القنوات الآمنة (Gmail drafts / Sheets / website forms).",
"يوم 3: توليد أول Proof Pack template + تدريب على Approval Center.",
"يوم 4: إطلاق أول mission (10 فرص في 10 دقائق).",
"يوم 5: مراجعة النتائج + تخطيط الأسبوع الثاني.",
],
"approval_required": True,
"live_send_allowed": False,
}
def build_service_launch_package(service_id: str) -> dict[str, Any]:
"""Full launch package = landing + sales + demo + onboarding."""
return {
"service_id": service_id,
"landing": build_landing_page_outline(service_id),
"sales_script": build_sales_script(service_id),
"demo_script": build_demo_script(service_id),
"onboarding": build_onboarding_checklist(service_id),
"approval_required": True,
}