false, 'error'=>'truth registry not found', 'tried'=>$candidates]); exit; } $raw = file_get_contents($path); $data = json_decode($raw, true); if (!is_array($data)) { echo json_encode(['ok'=>false, 'error'=>'invalid JSON', 'path'=>$path]); exit; } // Extract scalars (flat values) + count nested arrays $scalars = []; $nested = []; foreach ($data as $k => $v) { if (is_array($v) || is_object($v)) { $nested[$k] = is_array($v) ? count($v) : 'object'; } else { $scalars[$k] = $v; } } // Pick the 10 most relevant headline metrics if they exist $headlines = []; foreach ([ 'agents_count','agents_total','intents_count','tools_count','providers_count', 'skills_total','brains_count','doctrines_count','dashboards_count', 'nonreg_score','l99_score','autonomy_level','autonomy_score', 'ethica_hcps_total','pages_count','apis_count','crons_count','built_at','last_update' ] as $key) { if (isset($data[$key]) && !is_array($data[$key])) { $headlines[$key] = $data[$key]; } } echo json_encode([ 'ok' => true, 'path' => $path, 'bytes' => strlen($raw), 'headlines' => $headlines, 'scalars' => $scalars, 'nested' => $nested, 'source' => 'intent-opus4-read_truth_registry.php · ambre · doctrine#4 honest · no hallucination', ], JSON_PRETTY_PRINT);