CloudCountryCatalog::options()") && str_contains($service, 'CloudCountryCatalog::normalize(') && str_contains($service, "'country_name' => \$country['name']") && str_contains($service, "'country_flag' => \$country['flag']") && str_contains($countryCatalog, '$code = strtoupper(trim($value));') && !str_contains($service, 'strtoupper(self::safeText($countryValue, 2))'), 'Regions must use the shared country catalog and reject rather than truncate invalid input.'); $assert(str_contains($placement, "->whereIn('state', ['held', 'uncertain', 'committed'])") && str_contains($placement, "->orderBy('id')->lockForUpdate()->get([") && str_contains($placement, 'CloudPanelUsageService::forHost(') && str_contains($placement, 'CloudPanelUsageService::forHosts(') && str_contains($placement, "(int) (\$usage['unknown'] ?? 0) > 0") && !str_contains($placement, "COALESCE(SUM(cpu_cores)") && str_contains($placement, "CloudResourceReservation::where('order_id', (int) \$order->id)->exists()") && !str_contains($placement, 'restoreExisting('), 'Final placement capacity must use a current locking read after the host sentinel, not a repeatable-read aggregate snapshot.'); $assert(str_contains($worker, '$requestedPublicIpCidr') && str_contains($worker, '$confirmedPublicIpCidr') && str_contains($worker, "'Agent 成功结果与预留公网 IP 不一致,必须人工核查'") && str_contains($placement, '(string) $ip->address . \'/\' . (int) $ip->prefix_length') && str_contains($placement, '$confirmedPublicIpCidr'), 'Create reconciliation must match requested, confirmed, and reserved public IPs before committing the ledger.'); $refundStart = strpos($createFinalizer, 'public static function refundAndReleaseLocked('); $refundEnd = $refundStart === false ? false : strpos($createFinalizer, 'private static function terminalizeLocked(', $refundStart); $refund = $refundStart === false || $refundEnd === false ? '' : substr($createFinalizer, $refundStart, $refundEnd - $refundStart); $stockPosition = strpos($refund, 'CloudOrderService::releaseStock($order)'); $releasePosition = strpos($refund, 'CloudPlacementService::release($order, $releaseReason)'); $assert($refund !== '' && str_contains($worker, 'CloudCreateFailureFinalizer::refundAndReleaseLocked(') && $stockPosition !== false && $releasePosition !== false && $stockPosition < $releasePosition, 'Create refunds must lock offer stock before host resources to match payment placement lock order.'); foreach (['资源拓扑', '容量与健康', '资源预留'] as $label) { $assert(str_contains($template, '>' . $label . '<') || str_contains($template, '>' . $label . ''), 'Resource page is missing a persistent tab: ' . $label); } $assert(!str_contains($template, 'view=overview') && !str_contains($template, 'view=regions') && !str_contains($template, 'view=lines') && !str_contains($template, 'view=pools') && str_contains($template, 'data-resource-region') && str_contains($template, 'data-resource-line') && str_contains($template, 'data-resource-pool') && str_contains($template, '{foreach $region.pools as $pool}') && str_contains($template, 'data-parent-region-id="{$region.id|escape}"') && str_contains($template, 'data-parent-line-id="{$region.default_line_id|escape}"') && str_contains($template, 'data-parent-line-id="{$line.id|escape}"'), 'Resource navigation and hierarchy must use the three-view clean-break topology contract.'); $assert(str_contains($template, '{if $admin_can_manage|default:false}国家 / 地区') && str_contains($template, '{foreach $resource_page.country_options as $country}') && str_contains($template, 'id="resource-code-label"') && str_contains($template, 'id="resource-code-help"') && str_contains($template, 'pattern="[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?"') && str_contains($template, '高级技术信息') && str_contains($template, '系统标识(可选)') && str_contains($script, "label: '地区系统标识(可选)'") && str_contains($script, "label: '线路系统标识(可选)'") && str_contains($script, "label: '资源池系统标识(可选)'") && str_contains($script, '创建成功后永久锁定') && str_contains($script, '.value.trim().toLowerCase()') && !str_contains($template, 'locked_reservation') && !str_contains($template, "'locked'"), 'Resource forms must keep immutable identifiers in optional advanced settings and use uncertain clean-break fields.'); $assert(str_contains($styles, '[data-admin-resources] .admin-resource-tabs') && str_contains($styles, '.admin-resource-responsive-table td::before') && str_contains($styles, 'grid-template-columns: 1fr;') && !str_contains($styles, '.admin-resource-table-wrap table {\n min-width: 820px;') && str_contains($styles, '[data-admin-resource-drawer] .admin-resource-form-fields') && !is_file($root . '/public/cloud/admin-resources.css'), 'Resource UI must extend the shared Venix stylesheet without adding a parallel theme file.'); echo "Administrator resource scheduling contracts passed.\n";