20, 'noVNC dependency graph was not validated'); $assert(is_file($public . '/vendor/novnc/LICENSE.txt'), 'Vendored noVNC license missing'); foreach (['almalinux', 'ubuntu', 'debian', 'centos'] as $system) { $assert(is_file($public . '/' . $system . '-icon.svg'), 'Local OS icon missing: ' . $system); } foreach (['user/layout_header.tpl', 'user/layout_plain_header.tpl', 'auth/layout_header.tpl'] as $template) { $source = file_get_contents($root . '/resources/views/venix/' . $template); $assert(str_contains($source, '/cloud/styles.css') && str_contains($source, '/cloud/account.css'), 'Unified user styles missing: ' . $template); $assert(!str_contains($source, 'user-home.css') && !str_contains($source, '/css/auth.css'), 'Retired user stylesheet still active: ' . $template); } $views = $root . '/resources/views/venix'; $cloudShell = file_get_contents($views . '/cloud/page.tpl'); $cloudPages = ''; foreach (glob($views . '/cloud/pages/*.tpl') as $template) { $cloudPages .= "\n" . file_get_contents($template); } $cloudTemplate = $cloudShell . $cloudPages; $userLayout = file_get_contents($views . '/user/layout_header.tpl'); $sharedSidebar = file_get_contents($views . '/user/panel_sidebar.tpl'); $sharedTopbar = file_get_contents($views . '/user/panel_topbar.tpl'); $clientEntry = file_get_contents($public . '/app.js'); $clientScript = $clientEntry . "\n" . file_get_contents($public . '/runtime.js'); foreach (['instances', 'detail', 'deploy', 'backups', 'iso-images', 'ssh-keys', 'invoices', 'invoice-detail', 'reinstall'] as $module) { $path = $public . '/' . $module . '.js'; $assert(is_file($path), 'Cloud page module missing: ' . $module); $clientScript .= "\n" . file_get_contents($path); } $invoiceDetailRuntimePath = $public . '/invoice-detail-runtime.js'; $assert(is_file($invoiceDetailRuntimePath), 'Dedicated invoice-detail runtime missing: invoice-detail-runtime.js'); $invoiceDetailModule = file_get_contents($public . '/invoice-detail.js'); $invoiceDetailRuntime = file_get_contents($invoiceDetailRuntimePath); $clientStyles = file_get_contents($public . '/client.css'); $baseStyles = file_get_contents($public . '/styles.css'); $routes = file_get_contents($root . '/config/routes.php'); $userController = file_get_contents($root . '/app/Controllers/UserController.php'); $cloudPageController = file_get_contents($root . '/app/Controllers/CloudPageController.php'); $deploymentPageService = file_get_contents($root . '/app/Services/Cloud/CloudDeploymentPageService.php'); $deployTemplate = file_get_contents($views . '/cloud/pages/deploy.tpl'); $detailTemplate = file_get_contents($views . '/cloud/pages/detail.tpl'); $reinstallTemplate = file_get_contents($views . '/cloud/pages/reinstall.tpl'); $deployModule = file_get_contents($public . '/deploy.js'); $reinstallModule = file_get_contents($public . '/reinstall.js'); $shopFormScript = file_get_contents($views . '/admin/shop/form_js.tpl'); $templateAdmin = file_get_contents($views . '/admin/cloud/templates.tpl'); $rescueAdmin = file_get_contents($views . '/admin/cloud/rescue.tpl'); $adminScript = file_get_contents($public . '/admin.js'); $templateUploadScript = file_get_contents( $public . '/admin-template-upload.js' ); $cloudAdminController = file_get_contents($root . '/app/Controllers/CloudAdminController.php'); $cloudRoutes = file_get_contents($root . '/config/routes_cloud.php'); $api = file_get_contents($root . '/app/Controllers/CloudApiController.php'); $middleware = file_get_contents($root . '/app/Middleware/CloudApi.php'); $cloudJobService = file_get_contents($root . '/app/Services/Cloud/CloudJobService.php'); $cloudOperationCatalog = file_get_contents($root . '/app/Services/Cloud/CloudOperationCatalog.php'); $cloudSchema = file_get_contents($root . '/sql/cloud.sql'); $adminBillingTemplate = $views . '/admin/billing.tpl'; $adminBillingScript = $public . '/admin-billing.js'; $adminBillingRuntime = file_get_contents($adminBillingScript); $adminInstanceScript = file_get_contents($public . '/admin-instances.js') . "\n" . file_get_contents($public . '/admin-instance-detail.js'); $adminBillingStyles = $public . '/admin-billing.css'; $adminSharedStyles = file_get_contents($root . '/public/theme/venix/css/admin-home.css'); $templateCatalogService = file_get_contents( $root . '/app/Services/Cloud/CloudTemplateCatalogService.php'); $templateStateMachine = file_get_contents( $root . '/app/Services/Cloud/CloudTemplateStateMachine.php'); $assert(str_contains($cloudShell, "file='user/panel_sidebar.tpl'") && str_contains($userLayout, "file='user/panel_sidebar.tpl'"), 'Cloud and account pages must share one sidebar partial'); $assert(str_contains($cloudShell, "file='user/panel_topbar.tpl'") && str_contains($userLayout, "file='user/panel_topbar.tpl'"), 'Cloud and account pages must share one topbar partial'); $taskDrawerInclude = "{include file='user/task_center_drawer.tpl'}"; $assert(!str_contains($sharedTopbar, $taskDrawerInclude) && substr_count($cloudShell, $taskDrawerInclude) === 1 && strpos($cloudShell, $taskDrawerInclude) > strpos($cloudShell, '\n'), 'The task center drawer must be a body-level cloud shell sibling, never nested in the scrolling main area'); $assert(preg_match('/\.panel-task-drawer:not\(\[open\]\)\s*\{[^}]*display:\s*none[^}]*\}/s', $clientStyles) === 1, 'The task center drawer must remain hidden without relying on browser dialog defaults'); $assert(preg_match('/\.panel-task-drawer\s*\{(?=[^}]*isolation:\s*isolate)(?=[^}]*z-index:\s*[1-9][0-9]*)[^}]*\}/s', $clientStyles) === 1, 'The task center drawer fallback must own an isolated layer above the user page'); $assert(preg_match('/\.panel-topbar\s*\{(?=[^}]*position:\s*sticky)(?=[^}]*top:\s*0)(?=[^}]*z-index:\s*[1-9][0-9]*)[^}]*\}/s', $clientStyles) === 1, 'The shared user topbar must remain visible while the page content scrolls'); $assert(preg_match('/\.main-area\s*>\s*\.content\s+\.template-catalog\s*\{[^}]*isolation:\s*isolate[^}]*\}/s', $clientStyles) === 1, 'Template picker layers must remain below the sticky shared topbar'); $assert(preg_match('/html\.panel-(?:announcements|task)-open\s+\.panel-topbar\s*\{[^}]*position:\s*fixed[^}]*\}/s', $clientStyles) === 0, 'Drawer scroll locking must not remove the shared topbar from normal flow'); foreach (['announcements' => 'announcements', 'task' => 'task'] as $drawerClass => $scrollVariable) { foreach (['topbar', 'sidebar'] as $shellPart) { $assert(preg_match('/html\.panel-' . $drawerClass . '-open\s+\.panel-' . $shellPart . '\s*\{[^}]*transform:\s*translate3d\(0,\s*calc\(0px\s*-\s*var\(--panel-' . $scrollVariable . '-scroll-top,\s*0px\)\),\s*0\)[^}]*\}/s', $clientStyles) === 1, 'Opening the ' . $drawerClass . ' drawer after scrolling must retain the desktop ' . $shellPart . ' position'); } } $assert(preg_match('/@media\s*\(max-width:\s*960px\)\s*\{[\s\S]*?html\.panel-announcements-open\s+\.panel-topbar\s*\{[^}]*max\(0px,\s*calc\(0px\s*-\s*var\(--panel-announcements-scroll-top,\s*0px\)\s*-\s*65px\)\)[^}]*\}[\s\S]*?html\.panel-task-open\s+\.panel-topbar\s*\{[^}]*max\(0px,\s*calc\(0px\s*-\s*var\(--panel-task-scroll-top,\s*0px\)\s*-\s*65px\)\)[^}]*\}[\s\S]*?html\.panel-announcements-open\s+\.panel-sidebar,\s*html\.panel-task-open\s+\.panel-sidebar\s*\{[^}]*transform:\s*none[^}]*\}/s', $clientStyles) === 1, 'Mobile drawers must compensate for the 65px mobile sidebar without reviving it'); $assert(!str_contains($cloudShell, '