'"errors":0', 'second-types.txt' => 'tsc --noEmit', 'second-build.txt' => 'built in', 'second-frontend.txt' => 'pass 151'] as $name => $needle) { if (! str_contains($read($root.'/storage/app/private/investmoz-v2/'.$name), $needle)) { throw new RuntimeException('Required QA evidence missing: '.$name); } } $app = require $root.'/bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); $db = DB::connection(); $db->beginTransaction(); $db->statement('SET TRANSACTION READ ONLY'); $identity = $db->selectOne('select current_database() as database, inet_server_port() as port'); if ($identity->database !== 'investemoz' || (int) $identity->port !== 5432) { throw new RuntimeException('Active read-only identity rejected.'); } $installation = app(VirtualDeskInstallation::class); $qa = ['passed' => true, 'verified_at' => gmdate('c'), 'code_hash' => $installation->fingerprint(), 'database' => 'investmoz_v2_20261008_test', 'port' => 55441, 'tests' => $tests, 'limitation' => 'Three real ClamD integration tests skipped because no local service is available. No real scan asserted.']; file_put_contents(storage_path('app/private/virtual-desk/guidance-qa-evidence.json'), json_encode($qa, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR)); $preview = $installation->preview(); $db->rollBack(); file_put_contents(storage_path('app/private/virtual-desk/activation-preview.json'), json_encode($preview, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR)); echo json_encode(['target' => $preview['target'], 'pending' => $preview['pendingMigrations'], 'backup' => $preview['backupVerified'], 'qa' => $preview['qaVerified'], 'compatibility' => $preview['compatibilityVerified'], 'scanner' => $preview['scanner'], 'page' => '/management/balcao-install'], JSON_THROW_ON_ERROR);