/** Attribute only the synchronous load call. The diagnostics wrapper carries its label into completion. */ export function withDiagnosticSource(source: string, action: () => T): T { const diagnostics = typeof window !== 'undefined' && (window as any).__memoryDiagnostics; if (diagnostics && diagnostics.enabled && typeof diagnostics.withSource === 'function') { return diagnostics.withSource(source, action); } return action(); }