safeWriteJson(filePath: string, data: any): Promise<void> from src/utils/safeWriteJson.ts instead of JSON.stringify with file-write operationssafeWriteJson will create parent directories if necessary, so do not call mkdir prior to safeWriteJsonsafeWriteJson prevents data corruption via atomic writes with locking and streams the write to minimize memory footprint