'opus46', 'tool' => 'self_diagnostic', 'doctrine' => '#2 ZERO simulation · executed real shell']; // 1. Vault content (real) $vault = trim(@shell_exec('ls /opt/wevads/vault/ 2>/dev/null | head -20')); $vault_count = (int)trim(@shell_exec('ls /opt/wevads/vault/ 2>/dev/null | wc -l')); $out['vault'] = [ 'path' => '/opt/wevads/vault/', 'file_count' => $vault_count, 'sample_files' => array_slice(explode("\n", $vault), 0, 10) ]; // 2. Intents registry (real count via preg_match occurrences) $files = ['wevia-opus46-intents.php', 'wevia-opus-intents.php', 'wevia-fast-path-v3.php']; $intents = []; foreach ($files as $f) { $p = "/var/www/html/api/$f"; if (is_readable($p)) { $c = (int)trim(@shell_exec("grep -c 'preg_match\\|INTENT:' " . escapeshellarg($p))); $intents[$f] = $c; } } $out['intents_registry'] = $intents; $out['intents_total'] = array_sum($intents); // 3. Chat log last 10 (real) $log = @shell_exec('tail -10 /var/log/weval/wevia-master-api.log 2>/dev/null || tail -10 /var/log/apache2/access.log 2>/dev/null | grep wevia-master'); $out['chat_log_last_10'] = substr(trim($log), 0, 800); // 4. Self-code fingerprint $out['master_api'] = [ 'size' => filesize('/var/www/html/api/wevia-master-api.php'), 'last_modified' => date('c', filemtime('/var/www/html/api/wevia-master-api.php')), 'md5' => md5_file('/var/www/html/api/wevia-master-api.php') ]; // 5. Doctrine file real content $doctrines_file = '/opt/wevads/vault/doctrines.md'; if (is_readable($doctrines_file)) { $out['doctrines'] = [ 'path' => $doctrines_file, 'size' => filesize($doctrines_file), 'first_500_chars' => substr(file_get_contents($doctrines_file), 0, 500) ]; } else { $out['doctrines'] = ['status' => 'file_not_found', 'path' => $doctrines_file]; } // 6. Explanation (doctrine #4 honesty) $out['note'] = 'All values above are RESULTS OF REAL SHELL COMMANDS on S204 — no LLM simulation (doctrine #2). If a prompt does not match any intent, check wevia-master-api.php _is_content_req guard (line ~485) + V27-SURGICAL exclusion list (line ~489).'; $out['content'] = json_encode([ 'vault_files' => $out['vault']['file_count'], 'intents_total' => $out['intents_total'], 'master_api_size' => $out['master_api']['size'], 'master_api_md5' => substr($out['master_api']['md5'], 0, 12), 'doctrine_file' => $out['doctrines']['status'] ?? 'live', 'log_preview' => substr($out['chat_log_last_10'] ?? '', 0, 200), 'full' => 'See structured fields for details' ], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); return $out; } }