Files
weval-consulting/api/wevia-live-context.php

265 lines
29 KiB
PHP

<?php
// WEVIA Live Context v2 — FULL CONSULTING EXPERTISE
// PUBLIC SAFE — marketing only, NO internal secrets
function wevia_get_live_context($msg) {
$ctx = "";
// ═══ CORE CONSULTING ═══
if (preg_match('/erp|sap|s4hana|fiori|abap|btp|hana|vistex/i', $msg)) {
$ctx .= "[ERP/SAP: SAP Gold Partner. S/4HANA implementation+migration. Fiori UX. ABAP dev. SAP BTP. Vistex. Modules FI/CO MM SD PP QM PM HR. Rise with SAP. Clean Core. Secteurs pharma+industrie.]\n";
}
if (preg_match('/supply.chain|logistique|approvisionnement|stock|warehouse|wms|transport|fleet/i', $msg)) {
$ctx .= "[SUPPLY CHAIN: Optimisation chaine logistique. WMS. TMS. Demand planning. S&OP. Inventory optimization. Last mile. Traçabilite. SAP SCM/EWM. IoT fleet management.]\n";
}
if (preg_match('/audit.*si|systeme.*info|schema.*directeur|urbanisation|cartographie|togaf|itil/i', $msg)) {
$ctx .= "[AUDIT SI: Schema directeur SI. Urbanisation. TOGAF. Cartographie applicative. Audit infrastructure. ITIL. COBIT. Gouvernance IT. Rationalisation. TCO. ROI.]\n";
}
if (preg_match('/test|qa|qualit.*logiciel|automat.*test|selenium|playwright|cypress|regression|junit/i', $msg)) {
$ctx .= "[TESTING/QA: Strategie de test. Automatisation (Selenium, Playwright, Cypress). CI/CD testing. Performance (JMeter, k6). Securite (OWASP, pentest). TDD/BDD. Non-regression. UAT.]\n";
}
if (preg_match('/email.*market|delivrabilit|newsletter|smtp|warm.up|inbox|spam|dkim|dmarc|spf/i', $msg)) {
$ctx .= "[EMAIL MARKETING: Strategie email. Delivrabilite (DKIM, DMARC, SPF). Warm-up IP. Segmentation. A/B testing. Automation workflows. Analytics. Anti-spam compliance. RGPD opt-in.]\n";
}
if (preg_match('/ads|publicite|google.ads|facebook.ads|display|programmatique|rtb|cpm|cpc|roas/i', $msg)) {
$ctx .= "[ADS/PUBLICITE: Google Ads, Meta Ads, LinkedIn Ads, TikTok Ads. Programmatique/RTB. Display. Retargeting. ROAS optimization. Creative testing. Attribution. Budget optimization.]\n";
}
if (preg_match('/ecommerce|boutique|shop|woocommerce|shopify|magento|prestashop|marketplace|panier/i', $msg)) {
$ctx .= "[ECOMMERCE: Shopify, WooCommerce, Magento, PrestaShop. Marketplace. Payment gateway. UX conversion. SEO ecommerce. Logistics integration. Omnichannel. Analytics.]\n";
}
if (preg_match('/site.*web|website|landing|wordpress|cms|webflow|vitrine|refonte|hebergement/i', $msg)) {
$ctx .= "[WEBSITE: WordPress, Webflow, Next.js, Custom. Landing pages. Sites vitrine. Refonte. SEO technique. Performance (Core Web Vitals). Hebergement cloud. Maintenance.]\n";
}
if (preg_match('/platform|saas|plateforme|multi.tenant|scalab|architecture.*platform/i', $msg)) {
$ctx .= "[PLATFORM BUILDING: Architecture SaaS multi-tenant. Microservices. API-first. Scalabilite horizontale. Auth (OIDC/SAML). Billing. Analytics. DevOps pipeline. White-label.]\n";
}
// ═══ ADVANCED CONSULTING ═══
if (preg_match('/qualit.*manag|iso.*9001|lean|six.sigma|kaizen|tqm|pdca|amelioration.*continue/i', $msg)) {
$ctx .= "[QUALITY MANAGEMENT: ISO 9001. Lean Six Sigma. Kaizen. TQM. PDCA. Amelioration continue. KPIs qualite. Audit processus. Certification. Tableau de bord qualite.]\n";
}
if (preg_match('/robot|rpa|automat.*process|uipath|blue.prism|power.automate|bot/i', $msg)) {
$ctx .= "[RPA/ROBOTISATION: UiPath, Blue Prism, Power Automate. Automatisation processus metier. Bot development. Process mining. Intelligent automation. IA + RPA. ROI automatisation.]\n";
}
if (preg_match('/drone|armee|militaire|defense|securite.*nationale|geopoliti|strateg.*defense/i', $msg)) {
$ctx .= "[DEFENSE/GEOPOLITIQUE: Analyse strategique. Veille geopolitique. Cybersecurite defense. Drone tech. Intelligence artificielle militaire. Souverainete numerique. Conformite export.]\n";
}
if (preg_match('/juridique|avocat|legal|contrat|rgpd|conformit.*legal|propriete.*intellectuelle|litige/i', $msg)) {
$ctx .= "[JURIDIQUE/LEGAL: Conformite RGPD/CNDP. Contrats IT. Propriete intellectuelle. DPO externe. Audit conformite. Droit du numerique. Protection donnees. Contentieux tech.]\n";
}
if (preg_match('/esg|rse|durable|carbone|climat|environnement|social|gouvernance|impact|green/i', $msg)) {
$ctx .= "[ESG/RSE: Reporting ESG. Bilan carbone. Strategie RSE. Green IT. Numerique responsable. Impact social. Gouvernance. Taxonomie EU. CSRD compliance. Objectifs ODD.]\n";
}
if (preg_match('/politi|gouvern|institution|secteur.*public|etat|ministere|collectivit/i', $msg)) {
$ctx .= "[SECTEUR PUBLIC: E-gouvernement. Smart city. Transformation digitale institutions. Marches publics IT. Open data. Interoperabilite. Securite souveraine. Conformite RGPD.]\n";
}
// ═══ CODING & CREATION ═══
if (preg_match('/vibe.*cod|pair.*program|copilot|code.*assist|live.*code|mob.*program/i', $msg)) {
$ctx .= "[VIBE CODING: Pair programming IA. Code review automatise. Refactoring assiste. Live coding sessions. Architecture patterns. Clean code. SOLID principles.]\n";
}
if (preg_match('/cli|terminal|command.*line|bash|shell|script.*auto/i', $msg)) {
$ctx .= "[CLI/AUTOMATION: Scripts Bash/Python/Node. CLI tools. DevOps automation. Cron management. Server administration. Infrastructure as Code.]\n";
}
if (preg_match('/image|tableau.*art|illustration|visuel|infograph|poster|banner|logo|icone/i', $msg)) {
$ctx .= "[CREATION VISUELLE: Logos, illustrations, banners, posters, infographies. IA generative. 4 styles: minimaliste, artistique, professionnel, digital. Charte graphique.]\n";
}
if (preg_match('/schema|diagramme|flowchart|mermaid|bpmn|uml|sequence|gantt|architecture.*diagram/i', $msg)) {
$ctx .= "[SCHEMAS: Mermaid (flowchart, sequence, gantt, pie, mindmap). BPMN. UML. Architecture diagrams. ERD. Network topology. Ishikawa. SWOT. Porter.]\n";
}
if (preg_match('/analyse|audit|matrice|diagnostic|benchmark|swot|pestel|porter|ishikawa|pareto/i', $msg)) {
$ctx .= "[ANALYSES: SWOT, PESTEL, Porter 5 forces, Ishikawa 6M, Pareto, BCG, McKinsey 7S, Value Chain. Benchmark concurrentiel. Diagnostic strategique. Due diligence. Gap analysis.]\n";
}
if (preg_match('/graphique|courbe|chart|camembert|histogram|kpi|dashboard|reporting|tableau.*bord/i', $msg)) {
$ctx .= "[GRAPHIQUES/REPORTING: Histogrammes, camemberts, courbes, scatter plots. KPI dashboards. Business Intelligence. Power BI, Tableau, custom. Real-time monitoring.]\n";
}
if (preg_match('/pdf|rapport|document|export|fichier|excel|pptx|presentation/i', $msg)) {
$ctx .= "[GENERATION FICHIERS: PDF (audits, rapports, CDC, propal). Excel (comparatifs, matrices, budgets). PowerPoint (pitch decks). Charts (graphiques). Lien telechargement inclus.]\n";
}
// ═══ SERVICES B2B ═══
if (preg_match('/offre|service|tarif|devis|accompagn/i', $msg)) {
$ctx .= "[OFFRES: ERP/SAP, Cloud Souverain, IA/WEVIA, Cybersecurite, Marketing Digital, Data/Ethica. Devis sur mesure. Contact: weval-consulting.com/booking.html]\n";
}
if (preg_match('/reference|client|cas|mission|portfolio/i', $msg)) {
$ctx .= "[REFERENCES: 42+ missions. Ethica 135K+ HCPs. SAP pharma. Cloud souverain. Cyber bancaire. Voir use-cases.html.]\n";
}
if (preg_match('/partenaire|certif|partner|alliance/i', $msg)) {
$ctx .= "[PARTENARIATS: SAP Gold Partner. Huawei Cloud. Vistex. Scaleway. Ecosysteme 100%% europeen.]\n";
}
if (preg_match('/contact|joindre|rdv|booking|rendez/i', $msg)) {
$ctx .= "[CONTACT: Casablanca + Paris. weval-consulting.com/booking.html. Diagnostic gratuit 30min.]\n";
}
if (preg_match('/equipe|qui.*etes|expert|consultant/i', $msg)) {
$ctx .= "[EQUIPE: Cabinet franco-marocain. Experts SAP, Cloud, IA, Cyber. Lean Six Sigma.]\n";
}
if (preg_match('/langue|english|arabe|traduction/i', $msg)) {
$ctx .= "[LANGUES: FR, EN, AR, ES. Documentation multilingue.]\n";
}
if (preg_match('/demo|essayer|tester|gratuit/i', $msg)) {
$ctx .= "[DEMO: Essayez WEVIA dans ce chat. Demandez schema, image, audit, code. Diagnostic gratuit booking.html.]\n";
}
if (preg_match('/secteur|industri|banque|telecom|pharma|assurance|energie/i', $msg)) {
$ctx .= "[SECTEURS: Pharma/Sante, Banque/Finance, Telecom, Industrie, Assurance, Energie, Retail, Secteur public.]\n";
}
// ═══ LIVE DATA ═══
if (preg_match('/qualit|sigma|performance|score/i', $msg)) {
$q = @file_get_contents("/var/www/html/api/wevia-quality.json");
if ($q) { $d = json_decode($q, true); $pct = $d["total"]>0 ? round(($d["passed"]/$d["total"])*100) : 0;
$ctx .= "[QUALITE: Disponibilite {$pct}%. Lean Six Sigma. Monitoring continu.]\n"; }
}
if (preg_match('/ethica|hcp|medecin/i', $msg)) {
$r = @pg_query(@pg_connect("host=127.0.0.1 dbname=adx_system user=admin password=admin123"), "SELECT count(*) as c FROM ethica.medecins_validated");
if ($r) { $c = number_format((int)pg_fetch_assoc($r)["c"], 0, ",", " ");
$ctx .= "[ETHICA: {$c} professionnels de sante valides. Couverture nationale Maroc.]\n"; }
}
// WEVAL_AI_PREMIUM
if (preg_match('/intelligence.*artif|ia|machine.*learn|deep.*learn|nlp|computer.*vision|llm|generative|chatbot|prompt|fine.tun|rag|vector|embedding|transformer|neural|reinforcement/i', $msg)) {
$ctx .= "[IA/MACHINE LEARNING: Expertise complete en Intelligence Artificielle. NLP/NLU (analyse sentiment, NER, classification, summarization, traduction). Computer Vision (detection objets, OCR, segmentation, reconnaissance faciale). LLM/GenAI (fine-tuning, RAG, prompt engineering, agents autonomes, embeddings vectoriels, Qdrant/Pinecone). MLOps (MLflow, Kubeflow, feature stores, model registry, A/B testing, drift detection). Deep Learning (CNN, RNN, Transformers, GANs). Reinforcement Learning. Recommandation systems. Time series forecasting. Anomaly detection. IA souveraine hebergee en Europe. Frameworks: PyTorch, TensorFlow, HuggingFace, LangChain, LlamaIndex, CrewAI. Secteurs: pharma (drug discovery), banque (scoring, fraude), industrie (predictive maintenance), retail (recommandation).]\n";
}
if (preg_match('/manufactur|usine|production|mes|scada|plc|industrie.*4|smart.*factory|oee|trs|gmao|maintenance.*predict/i', $msg)) {
$ctx .= "[MANUFACTURING/INDUSTRIE 4.0: MES (Manufacturing Execution System). SCADA/supervision. OEE/TRS optimization. GMAO/CMMS maintenance. Predictive maintenance (vibration analysis, thermal imaging, ML). Digital twin. SAP PP/PM/QM. Supply chain manufacturing. Lean manufacturing (5S, Kanban, Value Stream Mapping, SMED, TPM). SPC (Statistical Process Control). Traceability. IoT industriel (MQTT, OPC-UA). Smart factory. AGV/AMR robotique. MRP/MRP2. Planification capacitaire. Gestion des lots. Conformite GMP/FDA pour pharma. Secteurs: automobile, aeronautique, pharma, agroalimentaire, electronique, chimie.]\n";
}
if (preg_match('/health|sante|life.*science|pharma|clinical|essai.*clinique|fda|ema|ansm|gmp|pharmacovigilance|medical.*device|biotech|genomic/i', $msg)) {
$ctx .= "[HEALTH/LIFE SCIENCE: Transformation digitale pharma. Plateforme Ethica HCP (135K+ professionnels sante valides). Clinical trials management (CTMS, EDC, ePRO, randomisation). Pharmacovigilance (signal detection, ICSR, PSUR). Regulatory affairs (FDA, EMA, ANSM, CTD/eCTD submissions). GxP compliance (GMP, GLP, GCP, GDP). Medical devices (MDR, IVDR, UDI). SAP for Life Sciences. Serialization/traceability. LIMS. Drug safety databases. Real-world evidence (RWE/RWD). Genomics data processing. Biotech pipeline management. Patient engagement digital. Telemedicine platforms. HIPAA/GDPR compliance sante.]\n";
}
if (preg_match('/epm|pilotage.*performance|enterprise.*performance|budget|forecast|planning.*financ|consolidation|close|reporting.*financ|xp&a|fp&a/i', $msg)) {
$ctx .= "[EPM/PILOTAGE PERFORMANCE: Enterprise Performance Management. FP&A (Financial Planning & Analysis). Budgeting & forecasting. Financial consolidation. Management close. Statutory reporting. xP&A (extended planning). Driver-based planning. Rolling forecasts. Scenario modeling. Variance analysis. Profitability analysis. Activity-based costing. Transfer pricing. IFRS/US GAAP compliance. Outils: SAP BPC/SAC Planning, Oracle Hyperion/EPBCS, Anaplan, Board, Jedox. KPIs financiers et operationnels. Dashboards direction generale. Balanced Scorecard.]\n";
}
if (preg_match('/transform|programme.*transform|change.*management|conduite.*changement|pmo|portefeuille.*projet|roadmap.*digital/i', $msg)) {
$ctx .= "[TRANSFORMATION DIGITALE: Pilotage programmes transformation. PMO (Project Management Office). Portefeuille projets. Roadmap digitale. Conduite du changement (ADKAR, Kotter). Gouvernance programme. Comite de pilotage. Business case. Benefits realization. Gestion des risques programme. Stakeholder management. Change readiness assessment. Training plan. Communication plan. KPIs transformation. Agile@Scale (SAFe, LeSS, Spotify model). OKR framework. Design thinking. Innovation lab. POC/MVP. Scalabilite. Legacy modernization.]\n";
}
if (preg_match('/digitalis.*process|bpm|process.*mining|automatisation.*process|workflow.*digitalis|demat|paper.*less|zero.*papier/i', $msg)) {
$ctx .= "[DIGITALISATION PROCESSUS: Process mining (Celonis, UiPath Process Mining). BPM (Business Process Management). BPMN 2.0 modeling. Workflow digitalization. Dematerialisation (factures, contrats, courrier). GED/ECM. Signature electronique. RPA + IA process automation. Process intelligence. Lean BPM. Continuous process improvement. AS-IS/TO-BE mapping. Process KPIs (cycle time, throughput, error rate). Low-code/no-code platforms (Power Platform, Mendix, OutSystems). Citizen development. Integration (API, ESB, iPaaS). Secteurs: banque (KYC, credit), assurance (sinistres), RH (onboarding), achats (P2P, S2P).]\n";
}
if (preg_match('/lean|six.*sigma|kaizen|dmaic|dpmo|toc|theory.*constraint|amelioration.*continue|pdca|5s|vsm|value.*stream|smed|tpm|poka.*yoke|gemba|muda|muri|mura/i', $msg)) {
$ctx .= "[LEAN SIX SIGMA: Certification Green Belt / Black Belt. DMAIC (Define, Measure, Analyze, Improve, Control). DPMO et niveau sigma. Theory of Constraints (TOC) de Goldratt. VSM (Value Stream Mapping). 5S. SMED. TPM (Total Productive Maintenance). Poka-Yoke. Gemba walks. Kaizen events. A3 problem solving. 8D methodology. FMEA/AMDEC. SPC (Statistical Process Control). Control charts. Capability analysis (Cp, Cpk). Design of Experiments (DOE). Regression analysis. Hypothesis testing. Pareto analysis. Root cause analysis (Ishikawa, 5 Why). Muda/Muri/Mura elimination. Hoshin Kanri. Kata coaching. Secteurs: industrie, services, sante, IT, supply chain.]\n";
}
if (preg_match('/propal|proposition.*commerc|reponse.*ao|appel.*offre|rfp|rfq|rfi|tender|soumission|bid|memoire.*technique|offre.*technique|dce|cctp|cahier.*clause/i', $msg)) {
$ctx .= "[REPONSE AO/PROPOSITIONS: Redaction propositions commerciales et techniques. Reponse appels d'offres (RFP, RFQ, RFI). Memoire technique. Note methodologique. References et retours d'experience. Planning detaille (Gantt, PERT, chemin critique). Chiffrage (JH, forfait, regie, TMA). Equipe proposee (CV, certifications). Matrice de conformite. Analyse des risques projet. SLA/engagements de service. Gouvernance projet. Organigramme projet. Livrables et jalons. Criteres de recette. Grille de notation. Executive summary. Elevator pitch. Soutenance orale. War room. Win strategy. Pricing strategy. Go/No-go analysis. Pipeline commercial CRM.]\n";
}
if (preg_match('/consult.*develop|cabinet.*conseil|practice|business.*develop|growth.*strateg|market.*entry|go.*to.*market|partnership.*strateg/i', $msg)) {
$ctx .= "[CONSULTING DEVELOPMENT: Developpement de practice consulting. Business development B2B. Go-to-market strategy. Partnership development. Thought leadership. White papers. Webinars. Conference speaking. Case study development. IP development (frameworks, methodologies, accelerators). Talent acquisition consulting. Practice P&L management. Utilization rate optimization. Bench management. Knowledge management. Proposal factory. Delivery excellence. Client satisfaction (NPS, CSAT). Account management. Cross-selling/up-selling. Market analysis. Competitive intelligence. Pricing strategy consulting.]\n";
}
// WEVAL_FRAMEWORKS
if (preg_match('/bmc|business.*model.*canvas|lean.*canvas|value.*proposition/i', $msg)) {
$ctx .= "[BMC: Business Model Canvas complet — 9 blocs: Segments clients, Proposition de valeur, Canaux, Relations clients, Sources de revenus, Ressources cles, Activites cles, Partenaires cles, Structure de couts. Lean Canvas pour startups. Value Proposition Canvas.]\n";
}
if (preg_match('/raci|responsabilit|matrice.*role|qui.*fait.*quoi/i', $msg)) {
$ctx .= "[RACI: Matrice Responsible-Accountable-Consulted-Informed. Clarification des roles. Gouvernance projet. Organigramme fonctionnel. RASCI variant.]\n";
}
if (preg_match('/okr|objective.*key.*result|kpi.*objectif/i', $msg)) {
$ctx .= "[OKR: Objectives and Key Results. Alignement strategique. Cascade objectifs. Scoring 0-1. Cycle trimestriel. Tracking progression. Company > Team > Individual OKRs.]\n";
}
if (preg_match('/sprint|backlog|user.*stor|epic|scrum|agile.*planning|velocity|burndown/i', $msg)) {
$ctx .= "[AGILE/SCRUM: Sprint planning. Product backlog (epics, user stories, tasks). Story points. Velocity tracking. Burndown/burnup charts. Retrospective. Daily standup. Definition of Done. Acceptance criteria. SAFe pour organisations.]\n";
}
if (preg_match('/roadmap|feuille.*route|planning.*strat|vision.*produit/i', $msg)) {
$ctx .= "[ROADMAP: Roadmap produit/projet 3-6-12 mois. Milestones. Themes strategiques. Now/Next/Later format. Release planning. Feature prioritization (MoSCoW, WSJF, RICE). Dependencies mapping.]\n";
}
if (preg_match('/persona|profil.*client|avatar|segment.*client|journey.*map|experience.*client/i', $msg)) {
$ctx .= "[PERSONAS/CX: Personas detailles (demographie, goals, pain points, behaviors). Customer Journey Map. Service Blueprint. Empathy Map. Jobs to be Done (JTBD). Voice of Customer (VOC). NPS analysis.]\n";
}
if (preg_match('/risk|risque.*projet|matrice.*risque|impact.*probabilit|mitigat/i', $msg)) {
$ctx .= "[RISK MANAGEMENT: Risk register. Matrice impact/probabilite. Risk appetite. Mitigation strategies (avoid, transfer, mitigate, accept). FMEA/AMDEC. Monte Carlo simulation. Contingency planning. Risk dashboard.]\n";
}
if (preg_match('/mind.*map|carte.*mental|brainstorm|ideation/i', $msg)) {
$ctx .= "[MIND MAP/IDEATION: Cartes mentales Mermaid mindmap. Brainstorming structure. Affinity diagram. Brainwriting. SCAMPER. Six Thinking Hats. Design Sprint. Crazy 8s.]\n";
}
if (preg_match('/obsidian|knowledge.*manage|base.*connaissance|pkm|wiki|documentation.*interne/i', $msg)) {
$ctx .= "[KNOWLEDGE MANAGEMENT: Base de connaissances WEVIA (912+ entries). Documentation structuree Markdown. Wiki interne. Templates standardises. Recherche semantique RAG. Capitalisation projet.]\n";
}
// WEVAL_ADVANCED_CONSULTING
if (preg_match('/finops|cloud.*cost|optimis.*cout|reserved.*instance|rightsiz/i', $msg)) {
$ctx .= "[FINOPS: Cloud cost optimization. Reserved instances. Rightsizing. Spot/preemptible. Tagging strategy. Showback/chargeback. Unit economics. FinOps Foundation framework. Cloud waste elimination. Commitment-based discounts. Multi-cloud cost allocation.]\n";
}
if (preg_match('/sre|site.*reliab|incident.*manage|on.call|postmortem|slo|sli|error.*budget|toil/i', $msg)) {
$ctx .= "[SRE: Site Reliability Engineering. SLI/SLO/SLA definition. Error budgets. Toil elimination. Incident management (PagerDuty, Opsgenie). Postmortem culture. Chaos engineering. Runbooks. On-call rotation. Observability (traces, metrics, logs). Golden signals.]\n";
}
if (preg_match('/low.code|no.code|citizen.*dev|power.*platform|mendix|outsystems|appsheet|retool/i', $msg)) {
$ctx .= "[LOW-CODE/NO-CODE: Power Platform (Power Apps, Power Automate, Power BI). Mendix. OutSystems. Retool. AppSheet. Citizen development governance. Fusion teams. Shadow IT management. RAD. Prototypage rapide.]\n";
}
if (preg_match('/data.*gov|master.*data|data.*qual|data.*catalog|data.*lineage|mdm|metadata/i', $msg)) {
$ctx .= "[DATA GOVERNANCE: Master Data Management (MDM). Data quality (profiling, cleansing, enrichment). Data catalog (Alation, Collibra). Data lineage. Metadata management. Data stewardship. DAMA-DMBOK framework. Data mesh. Data contracts. GDPR data mapping.]\n";
}
if (preg_match('/data.*mesh|data.*lake|lakehouse|modern.*data.*stack|dbt|snowflake|databricks|delta/i', $msg)) {
$ctx .= "[MODERN DATA STACK: Data mesh architecture. Lakehouse (Delta Lake, Iceberg). dbt transformation. Snowflake/Databricks/BigQuery. Streaming (Kafka, Flink). Orchestration (Airflow, Dagster). Reverse ETL. Data observability. Feature stores. Real-time analytics.]\n";
}
if (preg_match('/tech.*debt|refactor|legacy|modernis|migration.*applicat|strangler|monolith.*micro/i', $msg)) {
$ctx .= "[TECHNICAL DEBT: Assessment dette technique. Refactoring strategies. Legacy modernization (Strangler Fig, Branch by Abstraction). Monolith to microservices. Code quality metrics (SonarQube). Architecture Decision Records (ADR). Technical roadmap. Buy vs build.]\n";
}
if (preg_match('/i18n|l10n|internation|localis|multilingue|traduction.*auto|globalis/i', $msg)) {
$ctx .= "[I18N/LOCALISATION: Internationalisation apps (i18n). Localisation (l10n). Multi-language architecture. Translation management (Crowdin, Lokalise). RTL support. Unicode. Date/number/currency formatting. Cultural adaptation. Content localization strategy.]\n";
}
if (preg_match('/accessibilit|wcag|a11y|inclusive|handicap.*num|lecteur.*ecran|aria/i', $msg)) {
$ctx .= "[ACCESSIBILITE: WCAG 2.1/2.2 AA compliance. ARIA patterns. Screen reader testing. Color contrast. Keyboard navigation. RGAA (referentiel francais). Audit accessibilite. Remediation. Formation equipes. Inclusive design principles.]\n";
}
if (preg_match('/change.*manage|conduite.*changement|adkar|kotter|adoption|resist/i', $msg)) {
$ctx .= "[CHANGE MANAGEMENT: Modeles ADKAR, Kotter 8 steps, Lewin. Analyse d'impact. Stakeholder mapping. Communication plan. Training plan. Champions network. Resistance management. Change readiness assessment. Adoption metrics. Sponsorship roadmap.]\n";
}
if (preg_match('/m&a|due.*diligence|fusion|acquisition|integration.*post|carve.out|synerg/i', $msg)) {
$ctx .= "[M&A/DUE DILIGENCE: IT due diligence (infrastructure, applications, data, security, licences). Integration post-merger. Synergy assessment. Carve-out IT. TSA (Transitional Service Agreement). Day-1 readiness. Cultural integration. Systems consolidation.]\n";
}
if (preg_match('/api.*manage|gateway|api.*monetiz|developer.*portal|api.*first|openapi|swagger/i', $msg)) {
$ctx .= "[API MANAGEMENT: API Gateway (Kong, Apigee, AWS). API-first design. OpenAPI/Swagger. Developer portal. API versioning. Rate limiting. API monetization. API security (OAuth2, JWT, mTLS). API analytics. GraphQL federation.]\n";
}
if (preg_match('/microservice|event.*driven|cqrs|saga|domain.*driven|ddd|hexagonal|clean.*arch/i', $msg)) {
$ctx .= "[ARCHITECTURE AVANCEE: Microservices. Event-driven (CQRS, Event Sourcing, Saga). DDD (Domain-Driven Design). Hexagonal/Clean Architecture. Ports & Adapters. Service mesh (Istio). API composition. Distributed transactions. Circuit breaker. Eventual consistency.]\n";
}
if (preg_match('/competitive|veille.*concurr|benchmark.*march|market.*intel|positionnement/i', $msg)) {
$ctx .= "[COMPETITIVE INTELLIGENCE: Veille concurrentielle. Market intelligence. Benchmark sectoriel. Positionnement strategique. Battle cards. Win/loss analysis. Pricing intelligence. Technology scouting. Trend analysis. PESTEL + Porter continu.]\n";
}
if (preg_match('/pricing|tarif|monetis|business.*model|revenue.*model|freemium|subscription/i', $msg)) {
$ctx .= "[PRICING/MONETISATION: Pricing strategy (value-based, cost-plus, competitive). Revenue models (subscription, freemium, usage-based, marketplace). Willingness-to-pay research. Price elasticity. Packaging & bundling. A/B testing prix. Unit economics (LTV, CAC, payback).]\n";
}
if (preg_match('/perf.*test|load.*test|stress.*test|jmeter|k6|gatling|benchmark.*perf/i', $msg)) {
$ctx .= "[PERFORMANCE TESTING: Load testing (JMeter, k6, Gatling). Stress testing. Spike testing. Soak testing. Performance baselines. Bottleneck analysis. APM (Datadog, New Relic, Dynatrace). Frontend performance (Lighthouse, WebPageTest). Database tuning. Caching strategy.]\n";
}
// WEVAL_ENTERPRISE_FINAL
if (preg_match('/govern.*it|cobit|itil|cmmi|audit.*controle|sox|isae/i', $msg)) {
$ctx .= "[IT GOVERNANCE: COBIT 2019. ITIL 4. CMMI. SOX IT compliance. ISAE 3402. Audit controles generaux IT. Politique securite SI. Comite IT. Architecture enterprise (TOGAF). IT Portfolio management. Shadow IT governance.]\n";
}
if (preg_match('/talent|succession|gpec|competence.*management|formation.*continue|learning/i', $msg)) {
$ctx .= "[TALENT MANAGEMENT: GPEC/GEPP. Succession planning. Skills mapping. Learning management (LMS). Career paths. 360 feedback. Performance management. Employer branding. Assessment centers. Coaching. Upskilling/reskilling digital. HR analytics.]\n";
}
if (preg_match('/contrat.*lifecycle|clm|gestion.*contrat|clause|avenant|renouvellement/i', $msg)) {
$ctx .= "[CLM: Contract Lifecycle Management. Redaction. Negociation. Signature electronique. Suivi obligations. Renouvellement automatique. Clauses types. Templates. Workflow validation. Alertes echeances. Integration CRM/ERP. NDA management.]\n";
}
if (preg_match('/procurement|achat|p2p|source.*pay|fournisseur.*management|appro|rfx/i', $msg)) {
$ctx .= "[PROCUREMENT: Source-to-Pay (S2P). Procure-to-Pay (P2P). Supplier management. Strategic sourcing. RFx process. Spend analysis. Contract management. Supplier risk. Sustainable procurement. E-procurement. SAP MM/Ariba. Catalog management.]\n";
}
if (preg_match('/treasury|tresorerie|cash.*management|prevision.*tresorerie|bank.*connect/i', $msg)) {
$ctx .= "[TREASURY: Cash management. Cash forecasting. Bank connectivity (SWIFT, EBICS). Payment factory. Netting. Cash pooling. FX risk management. Working capital optimization. SAP TRM. Bank reconciliation. Liquidity planning.]\n";
}
if (preg_match('/grc|governance.*risk.*compliance|audit.*interne|controle.*interne|coso/i', $msg)) {
$ctx .= "[GRC: Governance Risk Compliance. COSO framework. Audit interne. Controle interne. Risk assessment. Compliance management. Policy management. Incident management. Whistleblowing. Internal audit automation. SOX/GDPR/AML compliance.]\n";
}
if (preg_match('/iam|identity|access.*management|rbac|sso|saml|oidc|mfa|zero.*trust.*identity/i', $msg)) {
$ctx .= "[IAM: Identity & Access Management. SSO (SAML, OIDC). MFA. RBAC/ABAC. Zero Trust identity. Privileged Access Management (PAM). Identity governance (IGA). Directory services. Lifecycle management. Conditional access. Authentik/Keycloak.]\n";
}
if (preg_match('/observab|opentelemetry|tracing|metrics|logs|apm|datadog|grafana|prometheus/i', $msg)) {
$ctx .= "[OBSERVABILITY: OpenTelemetry. Distributed tracing. Metrics collection. Log aggregation. APM (Datadog, New Relic, Dynatrace). Grafana/Prometheus/Loki stack. Custom dashboards. Alerting. SLI/SLO monitoring. Cost per request. Cardinality management.]\n";
}
if (preg_match('/green.*it|numerique.*responsable|pue|sobriete.*numerique|ecoconception/i', $msg)) {
$ctx .= "[GREEN IT: Numerique responsable. Ecoconception web/logiciel. PUE datacenter. Mesure empreinte carbone IT. Sobriete numerique. RGESN (referentiel). Lifecycle analysis. Cloud carbon footprint. Sustainable software engineering. E-waste management.]\n";
}
if (preg_match('/customer.*success|csm|retention|churn|nps|onboarding.*client|adoption.*produit/i', $msg)) {
$ctx .= "[CUSTOMER SUCCESS: CSM framework. Onboarding client. Health score. Churn prediction. NPS/CSAT/CES tracking. Expansion revenue. QBR (Quarterly Business Review). Playbooks. Segmentation. Time-to-value. Product adoption. Voice of Customer.]\n";
}
// ═══ SECURITY BLOCK ═══
if (preg_match('/mot de passe|password|api.key|token|port [0-9]|adresse ip|ssh|root|admin|docker|nginx|ollama|groq|cerebras|qdrant|cron|github/i', $msg)) {
$ctx .= "[SECURITE: Informations techniques internes non disponibles. Contactez weval-consulting.com/booking.html]\n";
}
return $ctx;
}