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($worker, "elseif (\$status === 'failed' && \$order !== null"); $refundEnd = $refundStart === false ? false : strpos($worker, "elseif (\$status === 'failed' && \$job->kind", $refundStart); $refund = $refundStart === false || $refundEnd === false ? '' : substr($worker, $refundStart, $refundEnd - $refundStart); $stockPosition = strpos($refund, 'CloudOrderService::releaseStock($order)'); $releasePosition = strpos($refund, "CloudPlacementService::release(\$order, 'create_failed')"); $assert($refund !== '' && $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, '{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($script, "label: '地区标识'") && str_contains($script, "label: '线路标识'") && str_contains($script, "label: '资源池标识'") && str_contains($script, '.value.trim().toLowerCase()'), 'Resource forms must explain identifiers, provide readable countries and normalize codes consistently.'); $assert(str_contains($styles, '[data-admin-resources] .admin-resource-tabs') && 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";