From 08eccabef6f07dbe2e42d1de191a0ce3f7ed14b3 Mon Sep 17 00:00:00 2001 From: opus Date: Mon, 20 Apr 2026 15:22:16 +0200 Subject: [PATCH] auto-sync-opus46 --- api/accounting-api.php | 92 +++++++++++++++++++ api/agent-leads-sync.json | 2 +- api/blade-actions-surfaced.json | 4 +- .../task_20260420_132023_8417ee.json | 15 +++ .../task_20260420_132046_ae2aac.json | 15 +++ api/mql-scoring-status.json | 16 ++-- api/v83-business-kpi-latest.json | 2 +- api/v93_audit_3pages.js | 52 +++++++++++ api/weval-technology-platform-api.php | 4 +- 9 files changed, 188 insertions(+), 14 deletions(-) create mode 100644 api/accounting-api.php create mode 100644 api/blade-tasks/task_20260420_132023_8417ee.json create mode 100644 api/blade-tasks/task_20260420_132046_ae2aac.json create mode 100644 api/v93_audit_3pages.js diff --git a/api/accounting-api.php b/api/accounting-api.php new file mode 100644 index 000000000..c8b1e89ed --- /dev/null +++ b/api/accounting-api.php @@ -0,0 +1,92 @@ +'token required'])); +} + +try { + $db = @new PDO('pgsql:host=10.1.0.3;port=5432;dbname=adx_system', 'admin', 'admin123'); +} catch (Exception $e) { + $db = null; +} + +switch ($action) { +case 'status': + // Real P&L skeleton — data if tables exist, else honest empty + $out = [ + 'ok' => true, + 'module' => 'accounting', + 'status' => 'wired_stub', + 'created_by' => 'opus_20avr_wire_dormants', + 'note' => 'Module accounting wired — skeleton live. Fill tables accounting.pnl / accounting.invoices when ready.', + 'tables_expected' => ['accounting.invoices', 'accounting.pnl_monthly', 'accounting.expenses', 'accounting.taxes'], + 'ui_url' => '/accounting.html (to create)', + ]; + if ($db) { + $out['db_connected'] = true; + // Check if accounting schema exists + $r = $db->query("SELECT schema_name FROM information_schema.schemata WHERE schema_name='accounting'"); + $out['schema_exists'] = (bool)$r->fetchColumn(); + // CRM real data as proxy for revenue + try { + $r = $db->query("SELECT COUNT(*) FROM crm.deals WHERE status='won'"); + $out['deals_won_count'] = (int)$r->fetchColumn(); + $r = $db->query("SELECT COALESCE(SUM(value),0) FROM crm.deals WHERE status IN ('won','open')"); + $out['pipeline_total_eur'] = (float)$r->fetchColumn(); + } catch (Exception $e) { $out['crm_err'] = $e->getMessage(); } + } else { + $out['db_connected'] = false; + } + $out['ts'] = date('c'); + echo json_encode($out, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); + break; + +case 'pnl': + // P&L skeleton (return zero-data structure if no tables, doctrine #4 honest) + $pnl = [ + 'period' => $_GET['period'] ?? 'current_month', + 'revenue' => 0, + 'costs' => 0, + 'margin' => 0, + 'status' => 'no_data', + 'note' => 'Fill accounting.pnl_monthly to populate. Doctrine #4: returning zeros, not simulations.', + ]; + if ($db) { + try { + $r = $db->query("SELECT * FROM accounting.pnl_monthly ORDER BY month DESC LIMIT 1"); + if ($r && $row = $r->fetch(PDO::FETCH_ASSOC)) { + $pnl = array_merge($pnl, $row); + $pnl['status'] = 'live'; + } + } catch (Exception $e) { /* schema not yet created */ } + } + echo json_encode($pnl, JSON_UNESCAPED_UNICODE); + break; + +case 'invoices': + $invoices = []; + if ($db) { + try { + $r = $db->query("SELECT id, client, amount, date, status FROM accounting.invoices ORDER BY date DESC LIMIT 20"); + while ($row = $r->fetch(PDO::FETCH_ASSOC)) $invoices[] = $row; + } catch (Exception $e) { /* schema not yet */ } + } + echo json_encode(['invoices' => $invoices, 'count' => count($invoices), 'status' => $invoices ? 'live' : 'empty_schema_pending']); + break; + +case 'public': + echo json_encode(['module' => 'accounting', 'status' => 'wired_public', 'endpoints' => ['/api/accounting-api.php?action=status&token=WEVADS2026']]); + break; + +default: + echo json_encode(['error' => 'unknown action', 'actions' => ['status', 'pnl', 'invoices', 'public']]); +} diff --git a/api/agent-leads-sync.json b/api/agent-leads-sync.json index e06b001fa..a6d77266e 100644 --- a/api/agent-leads-sync.json +++ b/api/agent-leads-sync.json @@ -1,6 +1,6 @@ { "agent": "V45_Leads_Sync", - "ts": "2026-04-20T15:10:02+02:00", + "ts": "2026-04-20T15:20:02+02:00", "paperclip_total": 48, "active_customer": 4, "warm_prospect": 5, diff --git a/api/blade-actions-surfaced.json b/api/blade-actions-surfaced.json index ffbc8cefc..35f054cb7 100644 --- a/api/blade-actions-surfaced.json +++ b/api/blade-actions-surfaced.json @@ -1,7 +1,7 @@ { - "generated_at": "2026-04-20T15:15:01.511873", + "generated_at": "2026-04-20T15:20:01.934005", "stats": { - "total": 27, + "total": 30, "pending": 20, "kaouther_surfaced": 18, "chrome_surfaced": 2, diff --git a/api/blade-tasks/task_20260420_132023_8417ee.json b/api/blade-tasks/task_20260420_132023_8417ee.json new file mode 100644 index 000000000..392c747d3 --- /dev/null +++ b/api/blade-tasks/task_20260420_132023_8417ee.json @@ -0,0 +1,15 @@ +{ + "id": "task_20260420_132023_8417ee", + "type": "powershell", + "cmd": "Test-NetConnection -ComputerName 127.0.0.1 -Port 9222 -InformationLevel Quiet -WarningAction SilentlyContinue", + "label": "mcp_exec", + "priority": 200, + "status": "dispatched", + "created": "2026-04-20T13:20:23+00:00", + "started": null, + "completed": null, + "result": null, + "error": null, + "source": "api", + "dispatched_at": "2026-04-20T13:20:28+00:00" +} \ No newline at end of file diff --git a/api/blade-tasks/task_20260420_132046_ae2aac.json b/api/blade-tasks/task_20260420_132046_ae2aac.json new file mode 100644 index 000000000..ff399f3fd --- /dev/null +++ b/api/blade-tasks/task_20260420_132046_ae2aac.json @@ -0,0 +1,15 @@ +{ + "id": "task_20260420_132046_ae2aac", + "type": "powershell", + "cmd": "Test-NetConnection -ComputerName 127.0.0.1 -Port 9222 -InformationLevel Quiet -WarningAction SilentlyContinue", + "label": "mcp_exec", + "priority": 200, + "status": "dispatched", + "created": "2026-04-20T13:20:46+00:00", + "started": null, + "completed": null, + "result": null, + "error": null, + "source": "api", + "dispatched_at": "2026-04-20T13:20:54+00:00" +} \ No newline at end of file diff --git a/api/mql-scoring-status.json b/api/mql-scoring-status.json index 1e094eb6e..9e4d19819 100644 --- a/api/mql-scoring-status.json +++ b/api/mql-scoring-status.json @@ -1,27 +1,27 @@ { "ok": true, "agent": "V42_MQL_Scoring_Agent_REAL", - "ts": "2026-04-20T13:10:01+00:00", + "ts": "2026-04-20T13:20:01+00:00", "status": "DEPLOYED_AUTO", "deployed": true, "algorithm": "weighted_behavioral_signals", "signals_tracked": { - "wtp_engagement": 18, + "wtp_engagement": 100, "chat_engagement": 0, "roi_tool": 0, "email_opened": 0 }, - "avg_score": 4.5, + "avg_score": 25, "mql_threshold": 50, "sql_threshold": 75, "leads_captured": 48, - "mql_auto_scored": 17, - "sql_auto_scored": 7, - "mql_auto_pct": 36, + "mql_auto_scored": 20, + "sql_auto_scored": 8, + "mql_auto_pct": 41, "improvement_vs_manual": { "before_manual_pct": 33.3, - "after_auto_pct": 36, - "delta": 2.700000000000003 + "after_auto_pct": 41, + "delta": 7.700000000000003 }, "paperclip_db_ok": true, "paperclip_tables": 1, diff --git a/api/v83-business-kpi-latest.json b/api/v83-business-kpi-latest.json index d8fa66b5c..6d5a089e6 100644 --- a/api/v83-business-kpi-latest.json +++ b/api/v83-business-kpi-latest.json @@ -1,7 +1,7 @@ { "ok": true, "version": "V83-business-kpi", - "ts": "2026-04-20T13:19:05+00:00", + "ts": "2026-04-20T13:20:15+00:00", "summary": { "total_categories": 7, "total_kpis": 56, diff --git a/api/v93_audit_3pages.js b/api/v93_audit_3pages.js new file mode 100644 index 000000000..be3d2a19c --- /dev/null +++ b/api/v93_audit_3pages.js @@ -0,0 +1,52 @@ +const { chromium } = require('playwright'); +const fs = require('fs'); + +(async () => { + const browser = await chromium.launch({ headless: true }); + const ctx = await browser.newContext({ viewport: { width: 1920, height: 1080 } }); + const page = await ctx.newPage(); + await page.addInitScript(() => { try { localStorage.setItem('weval_internal','yacine-2026');}catch(e){}}); + + const results = []; + for (const target of [ + { name: 'agents-archi', url: 'https://weval-consulting.com/agents-archi.html' }, + { name: 'enterprise-model', url: 'https://weval-consulting.com/enterprise-model.html' }, + { name: 'wevia-em-big4', url: 'https://weval-consulting.com/wevia-em-big4.html' } + ]) { + const errs = []; + page.on('pageerror', e => errs.push(e.message)); + page.on('console', m => { if (m.type()==='error') errs.push('console: '+m.text().substring(0,100));}); + + try { + await page.goto(target.url, { waitUntil: 'load', timeout: 30000 }); + await page.waitForTimeout(6000); + + const diag = await page.evaluate(() => { + const r = { + title: document.title, + url: location.href, + body_len: document.body.innerText.length, + canvas: document.querySelectorAll('canvas').length, + svg: document.querySelectorAll('svg').length + }; + // Access global vars used in these pages + try { r.AG_len = typeof AG !== 'undefined' ? AG.length : null; } catch(e){r.AG_err=e.message} + try { r.DP_len = typeof DP !== 'undefined' ? DP.length : null; } catch(e){r.DP_err=e.message} + // Count empty/anonymous patterns + const bodyHTML = document.body.innerHTML; + r.pattern_anon = (bodyHTML.match(/anonymous|anonyme|\"\"|unknown/gi) || []).length; + r.pattern_out = (bodyHTML.match(/\bout\b|\bvide\b|\bempty\b/gi) || []).length; + return r; + }); + + await page.screenshot({ path: `/tmp/v93-${target.name}.png`, fullPage: false }); + results.push({ target: target.name, url: target.url, ...diag, js_errors: errs.slice(0, 5) }); + } catch(e) { + results.push({ target: target.name, err: e.message.substring(0, 200) }); + } + } + + await browser.close(); + fs.writeFileSync('/var/www/html/api/playwright-v93-3pages-audit.json', JSON.stringify(results, null, 2)); + console.log(JSON.stringify(results, null, 2)); +})(); diff --git a/api/weval-technology-platform-api.php b/api/weval-technology-platform-api.php index 3973becf4..4a4c58713 100644 --- a/api/weval-technology-platform-api.php +++ b/api/weval-technology-platform-api.php @@ -99,7 +99,7 @@ $modules = [ ['id' => 'stripe_payments', 'label' => 'Stripe Payments (live)', 'desc' => 'sk_live + pk_live + acct', 'apis' => ['/api/stripe.php', '/api/stripe-webhook.php']], ['id' => 'billing_db', 'label' => 'PG schema billing', 'desc' => 'Schema dédié PG S204'], ['id' => 'gap_detector', 'label' => 'Gap Detector / AI Gap', 'desc' => 'Cron weval-ai-gap + weval-gap-detector', 'apis' => ['/api/gap-detector.json']], - ['id' => 'accounting', 'label' => 'Comptabilité (dormant)', 'status' => 'dormant', 'desc' => 'P3: ERP gap-fill comptable à activer'], + ['id' => 'accounting', 'label' => 'Comptabilité (wired stub)', 'status' => 'wired_stub', 'desc' => 'Module comptable stub wiré — fill accounting.* tables pour activer', 'apis' => ['/api/accounting-api.php']], ['id' => 'enterprise_complete_v73', 'label' => '🏢 Enterprise Complete V73', 'desc' => '20 depts + 169 KPIs + 12 gap agents Scrum/SAFe/DevOps + 9 innovations today + 8 macro processes R2R/O2C/P2P/H2R/M2L/D2D · avatars unifiés registry', 'pages' => ['enterprise-complete.html', 'enterprise-complete-v73.html'], 'apis' => ['/api/wevia-v70-enterprise-complete.php', '/api/wevia-v71-intelligence-growth.php', '/api/agent-avatars.json']], ['id' => 'v70_enterprise', 'label' => 'Enterprise Complete (V70)', 'desc' => '20 departements 169 KPIs 61 integrations universelles', 'pages' => ['enterprise-complete.html'], 'apis' => ['/api/wevia-v70-enterprise-complete.php']] ] @@ -231,7 +231,7 @@ $modules = [ 'tagline' => 'WhatsApp · SMS · Telegram · Mattermost · chat interne', 'submodules' => [ ['id' => 'whatsapp', 'label' => 'WhatsApp Business (live)', 'desc' => 'token+phone+business_id configurés', 'apis' => ['/api/whatsapp-api.php']], - ['id' => 'sms_ovh', 'label' => 'OVH SMS', 'apis' => ['/api/ovh-sms-setup.php'], 'status' => 'dormant'], + ['id' => 'sms_ovh', 'label' => 'OVH SMS (ready, awaiting credentials)', 'apis' => ['/api/ovh-sms-setup.php'], 'status' => 'ready_pending_credentials', 'desc' => 'API fonctionnelle, POST app_key+app_secret+consumer_key pour activer'], ['id' => 'telegram_bot', 'label' => 'Telegram Bot @wevia_cyber_bot', 'desc' => 'chat_id=7605775322'], ['id' => 'mattermost', 'label' => 'Mattermost team chat', 'apis' => ['https://mm.weval-consulting.com/']], ['id' => 'wevia_meetings', 'label' => 'WEVIA Meetings', 'pages' => ['wevia-meetings.html', 'wevia-meeting-rooms.html']]