diff --git a/api/agent-leads-sync.json b/api/agent-leads-sync.json index 4c6548d64..e7b60bfed 100644 --- a/api/agent-leads-sync.json +++ b/api/agent-leads-sync.json @@ -1,6 +1,6 @@ { "agent": "V45_Leads_Sync", - "ts": "2026-04-20T12:30:04+02:00", + "ts": "2026-04-20T12:40:02+02:00", "paperclip_total": 48, "active_customer": 4, "warm_prospect": 5, diff --git a/api/v83-business-kpi-latest.json b/api/v83-business-kpi-latest.json index 7ed52adf0..acd165b8e 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-20T10:35:15+00:00", + "ts": "2026-04-20T10:40:14+00:00", "summary": { "total_categories": 7, "total_kpis": 56, diff --git a/api/wevia-deepseek-proxy.php b/api/wevia-deepseek-proxy.php index 797768946..8b07394f2 100644 --- a/api/wevia-deepseek-proxy.php +++ b/api/wevia-deepseek-proxy.php @@ -28,6 +28,26 @@ $message = $input['message'] ?? ''; $mode = $input['mode'] ?? 'instant'; $model = $input['model'] ?? 'auto'; $history = $input['history'] ?? []; + +// OPUS 20avr doctrine #2 ZERO simulation: check structured intents BEFORE LLM fallback +// Prevents hallucination on diagnostic/vault/self-reference questions +if (!empty($message) && file_exists(__DIR__ . "/wevia-self-diagnostic-intent.php")) { + require_once __DIR__ . "/wevia-self-diagnostic-intent.php"; + if (function_exists("wevia_self_diagnostic")) { + $_sd_result = wevia_self_diagnostic($message); + if ($_sd_result) { + $_sd_content = isset($_sd_result["content"]) ? $_sd_result["content"] : json_encode($_sd_result, JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT); + echo json_encode([ + "content" => $_sd_content, + "provider" => "opus46", + "tool" => "self_diagnostic", + "model" => "php-intent-real-exec", + "note" => "Doctrine #2: real shell execution, not LLM simulation" + ], JSON_UNESCAPED_UNICODE); + exit; + } + } +} $temp = floatval($input['temperature'] ?? 0.7); // === DEEPSEEK WEB DIRECT (port 8901) — FREE UNLIMITED === if ($model === 'deepseek-web' || $model === 'deepseek-web-think' || $model === 'deepseek-web-search') { diff --git a/api/wevia-multi-provider.php b/api/wevia-multi-provider.php index 76408ed45..a70bd242d 100644 --- a/api/wevia-multi-provider.php +++ b/api/wevia-multi-provider.php @@ -9,6 +9,25 @@ $msg = $raw["message"] ?? ""; $mdl = $raw["model"] ?? "auto"; if (!$msg) { echo json_encode(["error"=>"no message"]); exit; } +// OPUS 20avr doctrine #2 ZERO simulation: intercept self-reference queries BEFORE LLM +if (file_exists(__DIR__ . "/wevia-self-diagnostic-intent.php")) { + require_once __DIR__ . "/wevia-self-diagnostic-intent.php"; + if (function_exists("wevia_self_diagnostic")) { + $_sd = wevia_self_diagnostic($msg); + if ($_sd) { + $_c = isset($_sd["content"]) ? $_sd["content"] : json_encode($_sd, JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT); + echo json_encode([ + "content" => $_c, + "provider" => "opus46", + "tool" => "self_diagnostic", + "model" => "php-intent-real-exec", + "note" => "Doctrine #2: real shell, not LLM simulation" + ], JSON_UNESCAPED_UNICODE); + exit; + } + } +} + $env = @file_get_contents("/etc/weval/secrets.env"); if (!$env) $env = "";