'int'") && str_contains($itemModel, "'child_job_id' => 'int'"), 'Replacement batch-item model lost family or child identity casts.'); $service = new ReflectionClass( CloudPublicIpPoolReplacementBatchService::class ); $serviceMethods = array_values(array_map( static fn (ReflectionMethod $method): string => $method->getName(), array_filter( $service->getMethods(ReflectionMethod::IS_PUBLIC), static fn (ReflectionMethod $method): bool => $method->getDeclaringClass()->getName() === CloudPublicIpPoolReplacementBatchService::class ) )); sort($serviceMethods, SORT_STRING); $expectedServiceMethods = [ 'overview', 'detail', 'start', 'projectTransitionEvidenceLocked', 'display', ]; sort($expectedServiceMethods, SORT_STRING); $assert($service->isFinal() && $serviceMethods === $expectedServiceMethods, 'Replacement batch public API drifted.'); $plan = new ReflectionClass(CloudPublicNetworkTransitionBatchPlan::class); $constructor = $plan->getConstructor(); $assert($plan->isFinal() && $constructor instanceof ReflectionMethod, 'Caller-locked replacement plan is missing.'); foreach ($constructor->getParameters() as $parameter) { $property = $plan->getProperty($parameter->getName()); $assert($property->isPublic() && $property->isReadOnly(), 'Replacement plan input is not an immutable public projection: ' . $parameter->getName()); } $assert(is_string($jobs) && !str_contains($jobs, 'enqueuePoolReplacementNetworkChangeLocked') && !str_contains($jobs, 'finishResolvedChildLocked'), 'Retired replacement-specific job writers returned.'); $assert(is_string($worker) && !str_contains($worker, 'CloudPublicIpPoolReplacementBatchService::finishChildLocked') && str_contains($worker, 'CloudPublicNetworkTransitionWorkflow::finishJobLocked') && str_contains($worker, '$aggregateParent') && str_contains($worker, "'public_ip_pool_replacement_batch'") && is_string($recovery) && str_contains($recovery, 'CloudPublicNetworkTransitionWorkflow::') && str_contains($recovery, 'publishPreparedLocked(') && str_contains($recovery, '$aggregateParent') && is_string($automaticRecovery) && str_contains( $automaticRecovery, 'CloudPublicNetworkTransitionWorkflow::' ) && str_contains($automaticRecovery, 'retryPendingFinalization('), 'Worker or recovery no longer uses the canonical transition facade.'); echo "Cloud public IP pool replacement schema contract tests passed\n";