add(new SuperAdmin())"), 'Object-storage action lost its SuperAdmin gate: ' . $action); } $test = $method($registry, 'test', 'activate'); $activate = $method($registry, 'activate', 'drain'); $drain = $method($registry, 'drain', 'resume'); $runtime = $method($registry, 'runtime'); $assert(str_contains($test, 'headBucket(') && str_contains($test, "health_state = 'healthy'") && !str_contains($test, "admin_state = 'active'"), 'Connection testing must remain read-only and separate from activation.'); $assert(str_contains($activate, "['draft', 'disabled', 'read_only'], 'active', true") && str_contains($drain, "['active', 'read_only'], 'draining', false"), 'Activation and drain transitions lost their explicit state/health gates.'); $assert(str_contains($runtime, "admin_state === 'retired'") && !str_contains($runtime, "admin_state === 'draining'") && !str_contains($runtime, "admin_state === 'disabled'"), 'Draining/disabled backends must remain addressable for historical reads and cleanup.'); $assert(str_contains($registry, 'protected $hidden =') === false && !preg_match("/'sealed_credentials'\\s*=>/", $method($registry, 'listView', 'summary')), 'Browser-facing backend listing may expose encrypted credentials.'); $cleanupDebt = $method($backups, 'cleanupDebt', 'retryCleanup'); $retryCleanup = $method($backups, 'retryCleanup', 'create'); $assert(str_contains($cleanupDebt, "'next_check_at'") && str_contains($cleanupDebt, "'attention_at'") && !str_contains($cleanupDebt, "'object_key'") && !str_contains($cleanupDebt, "'object_version_id'"), 'Cleanup-debt DTO exposed provider object identity.'); $assert(str_contains($retryCleanup, 'CloudStorageArtifactDeletionService') && str_contains($retryCleanup, 'reopenAttention(') && str_contains($retryCleanup, '->process(') && !str_contains($retryCleanup, 'deleteObject(') && str_contains($artifactDeletion, "=== 'reconcile'") && str_contains($artifactDeletion, 'recordPresence(') && str_contains($artifactDeletion, 'reopenDeleteReconciliation(') && str_contains($artifactDeletion, "['publish', 'copy'], true"), 'Manual cleanup retry must resume the fenced replica-deletion ledger.'); $reconcileGuard = strpos( $artifactDeletion, "if ((string) \$work['mode'] === 'reconcile')" ); $deleteCall = strpos($artifactDeletion, '$this->s3()->deleteObject('); $assert($reconcileGuard !== false && $deleteCall !== false && $reconcileGuard < $deleteCall, 'Unknown-effect reconciliation must return before issuing another DELETE.'); echo "Object-storage lifecycle and cleanup contracts passed.\n";