deployment_snapshot_id') && str_contains($orders, '$sourceSnapshot->id'), 'Provisioning orders must persist the selected deployment snapshot instead of relying on a request-only source key.'); $assert(str_contains($purchase, "'deployment_snapshot_id'") && str_contains($purchase, "'cloud_snapshot_key'") && str_contains($purchase, "'backing_backup_id'") && str_contains($purchase, "'backing_backup_key'") && str_contains($purchase, "'backing_backup_size_bytes'") && str_contains($purchase, "'backing_backup_virtual_size_bytes'") && str_contains($purchase, "'backing_backup_sha256'") && str_contains($purchase, "'backing_backup_identity'"), 'The safe order snapshot must freeze both the public cloud snapshot and its immutable backing object identity.'); $jobBound = str_contains($schema, 'deployment_snapshot_id BIGINT UNSIGNED DEFAULT NULL') && str_contains($schema, 'cloud_job_deployment_snapshot') && str_contains($orders, '$job->deployment_snapshot_id') || (str_contains($orders, '$job->backup_id') && str_contains($payment, 'backing_backup_id')); $assert($jobBound, 'Provisioning jobs must remain audibly bound to the deployment snapshot or its frozen backing backup.'); $assert(str_contains($recovery, "!== 'deployment_snapshot'") && !str_contains($recovery, "!== 'backup'") && str_contains($placement, "=== 'deployment_snapshot'") && !str_contains($placement, "=== 'backup'"), 'Placement and operation recovery must use the cloud snapshot source contract while preserving the internal restore-backup protocol.'); $assert(!str_contains($orders, 'backup_sealed_credential') && !str_contains($recovery, 'backup_sealed_credential') && str_contains($worker, '$instance->sealed_credential = null;'), 'Cloud-snapshot provisioning must preserve the system-disk password and must not expose the historical panel credential as current.'); $assert($catalog !== '' && substr_count($catalog, 'lockForUpdate()') >= 2 && str_contains($catalog, "'ready'") && str_contains($catalog, 'sha256') && str_contains($catalog, 'object_size_bytes') && str_contains($catalog, 'virtual_size_bytes') && str_contains($purchase, 'CloudDeploymentSnapshot') && str_contains($payment, 'CloudDeploymentSnapshot'), 'Purchase and paid provisioning must both re-lock a ready snapshot and validate the immutable object identity.'); $automaticCapacity = $section($backups, '$usedQuery = CloudInstanceBackup::where(', '$used = (int) $usedQuery->count'); $assert(str_contains($automaticCapacity, 'whereNotExists') && str_contains($automaticCapacity, 'cloud_deployment_snapshots') && str_contains($automaticCapacity, 'cloud_deployment_snapshots.state') && str_contains($automaticCapacity, "'deleted'"), 'Promoted snapshot backings must not consume the rolling automatic-backup retention capacity.'); $assert(str_contains($catalog, 'CloudOrder') && str_contains($catalog, 'deployment_snapshot_id') && str_contains($catalog, "'awaiting_payment'") && str_contains($catalog, "'queued'") && str_contains($catalog, 'effect_resolution') && str_contains($catalog, "'unknown'") && str_contains($catalog, 'finalization_incident'), 'Snapshot deletion must remain fenced by unpaid, queued, and unknown-effect provisioning references.'); $assert(!preg_match( "/whereIn\\('status',\\s*\\[[^]]*'succeeded'[^]]*\\]\\)/s", $catalog ) && !preg_match( "/whereIn\\('status',\\s*\\[[^]]*'expired'[^]]*\\]\\)/s", $catalog ), 'Terminal safe and expired provisioning orders must not permanently block manual snapshot deletion.'); echo "Cloud deployment snapshot order and deletion contracts passed.\n";