";
$stateQuery = $db->query("SELECT * FROM optimization_analysis_state ORDER BY id DESC LIMIT 1");
if ($stateQuery && $stateQuery->num_rows > 0) {
$state = $stateQuery->fetch_assoc();
echo "
" . json_encode($state, JSON_PRETTY_PRINT) . "
";
if ($state['is_running']) {
echo "
â ī¸ Analysis is marked as running
";
} else {
echo "
âšī¸ Analysis is not running
";
}
} else {
echo "
â ī¸ No analysis state found - creating initial state
";
$db->query("INSERT INTO optimization_analysis_state (total_combinations, processed_combinations, is_running) VALUES (0, 0, 0)");
}
// Check 2: Panel directives status
echo "
2. Panel Directives Status
";
$totalQuery = $db->query("SELECT COUNT(*) as total FROM panel_directives");
$total = $totalQuery->fetch_assoc()['total'];
$processedQuery = $db->query("SELECT COUNT(*) as processed FROM panel_directives WHERE llm_checked = 1");
$processed = $processedQuery->fetch_assoc()['processed'];
$pendingQuery = $db->query("SELECT COUNT(*) as pending FROM panel_directives WHERE llm_checked = 0");
$pending = $pendingQuery->fetch_assoc()['pending'];
echo "
đ Total combinations: " . number_format($total) . "
";
echo "
đ Processed: " . number_format($processed) . "
";
echo "
đ Pending: " . number_format($pending) . "
";
if ($pending === 0) {
echo "
â All combinations have been processed!
";
} else {
echo "
â ī¸ $pending combinations still need processing
";
}
// Check 3: Test database updates
echo "
3. Test Database Updates
";
echo "";
echo "";
// Check 4: Test single API call
echo "
";
}
?>
query("UPDATE optimization_analysis_state SET processed_combinations = processed_combinations + 1 WHERE id = 1");
if ($testUpdate) {
echo "
â Database update successful
";
// Get current state
$stateQuery = $db->query("SELECT * FROM optimization_analysis_state WHERE id = 1");
if ($stateQuery) {
$state = $stateQuery->fetch_assoc();
echo "