withJson\(\[\s*(.*?)\s*\],\s*202\)/s', (string) $controller, $receiptMatch ) === 1; $receiptKeys = []; if ($receiptMatched) { preg_match_all( "/'([a-z_]+)'\\s*=>/", (string) ($receiptMatch[1] ?? ''), $receiptKeys ); } $receiptKeys = array_values(array_unique($receiptKeys[1] ?? [])); sort($receiptKeys); $assert(is_string($controller) && str_contains($controller, "'confirm_replacement'") && str_contains($controller, "'expected_source_revision'") && str_contains($controller, "'expected_target_revision'") && $receiptMatched && $receiptKeys === ['status_url', 'task_id'], 'Replacement controller lost its strict input or 202 task receipt.'); $assert(is_string($service) && str_contains($service, "'target_pool_key'") && !str_contains($controller, "'instance_ids'") && !str_contains($controller, "'target_public_ip_id'"), 'The browser boundary can select instances or target IPs directly.'); $assert(str_contains( $service, 'beginPoolReplacementBatch(' ) && str_contains( $service, 'new CloudPublicNetworkTransitionBatchPlan(' ) && str_contains($service, "'active_claim', 1") && str_contains($service, "'network_change_effect_unknown'"), 'Replacement service lost durable child jobs or unknown-effect fencing.'); echo "Public-pool replacement HTTP contract passed.\n";