Enable Discovery debug logging for production troubleshooting

- Add DISCOVERY_LOG_LEVEL=debug
- Add DISCOVERY_SHOW_PROGRESS=true
- Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
2025-08-11 20:13:26 +02:00
parent 59fd3dd3b1
commit 55a330b223
3683 changed files with 2956207 additions and 16948 deletions

102
test_framework_agents.php Normal file
View File

@@ -0,0 +1,102 @@
<?php
declare(strict_types=1);
require_once __DIR__ . '/vendor/autoload.php';
use App\Framework\Core\AppBootstrapper;
use App\Framework\Mcp\Tools\FrameworkAgents;
use App\Framework\Performance\EnhancedPerformanceCollector;
use App\Framework\DateTime\SystemClock;
use App\Framework\DateTime\SystemHighResolutionClock;
use App\Framework\Performance\MemoryMonitor;
try {
// Bootstrap the application (similar to console.php)
$clock = new SystemClock();
$highResClock = new SystemHighResolutionClock();
$memoryMonitor = new MemoryMonitor();
$collector = new EnhancedPerformanceCollector($clock, $highResClock, $memoryMonitor, enabled: false);
$bootstrapper = new AppBootstrapper(__DIR__, $collector, $memoryMonitor);
$consoleApp = $bootstrapper->bootstrapConsole();
// Extract container from the ConsoleApplication via reflection
$reflection = new \ReflectionClass($consoleApp);
$containerProperty = $reflection->getProperty('container');
$containerProperty->setAccessible(true);
$container = $containerProperty->getValue($consoleApp);
// Get the FrameworkAgents instance
$frameworkAgents = $container->get(FrameworkAgents::class);
echo "=== Testing Framework Agents ===\n\n";
// Test Framework Core Agent
echo "🔧 Testing Framework Core Agent:\n";
$coreResult = $frameworkAgents->frameworkCoreAgent(
'Analyze current framework architecture and patterns',
'architecture'
);
echo "✅ Framework Core Agent Response:\n";
echo "- Agent: " . $coreResult['agent_identity'] . "\n";
echo "- Principles: " . count($coreResult['core_principles']) . " core principles\n";
echo "- Framework Health: " . $coreResult['framework_health']['status'] . "\n";
echo "- Recommendations: " . count($coreResult['recommendations']) . " recommendations\n";
echo "\n";
// Test MCP Specialist Agent
echo "🤖 Testing MCP Specialist Agent:\n";
$mcpResult = $frameworkAgents->mcpSpecialistAgent(
'Analyze MCP integration capabilities',
'tools'
);
echo "✅ MCP Specialist Agent Response:\n";
echo "- Agent: " . $mcpResult['agent_identity'] . "\n";
echo "- Principles: " . count($mcpResult['core_principles']) . " core principles\n";
echo "- Available Tools: " . count($mcpResult['mcp_framework_integration']['available_tools']) . " MCP tools\n";
echo "- Routes: " . $mcpResult['mcp_framework_integration']['routes_analysis']['total_routes'] . " total routes\n";
echo "\n";
// Test Value Object Agent
echo "💎 Testing Value Object Agent:\n";
$voResult = $frameworkAgents->valueObjectAgent(
'Analyze current value object usage and suggest improvements',
'core'
);
echo "✅ Value Object Agent Response:\n";
echo "- Agent: " . $voResult['agent_identity'] . "\n";
echo "- Principles: " . count($voResult['core_principles']) . " core principles\n";
echo "- VO Categories: " . count($voResult['value_object_categories']) . " categories\n";
echo "- Recommendations: " . count($voResult['recommendations']) . " recommendations\n";
echo "\n";
// Test Discovery Expert Agent
echo "🔍 Testing Discovery Expert Agent:\n";
$discoveryResult = $frameworkAgents->discoveryExpertAgent(
'Analyze attribute discovery system performance',
'routing'
);
echo "✅ Discovery Expert Agent Response:\n";
echo "- Agent: " . $discoveryResult['agent_identity'] . "\n";
echo "- Principles: " . count($discoveryResult['core_principles']) . " core principles\n";
echo "- Attribute Systems: " . count($discoveryResult['attribute_expertise']) . " expertise areas\n";
echo "- Components: " . count($discoveryResult['attribute_components']) . " components analyzed\n";
echo "\n";
echo "🎉 All Framework Agents are working successfully!\n";
echo "\nThese agents are now available as MCP tools:\n";
echo "- framework_core_agent\n";
echo "- mcp_specialist_agent\n";
echo "- value_object_agent\n";
echo "- discovery_expert_agent\n";
} catch (\Throwable $e) {
echo "❌ Error testing framework agents:\n";
echo "Error: " . $e->getMessage() . "\n";
echo "File: " . $e->getFile() . ":" . $e->getLine() . "\n";
exit(1);
}