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, 'inspectObject(') && str_contains($retryCleanup, "'delete_uncertain'") && !str_contains($retryCleanup, 'deleteObject('), 'Manual cleanup retry must inspect exact evidence without replaying DELETE.'); echo "Object-storage lifecycle and cleanup contracts passed.\n";