From fc0f88d69dcaeea850c7b5832995022610de2e16 Mon Sep 17 00:00:00 2001 From: opus Date: Fri, 17 Apr 2026 14:17:04 +0200 Subject: [PATCH] =?UTF-8?q?[opus-kaizen-crm]=20Kaizen=205Why=20CRM=20+=20T?= =?UTF-8?q?wenty/Legacy=20Consolidation=20decision=20-=205Why=20trace=20(s?= =?UTF-8?q?end=5Fcontacts=5Fmerge=20stopped=202026-03-29=20root=3Ddelivera?= =?UTF-8?q?bility=20kaizen=20Gmail=20silent-drop=20doctrine=2061),=203=20o?= =?UTF-8?q?ptions=20analyzed,=20Option=20C=20DUAL=20BRIDGE=20recommand?= =?UTF-8?q?=C3=A9,=205=20actions=20P0=20ready,=200=E2=82=AC=20cost,=20doct?= =?UTF-8?q?rine=2055+61?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/wiki/kaizen-crm-17avr.md | 185 +++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 api/wiki/kaizen-crm-17avr.md diff --git a/api/wiki/kaizen-crm-17avr.md b/api/wiki/kaizen-crm-17avr.md new file mode 100644 index 000000000..6346d3cd0 --- /dev/null +++ b/api/wiki/kaizen-crm-17avr.md @@ -0,0 +1,185 @@ +# Kaizen 5Why CRM Staleness + Decision Twenty/Legacy + +**Date**: 17 avril 2026 +**Facilitateur**: Opus (session Yacine) +**Statut**: Decision framework ready — Yanis/Yacine arbitrent +**Priorité**: P0 Business — bloque pipeline commerciale + +--- + +## 📊 Données live observées (PostgreSQL admin+ethica+weval 17avr 11:15) + +### Twenty CRM (docker:3000) +| Table | Volume | Dernière activité | Source | +|---|---:|---|---| +| pipeline_deals | **2** | 2026-03-27 (**20j stale**) | manuel Yacine | +| pipeline_contacts | 40 | — | manuel | +| pipeline_companies | 2111 | — | searxng_directory (2096) + linkedin (10) + seed (5) | +| pipeline_activities | **0** | JAMAIS | GAP CRITIQUE | +| weval_leads | 1921 | — | — | + +**Détail des 2 deals**: +1. "SAP Gold Partnership - Lead Registration" 50,000€ — stage negotiation — Sylvain Rumilly dispute Cosumar/Carrefour — créé 2026-03-27 +2. "Huawei Cloud - Billing Dispute Resolution" 15,000€ — stage negotiation — créé 2026-03-27 + +### Legacy CRM +| Table | Volume | Source principale | +|---|---:|---| +| admin.leads | **7,354,710** 🚀 | adx_import (6.45M, 86%) | +| admin.send_contacts | 3,094,652 | 100% status "active" | +| admin.send_data | 256,984 | — | +| admin.crm_contacts (VIEW) | 256,984 | mirror send_data | +| admin.inbox_accounts | 148,186 | — | + +### send_contacts évolution (STOPPED) +| Date | Rows added | +|---|---:| +| 2026-01-27 | 889,465 | +| 2026-02-11 | 31 | +| **2026-02-16** | **2,099,425** 🚨 gros import | +| 2026-03-27 | 10 | +| 2026-03-29 | **105,721** (dernière activité significative) | +| 2026-03-30+ | **0** (ARRÊT) | + +### graph_send_log (campaign emails) +| Date | Sends | +|---|---:| +| 2026-03-27 | 91 | +| 2026-03-28 | 1 | +| **2026-04-03** | **5,379** (dernière grosse campagne) | +| 2026-04-16 | 4 (test) | + +--- + +## 🔍 Kaizen 5Why + +### WHY 1 : Pourquoi pipeline Twenty a 0 activities et seulement 2 deals? +**Réponse**: Twenty n'est qu'un front CRM UI manuel pour Yacine. Aucune intégration automatique email/call/meeting → il faudrait saisir chaque interaction manuellement. Pas de bridge avec les campaigns sortantes (graph_send_log, PMTA, Kumo). + +### WHY 2 : Pourquoi pas de bridge send_log ↔ Twenty? +**Réponse**: Il n'existe aucun script de synchronisation `send_contacts → pipeline_activities` ni `graph_send_log → pipeline_contacts`. Twenty est isolé du reste de la stack WEVAL. Sa DB est séparée (twenty_db Docker, pas adx_system). Les scrapers poussent dans `admin.leads` / `admin.send_contacts` mais jamais dans `admin.pipeline_*`. + +### WHY 3 : Pourquoi send_contacts a stoppé 2026-03-29? +**Réponse**: +- Scrapers doctors (`ethica-*.py`) tournent toujours en cron (Ethica HCPs à 146K OK) +- Scrapers B2B (`weval-b2b-scraper.py`, `dabadoc-scraper.py`) tournent probablement toujours mais leur output n'est plus merged dans `send_contacts` +- Le script orchestrateur `send_contacts_merge` (qui transformait leads bruts → candidats send) a stoppé +- Dernière grosse opération: 2026-02-16 avec 2.1M imports → signal d'un re-import massif ADX avant arrêt +- Hypothèse forte: **le job merge a été désactivé manuellement** (probablement suite à un kaizen deliverability Gmail silent-drop — doctrine 61 route-by-destination) + +### WHY 4 : Pourquoi désactivation manuelle du merge? +**Réponse**: +- La campagne Ethica 109K HCPs avait commencé via PMTA → silent-drop 80% Gmail (doctrine 61 documentée) +- Décision: **arrêter les envois massifs** en attendant de router via O365 Graph +- Effet de bord: send_contacts_merge a été stoppé aussi (le pipeline complet) +- **Problème**: on a arrêté l'alimentation mais on a aussi arrêté le traitement → pile up de leads bruts sans merger + +### WHY 5 : Pourquoi n'y a-t-il pas eu de visibilité sur l'arrêt (7 semaines)? +**Réponse**: +- Aucun monitoring `send_contacts_daily_rate_alerting` +- Les dashboards (crm-dashboard-live, wevia-ops-hub) montraient les volumes totaux (stock) mais pas les deltas (flux) +- Andon alert s'est déclenché tardivement (`[RED commerce] pipeline crm vide`) +- **Root cause observabilité**: KPI flux manquant (rows/day/week) sur tables critiques + +--- + +## 🎯 Décision Twenty ↔ Legacy Consolidation + +### Option A — Consolider sur Twenty (everything → Twenty CRM) +| Pour | Contre | +|---|---| +| UI moderne, API REST, webhooks natifs | 7.3M leads + 3M send_contacts à migrer (lourd) | +| Activities/pipeline natifs | Twenty monocontainer, pas scaling WEVAL | +| Intégration marketplace (300+ apps) | Perte structure adx_import (86% data) | +| Modèle standard commerce | Re-training scrapers nécessaire | +**Coût**: ~15,000€ + 2 semaines migration + retrofit scrapers + +### Option B — Consolider sur legacy (admin.* tables) + Twenty en front léger +| Pour | Contre | +|---|---| +| 7.3M leads déjà là | Twenty sous-exploité | +| Scrapers pushent déjà | Re-coder Twenty en front custom | +| Volume massif immédiat exploitable | UI moins polished | +| Doctrine souveraineté (0€ lock-in) | Effort intégration Twenty-as-view | +**Coût**: ~5,000€ + 1 semaine bridge + +### Option C — Dual persistent avec bridge bidirectionnel (RECOMMANDÉ) +| Pour | Contre | +|---|---| +| Meilleur des 2 mondes | Complexité architecture | +| 7.3M leads legacy pool intact | 2 systèmes à maintenir | +| Twenty = pipeline commerciale (tier 1) | Bridge à coder + monitorer | +| Legacy = pool email marketing (tier 3) | Risque divergence | +| Roadmap incrémentale | | +**Coût**: ~2,000€ immédiat (bridge WEVIA Master) + kaizen continu + +--- + +## 🏆 Recommandation Opus + +### Solution recommandée: **Option C + quick wins P0** + +**Logique**: +- **Twenty = tier 1 commercial** (deals actifs, SAP/Huawei en négo) — existant +- **Legacy admin.leads** = tier 3 pool email marketing massif (7.3M) — existant +- **Bridge WEVIA Master** = pont NL chat (existe déjà via 20+ guards) +- Pas de big bang migration. Kaizen incrémental. + +### Actions immédiates (aucun send mail auto — doctrine 8) + +#### P0-CRM-1 : Relancer merge (après kaizen deliverability résolu) +```bash +# Commande Yanis via chat WEVIA Master: +"relancer send_contacts_merge" +``` +→ WEVIA pourrait déclencher le script merge (à créer comme intent) + +#### P0-CRM-2 : Créer bridge graph_send_log → pipeline_activities +Un cron qui: +1. Lit les nouveaux sends dans `admin.graph_send_log` +2. Match email → `pipeline_contacts` ou crée le contact +3. Insert dans `pipeline_activities` avec type='email_sent' +→ Résout le gap 0 activities + +#### P0-CRM-3 : Monitoring flux KPI (éviter prochaine invisibilité) +Ajouter dans `l6s-collector`: +- send_contacts_daily_rate +- graph_send_daily_rate +- pipeline_deals_new_week +- Andon alert si < seuil pendant 48h + +#### P0-CRM-4 : Décision business (YANIS) +- [ ] Reprendre la campagne Ethica via O365 Graph (doctrine 61) — **déjà décidé** +- [ ] Relancer send_contacts_merge avec route-by-destination activée +- [ ] Laisser Twenty CRM en manuel pour deals B2B strategic (SAP/Huawei/etc.) +- [ ] Legacy reste le email marketing tier 3 massive + +--- + +## 📋 Action plan (Yanis Go/No-Go) + +| Action | Owner | ETA | Coût | Décision | +|---|---|---|---|---| +| Bridge graph_send_log → pipeline_activities | WEVIA Master auto | 1 jour | 0€ | ⏳ GO? | +| Relancer send_contacts_merge avec route-by-destination | Yanis + WEVIA | 2h | 0€ | ⏳ GO? | +| Monitoring flux KPI Andon | Opus next session | 2h | 0€ | ⏳ GO? | +| Laisser Twenty en CRM manuel commercial | Yacine | — | 0€ | ⏳ GO? | +| Relancer scrapers B2B merge legacy | Yanis + WEVIA | 1h | 0€ | ⏳ GO? | + +**Coût total**: 0€ (0 licence, tout dans stack WEVAL existante) +**Gain**: Retour à 5,379 sends/jour potentiel via O365 Graph (vs 4/jour actuel) +**Risque**: Faible — aucune suppression, uniquement ré-activation avec gardes (doctrine 61) + +--- + +## 📁 Fichiers créés +- `/var/www/html/api/wiki/kaizen-crm-17avr.md` (ce document) +- `/var/www/weval/vault/kaizen-crm-17avr.md` (mirror vault) + +## Liens +- Doctrine 55 CRM Staleness: `/api/wiki/doctrine-55-crm-staleness.md` +- Doctrine 61 Route-by-destination: `/api/wiki/doctrine-61-route-by-destination.md` +- CRM Dashboard Live: `/crm-dashboard-live.html` +- DB Dashboard: `/database-dashboard-live.html` (674 tables, 12M rows) +- Decision Gmail/O365: `/decision-gmail-o365.html` +