true, "helper_loaded" => $fn_exists]; if ($fn_exists) { $out["snapshot"] = __ambre_truth_snapshot(); } // Also load truth registry ourselves to see nested structure $p = "/var/www/html/api/wevia-truth-registry.json"; if (file_exists($p)) { $d = @json_decode(@file_get_contents($p), true); if (is_array($d)) { $out["file_ok"] = true; $out["file_size"] = filesize($p); $out["top_keys"] = array_keys($d); // Probe nested structures to find count-like fields foreach (["tools","providers","intents","skills","brains","doctrines","dashboards","nonreg"] as $k) { if (isset($d[$k]) && is_array($d[$k])) { $out["nested"][$k] = [ "keys" => array_keys($d[$k]), ]; // List sub-types foreach ($d[$k] as $sk => $sv) { $out["nested"][$k]["types"][$sk] = is_array($sv) ? "array[" . count($sv) . "]" : (is_numeric($sv) ? "num=" . $sv : gettype($sv)); } } } } } echo json_encode($out, JSON_PRETTY_PRINT);