unprepared(self::schema(\'cloud.sql\'))'); $verifyAt = strpos($setup, 'self::assertInstalledSchema($connection, $logConnection);', $ddlAt === false ? 0 : $ddlAt); $markerAt = strpos($setup, "'name' => 'cloud_schema_version'", $verifyAt === false ? 0 : $verifyAt); $assert($ddlAt !== false && $verifyAt !== false && $markerAt !== false && $ddlAt < $verifyAt && $verifyAt < $markerAt && str_contains($setup, 'self::assertNamedDatabaseObjects(') && str_contains($setup, 'self::REQUIRED_CHECKS'), 'Schema marker can be written before installed tables, columns and checks are verified.'); $assert(str_contains($schema, 'operation_id VARCHAR(80) CHARACTER SET ascii COLLATE ascii_bin NOT NULL PRIMARY KEY') && str_contains($schema, 'UNIQUE KEY cloud_rescue_import_template (host_id, template_id)') && str_contains($schema, 'import_type VARCHAR(16) CHARACTER SET ascii COLLATE ascii_bin NOT NULL'), 'Fresh schema is missing the durable rescue-template import identity.'); $assert(str_contains($schema, 'sealed_api_secret LONGTEXT NOT NULL') && str_contains($schema, 'tested_revision BIGINT UNSIGNED NOT NULL DEFAULT 0') && str_contains($schema, 'sealed_payload LONGTEXT') && str_contains($schema, 'sealed_credential LONGTEXT') && str_contains($schema, 'sealed_agent_ticket LONGTEXT NOT NULL'), 'Fresh schema is missing purpose-bound sealed data columns.'); $assert(!str_contains($schema, 'agent_websocket_url') && !str_contains($schema, 'endpoint VARCHAR(255)'), 'Fresh schema retained a panel-to-host Agent endpoint.'); $assert(!str_contains($schema, 'api_secret_cipher') && !str_contains($schema, 'payload_cipher') && !str_contains($schema, 'credential_cipher'), 'Fresh schema retained retired ciphertext column names.'); foreach (['cloud_order_admin_created', 'cloud_invoice_admin_created', 'cloud_invoice_payment_admin_created'] as $index) { $assert(str_contains($schema, 'KEY ' . $index . ' ('), 'Fresh schema did not inline index: ' . $index); } $assert(str_contains($baseSchema, 'ADD KEY `ticket_instance` (`instance_id`,`userid`,`rootid`)'), 'Fresh ticket schema is missing the instance ownership index.'); echo "Clean-break fresh cloud schema contract passed.\n";