sync($batchSize)'); $instanceReconcile = strpos($lifecycle, "\$this->heartbeat?->busy('instance_reconcile')"); $assert($sync !== false && $settle !== false && $due !== false && $compact !== false && $checkpointCompact !== false && $runtime !== false && $instanceReconcile !== false && $sync < $settle && $settle < $due && $due < $compact && $compact < $checkpointCompact && $checkpointCompact < $runtime && $runtime < $instanceReconcile, 'Lifecycle must sync counters, settle usage, reconcile due periods, ' . 'compact verified history, then continue with runtime and ' . 'per-instance reconciliation.'); $assert(str_contains($lifecycle, 'trafficUsageScanCursor') && str_contains($lifecycle, 'trafficPeriodScanCursor') && substr_count($lifecycle, "['next_cursor']") >= 2, 'Bounded accounting scans no longer advance past a persistent bad row.'); $privateReconcile = strpos($lifecycle, 'private function reconcile('); $assert($privateReconcile !== false && strpos(substr($lifecycle, $privateReconcile), 'CloudTrafficPoolAccounting::') === false, 'Pool accounting was nested inside the instance-first lifecycle transaction.'); $stage = substr($lifecycle, $settle, $runtime - $settle); $assert(!str_contains($stage, 'network_status') && !str_contains($stage, 'CloudJobService') && !str_contains($stage, 'CloudAgentClient') && str_contains($stage, "observeFailure('traffic_pool_accounting_failed')"), 'Shadow accounting changed network policy or lost fail-open observations.'); $assert(!str_contains($accounting, 'CloudAgentClient') && !str_contains($accounting, 'network_status') && !str_contains($accounting, "'kind' => 'network_suspend'") && !str_contains($accounting, "'kind' => 'network_resume'"), 'The shadow accounting module acquired an Agent/network side effect.'); echo "Cloud traffic-pool lifecycle scheduler contract passed.\n";