50)') && str_contains($repository, "->orderByDesc('created_at')->orderByDesc('id')"), 'Agent history query is not bounded or deterministically ordered.'); $assert(str_contains($service, "private const HISTORY_KINDS = ['domain_power']") && str_contains($service, 'historyForInstance(') && str_contains($service, '$agentId') && str_contains($service, '(int) ($instance->host_id ?? 0)') && str_contains($service, '(int) ($instance->id ?? 0)') && str_contains($service, 'return $kind === \'domain_power\' ? \'action\' : null') && str_contains($service, 'if ($action === \'destroy\')') && str_contains($service, 'CloudOperationErrorCatalog::result(') && str_contains($service, '\'kind_label\' => $labels[\'kind_label\']'), 'Agent history projection lost explicit domain_power/action mapping or result redaction.'); $assert($start !== false && $method !== '' && str_contains($method, 'CloudAccess::instance($args[\'id\'], $actor)') && str_contains($method, 'agentOperationHistoryService()') && !str_contains($method, 'CloudJobService::operationLogs') && !str_contains($method, 'CloudEngineClient') && !str_contains($method, 'shell_exec') && !str_contains($method, 'curl_exec') && !str_contains($method, 'ssh'), 'VM operation-log route must use the fresh Agent projection after owner/admin lookup, without legacy transport.'); $assert(str_contains($routes, "'/vms/{id:[0-9]+}/operations'") && str_contains($middleware, '/api/v1/vms/[0-9]+/operations$#D'), 'The existing VM operation-log route or database-only middleware boundary changed.'); foreach (['CloudJobService::', 'CloudEngineClient', 'shell_exec', 'curl_exec'] as $forbidden) { $assert(!str_contains($service, $forbidden), 'Agent operation-history service crossed a legacy boundary: ' . $forbidden); } fwrite(STDOUT, "Cloud Agent operation-history contract passed.\n");